2014-01-22 17:18:33 -04:00
|
|
|
<?php
|
|
|
|
|
namespace Services\Api\ProcessMaker\Project;
|
|
|
|
|
|
|
|
|
|
use \ProcessMaker\Services\Api;
|
|
|
|
|
use \Luracast\Restler\RestException;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Project\WebEntry Api Controller
|
|
|
|
|
*
|
|
|
|
|
* @protected
|
|
|
|
|
*/
|
|
|
|
|
class WebEntry extends Api
|
|
|
|
|
{
|
|
|
|
|
/**
|
2014-01-27 15:21:15 -04:00
|
|
|
* @url GET /:prj_uid/web-entry/:tas_uid/:dyn_uid
|
2014-01-22 17:18:33 -04:00
|
|
|
*
|
2014-01-27 15:21:15 -04:00
|
|
|
* @param string $dyn_uid {@min 32}{@max 32}
|
|
|
|
|
* @param string $tas_uid {@min 32}{@max 32}
|
|
|
|
|
* @param string $prj_uid {@min 32}{@max 32}
|
2014-01-22 17:18:33 -04:00
|
|
|
*/
|
2014-01-27 15:21:15 -04:00
|
|
|
public function doGetWebEntry($dyn_uid, $tas_uid, $prj_uid)
|
2014-01-22 17:18:33 -04:00
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
$webEntry = new \BusinessModel\WebEntry();
|
|
|
|
|
|
2014-01-27 15:21:15 -04:00
|
|
|
$response = $webEntry->getWebEntry($prj_uid, $tas_uid, $dyn_uid);
|
2014-01-22 17:18:33 -04:00
|
|
|
|
|
|
|
|
return $response;
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-01-24 16:06:50 -04:00
|
|
|
/**
|
2014-01-27 15:21:15 -04:00
|
|
|
* @url POST /:prj_uid/web-entry
|
2014-01-24 16:06:50 -04:00
|
|
|
*
|
2014-01-27 15:21:15 -04:00
|
|
|
* @param string $prj_uid {@min 32}{@max 32}
|
2014-01-24 16:06:50 -04:00
|
|
|
* @param array $request_data
|
|
|
|
|
* @param string $tas_uid {@from body}{@min 32}{@max 32}{@required true}
|
|
|
|
|
* @param string $dyn_uid {@from body}{@min 32}{@max 32}{@required true}
|
|
|
|
|
* @param string $method {@from body}{@choice WS,HTML}{@required true}
|
|
|
|
|
* @param int $input_document_access {@from body}{@choice 0,1}{@required true}
|
|
|
|
|
* @param string $usr_username {@from body}
|
|
|
|
|
* @param string $usr_password {@from body}
|
|
|
|
|
*
|
|
|
|
|
* @status 201
|
|
|
|
|
*/
|
|
|
|
|
public function doPostWebEntry(
|
2014-01-27 15:21:15 -04:00
|
|
|
$prj_uid,
|
2014-01-24 16:06:50 -04:00
|
|
|
$request_data,
|
|
|
|
|
$tas_uid = "00000000000000000000000000000000",
|
|
|
|
|
$dyn_uid = "00000000000000000000000000000000",
|
|
|
|
|
$method = "WS",
|
|
|
|
|
$input_document_access = 0,
|
|
|
|
|
$usr_username = "",
|
|
|
|
|
$usr_password = ""
|
|
|
|
|
) {
|
|
|
|
|
try {
|
|
|
|
|
$webEntry = new \BusinessModel\WebEntry();
|
|
|
|
|
|
2014-01-27 15:21:15 -04:00
|
|
|
$arrayData = $webEntry->create($prj_uid, $request_data);
|
2014-01-24 16:06:50 -04:00
|
|
|
|
|
|
|
|
$response = $arrayData;
|
|
|
|
|
|
|
|
|
|
return $response;
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-01-22 17:18:33 -04:00
|
|
|
|
|
|
|
|
/**
|
2014-01-27 15:21:15 -04:00
|
|
|
* @url DELETE /:prj_uid/web-entry/:tas_uid/:dyn_uid
|
2014-01-22 17:18:33 -04:00
|
|
|
*
|
2014-01-27 15:21:15 -04:00
|
|
|
* @param string $dyn_uid {@min 32}{@max 32}
|
|
|
|
|
* @param string $tas_uid {@min 32}{@max 32}
|
|
|
|
|
* @param string $prj_uid {@min 32}{@max 32}
|
2014-01-22 17:18:33 -04:00
|
|
|
*/
|
2014-01-27 15:21:15 -04:00
|
|
|
public function doDeleteWebEntry($dyn_uid, $tas_uid, $prj_uid)
|
2014-01-22 17:18:33 -04:00
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
$webEntry = new \BusinessModel\WebEntry();
|
|
|
|
|
|
2014-01-27 15:21:15 -04:00
|
|
|
$webEntry->delete($prj_uid, $tas_uid, $dyn_uid);
|
2014-01-22 17:18:33 -04:00
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|