Merge remote branch 'upstream/master'

This commit is contained in:
Julio Cesar Laura
2014-09-25 13:36:40 -04:00
9 changed files with 33 additions and 62 deletions

View File

@@ -20,7 +20,7 @@ Scenario Outline: Get the case schedulers list when there are exactly zero case
| test_description | project | record |
| Get case scheduler of process Test Michelangelo | 1265557095225ff5c688f46031700471 | 0 |
| Get case scheduler of process Process Complete BPMN | 1455892245368ebeb11c1a5001393784 | 0 |
| Get case scheduler of process Process Complete BPMN | 1455892245368ebeb11c1a5001393784 | 1 |
Scenario Outline: Create any case scheduler for a project
@@ -122,7 +122,7 @@ Scenario Outline: Get the case schedulers list when there are exactly 16 case sc
| test_description | project | record |
| Get case scheduler of process Test Michelangelo | 1265557095225ff5c688f46031700471 | 16 |
| Get case scheduler of process Process Complete BPMN | 1455892245368ebeb11c1a5001393784 | 16 |
| Get case scheduler of process Process Complete BPMN | 1455892245368ebeb11c1a5001393784 | 17 |
Scenario Outline: Update the case schedulers for a project and then check if the values had changed

View File

@@ -35,7 +35,7 @@ Scenario Outline: Get a list public folder of process files manager
Examples:
| test_description | project | records |
| Get list of process Test Michelangelo | 1265557095225ff5c688f46031700471 | 0 |
| Get list of process Process Complete BPMN | 1455892245368ebeb11c1a5001393784 | 2 |
| Get list of process Process Complete BPMN | 1455892245368ebeb11c1a5001393784 | 4 |
Scenario Outline: Get a list templates folder of process files manager

View File

@@ -78,7 +78,7 @@ Scenario: Get a list templates folder of process files manager
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
And the response has 1 records
And the response has 2 records
Scenario: Verify that there are report tables
Given I request "project/1455892245368ebeb11c1a5001393784/report-tables"

View File

@@ -17,7 +17,9 @@ class WebApplication
const RUNNING_INDEX = "index.running";
const RUNNING_WORKFLOW = "workflow.running";
const RUNNING_API = "api.running";
const RUNNING_OAUTH2 = "api.oauth2";
const SERVICE_API = "service.api";
const SERVICE_OAUTH2 = "service.oauth2";
const REDIRECT_DEFAULT = "redirect.default";
/**
@@ -111,55 +113,7 @@ class WebApplication
$uriParts = explode('/', $this->requestUri);
if ($uriParts[2] == 'oauth2') {
if (! isset($uriParts[2])) {
return self::RUNNING_WORKFLOW;
}
$uriTemp = explode('/', $_SERVER['REQUEST_URI']);
array_shift($uriTemp);
$workspace = array_shift($uriTemp);
$_SERVER['REQUEST_URI'] = '/' . implode('/', $uriTemp);
$this->loadEnvironment($workspace);
// $pmOauthClientId - contains PM Local OAuth Id (Web Designer)
$pmOauthClientId = 'x-pm-local-client';
// Setting current workspace to Api class
Services\Api::setWorkspace($workspace);
$cacheDir = defined("PATH_C")? PATH_C: sys_get_temp_dir();
$sysConfig = \System::getSystemConfiguration();
\Luracast\Restler\Defaults::$cacheDirectory = $cacheDir;
$productionMode = !(isset($sysConfig["service_api_debug"]) && $sysConfig["service_api_debug"]);
Util\Logger::log("Serving API mode: " . ($productionMode? "production": "development"));
// create a new Restler instance
//$rest = new \Luracast\Restler\Restler();
$rest = new \Maveriks\Extension\Restler($productionMode);
$rest->setworkspace($workspace);
// setting api version to Restler
$rest->setAPIVersion('1.0');
// adding $authenticationClass to Restler
// Setting database connection source
list($host, $port) = strpos(DB_HOST, ':') !== false ? explode(':', DB_HOST) : array(DB_HOST, '');
$port = empty($port) ? '' : ";port=$port";
Services\OAuth2\Server::setDatabaseSource(DB_USER, DB_PASS, DB_ADAPTER.":host=$host;dbname=".DB_NAME.$port);
// Setting default OAuth Client id, for local PM Web Designer
Services\OAuth2\Server::setPmClientId($pmOauthClientId);
Services\OAuth2\Server::setWorkspace($workspace);
$rest->setOverridingFormats('JsonFormat', 'UploadFormat');
$rest->addAPIClass('\ProcessMaker\\Services\\OAuth2\\Server', 'oauth2');
$rest->handle();
return self::RUNNING_OAUTH2;
} else {
return self::RUNNING_WORKFLOW;
}
@@ -186,6 +140,16 @@ class WebApplication
}
Util\Logger::log("API::End Dispatch");
break;
case self::SERVICE_OAUTH2:
$uriTemp = explode('/', $_SERVER['REQUEST_URI']);
array_shift($uriTemp);
$workspace = array_shift($uriTemp);
$uri = '/' . implode('/', $uriTemp);
$this->loadEnvironment($workspace);
$this->dispatchApiRequest($uri, $version = "1.0");
break;
}
}
@@ -393,6 +357,8 @@ class WebApplication
// }
// }
}
$this->rest->addAPIClass('\ProcessMaker\\Services\\OAuth2\\Server', 'oauth2');
}
public function parseApiRequestUri()

View File

@@ -259,7 +259,11 @@ class PMPluginRegistry
$this->registerFolder( $sNamespace, $sNamespace, $detail->sPluginFolder );
//register the default directory, later we can have more
$this->_aPluginDetails[$sNamespace]->enabled = true;
$oPlugin = new $detail->sClassName( $detail->sNamespace, $detail->sFilename );
if (class_exists($detail->sClassName)) {
$oPlugin = new $detail->sClassName( $detail->sNamespace, $detail->sFilename );
} else {
$oPlugin = $detail;
}
$this->_aPlugins[$detail->sNamespace] = $oPlugin;
if (method_exists( $oPlugin, 'enable' )) {
$oPlugin->enable();

View File

@@ -43,7 +43,7 @@ try {
require_once PATH_CORE . 'methods' . PATH_SEP . 'enterprise' . PATH_SEP . 'enterprise.php';
$enterprise = new enterprisePlugin('enterprise');
if (!file_exists(PATH_DATA_SITE . "plugin.singleton")) {
$enterprise->enable();
}
@@ -100,7 +100,7 @@ try {
$errLabel = 'WRONG_LOGIN_CREDENTIALS';
}
$_SESSION["USERNAME_PREVIOUS1"] = $_SESSION["USERNAME_PREVIOUS2"];
$_SESSION["USERNAME_PREVIOUS1"] = (isset($_SESSION["USERNAME_PREVIOUS2"]))? $_SESSION["USERNAME_PREVIOUS2"] : "";
$_SESSION["USERNAME_PREVIOUS2"] = $usr;
if (!isset($uid) || $uid < 0) {

View File

@@ -209,7 +209,7 @@ class PmPdo implements \OAuth2\Storage\AuthorizationCodeInterface,
// the default behavior is to use "username" as the user_id
return array_merge(array(
'user_id' => $username
'user_id' => $userInfo['USR_UID'] //$username
), $userInfo);
}

View File

@@ -732,7 +732,6 @@ Ext.onReady(function() {
}
if (sw == 1) {
var pm = PROCESSMAKER_URL;
uploadForm.getForm().submit({
url: "../enterprise/addonsStoreAction",
params: {
@@ -740,10 +739,8 @@ Ext.onReady(function() {
},
waitMsg: _('ID_UPDATING_LICENSE_MSG'),
success: function (form, o) {
//Ext.MessageBox.alert(_('ID_INFORMATION'), _('ID_SUCCESSFULLY_UPLOADED'));
//parent.parent.window.location.href = newLocation();
Ext.MessageBox.alert(_('ID_INFORMATION'), _('ID_SUCCESSFULLY_UPLOADED'), function () {
parent.parent.window.location.href = PROCESSMAKER_URL + (SYS_SKIN.substring(0,2) == 'ux')? "/main/login" :"/setup/login/login";
parent.parent.window.location.href = newLocation()
});
},
failure: function (form, o) {
@@ -1020,7 +1017,7 @@ Ext.onReady(function() {
value: license_expires+'/'+license_span+" ("+license_start_date+" / "+license_end_date+")",
hidden: !licensed,
hideLabel: !licensed
},
}
],
buttons : [
{

View File

@@ -56,6 +56,10 @@ try {
$app->run(Maveriks\WebApplication::SERVICE_API);
break;
case Maveriks\WebApplication::RUNNING_OAUTH2:
$app->run(Maveriks\WebApplication::SERVICE_OAUTH2);
break;
case Maveriks\WebApplication::RUNNING_INDEX:
$response = new Maveriks\Http\Response(file_get_contents("index.html"), 302);
$response->send();