16 import(
'lib.pkp.plugins.importexport.native.filter.NativeImportFilter');
25 parent::__construct($filterGroup);
54 return 'lib.pkp.plugins.importexport.users.filter.NativeXmlUserGroupFilter';
65 $context = $deployment->getContext();
69 $userGroup = $userGroupDao->newDataObject();
70 $userGroup->setContextId($context->getId());
73 $nodeList = $node->getElementsByTagNameNS($deployment->getNamespace(),
'name');
74 if ($nodeList->length > 0) {
76 $userGroups = $userGroupDao->getByContextId($context->getId());
77 while ($testGroup = $userGroups->next()) {
78 if (in_array($content[1], $testGroup->getName(
null))) {
83 for ($n = $node->firstChild; $n !==
null; $n=$n->nextSibling)
if (is_a($n,
'DOMElement'))
switch($n->tagName) {
84 case 'role_id': $userGroup->setRoleId($n->textContent);
break;
85 case 'is_default': $userGroup->setDefault($n->textContent);
break;
86 case 'show_title': $userGroup->setShowTitle($n->textContent);
break;
87 case 'name': $userGroup->setName($n->textContent, $n->getAttribute(
'locale'));
break;
88 case 'abbrev': $userGroup->setAbbrev($n->textContent, $n->getAttribute(
'locale'));
break;
89 case 'permit_self_registration': $userGroup->setPermitSelfRegistration($n->textContent);
break;
90 case 'permit_metadata_edit': $userGroup->setPermitMetadataEdit($n->textContent);
break;
93 $userGroupId = $userGroupDao->insertObject($userGroup);
95 $stageNodeList = $node->getElementsByTagNameNS($deployment->getNamespace(),
'stage_assignments');
96 if ($stageNodeList->length == 1) {
97 $n = $stageNodeList->item(0);
98 $assignedStages = preg_split(
'/:/', $n->textContent);
99 foreach ($assignedStages as $stage) {
100 if($stage >= WORKFLOW_STAGE_ID_SUBMISSION && $stage <= WORKFLOW_STAGE_ID_PRODUCTION) {
101 $userGroupDao->assignGroupToStage($context->getId(), $userGroupId, $stage);
108 fatalError(
"unable to find \"name\" userGroup node element. Check import XML document structure for validity.");