BPMN Import/Export Updates, adding url endpoint GET /project/{prj_uid}/export

This commit is contained in:
Erik Amaru Ortiz
2014-03-28 12:57:55 -04:00
parent 00fd862056
commit 262e29ab9c
4 changed files with 201 additions and 136 deletions

View File

@@ -23,22 +23,36 @@
*/
ini_set( 'max_execution_time', '0' );
$ext = pathinfo($_FILES["PROCESS_FILENAME"]["name"], PATHINFO_EXTENSION);
if ($ext == "pmx") {
$importer = new \ProcessMaker\Importer\XmlImporter();
$importer->setSourceFromGlobals("PROCESS_FILENAME");
$data = array("usr_uid" => $_SESSION['USER_LOGGED']);
$res = $importer->import($data);
$result = array(
"success" => true,
"catchMessage" => "",
"ExistProcessInDatabase" => 0,
"ExistGroupsInDatabase" => 0,
"sNewProUid" => $res[0]["new_uid"],
"project_type" => "bpmn"
);
$importer->setData("usr_uid", $_SESSION['USER_LOGGED']);
try {
$res = $importer->import();
$result = array(
"success" => true,
"catchMessage" => "",
"ExistProcessInDatabase" => 0,
"ExistGroupsInDatabase" => 0,
"sNewProUid" => $res[0]["new_uid"],
"project_type" => "bpmn"
);
} catch (Exception $e) {
$result = array(
"success" => true,
"catchMessage" => "", //$e->getMessage(),
"ExistProcessInDatabase" => 1,
"ExistGroupsInDatabase" => 0,
"groupBeforeAccion" => "uploadFileNewProcess",
"sNewProUid" => "63626727053359dabb8fee8019503780",
"proFileName" => $_FILES['PROCESS_FILENAME']['name'],
"project_type" => "bpmn"
);
}
echo json_encode($result);
exit(0);