Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Feb 20, 2015
2 parents 81dca71 + 2b0f940 commit 8a8baa7
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 11 deletions.
Expand Up @@ -571,6 +571,8 @@ public static <V extends PrismValue, F extends ObjectType> void evaluateMapping(
ModelExpressionThreadLocalHolder.pushCurrentTask(task);
try {
mapping.evaluate(task, parentResult);
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException(e.getMessage()+" in "+mapping.getContextDescription(), e);
} finally {
ModelExpressionThreadLocalHolder.popLensContext();
ModelExpressionThreadLocalHolder.popCurrentResult();
Expand Down
Expand Up @@ -1058,7 +1058,8 @@ private ConnectorObject fetchConnectorObject(ObjectClass icfObjectClass, Uid uid
} else if (midpointEx instanceof RuntimeException) {
throw (RuntimeException)midpointEx;
} else if (midpointEx instanceof Error) {
throw (Error)midpointEx;
// This should not happen. But some connectors are very strange.
throw new SystemException("ERROR: "+midpointEx.getClass().getName()+": "+midpointEx.getMessage(), midpointEx);
} else {
throw new SystemException(midpointEx.getClass().getName()+": "+midpointEx.getMessage(), midpointEx);
}
Expand Down
Expand Up @@ -22,6 +22,7 @@
import java.io.FileNotFoundException;
import java.lang.reflect.InvocationTargetException;
import java.net.ConnectException;
import java.net.UnknownHostException;
import java.sql.SQLException;
import java.sql.SQLSyntaxErrorException;
import java.util.Collection;
Expand Down Expand Up @@ -219,6 +220,11 @@ static Throwable processIcfException(Throwable icfException, String desc,
icfResult.recordFatalError("Connection failed: "+icfException.getMessage(), newEx);
return newEx;

} else if (icfException instanceof UnknownHostException) {
Exception newEx = new CommunicationException(createMessageFromAllExceptions("Unknown host", icfException));
icfResult.recordFatalError("Unknown host: "+icfException.getMessage(), newEx);
return newEx;

} else if (icfException instanceof ConnectorIOException) {
Exception newEx = new CommunicationException(createMessageFromAllExceptions("IO error", icfException));
icfResult.recordFatalError("IO error: "+icfException.getMessage(), newEx);
Expand Down
15 changes: 10 additions & 5 deletions samples/demo/hr.xml
Expand Up @@ -142,6 +142,16 @@
</outbound>-->
</attribute>

<activation>
<administrativeStatus>
<inbound>
<strength>weak</strength>
<expression>
<value>enabled</value>
</expression>
</inbound>
</administrativeStatus>
</activation>
<credentials>
<password>
<inbound>
Expand All @@ -153,11 +163,6 @@
</password>
</credentials>

<!-- <activation>
<enabled>
<inbound/>
</enabled>
</activation> -->

</objectType>
</schemaHandling>
Expand Down
20 changes: 20 additions & 0 deletions samples/demo/opendj.xml
Expand Up @@ -23,6 +23,7 @@
xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"
xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
xmlns:icfc="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/connector-schema-3"
xmlns:mr="http://prism.evolveum.com/xml/ns/public/matching-rule-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3">


Expand Down Expand Up @@ -436,6 +437,18 @@
</inbound>
</attribute>

<association>
<ref>ri:ldapGroups</ref>
<displayName>Group Membership</displayName>
<matchingRule>mr:stringIgnoreCase</matchingRule>
<tolerant>true</tolerant>
<kind>entitlement</kind>
<intent>group</intent>
<direction>objectToSubject</direction>
<associationAttribute>ri:uniqueMember</associationAttribute>
<valueAttribute>icfs:name</valueAttribute>
<explicitReferentialIntegrity>false</explicitReferentialIntegrity>
</association>
<protected>
<icfs:name>uid=idm,ou=Administrators,dc=example,dc=com</icfs:name>
</protected>
Expand Down Expand Up @@ -468,6 +481,13 @@
</password>
</credentials>
</objectType>
<objectType>
<displayName>Group</displayName>
<default>true</default>
<objectClass>ri:GroupObjectClass</objectClass>
<kind>entitlement</kind>
<intent>group</intent>
</objectType>
</schemaHandling>

<capabilities xmlns:cap="http://midpoint.evolveum.com/xml/ns/public/resource/capabilities-3">
Expand Down
31 changes: 27 additions & 4 deletions samples/demo/org.xml
Expand Up @@ -70,7 +70,9 @@
<name>F0200</name>
<description>Everything that moves or otherwise.</description>
<parentOrgRef oid="c74a7d86-7798-11e2-964e-100000000000" type="c:OrgType"/>
<assignment>
<displayName>Department of Machines</displayName>
<identifier>0200</identifier>
<inducement>
<description>Access to engineering library</description>
<construction>
<resourceRef oid="12c78a70-76b7-11e2-9cb3-001e8c717e5b" type="c:ResourceType"/>
Expand All @@ -83,6 +85,7 @@
</expression>
</outbound>
</attribute>
<!--
<attribute>
<ref>ri:ldapGroups</ref>
<outbound>
Expand All @@ -91,10 +94,30 @@
</expression>
</outbound>
</attribute>
-->
<association>
<ref>ri:ldapGroups</ref>
<outbound>
<expression>
<associationTargetSearch>
<filter>
<q:equal>
<q:path>
declare namespace icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3";
declare namespace ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3";
<!--attributes/icfs:name-->
attributes/ri:cn
</q:path>
<q:value>library</q:value>
</q:equal>
</filter>
<searchOnResource>true</searchOnResource>
</associationTargetSearch>
</expression>
</outbound>
</association>
</construction>
</assignment>
<displayName>Department of Machines</displayName>
<identifier>0200</identifier>
</inducement>
<orgType>functional</orgType>
<costCenter>CC200</costCenter>
</org>
Expand Down
25 changes: 25 additions & 0 deletions samples/demo/role-fte.xml
Expand Up @@ -17,6 +17,7 @@
<role oid="abf3884a-7778-11e2-abb7-001e8c717e5b" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3">
<name>Full Time Employee</name>
<description>Basic role for full-time employee. It contains basic access rights that every employee should get automatically.</description>
Expand All @@ -40,6 +41,7 @@
<construction>
<!-- The c: prefix in type must be there due to a JAXB bug -->
<resourceRef oid="12c78a70-76b7-11e2-9cb3-001e8c717e5b" type="c:ResourceType"/>
<!--
<attribute>
<ref>ri:ldapGroups</ref>
<outbound>
Expand All @@ -48,6 +50,29 @@
</expression>
</outbound>
</attribute>
-->
<association>
<ref>ri:ldapGroups</ref>
<outbound>
<expression>
<associationTargetSearch>
<filter>
<q:equal>
<q:path>
declare namespace icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3";
declare namespace ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3";
<!--attributes/icfs:name-->
attributes/ri:cn
</q:path>
<q:value>employees</q:value>
</q:equal>
</filter>
<searchOnResource>true</searchOnResource>
</associationTargetSearch>
</expression>
</outbound>
</association>

</construction>
</inducement>
</role>
Expand Down
3 changes: 2 additions & 1 deletion samples/demo/user-template.xml
Expand Up @@ -105,6 +105,7 @@
</condition>
</mapping>

<!-- moved to HR Feed resource
<mapping>
<strength>weak</strength>
<expression>
Expand All @@ -114,5 +115,5 @@
<path>activation/administrativeStatus</path>
</target>
</mapping>

-->
</objectTemplate>

0 comments on commit 8a8baa7

Please sign in to comment.