MT-115
Selective Import/Export - Add license key to include it only in enterprise/enterprise edition MT-115 addons feature MT-115
This commit is contained in:
@@ -282,6 +282,24 @@ class PMLicensedFeatures
|
||||
"type" => "features",
|
||||
"url" => "",
|
||||
"version" => ""
|
||||
),
|
||||
15 => array(),
|
||||
16 => array(
|
||||
"description" => "Selective Import Export.",
|
||||
"enabled" => false,
|
||||
"id" => "selectiveImportExport",
|
||||
"latest_version" => "",
|
||||
"log" => null,
|
||||
"name" => "selectiveImportExport",
|
||||
"nick" => "selectiveImportExport",
|
||||
"progress" => 0,
|
||||
"publisher" => "Colosa",
|
||||
"release_type" => "localRegistry",
|
||||
"status" => "ready",
|
||||
"store" => "00000000000000000000000000010016",
|
||||
"type" => "features",
|
||||
"url" => "",
|
||||
"version" => ""
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -61452,4 +61452,5 @@ INSERT INTO ADDONS_MANAGER (ADDON_DESCRIPTION,ADDON_ID,ADDON_NAME,ADDON_NICK,ADD
|
||||
('SSO with an LDAP provider.','windowsSSO','windowsSSO','windowsSSO','Colosa','localRegistry','ready','00000000000000000000000000010011','features','','','0'),
|
||||
('Integration with Gmail','pmGmail','pmGmail','pmGmail','Colosa','localRegistry','ready','00000000000000000000000000010012','features','','','0'),
|
||||
('User-based Language Management.','userBasedLanguage','userBasedLanguage','userBasedLanguage','Colosa','localRegistry','ready','00000000000000000000000000010013','features','','','0'),
|
||||
('User-based Time Zone Management.','userBasedTimeZone','userBasedTimeZone','userBasedTimeZone','Colosa','localRegistry','ready','00000000000000000000000000010014','features','','','0');
|
||||
('User-based Time Zone Management.','userBasedTimeZone','userBasedTimeZone','userBasedTimeZone','Colosa','localRegistry','ready','00000000000000000000000000010014','features','','','0'),
|
||||
('Selective Import Export.','selectiveImportExport','selectiveImportExport','selectiveImportExport','Colosa','localRegistry','ready','00000000000000000000000000010016','features','','','0');
|
||||
@@ -31,20 +31,25 @@ class GranularExporter
|
||||
public function export($objectList)
|
||||
{
|
||||
try {
|
||||
$exportObject = new ExportObjects();
|
||||
$objectList = $exportObject->mapObjectList($objectList);
|
||||
$this->beforeExport($objectList);
|
||||
foreach ($objectList as $data) {
|
||||
$migrator = $this->factory->create($data);
|
||||
$migratorData = $migrator->export($this->prjuid);
|
||||
$this->mergeData($migratorData);
|
||||
if (\PMLicensedFeatures::getSingleton()->verifyfeature
|
||||
("jXsSi94bkRUcVZyRStNVExlTXhEclVadGRRcG9xbjNvTWVFQUF3cklKQVBiVT0=")
|
||||
) {
|
||||
$exportObject = new ExportObjects();
|
||||
$objectList = $exportObject->mapObjectList($objectList);
|
||||
$this->beforeExport($objectList);
|
||||
foreach ($objectList as $data) {
|
||||
$migrator = $this->factory->create($data);
|
||||
$migratorData = $migrator->export($this->prjuid);
|
||||
$this->mergeData($migratorData);
|
||||
}
|
||||
return $this->publish();
|
||||
} else {
|
||||
$exception = new ExportException();
|
||||
$exception->setNameException(\G::LoadTranslation('ID_NO_LICENSE_SELECTIVEIMPORTEXPORT_ENABLED'));
|
||||
throw($exception);
|
||||
}
|
||||
return $this->publish();
|
||||
} catch (ExportException $e) {
|
||||
return array(
|
||||
'success' => false,
|
||||
'message' => $e->getMessage()
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -161,26 +161,39 @@ class GranularImporter
|
||||
public function import($objectList)
|
||||
{
|
||||
try {
|
||||
$objectList = $this->reorderImportOrder($objectList);
|
||||
foreach ($objectList as $data) {
|
||||
$objClass = $this->factory->create($data['name']);
|
||||
if (is_object($objClass)) {
|
||||
$dataImport = $data['data'][$data['name']];
|
||||
$replace = ($data['value'] == 'replace') ? true : false;
|
||||
$migratorData = $objClass->import($dataImport, $replace);
|
||||
if (\PMLicensedFeatures::getSingleton()->verifyfeature
|
||||
("jXsSi94bkRUcVZyRStNVExlTXhEclVadGRRcG9xbjNvTWVFQUF3cklKQVBiVT0=")
|
||||
) {
|
||||
$objectList = $this->reorderImportOrder($objectList);
|
||||
foreach ($objectList as $data) {
|
||||
$objClass = $this->factory->create($data['name']);
|
||||
if (is_object($objClass)) {
|
||||
$dataImport = $data['data'][$data['name']];
|
||||
$replace = ($data['value'] == 'replace') ? true : false;
|
||||
$migratorData = $objClass->import($dataImport, $replace);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$exception = new ImportException();
|
||||
$exception->setNameException(\G::LoadTranslation('ID_NO_LICENSE_SELECTIVEIMPORTEXPORT_ENABLED'));
|
||||
throw($exception);
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$exception = new ImportException('Please review your current process definition
|
||||
if (get_class($e) === 'ProcessMaker\BusinessModel\Migrator\ImportException') {
|
||||
throw $e;
|
||||
} else {
|
||||
$exception = new ImportException('Please review your current process definition
|
||||
for missing elements, it\'s recommended that a new process should be exported
|
||||
with all the elements.');
|
||||
throw $exception;
|
||||
throw $exception;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $objectList
|
||||
* @param bool $generateUid
|
||||
* @param $option
|
||||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user