PM Rest Feature: added plugins support & more improvements
from a plugin a rest class can be registered now:
on setup method add the following:
---
$this->registerRestService('Sample', [optional string: $path]);
--
and create the folder PATH_PLUGIN . /your_plugin/classes/rest
next add a class with the flowing characteristics:
<?php
class Plugin_Services_Rest_Sample
{
public function get()
{
return 'hello world';
}
}
A class prefixed with Plugin_Services_Rest_
and add the corresponding methods for a Restler api
(http://luracast.com/products/restler/)
Finally on process maker will be exposed as:
via GET: http://127.0.0.1/rest/workflow/sample
This commit is contained in:
@@ -5175,25 +5175,39 @@ function getDirectorySize($path,$maxmtime=0)
|
||||
|
||||
$rest = new Restler();
|
||||
$rest->setSupportedFormats('JsonFormat', 'XmlFormat');
|
||||
$namespace = 'Services_Rest_';
|
||||
|
||||
// override global REQUEST_URI to pass to Restler library
|
||||
$_SERVER['REQUEST_URI'] = '/' . strtolower($namespace) . ltrim($uri, '/');
|
||||
|
||||
// getting all services class
|
||||
$srvClasses = glob(PATH_SERVICES_REST . '*.php');
|
||||
$crudClasses = glob(PATH_SERVICES_REST . 'crud/*.php');
|
||||
|
||||
$srvClasses = array_merge($srvClasses, $crudClasses);
|
||||
|
||||
|
||||
// hook to get rest api classes from plugins
|
||||
if ( class_exists( 'PMPluginRegistry' ) ) {
|
||||
$pluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$pluginClasses = $pluginRegistry->getRegisteredRestClassFiles();
|
||||
$srvClasses = array_merge($srvClasses, $pluginClasses);
|
||||
}
|
||||
|
||||
foreach ($srvClasses as $classFile) {
|
||||
require_once $classFile;
|
||||
$namespace = 'Services_Rest_';
|
||||
$className = str_replace('.php', '', basename($classFile));
|
||||
|
||||
$className = $namespace . str_replace('.php', '', basename($classFile));
|
||||
// if the core class does not exists try resolve the for a plugin
|
||||
if (! class_exists($namespace . $className)) {
|
||||
$namespace = 'Plugin_Services_Rest_';
|
||||
|
||||
// Couldn't resolve the class name, just skipp it
|
||||
if (! class_exists($namespace . $className)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$className = $namespace . $className;
|
||||
$reflClass = new ReflectionClass($className);
|
||||
|
||||
// verify if there is an auth class implementing 'iAuthenticate'
|
||||
if ($reflClass->implementsInterface('iAuthenticate')) {
|
||||
// verify if there is an auth class implementing 'iAuthenticate' that wasn't from plugin
|
||||
if ($reflClass->implementsInterface('iAuthenticate') && $namespace != 'Plugin_Services_Rest_') {
|
||||
// auth class found, set as restler authentication class handler
|
||||
$rest->addAuthenticationClass($className);
|
||||
} else {
|
||||
@@ -5202,6 +5216,9 @@ function getDirectorySize($path,$maxmtime=0)
|
||||
}
|
||||
}
|
||||
|
||||
// override global REQUEST_URI to pass to Restler library
|
||||
$_SERVER['REQUEST_URI'] = '/' . strtolower($namespace) . ltrim($uri, '/');
|
||||
|
||||
$rest->handle();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,12 +302,12 @@ class headPublisher {
|
||||
//$head .= $this->getExtJsStylesheets();
|
||||
$head .= $this->getExtJsScripts();
|
||||
$head .= $this->getExtJsVariablesScript();
|
||||
|
||||
|
||||
$oServerConf =& serverConf::getSingleton();
|
||||
if ($oServerConf->isRtl(SYS_LANG)) {
|
||||
$head .= " <script type='text/javascript' src='/js/ext/extjs_rtl.js'></script>\n";
|
||||
}
|
||||
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
||||
@@ -491,7 +491,7 @@ class headPublisher {
|
||||
if ($debug) {
|
||||
foreach ($pluginJavascripts as $pluginJsFile) {
|
||||
$jsPluginCacheName = '';
|
||||
if (substr($pluginJsFile, -3) != '.js') {
|
||||
if (substr($pgetRegisteredJavascriptByluginJsFile, -3) != '.js') {
|
||||
$pluginJsFile .= '.js';
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include '../../../gulliver/Core/Bootstrap.php';
|
||||
include '../../../workflow/engine/PmBootstrap.php';
|
||||
@@ -327,6 +327,34 @@ class PMPlugin
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
return $oPluginRegistry->getSteps();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a rest service and expose it
|
||||
*
|
||||
* @author Erik Amaru Ortiz <erik@colosa.com>
|
||||
* @param string $coreJsFile
|
||||
* @param array/string $pluginJsFile
|
||||
* @return void
|
||||
*/
|
||||
function registerRestService($classname, $path = '')
|
||||
{
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry->registerRestService($this->sNamespace, $classname, $path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregister a rest service
|
||||
*
|
||||
* @author Erik Amaru Ortiz <erik@colosa.com>
|
||||
* @param string $coreJsFile
|
||||
* @param array/string $pluginJsFile
|
||||
* @return void
|
||||
*/
|
||||
function unregisterRestService($classname, $path)
|
||||
{
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry->unregisterRestService($this->sNamespace, $classname, $path);
|
||||
}
|
||||
}
|
||||
|
||||
class menuDetail
|
||||
|
||||
@@ -95,6 +95,11 @@ class PMPluginRegistry {
|
||||
*/
|
||||
private $_aJavascripts = array();
|
||||
|
||||
/**
|
||||
* Contains all rest services classes from plugins
|
||||
*/
|
||||
private $_restServices = array();
|
||||
|
||||
static private $instance = NULL;
|
||||
|
||||
/**
|
||||
@@ -1224,6 +1229,67 @@ class PMPluginRegistry {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a rest service class from a plugin to be served by processmaker
|
||||
*
|
||||
* @param string $sNamespace The namespace for the plugin
|
||||
* @param string $classname The service (api) class name
|
||||
* @param string $path (optional) the class file path, if it is not set the system will try resolve the
|
||||
* file path from its classname.
|
||||
*/
|
||||
public function registerRestService($sNamespace, $classname, $path = '')
|
||||
{
|
||||
$restService = new StdClass();
|
||||
$restService->sNamespace = $sNamespace;
|
||||
$restService->classname = $classname;
|
||||
|
||||
if (empty($path)) {
|
||||
$path = PATH_PLUGINS . $restService->sNamespace . "/classes/rest/$classname.php";
|
||||
}
|
||||
|
||||
if (! file_exists($path)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$restService->path = $path;
|
||||
$this->_restServices[] = $restService;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregister a rest service class of a plugin
|
||||
*
|
||||
* @param string $sNamespace The namespace for the plugin
|
||||
* @param string $classname The service (api) class name
|
||||
*/
|
||||
public function unregisterRestService($sNamespace, $classname)
|
||||
{
|
||||
foreach ($this->_restServices as $i => $service) {
|
||||
if ($sNamespace == $service->sNamespace) {
|
||||
unset($this->_restServices[$i]);
|
||||
}
|
||||
}
|
||||
// Re-index when all js were unregistered
|
||||
$this->_restServices = array_values($this->_restServices);
|
||||
}
|
||||
|
||||
public function getRegisteredRestServices()
|
||||
{
|
||||
return $this->_restServices;
|
||||
}
|
||||
|
||||
public function getRegisteredRestClassFiles()
|
||||
{
|
||||
$restClassFiles = array();
|
||||
|
||||
foreach ($this->_restServices as $restService) {
|
||||
$restClassFiles[] = $restService->path;
|
||||
}
|
||||
|
||||
return $restClassFiles;
|
||||
}
|
||||
|
||||
/**
|
||||
* return all dashboard pages
|
||||
*
|
||||
|
||||
627
workflow/engine/config/rest-config.ini
Normal file
627
workflow/engine/config/rest-config.ini
Normal file
File diff suppressed because it is too large
Load Diff
@@ -38,7 +38,7 @@ class Service_Rest_RestTool
|
||||
$this->dbInfo[$table['@name']]['pKeys'] = array();
|
||||
$this->dbInfo[$table['@name']]['columns'] = array();
|
||||
$this->dbInfo[$table['@name']]['required_columns'] = array();
|
||||
|
||||
|
||||
foreach ($table['column'] as $column) {
|
||||
$this->dbInfo[$table['@name']]['columns'][] = $column['@name'];
|
||||
|
||||
@@ -58,14 +58,23 @@ class Service_Rest_RestTool
|
||||
$this->loadDbXmlSchema();
|
||||
|
||||
$this->configFile = empty($filename) ? PATH_CONFIG . $this->configFile : $filename;
|
||||
$configIniStr = '';
|
||||
$configIniStr = "; -= ProcessMaker RestFul services configuration =-\n";
|
||||
$configIniStr .= "\n";
|
||||
$configIniStr .= "; On this configuration you file can customize all crud rest api.\n";
|
||||
$configIniStr .= "; With what methods (GET,POST,PUT,DELETE) you need that PM serve.\n";
|
||||
$configIniStr .= "; And for each table/method what columns you can expose.\n";
|
||||
$configIniStr .= "\n";
|
||||
|
||||
foreach ($this->dbInfo as $table => $columns) {
|
||||
$strColumns = implode(' ', $columns['columns']);
|
||||
$configIniStr .= ";Rest Api for table $table with (".count($columns['columns']).") columns.\n";
|
||||
$configIniStr .= "[$table]\n";
|
||||
$configIniStr .= " ALLOW_METHODS = GET POST PUT DELETE\n";
|
||||
$configIniStr .= " ; Param to set the allowed methods (separeted by a single space), complete sample: ALLOW_METHODS = GET POST PUT DELETE\n";
|
||||
$configIniStr .= " ALLOW_METHODS = GET\n";
|
||||
$configIniStr .= " ; Params to set what columns should be exposed, you can use wildcard '*' to speccify all columns \n";
|
||||
$configIniStr .= " EXPOSE_COLUMNS_GET = *\n";
|
||||
$configIniStr .= " EXPOSE_COLUMNS_POST = ".implode(' ', $columns) . "\n";
|
||||
$configIniStr .= " EXPOSE_COLUMNS_PUT = ".implode(' ', $columns) . "\n";
|
||||
$configIniStr .= " EXPOSE_COLUMNS_POST = ".$strColumns."\n";
|
||||
$configIniStr .= " EXPOSE_COLUMNS_PUT = ".$strColumns."\n";
|
||||
$configIniStr .= "\n";
|
||||
}
|
||||
|
||||
@@ -97,7 +106,7 @@ class Service_Rest_RestTool
|
||||
|
||||
)
|
||||
));
|
||||
|
||||
|
||||
foreach ($this->config as $table => $conf) {
|
||||
$classname = self::camelize($table, 'class');
|
||||
$allowedMethods = explode(' ', $conf['ALLOW_METHODS']);
|
||||
@@ -105,6 +114,11 @@ class Service_Rest_RestTool
|
||||
//$allowedMethods = array('DELETE');
|
||||
|
||||
foreach ($allowedMethods as $method) {
|
||||
// validation for a valid method
|
||||
if (! in_array($method, array('GET', 'POST', 'PUT', 'DELETE'))) {
|
||||
throw new Exception("Invalid method '$method'.");
|
||||
}
|
||||
|
||||
$method = strtoupper($method);
|
||||
$exposedColumns = array();
|
||||
$params = array();
|
||||
@@ -118,6 +132,15 @@ class Service_Rest_RestTool
|
||||
} else {
|
||||
$exposedColumns = explode(' ', $conf['EXPOSE_COLUMNS_'.$method]);
|
||||
|
||||
// validation for valid columns
|
||||
$tableColumns = $this->dbInfo[$table]['columns'];
|
||||
|
||||
foreach ($exposedColumns as $column) {
|
||||
if (! in_array($column, $tableColumns)) {
|
||||
throw new Exception("Invalid column '$column' for table $table, it does not exist!.");
|
||||
}
|
||||
}
|
||||
|
||||
// validate that all required columns are in exposed columns array
|
||||
if ($method == 'POST') {
|
||||
// intersect required columns with exposed columns
|
||||
@@ -152,7 +175,7 @@ class Service_Rest_RestTool
|
||||
case 'PUT':
|
||||
foreach ($exposedColumns as $i => $column) {
|
||||
$paramsStr[$i] = "\$".self::camelize($column);
|
||||
|
||||
|
||||
if (! in_array($column, $this->dbInfo[$table]['pKeys'])) {
|
||||
$params[$i] = self::camelize($column);
|
||||
}
|
||||
@@ -168,14 +191,14 @@ class Service_Rest_RestTool
|
||||
}
|
||||
$paramsStr = implode(', ', $paramsStr);
|
||||
|
||||
// formatting primary keys for template
|
||||
// formatting primary keys for template
|
||||
foreach ($this->dbInfo[$table]['pKeys'] as $i => $pk) {
|
||||
$primaryKeys[$i] = "\$".self::camelize($pk);
|
||||
}
|
||||
$primaryKeys = implode(', ', $primaryKeys);
|
||||
|
||||
$methods .= Haanga::Load(
|
||||
'method'.self::camelize($method, 'class').'.tpl',
|
||||
'method'.self::camelize($method, 'class').'.tpl',
|
||||
array(
|
||||
'params' => $params,
|
||||
'paramsStr' => $paramsStr,
|
||||
|
||||
@@ -51,105 +51,5 @@ class Services_Rest_AdditionalTables
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'POST' method for Rest API
|
||||
*
|
||||
* @param mixed $addTabUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function post($addTabUid, $addTabName, $addTabClassName, $addTabDescription, $addTabSdwLogInsert, $addTabSdwLogUpdate, $addTabSdwLogDelete, $addTabSdwLogSelect, $addTabSdwMaxLength, $addTabSdwAutoDelete, $addTabPlgUid, $dbsUid, $proUid, $addTabType, $addTabGrid, $addTabTag)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$obj = new AdditionalTables();
|
||||
|
||||
$obj->setAddTabUid($addTabUid);
|
||||
$obj->setAddTabName($addTabName);
|
||||
$obj->setAddTabClassName($addTabClassName);
|
||||
$obj->setAddTabDescription($addTabDescription);
|
||||
$obj->setAddTabSdwLogInsert($addTabSdwLogInsert);
|
||||
$obj->setAddTabSdwLogUpdate($addTabSdwLogUpdate);
|
||||
$obj->setAddTabSdwLogDelete($addTabSdwLogDelete);
|
||||
$obj->setAddTabSdwLogSelect($addTabSdwLogSelect);
|
||||
$obj->setAddTabSdwMaxLength($addTabSdwMaxLength);
|
||||
$obj->setAddTabSdwAutoDelete($addTabSdwAutoDelete);
|
||||
$obj->setAddTabPlgUid($addTabPlgUid);
|
||||
$obj->setDbsUid($dbsUid);
|
||||
$obj->setProUid($proUid);
|
||||
$obj->setAddTabType($addTabType);
|
||||
$obj->setAddTabGrid($addTabGrid);
|
||||
$obj->setAddTabTag($addTabTag);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'PUT' method for Rest API
|
||||
*
|
||||
* @param mixed $addTabUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function put($addTabUid, $addTabName, $addTabClassName, $addTabDescription, $addTabSdwLogInsert, $addTabSdwLogUpdate, $addTabSdwLogDelete, $addTabSdwLogSelect, $addTabSdwMaxLength, $addTabSdwAutoDelete, $addTabPlgUid, $dbsUid, $proUid, $addTabType, $addTabGrid, $addTabTag)
|
||||
{
|
||||
try {
|
||||
$obj = AdditionalTablesPeer::retrieveByPK($addTabUid);
|
||||
|
||||
$obj->setAddTabName($addTabName);
|
||||
$obj->setAddTabClassName($addTabClassName);
|
||||
$obj->setAddTabDescription($addTabDescription);
|
||||
$obj->setAddTabSdwLogInsert($addTabSdwLogInsert);
|
||||
$obj->setAddTabSdwLogUpdate($addTabSdwLogUpdate);
|
||||
$obj->setAddTabSdwLogDelete($addTabSdwLogDelete);
|
||||
$obj->setAddTabSdwLogSelect($addTabSdwLogSelect);
|
||||
$obj->setAddTabSdwMaxLength($addTabSdwMaxLength);
|
||||
$obj->setAddTabSdwAutoDelete($addTabSdwAutoDelete);
|
||||
$obj->setAddTabPlgUid($addTabPlgUid);
|
||||
$obj->setDbsUid($dbsUid);
|
||||
$obj->setProUid($proUid);
|
||||
$obj->setAddTabType($addTabType);
|
||||
$obj->setAddTabGrid($addTabGrid);
|
||||
$obj->setAddTabTag($addTabTag);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'DELETE' method for Rest API
|
||||
*
|
||||
* @param mixed $addTabUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function delete($addTabUid)
|
||||
{
|
||||
$conn = Propel::getConnection(AdditionalTablesPeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$conn->begin();
|
||||
|
||||
$obj = AdditionalTablesPeer::retrieveByPK($addTabUid);
|
||||
if (! is_object($obj)) {
|
||||
throw new RestException(412, 'Record does not exist.');
|
||||
}
|
||||
$obj->delete();
|
||||
|
||||
$conn->commit();
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -65,132 +65,5 @@ class Services_Rest_AppCacheView
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'POST' method for Rest API
|
||||
*
|
||||
* @param mixed $appUid, $delIndex Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function post($appUid, $delIndex, $appNumber, $appStatus, $usrUid, $previousUsrUid, $tasUid, $proUid, $delDelegateDate, $delInitDate, $delTaskDueDate, $delFinishDate, $delThreadStatus, $appThreadStatus, $appTitle, $appProTitle, $appTasTitle, $appCurrentUser, $appDelPreviousUser, $delPriority, $delDuration, $delQueueDuration, $delDelayDuration, $delStarted, $delFinished, $delDelayed, $appCreateDate, $appFinishDate, $appUpdateDate, $appOverduePercentage)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$obj = new AppCacheView();
|
||||
|
||||
$obj->setAppUid($appUid);
|
||||
$obj->setDelIndex($delIndex);
|
||||
$obj->setAppNumber($appNumber);
|
||||
$obj->setAppStatus($appStatus);
|
||||
$obj->setUsrUid($usrUid);
|
||||
$obj->setPreviousUsrUid($previousUsrUid);
|
||||
$obj->setTasUid($tasUid);
|
||||
$obj->setProUid($proUid);
|
||||
$obj->setDelDelegateDate($delDelegateDate);
|
||||
$obj->setDelInitDate($delInitDate);
|
||||
$obj->setDelTaskDueDate($delTaskDueDate);
|
||||
$obj->setDelFinishDate($delFinishDate);
|
||||
$obj->setDelThreadStatus($delThreadStatus);
|
||||
$obj->setAppThreadStatus($appThreadStatus);
|
||||
$obj->setAppTitle($appTitle);
|
||||
$obj->setAppProTitle($appProTitle);
|
||||
$obj->setAppTasTitle($appTasTitle);
|
||||
$obj->setAppCurrentUser($appCurrentUser);
|
||||
$obj->setAppDelPreviousUser($appDelPreviousUser);
|
||||
$obj->setDelPriority($delPriority);
|
||||
$obj->setDelDuration($delDuration);
|
||||
$obj->setDelQueueDuration($delQueueDuration);
|
||||
$obj->setDelDelayDuration($delDelayDuration);
|
||||
$obj->setDelStarted($delStarted);
|
||||
$obj->setDelFinished($delFinished);
|
||||
$obj->setDelDelayed($delDelayed);
|
||||
$obj->setAppCreateDate($appCreateDate);
|
||||
$obj->setAppFinishDate($appFinishDate);
|
||||
$obj->setAppUpdateDate($appUpdateDate);
|
||||
$obj->setAppOverduePercentage($appOverduePercentage);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'PUT' method for Rest API
|
||||
*
|
||||
* @param mixed $appUid, $delIndex Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function put($appUid, $delIndex, $appNumber, $appStatus, $usrUid, $previousUsrUid, $tasUid, $proUid, $delDelegateDate, $delInitDate, $delTaskDueDate, $delFinishDate, $delThreadStatus, $appThreadStatus, $appTitle, $appProTitle, $appTasTitle, $appCurrentUser, $appDelPreviousUser, $delPriority, $delDuration, $delQueueDuration, $delDelayDuration, $delStarted, $delFinished, $delDelayed, $appCreateDate, $appFinishDate, $appUpdateDate, $appOverduePercentage)
|
||||
{
|
||||
try {
|
||||
$obj = AppCacheViewPeer::retrieveByPK($appUid, $delIndex);
|
||||
|
||||
$obj->setAppNumber($appNumber);
|
||||
$obj->setAppStatus($appStatus);
|
||||
$obj->setUsrUid($usrUid);
|
||||
$obj->setPreviousUsrUid($previousUsrUid);
|
||||
$obj->setTasUid($tasUid);
|
||||
$obj->setProUid($proUid);
|
||||
$obj->setDelDelegateDate($delDelegateDate);
|
||||
$obj->setDelInitDate($delInitDate);
|
||||
$obj->setDelTaskDueDate($delTaskDueDate);
|
||||
$obj->setDelFinishDate($delFinishDate);
|
||||
$obj->setDelThreadStatus($delThreadStatus);
|
||||
$obj->setAppThreadStatus($appThreadStatus);
|
||||
$obj->setAppTitle($appTitle);
|
||||
$obj->setAppProTitle($appProTitle);
|
||||
$obj->setAppTasTitle($appTasTitle);
|
||||
$obj->setAppCurrentUser($appCurrentUser);
|
||||
$obj->setAppDelPreviousUser($appDelPreviousUser);
|
||||
$obj->setDelPriority($delPriority);
|
||||
$obj->setDelDuration($delDuration);
|
||||
$obj->setDelQueueDuration($delQueueDuration);
|
||||
$obj->setDelDelayDuration($delDelayDuration);
|
||||
$obj->setDelStarted($delStarted);
|
||||
$obj->setDelFinished($delFinished);
|
||||
$obj->setDelDelayed($delDelayed);
|
||||
$obj->setAppCreateDate($appCreateDate);
|
||||
$obj->setAppFinishDate($appFinishDate);
|
||||
$obj->setAppUpdateDate($appUpdateDate);
|
||||
$obj->setAppOverduePercentage($appOverduePercentage);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'DELETE' method for Rest API
|
||||
*
|
||||
* @param mixed $appUid, $delIndex Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function delete($appUid, $delIndex)
|
||||
{
|
||||
$conn = Propel::getConnection(AppCacheViewPeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$conn->begin();
|
||||
|
||||
$obj = AppCacheViewPeer::retrieveByPK($appUid, $delIndex);
|
||||
if (! is_object($obj)) {
|
||||
throw new RestException(412, 'Record does not exist.');
|
||||
}
|
||||
$obj->delete();
|
||||
|
||||
$conn->commit();
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -49,101 +49,5 @@ class Services_Rest_AppDelay
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'POST' method for Rest API
|
||||
*
|
||||
* @param mixed $appDelayUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function post($appDelayUid, $proUid, $appUid, $appThreadIndex, $appDelIndex, $appType, $appStatus, $appNextTask, $appDelegationUser, $appEnableActionUser, $appEnableActionDate, $appDisableActionUser, $appDisableActionDate, $appAutomaticDisabledDate)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$obj = new AppDelay();
|
||||
|
||||
$obj->setAppDelayUid($appDelayUid);
|
||||
$obj->setProUid($proUid);
|
||||
$obj->setAppUid($appUid);
|
||||
$obj->setAppThreadIndex($appThreadIndex);
|
||||
$obj->setAppDelIndex($appDelIndex);
|
||||
$obj->setAppType($appType);
|
||||
$obj->setAppStatus($appStatus);
|
||||
$obj->setAppNextTask($appNextTask);
|
||||
$obj->setAppDelegationUser($appDelegationUser);
|
||||
$obj->setAppEnableActionUser($appEnableActionUser);
|
||||
$obj->setAppEnableActionDate($appEnableActionDate);
|
||||
$obj->setAppDisableActionUser($appDisableActionUser);
|
||||
$obj->setAppDisableActionDate($appDisableActionDate);
|
||||
$obj->setAppAutomaticDisabledDate($appAutomaticDisabledDate);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'PUT' method for Rest API
|
||||
*
|
||||
* @param mixed $appDelayUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function put($appDelayUid, $proUid, $appUid, $appThreadIndex, $appDelIndex, $appType, $appStatus, $appNextTask, $appDelegationUser, $appEnableActionUser, $appEnableActionDate, $appDisableActionUser, $appDisableActionDate, $appAutomaticDisabledDate)
|
||||
{
|
||||
try {
|
||||
$obj = AppDelayPeer::retrieveByPK($appDelayUid);
|
||||
|
||||
$obj->setProUid($proUid);
|
||||
$obj->setAppUid($appUid);
|
||||
$obj->setAppThreadIndex($appThreadIndex);
|
||||
$obj->setAppDelIndex($appDelIndex);
|
||||
$obj->setAppType($appType);
|
||||
$obj->setAppStatus($appStatus);
|
||||
$obj->setAppNextTask($appNextTask);
|
||||
$obj->setAppDelegationUser($appDelegationUser);
|
||||
$obj->setAppEnableActionUser($appEnableActionUser);
|
||||
$obj->setAppEnableActionDate($appEnableActionDate);
|
||||
$obj->setAppDisableActionUser($appDisableActionUser);
|
||||
$obj->setAppDisableActionDate($appDisableActionDate);
|
||||
$obj->setAppAutomaticDisabledDate($appAutomaticDisabledDate);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'DELETE' method for Rest API
|
||||
*
|
||||
* @param mixed $appDelayUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function delete($appDelayUid)
|
||||
{
|
||||
$conn = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$conn->begin();
|
||||
|
||||
$obj = AppDelayPeer::retrieveByPK($appDelayUid);
|
||||
if (! is_object($obj)) {
|
||||
throw new RestException(412, 'Record does not exist.');
|
||||
}
|
||||
$obj->delete();
|
||||
|
||||
$conn->commit();
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -57,116 +57,5 @@ class Services_Rest_AppDelegation
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'POST' method for Rest API
|
||||
*
|
||||
* @param mixed $appUid, $delIndex Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function post($appUid, $delIndex, $delPrevious, $proUid, $tasUid, $usrUid, $delType, $delThread, $delThreadStatus, $delPriority, $delDelegateDate, $delInitDate, $delTaskDueDate, $delFinishDate, $delDuration, $delQueueDuration, $delDelayDuration, $delStarted, $delFinished, $delDelayed, $delData, $appOverduePercentage)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$obj = new AppDelegation();
|
||||
|
||||
$obj->setAppUid($appUid);
|
||||
$obj->setDelIndex($delIndex);
|
||||
$obj->setDelPrevious($delPrevious);
|
||||
$obj->setProUid($proUid);
|
||||
$obj->setTasUid($tasUid);
|
||||
$obj->setUsrUid($usrUid);
|
||||
$obj->setDelType($delType);
|
||||
$obj->setDelThread($delThread);
|
||||
$obj->setDelThreadStatus($delThreadStatus);
|
||||
$obj->setDelPriority($delPriority);
|
||||
$obj->setDelDelegateDate($delDelegateDate);
|
||||
$obj->setDelInitDate($delInitDate);
|
||||
$obj->setDelTaskDueDate($delTaskDueDate);
|
||||
$obj->setDelFinishDate($delFinishDate);
|
||||
$obj->setDelDuration($delDuration);
|
||||
$obj->setDelQueueDuration($delQueueDuration);
|
||||
$obj->setDelDelayDuration($delDelayDuration);
|
||||
$obj->setDelStarted($delStarted);
|
||||
$obj->setDelFinished($delFinished);
|
||||
$obj->setDelDelayed($delDelayed);
|
||||
$obj->setDelData($delData);
|
||||
$obj->setAppOverduePercentage($appOverduePercentage);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'PUT' method for Rest API
|
||||
*
|
||||
* @param mixed $appUid, $delIndex Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function put($appUid, $delIndex, $delPrevious, $proUid, $tasUid, $usrUid, $delType, $delThread, $delThreadStatus, $delPriority, $delDelegateDate, $delInitDate, $delTaskDueDate, $delFinishDate, $delDuration, $delQueueDuration, $delDelayDuration, $delStarted, $delFinished, $delDelayed, $delData, $appOverduePercentage)
|
||||
{
|
||||
try {
|
||||
$obj = AppDelegationPeer::retrieveByPK($appUid, $delIndex);
|
||||
|
||||
$obj->setDelPrevious($delPrevious);
|
||||
$obj->setProUid($proUid);
|
||||
$obj->setTasUid($tasUid);
|
||||
$obj->setUsrUid($usrUid);
|
||||
$obj->setDelType($delType);
|
||||
$obj->setDelThread($delThread);
|
||||
$obj->setDelThreadStatus($delThreadStatus);
|
||||
$obj->setDelPriority($delPriority);
|
||||
$obj->setDelDelegateDate($delDelegateDate);
|
||||
$obj->setDelInitDate($delInitDate);
|
||||
$obj->setDelTaskDueDate($delTaskDueDate);
|
||||
$obj->setDelFinishDate($delFinishDate);
|
||||
$obj->setDelDuration($delDuration);
|
||||
$obj->setDelQueueDuration($delQueueDuration);
|
||||
$obj->setDelDelayDuration($delDelayDuration);
|
||||
$obj->setDelStarted($delStarted);
|
||||
$obj->setDelFinished($delFinished);
|
||||
$obj->setDelDelayed($delDelayed);
|
||||
$obj->setDelData($delData);
|
||||
$obj->setAppOverduePercentage($appOverduePercentage);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'DELETE' method for Rest API
|
||||
*
|
||||
* @param mixed $appUid, $delIndex Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function delete($appUid, $delIndex)
|
||||
{
|
||||
$conn = Propel::getConnection(AppDelegationPeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$conn->begin();
|
||||
|
||||
$obj = AppDelegationPeer::retrieveByPK($appUid, $delIndex);
|
||||
if (! is_object($obj)) {
|
||||
throw new RestException(412, 'Record does not exist.');
|
||||
}
|
||||
$obj->delete();
|
||||
|
||||
$conn->commit();
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -49,100 +49,5 @@ class Services_Rest_AppDocument
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'POST' method for Rest API
|
||||
*
|
||||
* @param mixed $appDocUid, $docVersion Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function post($appDocUid, $docVersion, $appUid, $delIndex, $docUid, $usrUid, $appDocType, $appDocCreateDate, $appDocIndex, $folderUid, $appDocPlugin, $appDocTags, $appDocStatus, $appDocStatusDate)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$obj = new AppDocument();
|
||||
|
||||
$obj->setAppDocUid($appDocUid);
|
||||
$obj->setDocVersion($docVersion);
|
||||
$obj->setAppUid($appUid);
|
||||
$obj->setDelIndex($delIndex);
|
||||
$obj->setDocUid($docUid);
|
||||
$obj->setUsrUid($usrUid);
|
||||
$obj->setAppDocType($appDocType);
|
||||
$obj->setAppDocCreateDate($appDocCreateDate);
|
||||
$obj->setAppDocIndex($appDocIndex);
|
||||
$obj->setFolderUid($folderUid);
|
||||
$obj->setAppDocPlugin($appDocPlugin);
|
||||
$obj->setAppDocTags($appDocTags);
|
||||
$obj->setAppDocStatus($appDocStatus);
|
||||
$obj->setAppDocStatusDate($appDocStatusDate);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'PUT' method for Rest API
|
||||
*
|
||||
* @param mixed $appDocUid, $docVersion Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function put($appDocUid, $docVersion, $appUid, $delIndex, $docUid, $usrUid, $appDocType, $appDocCreateDate, $appDocIndex, $folderUid, $appDocPlugin, $appDocTags, $appDocStatus, $appDocStatusDate)
|
||||
{
|
||||
try {
|
||||
$obj = AppDocumentPeer::retrieveByPK($appDocUid, $docVersion);
|
||||
|
||||
$obj->setAppUid($appUid);
|
||||
$obj->setDelIndex($delIndex);
|
||||
$obj->setDocUid($docUid);
|
||||
$obj->setUsrUid($usrUid);
|
||||
$obj->setAppDocType($appDocType);
|
||||
$obj->setAppDocCreateDate($appDocCreateDate);
|
||||
$obj->setAppDocIndex($appDocIndex);
|
||||
$obj->setFolderUid($folderUid);
|
||||
$obj->setAppDocPlugin($appDocPlugin);
|
||||
$obj->setAppDocTags($appDocTags);
|
||||
$obj->setAppDocStatus($appDocStatus);
|
||||
$obj->setAppDocStatusDate($appDocStatusDate);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'DELETE' method for Rest API
|
||||
*
|
||||
* @param mixed $appDocUid, $docVersion Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function delete($appDocUid, $docVersion)
|
||||
{
|
||||
$conn = Propel::getConnection(AppDocumentPeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$conn->begin();
|
||||
|
||||
$obj = AppDocumentPeer::retrieveByPK($appDocUid, $docVersion);
|
||||
if (! is_object($obj)) {
|
||||
throw new RestException(412, 'Record does not exist.');
|
||||
}
|
||||
$obj->delete();
|
||||
|
||||
$conn->commit();
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -42,85 +42,5 @@ class Services_Rest_AppEvent
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'POST' method for Rest API
|
||||
*
|
||||
* @param mixed $appUid, $delIndex, $evnUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function post($appUid, $delIndex, $evnUid, $appEvnActionDate, $appEvnAttempts, $appEvnLastExecutionDate, $appEvnStatus)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$obj = new AppEvent();
|
||||
|
||||
$obj->setAppUid($appUid);
|
||||
$obj->setDelIndex($delIndex);
|
||||
$obj->setEvnUid($evnUid);
|
||||
$obj->setAppEvnActionDate($appEvnActionDate);
|
||||
$obj->setAppEvnAttempts($appEvnAttempts);
|
||||
$obj->setAppEvnLastExecutionDate($appEvnLastExecutionDate);
|
||||
$obj->setAppEvnStatus($appEvnStatus);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'PUT' method for Rest API
|
||||
*
|
||||
* @param mixed $appUid, $delIndex, $evnUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function put($appUid, $delIndex, $evnUid, $appEvnActionDate, $appEvnAttempts, $appEvnLastExecutionDate, $appEvnStatus)
|
||||
{
|
||||
try {
|
||||
$obj = AppEventPeer::retrieveByPK($appUid, $delIndex, $evnUid);
|
||||
|
||||
$obj->setAppEvnActionDate($appEvnActionDate);
|
||||
$obj->setAppEvnAttempts($appEvnAttempts);
|
||||
$obj->setAppEvnLastExecutionDate($appEvnLastExecutionDate);
|
||||
$obj->setAppEvnStatus($appEvnStatus);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'DELETE' method for Rest API
|
||||
*
|
||||
* @param mixed $appUid, $delIndex, $evnUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function delete($appUid, $delIndex, $evnUid)
|
||||
{
|
||||
$conn = Propel::getConnection(AppEventPeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$conn->begin();
|
||||
|
||||
$obj = AppEventPeer::retrieveByPK($appUid, $delIndex, $evnUid);
|
||||
if (! is_object($obj)) {
|
||||
throw new RestException(412, 'Record does not exist.');
|
||||
}
|
||||
$obj->delete();
|
||||
|
||||
$conn->commit();
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -40,83 +40,5 @@ class Services_Rest_AppFolder
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'POST' method for Rest API
|
||||
*
|
||||
* @param mixed $folderUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function post($folderUid, $folderParentUid, $folderName, $folderCreateDate, $folderUpdateDate)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$obj = new AppFolder();
|
||||
|
||||
$obj->setFolderUid($folderUid);
|
||||
$obj->setFolderParentUid($folderParentUid);
|
||||
$obj->setFolderName($folderName);
|
||||
$obj->setFolderCreateDate($folderCreateDate);
|
||||
$obj->setFolderUpdateDate($folderUpdateDate);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'PUT' method for Rest API
|
||||
*
|
||||
* @param mixed $folderUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function put($folderUid, $folderParentUid, $folderName, $folderCreateDate, $folderUpdateDate)
|
||||
{
|
||||
try {
|
||||
$obj = AppFolderPeer::retrieveByPK($folderUid);
|
||||
|
||||
$obj->setFolderParentUid($folderParentUid);
|
||||
$obj->setFolderName($folderName);
|
||||
$obj->setFolderCreateDate($folderCreateDate);
|
||||
$obj->setFolderUpdateDate($folderUpdateDate);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'DELETE' method for Rest API
|
||||
*
|
||||
* @param mixed $folderUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function delete($folderUid)
|
||||
{
|
||||
$conn = Propel::getConnection(AppFolderPeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$conn->begin();
|
||||
|
||||
$obj = AppFolderPeer::retrieveByPK($folderUid);
|
||||
if (! is_object($obj)) {
|
||||
throw new RestException(412, 'Record does not exist.');
|
||||
}
|
||||
$obj->delete();
|
||||
|
||||
$conn->commit();
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -44,92 +44,5 @@ class Services_Rest_AppHistory
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'POST' method for Rest API
|
||||
*
|
||||
* @param mixed Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function post($appUid, $delIndex, $proUid, $tasUid, $dynUid, $usrUid, $appStatus, $historyDate, $historyData)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$obj = new AppHistory();
|
||||
|
||||
$obj->setAppUid($appUid);
|
||||
$obj->setDelIndex($delIndex);
|
||||
$obj->setProUid($proUid);
|
||||
$obj->setTasUid($tasUid);
|
||||
$obj->setDynUid($dynUid);
|
||||
$obj->setUsrUid($usrUid);
|
||||
$obj->setAppStatus($appStatus);
|
||||
$obj->setHistoryDate($historyDate);
|
||||
$obj->setHistoryData($historyData);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'PUT' method for Rest API
|
||||
*
|
||||
* @param mixed Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function put($appUid, $delIndex, $proUid, $tasUid, $dynUid, $usrUid, $appStatus, $historyDate, $historyData)
|
||||
{
|
||||
try {
|
||||
$obj = AppHistoryPeer::retrieveByPK();
|
||||
|
||||
$obj->setAppUid($appUid);
|
||||
$obj->setDelIndex($delIndex);
|
||||
$obj->setProUid($proUid);
|
||||
$obj->setTasUid($tasUid);
|
||||
$obj->setDynUid($dynUid);
|
||||
$obj->setUsrUid($usrUid);
|
||||
$obj->setAppStatus($appStatus);
|
||||
$obj->setHistoryDate($historyDate);
|
||||
$obj->setHistoryData($historyData);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'DELETE' method for Rest API
|
||||
*
|
||||
* @param mixed Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function delete()
|
||||
{
|
||||
$conn = Propel::getConnection(AppHistoryPeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$conn->begin();
|
||||
|
||||
$obj = AppHistoryPeer::retrieveByPK();
|
||||
if (! is_object($obj)) {
|
||||
throw new RestException(412, 'Record does not exist.');
|
||||
}
|
||||
$obj->delete();
|
||||
|
||||
$conn->commit();
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -51,105 +51,5 @@ class Services_Rest_AppMessage
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'POST' method for Rest API
|
||||
*
|
||||
* @param mixed $appMsgUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function post($appMsgUid, $msgUid, $appUid, $delIndex, $appMsgType, $appMsgSubject, $appMsgFrom, $appMsgTo, $appMsgBody, $appMsgDate, $appMsgCc, $appMsgBcc, $appMsgTemplate, $appMsgStatus, $appMsgAttach, $appMsgSendDate)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$obj = new AppMessage();
|
||||
|
||||
$obj->setAppMsgUid($appMsgUid);
|
||||
$obj->setMsgUid($msgUid);
|
||||
$obj->setAppUid($appUid);
|
||||
$obj->setDelIndex($delIndex);
|
||||
$obj->setAppMsgType($appMsgType);
|
||||
$obj->setAppMsgSubject($appMsgSubject);
|
||||
$obj->setAppMsgFrom($appMsgFrom);
|
||||
$obj->setAppMsgTo($appMsgTo);
|
||||
$obj->setAppMsgBody($appMsgBody);
|
||||
$obj->setAppMsgDate($appMsgDate);
|
||||
$obj->setAppMsgCc($appMsgCc);
|
||||
$obj->setAppMsgBcc($appMsgBcc);
|
||||
$obj->setAppMsgTemplate($appMsgTemplate);
|
||||
$obj->setAppMsgStatus($appMsgStatus);
|
||||
$obj->setAppMsgAttach($appMsgAttach);
|
||||
$obj->setAppMsgSendDate($appMsgSendDate);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'PUT' method for Rest API
|
||||
*
|
||||
* @param mixed $appMsgUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function put($appMsgUid, $msgUid, $appUid, $delIndex, $appMsgType, $appMsgSubject, $appMsgFrom, $appMsgTo, $appMsgBody, $appMsgDate, $appMsgCc, $appMsgBcc, $appMsgTemplate, $appMsgStatus, $appMsgAttach, $appMsgSendDate)
|
||||
{
|
||||
try {
|
||||
$obj = AppMessagePeer::retrieveByPK($appMsgUid);
|
||||
|
||||
$obj->setMsgUid($msgUid);
|
||||
$obj->setAppUid($appUid);
|
||||
$obj->setDelIndex($delIndex);
|
||||
$obj->setAppMsgType($appMsgType);
|
||||
$obj->setAppMsgSubject($appMsgSubject);
|
||||
$obj->setAppMsgFrom($appMsgFrom);
|
||||
$obj->setAppMsgTo($appMsgTo);
|
||||
$obj->setAppMsgBody($appMsgBody);
|
||||
$obj->setAppMsgDate($appMsgDate);
|
||||
$obj->setAppMsgCc($appMsgCc);
|
||||
$obj->setAppMsgBcc($appMsgBcc);
|
||||
$obj->setAppMsgTemplate($appMsgTemplate);
|
||||
$obj->setAppMsgStatus($appMsgStatus);
|
||||
$obj->setAppMsgAttach($appMsgAttach);
|
||||
$obj->setAppMsgSendDate($appMsgSendDate);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'DELETE' method for Rest API
|
||||
*
|
||||
* @param mixed $appMsgUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function delete($appMsgUid)
|
||||
{
|
||||
$conn = Propel::getConnection(AppMessagePeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$conn->begin();
|
||||
|
||||
$obj = AppMessagePeer::retrieveByPK($appMsgUid);
|
||||
if (! is_object($obj)) {
|
||||
throw new RestException(412, 'Record does not exist.');
|
||||
}
|
||||
$obj->delete();
|
||||
|
||||
$conn->commit();
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -45,94 +45,5 @@ class Services_Rest_AppNotes
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'POST' method for Rest API
|
||||
*
|
||||
* @param mixed Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function post($appUid, $usrUid, $noteDate, $noteContent, $noteType, $noteAvailability, $noteOriginObj, $noteAffectedObj1, $noteAffectedObj2, $noteRecipients)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$obj = new AppNotes();
|
||||
|
||||
$obj->setAppUid($appUid);
|
||||
$obj->setUsrUid($usrUid);
|
||||
$obj->setNoteDate($noteDate);
|
||||
$obj->setNoteContent($noteContent);
|
||||
$obj->setNoteType($noteType);
|
||||
$obj->setNoteAvailability($noteAvailability);
|
||||
$obj->setNoteOriginObj($noteOriginObj);
|
||||
$obj->setNoteAffectedObj1($noteAffectedObj1);
|
||||
$obj->setNoteAffectedObj2($noteAffectedObj2);
|
||||
$obj->setNoteRecipients($noteRecipients);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'PUT' method for Rest API
|
||||
*
|
||||
* @param mixed Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function put($appUid, $usrUid, $noteDate, $noteContent, $noteType, $noteAvailability, $noteOriginObj, $noteAffectedObj1, $noteAffectedObj2, $noteRecipients)
|
||||
{
|
||||
try {
|
||||
$obj = AppNotesPeer::retrieveByPK();
|
||||
|
||||
$obj->setAppUid($appUid);
|
||||
$obj->setUsrUid($usrUid);
|
||||
$obj->setNoteDate($noteDate);
|
||||
$obj->setNoteContent($noteContent);
|
||||
$obj->setNoteType($noteType);
|
||||
$obj->setNoteAvailability($noteAvailability);
|
||||
$obj->setNoteOriginObj($noteOriginObj);
|
||||
$obj->setNoteAffectedObj1($noteAffectedObj1);
|
||||
$obj->setNoteAffectedObj2($noteAffectedObj2);
|
||||
$obj->setNoteRecipients($noteRecipients);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'DELETE' method for Rest API
|
||||
*
|
||||
* @param mixed Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function delete()
|
||||
{
|
||||
$conn = Propel::getConnection(AppNotesPeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$conn->begin();
|
||||
|
||||
$obj = AppNotesPeer::retrieveByPK();
|
||||
if (! is_object($obj)) {
|
||||
throw new RestException(412, 'Record does not exist.');
|
||||
}
|
||||
$obj->delete();
|
||||
|
||||
$conn->commit();
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -38,77 +38,5 @@ class Services_Rest_AppOwner
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'POST' method for Rest API
|
||||
*
|
||||
* @param mixed $appUid, $ownUid, $usrUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function post($appUid, $ownUid, $usrUid)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$obj = new AppOwner();
|
||||
|
||||
$obj->setAppUid($appUid);
|
||||
$obj->setOwnUid($ownUid);
|
||||
$obj->setUsrUid($usrUid);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'PUT' method for Rest API
|
||||
*
|
||||
* @param mixed $appUid, $ownUid, $usrUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function put($appUid, $ownUid, $usrUid)
|
||||
{
|
||||
try {
|
||||
$obj = AppOwnerPeer::retrieveByPK($appUid, $ownUid, $usrUid);
|
||||
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'DELETE' method for Rest API
|
||||
*
|
||||
* @param mixed $appUid, $ownUid, $usrUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function delete($appUid, $ownUid, $usrUid)
|
||||
{
|
||||
$conn = Propel::getConnection(AppOwnerPeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$conn->begin();
|
||||
|
||||
$obj = AppOwnerPeer::retrieveByPK($appUid, $ownUid, $usrUid);
|
||||
if (! is_object($obj)) {
|
||||
throw new RestException(412, 'Record does not exist.');
|
||||
}
|
||||
$obj->delete();
|
||||
|
||||
$conn->commit();
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -37,77 +37,5 @@ class Services_Rest_AppSolrQueue
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'POST' method for Rest API
|
||||
*
|
||||
* @param mixed $appUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function post($appUid, $appUpdated)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$obj = new AppSolrQueue();
|
||||
|
||||
$obj->setAppUid($appUid);
|
||||
$obj->setAppUpdated($appUpdated);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'PUT' method for Rest API
|
||||
*
|
||||
* @param mixed $appUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function put($appUid, $appUpdated)
|
||||
{
|
||||
try {
|
||||
$obj = AppSolrQueuePeer::retrieveByPK($appUid);
|
||||
|
||||
$obj->setAppUpdated($appUpdated);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'DELETE' method for Rest API
|
||||
*
|
||||
* @param mixed $appUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function delete($appUid)
|
||||
{
|
||||
$conn = Propel::getConnection(AppSolrQueuePeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$conn->begin();
|
||||
|
||||
$obj = AppSolrQueuePeer::retrieveByPK($appUid);
|
||||
if (! is_object($obj)) {
|
||||
throw new RestException(412, 'Record does not exist.');
|
||||
}
|
||||
$obj->delete();
|
||||
|
||||
$conn->commit();
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -40,82 +40,5 @@ class Services_Rest_AppThread
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'POST' method for Rest API
|
||||
*
|
||||
* @param mixed $appUid, $appThreadIndex Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function post($appUid, $appThreadIndex, $appThreadParent, $appThreadStatus, $delIndex)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$obj = new AppThread();
|
||||
|
||||
$obj->setAppUid($appUid);
|
||||
$obj->setAppThreadIndex($appThreadIndex);
|
||||
$obj->setAppThreadParent($appThreadParent);
|
||||
$obj->setAppThreadStatus($appThreadStatus);
|
||||
$obj->setDelIndex($delIndex);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'PUT' method for Rest API
|
||||
*
|
||||
* @param mixed $appUid, $appThreadIndex Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function put($appUid, $appThreadIndex, $appThreadParent, $appThreadStatus, $delIndex)
|
||||
{
|
||||
try {
|
||||
$obj = AppThreadPeer::retrieveByPK($appUid, $appThreadIndex);
|
||||
|
||||
$obj->setAppThreadParent($appThreadParent);
|
||||
$obj->setAppThreadStatus($appThreadStatus);
|
||||
$obj->setDelIndex($delIndex);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'DELETE' method for Rest API
|
||||
*
|
||||
* @param mixed $appUid, $appThreadIndex Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function delete($appUid, $appThreadIndex)
|
||||
{
|
||||
$conn = Propel::getConnection(AppThreadPeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$conn->begin();
|
||||
|
||||
$obj = AppThreadPeer::retrieveByPK($appUid, $appThreadIndex);
|
||||
if (! is_object($obj)) {
|
||||
throw new RestException(412, 'Record does not exist.');
|
||||
}
|
||||
$obj->delete();
|
||||
|
||||
$conn->commit();
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -22,6 +22,17 @@ class Services_Rest_Application
|
||||
$criteria->addSelectColumn(ApplicationPeer::APP_PARENT);
|
||||
$criteria->addSelectColumn(ApplicationPeer::APP_STATUS);
|
||||
$criteria->addSelectColumn(ApplicationPeer::PRO_UID);
|
||||
$criteria->addSelectColumn(ApplicationPeer::APP_PROC_STATUS);
|
||||
$criteria->addSelectColumn(ApplicationPeer::APP_PROC_CODE);
|
||||
$criteria->addSelectColumn(ApplicationPeer::APP_PARALLEL);
|
||||
$criteria->addSelectColumn(ApplicationPeer::APP_INIT_USER);
|
||||
$criteria->addSelectColumn(ApplicationPeer::APP_CUR_USER);
|
||||
$criteria->addSelectColumn(ApplicationPeer::APP_CREATE_DATE);
|
||||
$criteria->addSelectColumn(ApplicationPeer::APP_INIT_DATE);
|
||||
$criteria->addSelectColumn(ApplicationPeer::APP_FINISH_DATE);
|
||||
$criteria->addSelectColumn(ApplicationPeer::APP_UPDATE_DATE);
|
||||
$criteria->addSelectColumn(ApplicationPeer::APP_DATA);
|
||||
$criteria->addSelectColumn(ApplicationPeer::APP_PIN);
|
||||
|
||||
$dataset = AppEventPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
@@ -40,105 +51,5 @@ class Services_Rest_Application
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'POST' method for Rest API
|
||||
*
|
||||
* @param mixed $appUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function post($appUid, $appNumber, $appParent, $appStatus, $proUid, $appProcStatus, $appProcCode, $appParallel, $appInitUser, $appCurUser, $appCreateDate, $appInitDate, $appFinishDate, $appUpdateDate, $appData, $appPin)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$obj = new Application();
|
||||
|
||||
$obj->setAppUid($appUid);
|
||||
$obj->setAppNumber($appNumber);
|
||||
$obj->setAppParent($appParent);
|
||||
$obj->setAppStatus($appStatus);
|
||||
$obj->setProUid($proUid);
|
||||
$obj->setAppProcStatus($appProcStatus);
|
||||
$obj->setAppProcCode($appProcCode);
|
||||
$obj->setAppParallel($appParallel);
|
||||
$obj->setAppInitUser($appInitUser);
|
||||
$obj->setAppCurUser($appCurUser);
|
||||
$obj->setAppCreateDate($appCreateDate);
|
||||
$obj->setAppInitDate($appInitDate);
|
||||
$obj->setAppFinishDate($appFinishDate);
|
||||
$obj->setAppUpdateDate($appUpdateDate);
|
||||
$obj->setAppData($appData);
|
||||
$obj->setAppPin($appPin);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'PUT' method for Rest API
|
||||
*
|
||||
* @param mixed $appUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function put($appUid, $appNumber, $appParent, $appStatus, $proUid, $appProcStatus, $appProcCode, $appParallel, $appInitUser, $appCurUser, $appCreateDate, $appInitDate, $appFinishDate, $appUpdateDate, $appData, $appPin)
|
||||
{
|
||||
try {
|
||||
$obj = ApplicationPeer::retrieveByPK($appUid);
|
||||
|
||||
$obj->setAppNumber($appNumber);
|
||||
$obj->setAppParent($appParent);
|
||||
$obj->setAppStatus($appStatus);
|
||||
$obj->setProUid($proUid);
|
||||
$obj->setAppProcStatus($appProcStatus);
|
||||
$obj->setAppProcCode($appProcCode);
|
||||
$obj->setAppParallel($appParallel);
|
||||
$obj->setAppInitUser($appInitUser);
|
||||
$obj->setAppCurUser($appCurUser);
|
||||
$obj->setAppCreateDate($appCreateDate);
|
||||
$obj->setAppInitDate($appInitDate);
|
||||
$obj->setAppFinishDate($appFinishDate);
|
||||
$obj->setAppUpdateDate($appUpdateDate);
|
||||
$obj->setAppData($appData);
|
||||
$obj->setAppPin($appPin);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'DELETE' method for Rest API
|
||||
*
|
||||
* @param mixed $appUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function delete($appUid)
|
||||
{
|
||||
$conn = Propel::getConnection(ApplicationPeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$conn->begin();
|
||||
|
||||
$obj = ApplicationPeer::retrieveByPK($appUid);
|
||||
if (! is_object($obj)) {
|
||||
throw new RestException(412, 'Record does not exist.');
|
||||
}
|
||||
$obj->delete();
|
||||
|
||||
$conn->commit();
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -38,79 +38,5 @@ class Services_Rest_CalendarAssignments
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'POST' method for Rest API
|
||||
*
|
||||
* @param mixed $objectUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function post($objectUid, $calendarUid, $objectType)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$obj = new CalendarAssignments();
|
||||
|
||||
$obj->setObjectUid($objectUid);
|
||||
$obj->setCalendarUid($calendarUid);
|
||||
$obj->setObjectType($objectType);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'PUT' method for Rest API
|
||||
*
|
||||
* @param mixed $objectUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function put($objectUid, $calendarUid, $objectType)
|
||||
{
|
||||
try {
|
||||
$obj = CalendarAssignmentsPeer::retrieveByPK($objectUid);
|
||||
|
||||
$obj->setCalendarUid($calendarUid);
|
||||
$obj->setObjectType($objectType);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'DELETE' method for Rest API
|
||||
*
|
||||
* @param mixed $objectUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function delete($objectUid)
|
||||
{
|
||||
$conn = Propel::getConnection(CalendarAssignmentsPeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$conn->begin();
|
||||
|
||||
$obj = CalendarAssignmentsPeer::retrieveByPK($objectUid);
|
||||
if (! is_object($obj)) {
|
||||
throw new RestException(412, 'Record does not exist.');
|
||||
}
|
||||
$obj->delete();
|
||||
|
||||
$conn->commit();
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -39,78 +39,5 @@ class Services_Rest_CalendarBusinessHours
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'POST' method for Rest API
|
||||
*
|
||||
* @param mixed $calendarUid, $calendarBusinessDay, $calendarBusinessStart, $calendarBusinessEnd Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function post($calendarUid, $calendarBusinessDay, $calendarBusinessStart, $calendarBusinessEnd)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$obj = new CalendarBusinessHours();
|
||||
|
||||
$obj->setCalendarUid($calendarUid);
|
||||
$obj->setCalendarBusinessDay($calendarBusinessDay);
|
||||
$obj->setCalendarBusinessStart($calendarBusinessStart);
|
||||
$obj->setCalendarBusinessEnd($calendarBusinessEnd);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'PUT' method for Rest API
|
||||
*
|
||||
* @param mixed $calendarUid, $calendarBusinessDay, $calendarBusinessStart, $calendarBusinessEnd Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function put($calendarUid, $calendarBusinessDay, $calendarBusinessStart, $calendarBusinessEnd)
|
||||
{
|
||||
try {
|
||||
$obj = CalendarBusinessHoursPeer::retrieveByPK($calendarUid, $calendarBusinessDay, $calendarBusinessStart, $calendarBusinessEnd);
|
||||
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'DELETE' method for Rest API
|
||||
*
|
||||
* @param mixed $calendarUid, $calendarBusinessDay, $calendarBusinessStart, $calendarBusinessEnd Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function delete($calendarUid, $calendarBusinessDay, $calendarBusinessStart, $calendarBusinessEnd)
|
||||
{
|
||||
$conn = Propel::getConnection(CalendarBusinessHoursPeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$conn->begin();
|
||||
|
||||
$obj = CalendarBusinessHoursPeer::retrieveByPK($calendarUid, $calendarBusinessDay, $calendarBusinessStart, $calendarBusinessEnd);
|
||||
if (! is_object($obj)) {
|
||||
throw new RestException(412, 'Record does not exist.');
|
||||
}
|
||||
$obj->delete();
|
||||
|
||||
$conn->commit();
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -42,87 +42,5 @@ class Services_Rest_CalendarDefinition
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'POST' method for Rest API
|
||||
*
|
||||
* @param mixed $calendarUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function post($calendarUid, $calendarName, $calendarCreateDate, $calendarUpdateDate, $calendarWorkDays, $calendarDescription, $calendarStatus)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$obj = new CalendarDefinition();
|
||||
|
||||
$obj->setCalendarUid($calendarUid);
|
||||
$obj->setCalendarName($calendarName);
|
||||
$obj->setCalendarCreateDate($calendarCreateDate);
|
||||
$obj->setCalendarUpdateDate($calendarUpdateDate);
|
||||
$obj->setCalendarWorkDays($calendarWorkDays);
|
||||
$obj->setCalendarDescription($calendarDescription);
|
||||
$obj->setCalendarStatus($calendarStatus);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'PUT' method for Rest API
|
||||
*
|
||||
* @param mixed $calendarUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function put($calendarUid, $calendarName, $calendarCreateDate, $calendarUpdateDate, $calendarWorkDays, $calendarDescription, $calendarStatus)
|
||||
{
|
||||
try {
|
||||
$obj = CalendarDefinitionPeer::retrieveByPK($calendarUid);
|
||||
|
||||
$obj->setCalendarName($calendarName);
|
||||
$obj->setCalendarCreateDate($calendarCreateDate);
|
||||
$obj->setCalendarUpdateDate($calendarUpdateDate);
|
||||
$obj->setCalendarWorkDays($calendarWorkDays);
|
||||
$obj->setCalendarDescription($calendarDescription);
|
||||
$obj->setCalendarStatus($calendarStatus);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'DELETE' method for Rest API
|
||||
*
|
||||
* @param mixed $calendarUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function delete($calendarUid)
|
||||
{
|
||||
$conn = Propel::getConnection(CalendarDefinitionPeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$conn->begin();
|
||||
|
||||
$obj = CalendarDefinitionPeer::retrieveByPK($calendarUid);
|
||||
if (! is_object($obj)) {
|
||||
throw new RestException(412, 'Record does not exist.');
|
||||
}
|
||||
$obj->delete();
|
||||
|
||||
$conn->commit();
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -39,80 +39,5 @@ class Services_Rest_CalendarHolidays
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'POST' method for Rest API
|
||||
*
|
||||
* @param mixed $calendarUid, $calendarHolidayName Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function post($calendarUid, $calendarHolidayName, $calendarHolidayStart, $calendarHolidayEnd)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$obj = new CalendarHolidays();
|
||||
|
||||
$obj->setCalendarUid($calendarUid);
|
||||
$obj->setCalendarHolidayName($calendarHolidayName);
|
||||
$obj->setCalendarHolidayStart($calendarHolidayStart);
|
||||
$obj->setCalendarHolidayEnd($calendarHolidayEnd);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'PUT' method for Rest API
|
||||
*
|
||||
* @param mixed $calendarUid, $calendarHolidayName Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function put($calendarUid, $calendarHolidayName, $calendarHolidayStart, $calendarHolidayEnd)
|
||||
{
|
||||
try {
|
||||
$obj = CalendarHolidaysPeer::retrieveByPK($calendarUid, $calendarHolidayName);
|
||||
|
||||
$obj->setCalendarHolidayStart($calendarHolidayStart);
|
||||
$obj->setCalendarHolidayEnd($calendarHolidayEnd);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'DELETE' method for Rest API
|
||||
*
|
||||
* @param mixed $calendarUid, $calendarHolidayName Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function delete($calendarUid, $calendarHolidayName)
|
||||
{
|
||||
$conn = Propel::getConnection(CalendarHolidaysPeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$conn->begin();
|
||||
|
||||
$obj = CalendarHolidaysPeer::retrieveByPK($calendarUid, $calendarHolidayName);
|
||||
if (! is_object($obj)) {
|
||||
throw new RestException(412, 'Record does not exist.');
|
||||
}
|
||||
$obj->delete();
|
||||
|
||||
$conn->commit();
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -60,123 +60,5 @@ class Services_Rest_CaseScheduler
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'POST' method for Rest API
|
||||
*
|
||||
* @param mixed $schUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function post($schUid, $schDelUserName, $schDelUserPass, $schDelUserUid, $schName, $proUid, $tasUid, $schTimeNextRun, $schLastRunTime, $schState, $schLastState, $usrUid, $schOption, $schStartTime, $schStartDate, $schDaysPerformTask, $schEveryDays, $schWeekDays, $schStartDay, $schMonths, $schEndDate, $schRepeatEvery, $schRepeatUntil, $schRepeatStopIfRunning, $caseShPluginUid)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$obj = new CaseScheduler();
|
||||
|
||||
$obj->setSchUid($schUid);
|
||||
$obj->setSchDelUserName($schDelUserName);
|
||||
$obj->setSchDelUserPass($schDelUserPass);
|
||||
$obj->setSchDelUserUid($schDelUserUid);
|
||||
$obj->setSchName($schName);
|
||||
$obj->setProUid($proUid);
|
||||
$obj->setTasUid($tasUid);
|
||||
$obj->setSchTimeNextRun($schTimeNextRun);
|
||||
$obj->setSchLastRunTime($schLastRunTime);
|
||||
$obj->setSchState($schState);
|
||||
$obj->setSchLastState($schLastState);
|
||||
$obj->setUsrUid($usrUid);
|
||||
$obj->setSchOption($schOption);
|
||||
$obj->setSchStartTime($schStartTime);
|
||||
$obj->setSchStartDate($schStartDate);
|
||||
$obj->setSchDaysPerformTask($schDaysPerformTask);
|
||||
$obj->setSchEveryDays($schEveryDays);
|
||||
$obj->setSchWeekDays($schWeekDays);
|
||||
$obj->setSchStartDay($schStartDay);
|
||||
$obj->setSchMonths($schMonths);
|
||||
$obj->setSchEndDate($schEndDate);
|
||||
$obj->setSchRepeatEvery($schRepeatEvery);
|
||||
$obj->setSchRepeatUntil($schRepeatUntil);
|
||||
$obj->setSchRepeatStopIfRunning($schRepeatStopIfRunning);
|
||||
$obj->setCaseShPluginUid($caseShPluginUid);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'PUT' method for Rest API
|
||||
*
|
||||
* @param mixed $schUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function put($schUid, $schDelUserName, $schDelUserPass, $schDelUserUid, $schName, $proUid, $tasUid, $schTimeNextRun, $schLastRunTime, $schState, $schLastState, $usrUid, $schOption, $schStartTime, $schStartDate, $schDaysPerformTask, $schEveryDays, $schWeekDays, $schStartDay, $schMonths, $schEndDate, $schRepeatEvery, $schRepeatUntil, $schRepeatStopIfRunning, $caseShPluginUid)
|
||||
{
|
||||
try {
|
||||
$obj = CaseSchedulerPeer::retrieveByPK($schUid);
|
||||
|
||||
$obj->setSchDelUserName($schDelUserName);
|
||||
$obj->setSchDelUserPass($schDelUserPass);
|
||||
$obj->setSchDelUserUid($schDelUserUid);
|
||||
$obj->setSchName($schName);
|
||||
$obj->setProUid($proUid);
|
||||
$obj->setTasUid($tasUid);
|
||||
$obj->setSchTimeNextRun($schTimeNextRun);
|
||||
$obj->setSchLastRunTime($schLastRunTime);
|
||||
$obj->setSchState($schState);
|
||||
$obj->setSchLastState($schLastState);
|
||||
$obj->setUsrUid($usrUid);
|
||||
$obj->setSchOption($schOption);
|
||||
$obj->setSchStartTime($schStartTime);
|
||||
$obj->setSchStartDate($schStartDate);
|
||||
$obj->setSchDaysPerformTask($schDaysPerformTask);
|
||||
$obj->setSchEveryDays($schEveryDays);
|
||||
$obj->setSchWeekDays($schWeekDays);
|
||||
$obj->setSchStartDay($schStartDay);
|
||||
$obj->setSchMonths($schMonths);
|
||||
$obj->setSchEndDate($schEndDate);
|
||||
$obj->setSchRepeatEvery($schRepeatEvery);
|
||||
$obj->setSchRepeatUntil($schRepeatUntil);
|
||||
$obj->setSchRepeatStopIfRunning($schRepeatStopIfRunning);
|
||||
$obj->setCaseShPluginUid($caseShPluginUid);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'DELETE' method for Rest API
|
||||
*
|
||||
* @param mixed $schUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function delete($schUid)
|
||||
{
|
||||
$conn = Propel::getConnection(CaseSchedulerPeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$conn->begin();
|
||||
|
||||
$obj = CaseSchedulerPeer::retrieveByPK($schUid);
|
||||
if (! is_object($obj)) {
|
||||
throw new RestException(412, 'Record does not exist.');
|
||||
}
|
||||
$obj->delete();
|
||||
|
||||
$conn->commit();
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -39,81 +39,5 @@ class Services_Rest_CaseTracker
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'POST' method for Rest API
|
||||
*
|
||||
* @param mixed $proUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function post($proUid, $ctMapType, $ctDerivationHistory, $ctMessageHistory)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$obj = new CaseTracker();
|
||||
|
||||
$obj->setProUid($proUid);
|
||||
$obj->setCtMapType($ctMapType);
|
||||
$obj->setCtDerivationHistory($ctDerivationHistory);
|
||||
$obj->setCtMessageHistory($ctMessageHistory);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'PUT' method for Rest API
|
||||
*
|
||||
* @param mixed $proUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function put($proUid, $ctMapType, $ctDerivationHistory, $ctMessageHistory)
|
||||
{
|
||||
try {
|
||||
$obj = CaseTrackerPeer::retrieveByPK($proUid);
|
||||
|
||||
$obj->setCtMapType($ctMapType);
|
||||
$obj->setCtDerivationHistory($ctDerivationHistory);
|
||||
$obj->setCtMessageHistory($ctMessageHistory);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'DELETE' method for Rest API
|
||||
*
|
||||
* @param mixed $proUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function delete($proUid)
|
||||
{
|
||||
$conn = Propel::getConnection(CaseTrackerPeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$conn->begin();
|
||||
|
||||
$obj = CaseTrackerPeer::retrieveByPK($proUid);
|
||||
if (! is_object($obj)) {
|
||||
throw new RestException(412, 'Record does not exist.');
|
||||
}
|
||||
$obj->delete();
|
||||
|
||||
$conn->commit();
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -41,85 +41,5 @@ class Services_Rest_CaseTrackerObject
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'POST' method for Rest API
|
||||
*
|
||||
* @param mixed $ctoUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function post($ctoUid, $proUid, $ctoTypeObj, $ctoUidObj, $ctoCondition, $ctoPosition)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$obj = new CaseTrackerObject();
|
||||
|
||||
$obj->setCtoUid($ctoUid);
|
||||
$obj->setProUid($proUid);
|
||||
$obj->setCtoTypeObj($ctoTypeObj);
|
||||
$obj->setCtoUidObj($ctoUidObj);
|
||||
$obj->setCtoCondition($ctoCondition);
|
||||
$obj->setCtoPosition($ctoPosition);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'PUT' method for Rest API
|
||||
*
|
||||
* @param mixed $ctoUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function put($ctoUid, $proUid, $ctoTypeObj, $ctoUidObj, $ctoCondition, $ctoPosition)
|
||||
{
|
||||
try {
|
||||
$obj = CaseTrackerObjectPeer::retrieveByPK($ctoUid);
|
||||
|
||||
$obj->setProUid($proUid);
|
||||
$obj->setCtoTypeObj($ctoTypeObj);
|
||||
$obj->setCtoUidObj($ctoUidObj);
|
||||
$obj->setCtoCondition($ctoCondition);
|
||||
$obj->setCtoPosition($ctoPosition);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'DELETE' method for Rest API
|
||||
*
|
||||
* @param mixed $ctoUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function delete($ctoUid)
|
||||
{
|
||||
$conn = Propel::getConnection(CaseTrackerObjectPeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$conn->begin();
|
||||
|
||||
$obj = CaseTrackerObjectPeer::retrieveByPK($ctoUid);
|
||||
if (! is_object($obj)) {
|
||||
throw new RestException(412, 'Record does not exist.');
|
||||
}
|
||||
$obj->delete();
|
||||
|
||||
$conn->commit();
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -41,81 +41,5 @@ class Services_Rest_Configuration
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'POST' method for Rest API
|
||||
*
|
||||
* @param mixed $cfgUid, $objUid, $proUid, $usrUid, $appUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function post($cfgUid, $objUid, $cfgValue, $proUid, $usrUid, $appUid)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$obj = new Configuration();
|
||||
|
||||
$obj->setCfgUid($cfgUid);
|
||||
$obj->setObjUid($objUid);
|
||||
$obj->setCfgValue($cfgValue);
|
||||
$obj->setProUid($proUid);
|
||||
$obj->setUsrUid($usrUid);
|
||||
$obj->setAppUid($appUid);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'PUT' method for Rest API
|
||||
*
|
||||
* @param mixed $cfgUid, $objUid, $proUid, $usrUid, $appUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function put($cfgUid, $objUid, $cfgValue, $proUid, $usrUid, $appUid)
|
||||
{
|
||||
try {
|
||||
$obj = ConfigurationPeer::retrieveByPK($cfgUid, $objUid, $proUid, $usrUid, $appUid);
|
||||
|
||||
$obj->setCfgValue($cfgValue);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'DELETE' method for Rest API
|
||||
*
|
||||
* @param mixed $cfgUid, $objUid, $proUid, $usrUid, $appUid Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function delete($cfgUid, $objUid, $proUid, $usrUid, $appUid)
|
||||
{
|
||||
$conn = Propel::getConnection(ConfigurationPeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$conn->begin();
|
||||
|
||||
$obj = ConfigurationPeer::retrieveByPK($cfgUid, $objUid, $proUid, $usrUid, $appUid);
|
||||
if (! is_object($obj)) {
|
||||
throw new RestException(412, 'Record does not exist.');
|
||||
}
|
||||
$obj->delete();
|
||||
|
||||
$conn->commit();
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -40,80 +40,5 @@ class Services_Rest_Content
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'POST' method for Rest API
|
||||
*
|
||||
* @param mixed $conCategory, $conParent, $conId, $conLang Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function post($conCategory, $conParent, $conId, $conLang, $conValue)
|
||||
{
|
||||
try {
|
||||
$result = array();
|
||||
$obj = new Content();
|
||||
|
||||
$obj->setConCategory($conCategory);
|
||||
$obj->setConParent($conParent);
|
||||
$obj->setConId($conId);
|
||||
$obj->setConLang($conLang);
|
||||
$obj->setConValue($conValue);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'PUT' method for Rest API
|
||||
*
|
||||
* @param mixed $conCategory, $conParent, $conId, $conLang Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function put($conCategory, $conParent, $conId, $conLang, $conValue)
|
||||
{
|
||||
try {
|
||||
$obj = ContentPeer::retrieveByPK($conCategory, $conParent, $conId, $conLang);
|
||||
|
||||
$obj->setConValue($conValue);
|
||||
|
||||
$obj->save();
|
||||
} catch (Exception $e) {
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for 'DELETE' method for Rest API
|
||||
*
|
||||
* @param mixed $conCategory, $conParent, $conId, $conLang Primary key
|
||||
*
|
||||
* @return array $result Returns array within multiple records or a single record depending if
|
||||
* a single selection was requested passing id(s) as param
|
||||
*/
|
||||
protected function delete($conCategory, $conParent, $conId, $conLang)
|
||||
{
|
||||
$conn = Propel::getConnection(ContentPeer::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
$conn->begin();
|
||||
|
||||
$obj = ContentPeer::retrieveByPK($conCategory, $conParent, $conId, $conLang);
|
||||
if (! is_object($obj)) {
|
||||
throw new RestException(412, 'Record does not exist.');
|
||||
}
|
||||
$obj->delete();
|
||||
|
||||
$conn->commit();
|
||||
} catch (Exception $e) {
|
||||
$conn->rollback();
|
||||
throw new RestException(412, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user