-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement option1 up to "back in midPoint" step
What is still missing from option1 is "back in LDAP" and targets. Plus minor improvements/fixes and tests.
- Loading branch information
Showing
11 changed files
with
301 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,26 @@ | ||
|
|
||
| def addGroups(gs,stem) { | ||
| def supergroup = GroupFinder.findByName(gs, "etc:midpointGroups", true) | ||
| def addGroups(gs,stem,owner,regexp) { | ||
| for (group in stem.childGroups) { | ||
| if (!group.name.endsWith('_includes') && | ||
| !group.name.endsWith('_excludes') && | ||
| !group.name.endsWith('_systemOfRecord') && | ||
| !group.name.endsWith('_systemOfRecordAndIncludes')) { | ||
| !group.name.endsWith('_systemOfRecordAndIncludes') && | ||
| (regexp == null || group.extension ==~ regexp)) { | ||
| println 'Adding: ' + group | ||
| def s = SubjectFinder.findById(group.getId(), 'group', 'g:gsa') | ||
| supergroup.addMember(s, false) | ||
| owner.addMember(s, false) | ||
| } else { | ||
| println 'Ignoring: ' + group | ||
| } | ||
| } | ||
| } | ||
|
|
||
| gs = GrouperSession.startRootSession() | ||
| def supergroup = GroupFinder.findByName(gs, "etc:midpointGroups", true) | ||
| def cs = GroupFinder.findByName(gs, "app:cs", true) | ||
|
|
||
| addGroups(gs, StemFinder.findByName(gs, 'ref:affiliation')) | ||
| addGroups(gs, StemFinder.findByName(gs, 'ref:dept')) | ||
| addGroups(gs, StemFinder.findByName(gs, 'ref:course')) | ||
| addGroups(gs, StemFinder.findByName(gs, 'ref:affiliation'), supergroup, null) | ||
| //addGroups(gs, StemFinder.findByName(gs, 'ref:dept'), null) | ||
| //addGroups(gs, StemFinder.findByName(gs, 'ref:course'), null) | ||
|
|
||
| addGroups(gs, StemFinder.findByName(gs, 'ref:course'), cs, /CS.*/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
demo/complex/midpoint-objects/objectTemplates/template-org-mailing-list.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <?xml version="1.0"?> | ||
| <objectTemplate xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3" | ||
| oid="be84a39a-c004-490b-9b78-a871b837f6df"> | ||
| <name>template-org-mailing-list</name> | ||
| <mapping> | ||
| <strength>strong</strength> | ||
| <expression> | ||
| <assignmentTargetSearch> | ||
| <targetType>RoleType</targetType> | ||
| <oid>1c7beff4-cdf6-4e9f-b54c-79d0766f6fbe</oid> <!-- metarole-mailing-list --> | ||
| </assignmentTargetSearch> | ||
| </expression> | ||
| <target> | ||
| <path>assignment</path> | ||
| </target> | ||
| </mapping> | ||
|
|
||
| </objectTemplate> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
demo/complex/midpoint-objects/roles/metarole-mailing-list.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <role xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3" | ||
| xmlns:apti="http://midpoint.evolveum.com/xml/ns/public/common/api-types-3" | ||
| xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" | ||
| xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3" | ||
| xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3" | ||
| xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3" | ||
| xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3" | ||
| xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| oid="1c7beff4-cdf6-4e9f-b54c-79d0766f6fbe"> | ||
| <name>metarole-mailing-list</name> | ||
| <inducement id="1"> | ||
| <targetRef oid="d81fb46c-20c7-44d3-8402-fef404ea1264" relation="org:default" type="c:OrgType" /> <!-- mailing-lists --> | ||
| </inducement> | ||
|
|
||
| </role> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #!/bin/bash | ||
|
|
||
| function upload () { | ||
| local filename=$1 | ||
| local regex="midpoint-objects.*/(.*)/(.*)" | ||
| if [[ $filename =~ $regex ]] | ||
| then | ||
| type="${BASH_REMATCH[1]}" | ||
| oid=`cat $filename | sed -n 's:.*oid=\"\([A-Za-z0-9\-]*\)\".*:\1:p' | sed -n '1 p'` | ||
| echo "Uploading $filename ($type, $oid)" | ||
| curl -k --user administrator:5ecr3t -H "Content-Type: application/xml" -X PUT "https://localhost:8443/midpoint/ws/rest/$type/$oid?options=overwrite" --data-binary @$filename | ||
| else | ||
| echo "Skipping $filename" | ||
| fi | ||
| } | ||
|
|
||
| upload midpoint-objects-manual/tasks/task-async-update-grouper.xml |
Oops, something went wrong.