<html><head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head><body bgcolor="#FFFFFF" text="#000000"><br>
Hmmm, I'm unable to get my custom schema extension to support attributes
on elements (which would lead me to my second problem described below -
so I'm actually one step behind)<br>
<br>
I'm trying to follow the sample :
midpoint/samples/schema/extension-whatever.xsd<br>
<br>
So I have <br>
<br>
<xsd:schema elementFormDefault="qualified"<br>
targetNamespace=<a class="moz-txt-link-rfc2396E" href="http://axapoint.com/apos2/xsd">"http://axapoint.com/apos2/xsd"</a><br>
xmlns:apos=<a class="moz-txt-link-rfc2396E" href="http://axapoint.com/apos2/xsd">"http://axapoint.com/apos2/xsd"</a><br>
xmlns:c=<a class="moz-txt-link-rfc2396E" href="http://midpoint.evolveum.com/xml/ns/public/common/common-3">"http://midpoint.evolveum.com/xml/ns/public/common/common-3"</a><br>
xmlns:a=<a class="moz-txt-link-rfc2396E" href="http://prism.evolveum.com/xml/ns/public/annotation-3">"http://prism.evolveum.com/xml/ns/public/annotation-3"</a><br>
xmlns:xsd=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>><br>
<br>
<xsd:complexType name="GroupType"><br>
<xsd:simpleContent><br>
<xsd:extension base="xsd:string"><br>
<xsd:attribute name="GroupDisplayName"
type="xsd:string" /><br>
</xsd:extension><br>
</xsd:simpleContent><br>
</xsd:complexType><br>
<br>
Which I then reference as :<br>
<br>
<xsd:complexType name="UserExtensionType"><br>
<xsd:annotation><br>
<xsd:appinfo><br>
<a:extension ref="c:UserType"/><br>
</xsd:appinfo><br>
</xsd:annotation><br>
<xsd:sequence><br>
<xsd:element name="groupMembership"
type="apos:GroupType" minOccurs="0" maxOccurs="unbounded" /><br>
...<br>
...<br>
</xsd:sequence><br>
</xsd:complexType><br>
<br>
At mapping time, this fails with :<br>
<br>
Caused by: java.lang.NullPointerException: null<br>
at
com.evolveum.midpoint.model.common.expression.ExpressionUtil.convertValue(ExpressionUtil.java:148)
~[model-common-2.3-SNAPSHOT.jar:na]<br>
at
com.evolveum.midpoint.model.common.expression.script.jsr223.Jsr223ScriptEvaluator.convertScalarResult(Jsr223ScriptEvaluator.java:184)
~[model-common-2.3-SNAPSHOT.jar:na]<br>
at
com.evolveum.midpoint.model.common.expression.script.jsr223.Jsr223ScriptEvaluator.evaluate(Jsr223ScriptEvaluator.java:143)
~[model-common-2.3-SNAPSHOT.jar:na]<br>
at
com.evolveum.midpoint.model.common.expression.script.ScriptExpression.evaluate(ScriptExpression.java:108)
~[model-common-2.3-SNAPSHOT.jar:na]<br>
at
com.evolveum.midpoint.model.common.expression.script.ScriptExpressionEvaluator.transformSingleValue(ScriptExpressionEvaluator.java:58)
~[model-common-2.3-SNAPSHOT.jar:na]<br>
at
com.evolveum.midpoint.model.common.expression.evaluator.AbstractValueTransformationExpressionEvaluator$1.process(AbstractValueTransformationExpressionEvaluator.java:420)
~[model-common-2.3-SNAPSHOT.jar:na]<br>
<br>
If I avoid the type declaration, and try :<br>
<br>
<span> <xsd:complexType name="UserExtensionType"><br>
<xsd:annotation><br>
<xsd:appinfo><br>
<a:extension ref="c:UserType"/><br>
</xsd:appinfo><br>
</xsd:annotation><br>
<xsd:sequence><br>
<xsd:element name="groupMembership" minOccurs="0"
maxOccurs="unbounded"><br>
<xsd:complexType><br>
<xsd:simpleContent><br>
<xsd:extension base="xsd:string"><br>
<xsd:attribute name="GroupDisplayName"
type="xsd:string" /><br>
</xsd:extension><br>
</xsd:simpleContent><br>
</xsd:complexType><br>
</xsd:element><br>
...<br>
...<br>
</xsd:sequence><br>
</xsd:complexType> </span><br>
<br>
This fails with :<br>
<br>
Caused by: com.evolveum.midpoint.util.exception.SchemaException: No
target item that would conform to the path
$user/extension/groupMembership in mapping in inbound expression for
{<a class="moz-txt-link-freetext" href="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3">http://midpoint.evolveum.com/xml/ns/public/resource/instance-3</a>}orgdesc
in <a class="moz-txt-link-freetext" href="resource:036f0100-2fe8-49e1-a8fd-5548374f8703(APOS">resource:036f0100-2fe8-49e1-a8fd-5548374f8703(APOS</a> CSV Feeder
Resource Definition)<br>
at
com.evolveum.midpoint.model.common.mapping.Mapping.parseTarget(Mapping.java:857)
~[model-common-2.3-SNAPSHOT.jar:na]<br>
at
com.evolveum.midpoint.model.common.mapping.Mapping.getOutputPath(Mapping.java:883)
~[model-common-2.3-SNAPSHOT.jar:na]<br>
at
com.evolveum.midpoint.model.lens.projector.InboundProcessor.evaluateInboundMapping(InboundProcessor.java:373)
~[model-impl-2.3-SNAPSHOT.jar:na]<br>
at
com.evolveum.midpoint.model.lens.projector.InboundProcessor.processInboundExpressionsForAccount(InboundProcessor.java:248)
~[model-impl-2.3-SNAPSHOT.jar:na]<br>
at
com.evolveum.midpoint.model.lens.projector.InboundProcessor.processInboundFocal(InboundProcessor.java:167)
~[model-impl-2.3-SNAPSHOT.jar:na]<br>
at
com.evolveum.midpoint.model.lens.projector.InboundProcessor.processInbound(InboundProcessor.java:113)
~[model-impl-2.3-SNAPSHOT.jar:na]<br>
at
com.evolveum.midpoint.model.lens.projector.FocusProcessor.processFocusFocus(FocusProcessor.java:239)
~[model-impl-2.3-SNAPSHOT.jar:na]<br>
at
com.evolveum.midpoint.model.lens.projector.FocusProcessor.processFocus(FocusProcessor.java:176)
~[model-impl-2.3-SNAPSHOT.jar:na]<br>
at
com.evolveum.midpoint.model.lens.projector.Projector.project(Projector.java:153)
~[model-impl-2.3-SNAPSHOT.jar:na]<br>
at
com.evolveum.midpoint.model.lens.Clockwork.click(Clockwork.java:199)
~[model-impl-2.3-SNAPSHOT.jar:na]<br>
at
com.evolveum.midpoint.model.lens.Clockwork.run(Clockwork.java:156)
~[model-impl-2.3-SNAPSHOT.jar:na]<br>
at
com.evolveum.midpoint.model.sync.SynchronizationService.reactToChange(SynchronizationService.java:611)
~[model-impl-2.3-SNAPSHOT.jar:na]<br>
at
com.evolveum.midpoint.model.sync.SynchronizationService.notifyChange(SynchronizationService.java:253)
~[model-impl-2.3-SNAPSHOT.jar:na]<br>
<br>
<br>
I've tried a couple of things and am about to throw the towel in. Could
anyone please help me? Thanks!<br>
<br>
BR/Deepak<br>
<br>
<blockquote style="border: 0px none;"
cite="mid:5383265F.4020103@trilobytesystems.com" type="cite">
<div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div
style="display:table;width:100%;border-top:1px solid
#EDEEF0;padding-top:5px"> <div
style="display:table-cell;vertical-align:middle;padding-right:6px;"><img
photoaddress="dnataraj@trilobytesystems.com" photoname="Deepak
Natarajan" src="cid:part1.07040808.04090400@trilobytesystems.com"
name="compose-unknown-contact.jpg" height="25px" width="25px"></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%">
<a moz-do-not-send="true"
href="mailto:dnataraj@trilobytesystems.com" style="color:#737F92
!important;padding-right:6px;font-weight:bold;text-decoration:none
!important;">Deepak Natarajan</a></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;">
<font color="#9FA2A5"><span style="padding-left:6px">May 26, 2014 at
2:32 PM</span></font></div></div></div>
<div style="color:#888888;margin-left:24px;margin-right:24px;"
__pbrmquotes="true" class="__pbConvBody"><div>Hi everyone -<br><br>I am
trying to achieve the following inbound mapping :<br><br>from resource :<br>"groups"
: "a_1,b_2,c_3,d_4"<br><br>to<br><br><user><br> <group
id="1">a</group><br> <group id="2">b</group><br>
<group id="3">c</group><br> </user><br><br>My
custom schema extension seems to be accepted by Midpoint. I have<br>extended
the UserType to support a multi-valued child element <group><br>with
an "id" attribute (I have a GroupType defined in my custom schema).<br><br>I
can achieve the simple case, without the "id" attribute. So I can see<br>in
the Admin Console that the User has several groups, which I do with<br>the
following mapping :<br><br><attribute><br>
<ref>ri:groups</ref><br> <inbound><br>
<expression><br> <script><br>
<code><br> [parse input and return
array of string [a, b,<br>c...]<br> </code><br>
</script><br> </expression><br>
<target><br>
<path>$user/extension/my:group</path><br>
</target><br> </inbound><br></attribute><br><br>Now
I'm trying to map attributes for the group element<br>($user/extension/my:group/@id)<br><br>Has
anyone tried this? Thanks for any input!<br><br>BR/<br></div></div>
</blockquote>
<br>
<div class="moz-signature">-- <br>Deepak Natarajan<br>
<br>
Trilobyte Systems ApS<br>
Falkoner Alle 1, 3<br>
2000 Frederiksberg<br>
Denmark<br>
+45 29375068<br>
<br>
</div>
</body></html>