Renaming issues fixed, and also adding the Rest API class for the ActionsByEmail Enterprise Feature

This commit is contained in:
Gustavo Cruz
2015-02-18 17:31:53 -04:00
parent 550e7bcc06
commit 382d1a57a9
64 changed files with 261 additions and 2 deletions

View File

@@ -333,6 +333,26 @@ class WebApplication
}
}
// adding features extension api classes
$featuresPath = $this->workflowDir .'engine' . DS . 'classes' . DS . 'features';
// $apiDir - contains directory to scan classes and add them to Restler
$featureDirList = glob($featuresPath . "/*", GLOB_ONLYDIR);
foreach ($featureDirList as $directory) {
if ($directory == 'ViewContainers') {
continue;
}
$featureApiClassList = Util\Common::rglob($directory . DS . 'api' . "/*");
foreach ($featureApiClassList as $classFile) {
if (pathinfo($classFile, PATHINFO_EXTENSION) === 'php') {
$relClassPath = str_replace('.php', '', str_replace($servicesDir, '', $classFile));
$namespace = 'Features\\'.basename($classFile, '.php');
$namespace = strpos($namespace, "//") === false? $namespace: str_replace("//", '', $namespace);
require_once $classFile;
$this->rest->addAPIClass($namespace);
}
}
}
// adding aliases for Restler
if (array_key_exists('alias', $config)) {
foreach ($config['alias'] as $alias => $aliasData) {

View File

@@ -4,7 +4,6 @@
* Description of ActionsByEmailFeature
*
*/
namespace Features\ActionsByEnmail;
class ActionsByEmailFeature implements EnterpriseFeature
{

View File

@@ -0,0 +1,29 @@
<?php
namespace Features\ActionsByEmail;
use Luracast\Restler\RestException;
use ProcessMaker\Services\Api;
/**
* Class Project
*
* @package Features\ActionsByEmail
* @author gustavo cruz <gustavo.cruz@colosa.com>
* @protected
*/
class ActionsByEmail extends Api
{
/**
* @url GET
*/
public function getABEList()
{
try {
$projects = array('status' => 200, 'message' => 'Hello');
return $projects;
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
}

View File

@@ -0,0 +1,211 @@
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
$features['ActionsByEmail']['views'] = array(
'taskConfiguration' => array(
'type' => 'form',
'language' => 'en',
'layouts' => array(),
'fields' => array(
array(
'name' => 'IFORM',
'type' => 'hidden'
),
array(
'name' => 'INDEX',
'type' => 'hidden'
),
array(
'name' => 'ABE_UID',
'type' => 'hidden'
),
array(
'name' => 'PRO_UID',
'type' => 'hidden'
),
array(
'name' => 'TAS_UID',
'type' => 'hidden'
),
array(
'name' => 'SYS_LANG',
'type' => 'hidden'
),
array(
'name' => 'ABE_EMAIL_FIELD_VALUE',
'type' => 'hidden'
),
array(
'name' => 'ABE_ACTION_FIELD_VALUE',
'type' => 'hidden'
),
array(
'name' => 'ABE_TYPE',
'label' => 'Type',
'type' => 'dropdown',
'options' => array(
array(
'name' => '',
'value' => '',
'text' => '- None -',
'type' => 'default'
),
array(
'name' => 'LINK',
'value' => 'LINK',
'text' => 'Link to fill a form',
),
array(
'name' => 'FIELD',
'value' => 'FIELD',
'text' => 'Use a field to generate actions links',
)
)
),
array(
'name' => 'ABE_TEMPLATE',
'label' => 'Template',
'type' => 'dropdown',
'data_source' => array(
'type' => 'REST',
'method' => 'GET',
'end_point' => '/ABE/ABETemplates/',
'parameters' => array()
),
'options' => array(
array(
'name' => '',
'value' => '',
'text' => '- Select a Template -',
'type' => 'default'
)
)
),
array(
'name' => 'EDIT',
'type' => 'link',
'value' => 'Edit',
'action' => array (
'type' => 'view-render',
'data_source' => array(
'type' => 'REST',
'method' => 'GET',
'end_point' => '/ABE/ABETemplates/editTemplateABE',
'parameters' => array('ABE_TEMPLATE')
)
)
),
array(
'name' => 'DYN_UID',
'value' => 'DYN_UID',
'type' => 'dropdown',
'data_source' => array(
'type' => 'REST',
'method' => 'GET',
'end_point' => '/Dynaform/',
'parameters' => array()
),
'options' => array(
array(
'name' => '',
'value' => '',
'text' => '- Select a Dynaform -',
'type' => 'default'
)
),
'events' => array(
'change' => array(
'listeners' => array('email-field', 'action-field')
)
),
),
array(
'name' => 'ABE_EMAIL_FIELD',
'value' => 'ABE_EMAIL_FIELD',
'label' => 'Field with the email',
'type' => 'dropdown',
'options' => array(
array(
'name' => '',
'value' => '',
'text' => '- Send to the email of the assigned user to the task -',
'type' => 'default'
)
),
'listeners' => array (
array (
'name' => 'email-field',
'action' => array (
'type' => 'field-render',
'data_source' => array (
'type' => 'REST',
'method' => 'GET',
'end_point' => '/Dynaform/loadFields',
'parameters' => array('DYN_UID')
)
)
)
)
),
array(
'name' => 'ABE_ACTION_FIELD',
'value' => 'ABE_ACTION_FIELD',
'label' => 'Field to Send in the Email',
'type' => 'dropdown',
'options' => array(
array(
'name' => '',
'value' => '',
'text' => '- Select a Field -',
'type' => 'default'
)
),
'listeners' => array(
'name' => 'action-field',
'action' => array(
'type' => 'field-render',
'data_source' => array(
'type' => 'REST',
'method' => 'GET',
'end_point' => '/Dynaform/loadFields',
'parameters' => array('DYN_UID')
)
)
)
),
array(
'name' => 'ABE_CASE_NOTE_IN_RESPONSE',
'value' => true,
'default' => false,
'label' => 'Register a Case Note when the recipient submits the Response',
'type' => 'checkbox'
),
array(
'name' => 'APPLY_CHANGES',
'type' => 'button',
'label' => 'Apply Changes',
'value' => 'APPLY_CHANGES',
'action' => array (
'type' => 'view-close',
'data_source' => array(
'type' => 'REST',
'method' => 'POST',
'end_point' => '/ABE/saveConfiguration',
'parameters' => array('_ALL')
)
)
),
array(
'name' => 'REQUIRED_LABEL',
'type' => 'label',
'label' => 'Required Field',
'value' => 'REQUIRED_LABEL'
)
)
)
);

View File

@@ -1,6 +1,6 @@
<?php
namespace Features\ActionsByEnmail;
namespace Features\ActionsByEmail;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates