Merge remote branch 'upstream/master' into EP-2183
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
<?php
|
||||
namespace Services\Api\ProcessMaker;
|
||||
|
||||
class Application extends \ProcessMaker\Api
|
||||
{
|
||||
/**
|
||||
* Sample api protected with OAuth2
|
||||
*
|
||||
* For testing the oAuth token
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
$data = array(
|
||||
'USSER_LOGGED' => $this->getUserId(),
|
||||
"APP_UID" => $id,
|
||||
"PRO_UID" => "13885168416038181883131343548151",
|
||||
"DUMMY" => "sample data",
|
||||
"WS" => $this->getWorkspace()
|
||||
);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function post($requestData = null)
|
||||
{
|
||||
$requestData['processed'] = true;
|
||||
|
||||
return $requestData;
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,10 @@ namespace Services\Api\ProcessMaker;
|
||||
use \ProcessMaker\Api;
|
||||
use \Luracast\Restler\RestException;
|
||||
|
||||
//TODO we need Refactor this class
|
||||
|
||||
/**
|
||||
*
|
||||
* Process Api Controller
|
||||
*
|
||||
* @protected
|
||||
@@ -36,7 +39,7 @@ class Process extends Api
|
||||
return $response;
|
||||
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::SYSTEM_EXCEPTION_STATUS, $e->getMessage());
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +57,7 @@ class Process extends Api
|
||||
$response["message"] = "Process load successfully";
|
||||
$response["data"] = $data;
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::SYSTEM_EXCEPTION_STATUS, $e->getMessage());
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
|
||||
return $response;
|
||||
@@ -71,7 +74,7 @@ class Process extends Api
|
||||
return $process->createProcess($userUid, $request_data);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::SYSTEM_EXCEPTION_STATUS, $e->getMessage());
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +93,7 @@ class Process extends Api
|
||||
$response["message"] = "Process updated successfully";
|
||||
$response["data"] = $data;
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::SYSTEM_EXCEPTION_STATUS, $e->getMessage());
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
|
||||
return $response;
|
||||
@@ -109,7 +112,7 @@ class Process extends Api
|
||||
$response["success"] = true;
|
||||
$response["message"] = "Process was deleted successfully";
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::SYSTEM_EXCEPTION_STATUS, $e->getMessage());
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
|
||||
return $response;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
namespace Services\Api\ProcessMaker;
|
||||
namespace Services\Api\ProcessMaker\Project;
|
||||
|
||||
use \ProcessMaker\Api;
|
||||
use \Luracast\Restler\RestException;
|
||||
|
||||
/**
|
||||
* ProjectActivity Api Controller
|
||||
* Project\Activity Api Controller
|
||||
*
|
||||
* @protected
|
||||
*/
|
||||
class ProjectActivity extends Api
|
||||
class Activity extends Api
|
||||
{
|
||||
/**
|
||||
* @url GET /:projectUid/activity/:activityUid
|
||||
@@ -44,7 +44,7 @@ class ProjectActivity extends Api
|
||||
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::SYSTEM_EXCEPTION_STATUS, $e->getMessage());
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ class ProjectActivity extends Api
|
||||
$task = new \BusinessModel\Task();
|
||||
$properties = $task->updateProperties($activityUid, $projectUid, $request_data);
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::SYSTEM_EXCEPTION_STATUS, $e->getMessage());
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ class ProjectActivity extends Api
|
||||
$task = new \BusinessModel\Task();
|
||||
$task->deleteTask($activityUid);
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::SYSTEM_EXCEPTION_STATUS, $e->getMessage());
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,4 +4,4 @@
|
||||
|
||||
[alias]
|
||||
test = "Services\Api\ProcessMaker\Test2"
|
||||
project = "Services\Api\ProcessMaker\ProjectActivity"
|
||||
project = "Services\Api\ProcessMaker\Project\Activity"
|
||||
|
||||
Reference in New Issue
Block a user