Skip to content

Cspwb 8 #11

Merged
merged 3 commits into from Dec 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
54 changes: 54 additions & 0 deletions Workbench/grouper_daemon/container_files/tmp/initialize.gsh
Expand Up @@ -30,4 +30,58 @@ idmfans = new GroupSave(gs).assignName("app:mailinglist:idm-fans").assignCreateP
cs = new GroupSave(gs).assignName("app:cs").assignCreateParentStemsIfNotExist(true).save()
volunteers = new GroupSave(gs).assignName("test:volunteers").assignCreateParentStemsIfNotExist(true).save()


group = new GroupSave(gs).assignName("etc:affiliationLoader").assignCreateParentStemsIfNotExist(true).save()
group.addType(GroupTypeFinder.find("grouperLoader"))
group.setAttribute("grouperLoaderDbName", "sis")
group.setAttribute("grouperLoaderType", "SQL_GROUP_LIST")
group.setAttribute("grouperLoaderScheduleType", "CRON")
group.setAttribute("grouperLoaderQuartzCron", "0 * * * * ?")
group.setAttribute("grouperLoaderDbName", "sis")
group.setAttribute("grouperLoaderGroupTypes", "addIncludeExclude")
group.setAttribute("grouperLoaderQuery", "SELECT concat('ref:affiliation:',affiliation,'_systemOfRecord') as GROUP_NAME, uid as SUBJECT_ID, 'ldap' as SUBJECT_SOURCE_ID from SIS_AFFILIATIONS")

group = new GroupSave(gs).assignName("etc:deptLoader").assignCreateParentStemsIfNotExist(true).save()
group.addType(GroupTypeFinder.find("grouperLoader"))
group.setAttribute("grouperLoaderDbName", "sis")
group.setAttribute("grouperLoaderType", "SQL_GROUP_LIST")
group.setAttribute("grouperLoaderScheduleType", "CRON")
group.setAttribute("grouperLoaderQuartzCron", "0 * * * * ?")
group.setAttribute("grouperLoaderDbName", "sis")
group.setAttribute("grouperLoaderQuery", "SELECT concat('ref:dept:',department) as GROUP_NAME, uid as SUBJECT_ID, 'ldap' as SUBJECT_SOURCE_ID from SIS_PERSONS where department is not null")

group = new GroupSave(gs).assignName("etc:coursesLoader").assignCreateParentStemsIfNotExist(true).save()
group.addType(GroupTypeFinder.find("grouperLoader"))
group.setAttribute("grouperLoaderDbName", "sis")
group.setAttribute("grouperLoaderType", "SQL_GROUP_LIST")
group.setAttribute("grouperLoaderScheduleType", "CRON")
group.setAttribute("grouperLoaderQuartzCron", "0 * * * * ?")
group.setAttribute("grouperLoaderDbName", "sis")
group.setAttribute("grouperLoaderQuery", "SELECT concat('ref:course:',courseId) as GROUP_NAME, uid as SUBJECT_ID, 'ldap' as SUBJECT_SOURCE_ID from SIS_COURSES")

edu.internet2.middleware.grouper.app.loader.GrouperLoaderType.scheduleLoads()



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') &&
(regexp == null || group.extension ==~ regexp)) {
println 'Adding: ' + group
def s = SubjectFinder.findById(group.getId(), 'group', 'g:gsa')
owner.addMember(s, false)
} else {
println 'Ignoring: ' + group
}
}
}

def cs = GroupFinder.findByName(gs, "app:cs", true)

gs = GrouperSession.startRootSession()
addGroups(gs, StemFinder.findByName(gs, 'ref:course'), cs, /CS.*/)

System.out.println("************** initialize.gsh done.")
@@ -0,0 +1,34 @@
<task xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3"
xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"
oid="22c2a3d0-0961-4255-9eec-c550a79aeaaa">
<name>Import from SIS persons</name>
<extension xmlns:mext="http://midpoint.evolveum.com/xml/ns/public/model/extension-3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="c:ExtensionType">
<mext:kind>account</mext:kind>
<mext:objectclass>ri:AccountObjectClass</mext:objectclass>
<!--
<mext:tracing>
<interval>500</interval>
</mext:tracing> -->
</extension>
<assignment>
<targetRef oid="00000000-0000-0000-0000-000000000503" type="ArchetypeType" /> <!--Import task-->
</assignment>
<taskIdentifier>1535407239440-0-1</taskIdentifier>
<ownerRef oid="00000000-0000-0000-0000-000000000002"
relation="org:default"
type="c:UserType"><!-- administrator --></ownerRef>
<executionStatus>runnable</executionStatus>
<category>ImportingAccounts</category>
<objectRef oid="4d70a0da-02dd-41cf-b0a1-00e75d3eaa15"
relation="org:default"
type="c:ResourceType"><!-- SQL SIS persons (sources) --></objectRef>
<recurrence>single</recurrence>
<binding>loose</binding>
</task>
@@ -0,0 +1,40 @@
<!--
~ Copyright (c) 2010-2019 Evolveum
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<task xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3"
oid="47fc57bd-8c34-4555-9b9f-7087ff179860">
<name>Grouper async updates</name>
<extension xmlns:mext="http://midpoint.evolveum.com/xml/ns/public/model/extension-3">
<mext:workerThreads>1</mext:workerThreads>
</extension>
<assignment>
<targetRef oid="00000000-0000-0000-0000-000000000505" type="ArchetypeType" /> <!-- Asynchronous update task -->
</assignment>
<taskIdentifier>1552664339630-0-2</taskIdentifier>
<ownerRef oid="00000000-0000-0000-0000-000000000002" relation="org:default" type="c:UserType">
<!-- administrator -->
</ownerRef>
<executionStatus>runnable</executionStatus>
<category>AsynchronousUpdate</category>
<objectRef oid="1eff65de-5bb6-483d-9edf-8cc2c2ee0233" relation="org:default" type="c:ResourceType">
<!-- Grouper Resource -->
</objectRef>
<recurrence>single</recurrence>
<binding>loose</binding>
<threadStopAction>restart</threadStopAction>
</task>
@@ -0,0 +1,41 @@
<!--
~ Copyright (c) 2010-2019 Evolveum
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<task xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3"
xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"
oid="605a0127-a313-442a-9d5e-151eac8b0745">
<name>Grouper reconciliation (groups)</name>
<extension xmlns:mext="http://midpoint.evolveum.com/xml/ns/public/model/extension-3">
<mext:objectclass>ri:Group</mext:objectclass>
</extension>
<assignment>
<targetRef oid="00000000-0000-0000-0000-000000000501" type="ArchetypeType" /> <!-- Reconciliation task -->
</assignment>
<taskIdentifier>605a0127-a313-442a-9d5e-151eac8b0745</taskIdentifier>
<ownerRef oid="00000000-0000-0000-0000-000000000002" relation="org:default" type="c:UserType">
<!-- administrator -->
</ownerRef>
<executionStatus>runnable</executionStatus>
<category>Reconciliation</category>
<objectRef oid="1eff65de-5bb6-483d-9edf-8cc2c2ee0233" relation="org:default" type="c:ResourceType">
<!-- Grouper Resource -->
</objectRef>
<recurrence>single</recurrence>
<binding>loose</binding>
<threadStopAction>restart</threadStopAction>
</task>
@@ -0,0 +1,22 @@
<task xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3"
oid="83a737ea-5eb7-4e78-b431-331cccf02354">
<name>User recomputation</name>
<extension xmlns:mext="http://midpoint.evolveum.com/xml/ns/public/model/extension-3">
<mext:objectType>c:UserType</mext:objectType>
<!-- <mext:tracingInterval>200</mext:tracingInterval> -->
</extension>
<assignment>
<targetRef oid="00000000-0000-0000-0000-000000000502" type="ArchetypeType"/> <!--Recomputation task -->
</assignment>
<taskIdentifier>1571729899646-0-1</taskIdentifier>
<ownerRef oid="00000000-0000-0000-0000-000000000002" relation="org:default" type="c:UserType">
<!-- administrator -->
</ownerRef>
<channel>http://midpoint.evolveum.com/xml/ns/public/provisioning/channels-3#recompute</channel>
<executionStatus>runnable</executionStatus>
<category>Recomputation</category>
<recurrence>single</recurrence>
<binding>tight</binding>
</task>