MT-28
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
namespace ProcessMaker\BusinessModel\Migrator;
|
||||
|
||||
|
||||
class DBConnectionMigrator implements Importable
|
||||
class DBConnectionMigrator implements Importable, Exportable
|
||||
{
|
||||
public function beforeImport($data)
|
||||
{
|
||||
@@ -26,4 +26,22 @@ class DBConnectionMigrator implements Importable
|
||||
// TODO: Implement afterImport() method.
|
||||
}
|
||||
|
||||
public function beforeExport()
|
||||
{
|
||||
// TODO: Implement beforeExport() method.
|
||||
}
|
||||
|
||||
public function export($prj_uid)
|
||||
{
|
||||
$oProcess = new \Process();
|
||||
$oData = new \StdClass();
|
||||
$oData->dbconnections = $oProcess->getDBConnectionsRows($prj_uid);
|
||||
return $oData;
|
||||
}
|
||||
|
||||
public function afterExport()
|
||||
{
|
||||
// TODO: Implement afterExport() method.
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
namespace ProcessMaker\BusinessModel\Migrator;
|
||||
use Symfony\Component\Config\Definition\Exception\Exception;
|
||||
|
||||
class DynaformsMigrator implements Importable
|
||||
class DynaformsMigrator implements Importable, Exportable
|
||||
{
|
||||
protected $processes;
|
||||
|
||||
@@ -39,4 +39,22 @@ class DynaformsMigrator implements Importable
|
||||
// TODO: Implement afterImport() method.
|
||||
}
|
||||
|
||||
public function beforeExport()
|
||||
{
|
||||
// TODO: Implement beforeExport() method.
|
||||
}
|
||||
|
||||
public function export($prj_uid)
|
||||
{
|
||||
$oProcess = new \Process();
|
||||
$oData = new \StdClass();
|
||||
$oData->dynaforms = $oProcess->getDynaformRows($prj_uid);
|
||||
return $oData;
|
||||
}
|
||||
|
||||
public function afterExport()
|
||||
{
|
||||
// TODO: Implement afterExport() method.
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
namespace ProcessMaker\BusinessModel\Migrator;
|
||||
|
||||
class ExportObjects
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $objectsList = array(
|
||||
'Process Definition / Diagram',
|
||||
'Assignment Rules',
|
||||
'Variables',
|
||||
'Dynaforms',
|
||||
'Input Documents',
|
||||
'Output Documents',
|
||||
'Triggers',
|
||||
'Report Tables',
|
||||
'Templates',
|
||||
'Files',
|
||||
'DB Connection',
|
||||
'Permissions',
|
||||
'Supervisors',
|
||||
'Supervisors Objects'
|
||||
);
|
||||
|
||||
/**
|
||||
* @param string $pro_uid
|
||||
* @return mixed|string
|
||||
* @throws Exception
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function objectList($pro_uid = '')
|
||||
{
|
||||
try {
|
||||
foreach ($this->objectsList as $key => $val) {
|
||||
$key++;
|
||||
$grid[] = array('OBJECT_ID' => $key, 'OBJECT_NAME' => $val, 'OBJECT_ACTION' => 0);
|
||||
}
|
||||
|
||||
$r = new \stdclass();
|
||||
$r->data = $grid;
|
||||
|
||||
return \G::json_encode($r);
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,17 +4,20 @@
|
||||
*/
|
||||
|
||||
namespace ProcessMaker\BusinessModel\Migrator;
|
||||
use \ProcessMaker\Exporter\XmlExporter;
|
||||
|
||||
class GranularExporter
|
||||
{
|
||||
protected $factory;
|
||||
protected $publisher;
|
||||
protected $data;
|
||||
protected $prjuid;
|
||||
/**
|
||||
* GranularExporter constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
public function __construct($prj_uid)
|
||||
{
|
||||
$this->prjuid = $prj_uid;
|
||||
$this->factory = new MigratorFactory();
|
||||
$this->publisher = new PMXGenerator();
|
||||
}
|
||||
@@ -32,6 +35,13 @@ class GranularExporter
|
||||
|
||||
protected function beforeExport()
|
||||
{
|
||||
$exporter = new XmlExporter($this->prjuid);
|
||||
$getProjectName = $exporter->truncateName($exporter->getProjectName(), false);
|
||||
$outputDir = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP;
|
||||
$version = \ProcessMaker\Util\Common::getLastVersion($outputDir . $getProjectName . "-*.pmx") + 1;
|
||||
$outputFilename = $outputDir . sprintf("%s-%s.%s", str_replace(" ", "_", $getProjectName), $version, "pmx");
|
||||
$exporter->setMetadata("export_version", $version);
|
||||
|
||||
$data = array();
|
||||
$data["version"] = "3.0";
|
||||
$data["container"] = "ProcessMaker-Project";
|
||||
@@ -44,9 +54,6 @@ class GranularExporter
|
||||
|
||||
protected function addData($migratorData)
|
||||
{
|
||||
|
||||
|
||||
|
||||
//$this->data = $data;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace ProcessMaker\BusinessModel\Migrator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Exception\Exception;
|
||||
|
||||
class InputDocumentsMigrator implements Importable
|
||||
class InputDocumentsMigrator implements Importable, Exportable
|
||||
{
|
||||
protected $processes;
|
||||
|
||||
@@ -41,4 +41,22 @@ class InputDocumentsMigrator implements Importable
|
||||
// TODO: Implement afterImport() method.
|
||||
}
|
||||
|
||||
public function beforeExport()
|
||||
{
|
||||
// TODO: Implement beforeExport() method.
|
||||
}
|
||||
|
||||
public function export($prj_uid)
|
||||
{
|
||||
$oProcess = new \Process();
|
||||
$oData = new \StdClass();
|
||||
$oData->inputs = $oProcess->getInputRows($prj_uid);
|
||||
return $oData;
|
||||
}
|
||||
|
||||
public function afterExport()
|
||||
{
|
||||
// TODO: Implement afterExport() method.
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,14 +9,12 @@
|
||||
namespace ProcessMaker\BusinessModel\Migrator;
|
||||
|
||||
|
||||
use Illuminate\Support\Facades\Input;
|
||||
|
||||
class MigratorFactory
|
||||
{
|
||||
public function create($classname)
|
||||
{
|
||||
$class = new NullMigrator();
|
||||
switch(strtoupper($classname)) {
|
||||
switch (strtoupper($classname)) {
|
||||
case 'ASSIGNMENTRULES':
|
||||
$class = new AssignmentRulesMigrator();
|
||||
break;
|
||||
|
||||
@@ -16,7 +16,7 @@ class NullMigrator implements Importable, Exportable
|
||||
// TODO: Implement beforeExport() method.
|
||||
}
|
||||
|
||||
public function export()
|
||||
public function export($prj_uid)
|
||||
{
|
||||
// TODO: Implement export() method.
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace ProcessMaker\BusinessModel\Migrator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Exception\Exception;
|
||||
|
||||
class OutputDocumentsMigrator implements Importable
|
||||
class OutputDocumentsMigrator implements Importable, Exportable
|
||||
{
|
||||
protected $processes;
|
||||
|
||||
@@ -41,4 +41,22 @@ class OutputDocumentsMigrator implements Importable
|
||||
// TODO: Implement afterImport() method.
|
||||
}
|
||||
|
||||
public function beforeExport()
|
||||
{
|
||||
// TODO: Implement beforeExport() method.
|
||||
}
|
||||
|
||||
public function export($prj_uid)
|
||||
{
|
||||
$oProcess = new \Process();
|
||||
$oData = new \StdClass();
|
||||
$oData->outputs = $oProcess->getOutputRows($prj_uid);
|
||||
return $oData;
|
||||
}
|
||||
|
||||
public function afterExport()
|
||||
{
|
||||
// TODO: Implement afterExport() method.
|
||||
}
|
||||
|
||||
}
|
||||
@@ -49,7 +49,60 @@ class ProcessDefinitionMigrator implements Importable, Exportable
|
||||
|
||||
public function export($prj_uid)
|
||||
{
|
||||
$bpmnStruct["ACTIVITY"] = \BpmnActivity::getAll($this->$prj_uid);
|
||||
$bpmnStruct["ARTIFACT"] = \BpmnArtifact::getAll($this->$prj_uid);
|
||||
$bpmnStruct["BOUND"] = \BpmnBound::getAll($this->$prj_uid);
|
||||
$bpmnStruct["DATA"] = \BpmnData::getAll($this->$prj_uid);
|
||||
$bpmnStruct["DIAGRAM"] = \BpmnDiagram::getAll($this->$prj_uid);
|
||||
$bpmnStruct["DOCUMENTATION"] = array();
|
||||
$bpmnStruct["EVENT"] = \BpmnEvent::getAll($this->$prj_uid);
|
||||
$bpmnStruct["EXTENSION"] = array();
|
||||
$bpmnStruct["FLOW"] = \BpmnFlow::getAll($this->$prj_uid, null, null, "", CASE_UPPER, false);
|
||||
$bpmnStruct["GATEWAY"] = \BpmnGateway::getAll($this->$prj_uid);
|
||||
$bpmnStruct["LANE"] = \BpmnLane::getAll($this->$prj_uid);
|
||||
$bpmnStruct["LANESET"] = \BpmnLaneset::getAll($this->$prj_uid);
|
||||
$bpmnStruct["PARTICIPANT"] = \BpmnParticipant::getAll($this->$prj_uid);
|
||||
$bpmnStruct["PROCESS"] = \BpmnProcess::getAll($this->$prj_uid);
|
||||
$bpmnStruct["PROJECT"] = array(\BpmnProjectPeer::retrieveByPK($this->$prj_uid)->toArray());
|
||||
|
||||
$oProcess = new \Processes();
|
||||
$oData = new \StdClass();
|
||||
$oData->process = $oProcess->getProcessRow($prj_uid, false);
|
||||
$oData->tasks = $oProcess->getTaskRows($prj_uid);
|
||||
$oData->routes = $oProcess->getRouteRows($prj_uid);
|
||||
$oData->lanes = $oProcess->getLaneRows($prj_uid);
|
||||
$oData->gateways = $oProcess->getGatewayRows($prj_uid);
|
||||
$oData->steps = $oProcess->getStepRows($prj_uid);
|
||||
$oData->taskusers = $oProcess->getTaskUserRows($oData->tasks);
|
||||
$oData->groupwfs = $oProcess->getGroupwfRows($oData->taskusers);
|
||||
$oData->steptriggers = $oProcess->getStepTriggerRows($oData->tasks);
|
||||
$oData->reportTablesVars = $oProcess->getReportTablesVarsRows($prj_uid);
|
||||
$oData->objectPermissions = $oProcess->getObjectPermissionRows($prj_uid, $oData);
|
||||
$oData->subProcess = $oProcess->getSubProcessRow($prj_uid);
|
||||
$oData->caseTracker = $oProcess->getCaseTrackerRow($prj_uid);
|
||||
$oData->caseTrackerObject = $oProcess->getCaseTrackerObjectRow($prj_uid);
|
||||
$oData->stage = $oProcess->getStageRow($prj_uid);
|
||||
$oData->fieldCondition = $oProcess->getFieldCondition($prj_uid);
|
||||
$oData->event = $oProcess->getEventRow($prj_uid);
|
||||
$oData->caseScheduler = $oProcess->getCaseSchedulerRow($prj_uid);
|
||||
$oData->processCategory = $oProcess->getProcessCategoryRow($prj_uid);
|
||||
$oData->taskExtraProperties = $oProcess->getTaskExtraPropertiesRows($prj_uid);
|
||||
$oData->processUser = $oProcess->getProcessUser($prj_uid);
|
||||
$oData->processVariables = $oProcess->getProcessVariables($prj_uid);
|
||||
$oData->webEntry = $oProcess->getWebEntries($prj_uid);
|
||||
$oData->webEntryEvent = $oProcess->getWebEntryEvents($prj_uid);
|
||||
$oData->messageType = $oProcess->getMessageTypes($prj_uid);
|
||||
$oData->messageTypeVariable = $oProcess->getMessageTypeVariables($prj_uid);
|
||||
$oData->messageEventDefinition = $oProcess->getMessageEventDefinitions($prj_uid);
|
||||
$oData->scriptTask = $oProcess->getScriptTasks($prj_uid);
|
||||
$oData->timerEvent = $oProcess->getTimerEvents($prj_uid);
|
||||
$oData->emailEvent = $oProcess->getEmailEvent($prj_uid);
|
||||
$oData->filesManager = $oProcess->getFilesManager($prj_uid);
|
||||
$oData->abeConfiguration = $oProcess->getActionsByEmail($prj_uid);
|
||||
$oData->groupwfs = $oProcess->groupwfsMerge($oData->groupwfs, $oData->processUser, "USR_UID");
|
||||
$oData->process["PRO_TYPE_PROCESS"] = "PUBLIC";
|
||||
|
||||
return $oData;
|
||||
}
|
||||
|
||||
public function afterExport()
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
namespace ProcessMaker\BusinessModel\Migrator;
|
||||
|
||||
class ReportTablesMigrator implements Importable
|
||||
class ReportTablesMigrator implements Importable, Exportable
|
||||
{
|
||||
public function beforeImport($data)
|
||||
{
|
||||
@@ -25,4 +25,22 @@ class ReportTablesMigrator implements Importable
|
||||
// TODO: Implement afterImport() method.
|
||||
}
|
||||
|
||||
public function beforeExport()
|
||||
{
|
||||
// TODO: Implement beforeExport() method.
|
||||
}
|
||||
|
||||
public function export($prj_uid)
|
||||
{
|
||||
$oProcess = new \Processes();
|
||||
$oData = new \StdClass();
|
||||
$oData->reportTables = $oProcess->getReportTablesRows($prj_uid);
|
||||
return $oData;
|
||||
}
|
||||
|
||||
public function afterExport()
|
||||
{
|
||||
// TODO: Implement afterExport() method.
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,7 +9,7 @@
|
||||
namespace ProcessMaker\BusinessModel\Migrator;
|
||||
|
||||
|
||||
class SupervisorsMigrator implements Importable
|
||||
class SupervisorsMigrator implements Importable, Exportable
|
||||
{
|
||||
public function beforeImport($data)
|
||||
{
|
||||
@@ -26,4 +26,22 @@ class SupervisorsMigrator implements Importable
|
||||
// TODO: Implement afterImport() method.
|
||||
}
|
||||
|
||||
public function beforeExport()
|
||||
{
|
||||
// TODO: Implement beforeExport() method.
|
||||
}
|
||||
|
||||
public function export($prj_uid)
|
||||
{
|
||||
$oProcess = new \Processes();
|
||||
$oData = new \StdClass();
|
||||
$oData->stepSupervisor = $oProcess->getStepSupervisorRows($prj_uid);
|
||||
return $oData;
|
||||
}
|
||||
|
||||
public function afterExport()
|
||||
{
|
||||
// TODO: Implement afterExport() method.
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,7 +9,7 @@
|
||||
namespace ProcessMaker\BusinessModel\Migrator;
|
||||
|
||||
|
||||
class SupervisorsObjectsMigrator implements Importable
|
||||
class SupervisorsObjectsMigrator implements Importable, Exportable
|
||||
{
|
||||
public function beforeImport($data)
|
||||
{
|
||||
@@ -26,4 +26,19 @@ class SupervisorsObjectsMigrator implements Importable
|
||||
// TODO: Implement afterImport() method.
|
||||
}
|
||||
|
||||
public function beforeExport()
|
||||
{
|
||||
// TODO: Implement beforeExport() method.
|
||||
}
|
||||
|
||||
public function export($prj_uid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function afterExport()
|
||||
{
|
||||
// TODO: Implement afterExport() method.
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,7 +9,7 @@
|
||||
namespace ProcessMaker\BusinessModel\Migrator;
|
||||
|
||||
|
||||
class TriggersMigrator implements Importable
|
||||
class TriggersMigrator implements Importable, Exportable
|
||||
{
|
||||
public function beforeImport($data)
|
||||
{
|
||||
@@ -26,4 +26,23 @@ class TriggersMigrator implements Importable
|
||||
// TODO: Implement afterImport() method.
|
||||
}
|
||||
|
||||
public function beforeExport()
|
||||
{
|
||||
// TODO: Implement beforeExport() method.
|
||||
}
|
||||
|
||||
public function export($prj_uid)
|
||||
{
|
||||
$process = new \Processes();
|
||||
$oData = new \StdClass();
|
||||
$oDataTasks = $process->getTaskRows($prj_uid);
|
||||
$oData->steptriggers = $process->getStepTriggerRows($oDataTasks);
|
||||
return $oData;
|
||||
}
|
||||
|
||||
public function afterExport()
|
||||
{
|
||||
// TODO: Implement afterExport() method.
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user