/** * @url POST /import * * @param array $request_data * * @status 201 */ public function doPostImport(array $request_data, $option = null, $option_group = null) { try { $importer = new \ProcessMaker\Importer\XmlImporter(); $importer->setSaveDir(PATH_DOCUMENT . "input"); $importer->setData("usr_uid", $this->getUserId()); $arrayData = $importer->importPostFile( $request_data, $option, $option_group, array("projectFile" => "project_file", "option" => "option", "optionGroup" => "option_group") ); $response = $arrayData; return $response; } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); } }
/** * @url POST /save-as * * @param string $prj_uid * @param string $prj_name * @param string $prj_description * @param string $prj_category */ public function doSaveAs($prj_uid, $prj_name, $prj_description, $prj_category) { $importer = new \ProcessMaker\Importer\XmlImporter(); return $importer->saveAs($prj_uid, $prj_name, $prj_description, $prj_category); }