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",
|
"type" => "features",
|
||||||
"url" => "",
|
"url" => "",
|
||||||
"version" => ""
|
"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'),
|
('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'),
|
('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 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)
|
public function export($objectList)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$exportObject = new ExportObjects();
|
if (\PMLicensedFeatures::getSingleton()->verifyfeature
|
||||||
$objectList = $exportObject->mapObjectList($objectList);
|
("jXsSi94bkRUcVZyRStNVExlTXhEclVadGRRcG9xbjNvTWVFQUF3cklKQVBiVT0=")
|
||||||
$this->beforeExport($objectList);
|
) {
|
||||||
foreach ($objectList as $data) {
|
$exportObject = new ExportObjects();
|
||||||
$migrator = $this->factory->create($data);
|
$objectList = $exportObject->mapObjectList($objectList);
|
||||||
$migratorData = $migrator->export($this->prjuid);
|
$this->beforeExport($objectList);
|
||||||
$this->mergeData($migratorData);
|
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 (\Exception $e) {
|
||||||
} catch (ExportException $e) {
|
throw $e;
|
||||||
return array(
|
|
||||||
'success' => false,
|
|
||||||
'message' => $e->getMessage()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -161,26 +161,39 @@ class GranularImporter
|
|||||||
public function import($objectList)
|
public function import($objectList)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$objectList = $this->reorderImportOrder($objectList);
|
if (\PMLicensedFeatures::getSingleton()->verifyfeature
|
||||||
foreach ($objectList as $data) {
|
("jXsSi94bkRUcVZyRStNVExlTXhEclVadGRRcG9xbjNvTWVFQUF3cklKQVBiVT0=")
|
||||||
$objClass = $this->factory->create($data['name']);
|
) {
|
||||||
if (is_object($objClass)) {
|
$objectList = $this->reorderImportOrder($objectList);
|
||||||
$dataImport = $data['data'][$data['name']];
|
foreach ($objectList as $data) {
|
||||||
$replace = ($data['value'] == 'replace') ? true : false;
|
$objClass = $this->factory->create($data['name']);
|
||||||
$migratorData = $objClass->import($dataImport, $replace);
|
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) {
|
} 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
|
for missing elements, it\'s recommended that a new process should be exported
|
||||||
with all the elements.');
|
with all the elements.');
|
||||||
throw $exception;
|
throw $exception;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $objectList
|
* @param $objectList
|
||||||
* @param bool $generateUid
|
* @param $option
|
||||||
* @return bool
|
* @return bool
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user