<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-AU link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><a name="_MailEndCompose">Update:<o:p></o:p></a></p><p class=MsoNormal><span style='mso-bookmark:_MailEndCompose'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-bookmark:_MailEndCompose'>It is possible the schema element needs to be:<o:p></o:p></span></p><p class=MsoNormal><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>xsd:element</span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas'> <span style='color:#7F007F'>maxOccurs</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"1"</span></i> <span style='color:#7F007F'>minOccurs</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"0"</span></i> <span style='color:#7F007F'>name</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"Photo"</span></i> <span style='color:#7F007F'>type</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"xsd:string"</span></i><span style='color:teal'>></span></span></span><span style='mso-bookmark:_MailEndCompose'><o:p></o:p></span></p><p class=MsoNormal><span style='mso-bookmark:_MailEndCompose'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-bookmark:_MailEndCompose'>And then need a little script like this on the inbound:<o:p></o:p></span></p><p class=MsoNormal><span style='mso-bookmark:_MailEndCompose'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:teal;mso-fareast-language:EN-AU'><</span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F;background:silver;mso-highlight:silver;mso-fareast-language:EN-AU'>script</span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:teal;mso-fareast-language:EN-AU'>></span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-AU'><o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-AU'>         </span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:teal;mso-fareast-language:EN-AU'><</span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F;mso-fareast-language:EN-AU'>language</span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:teal;mso-fareast-language:EN-AU'>></span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-AU'>http://midpoint.evolveum.com/xml/ns/public/expression/language#Groovy</span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:teal;mso-fareast-language:EN-AU'></</span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F;mso-fareast-language:EN-AU'>language</span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:teal;mso-fareast-language:EN-AU'>></span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-AU'><o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-AU'>         </span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:teal;mso-fareast-language:EN-AU'><</span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F;mso-fareast-language:EN-AU'>code</span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:teal;mso-fareast-language:EN-AU'>></span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-AU'><o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-AU'>               import javax.xml.bind.DatatypeConverter</span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-AU'><o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-AU'>               Photo = basic.getAttributeValue(shadow, 'http://midpoint.evolveum.com/xml/ns/public/resource/instance-3', 'Photo')</span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-AU'><o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-AU'>               <u>jpg</u> = DatatypeConverter.parseHexBinary(Photo)</span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-AU'><o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-AU'>                             </span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-AU'><o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-AU'>               return <u>jpg</u></span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-AU'><o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-AU'>                             </span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-AU'><o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-AU'>         </span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:teal;mso-fareast-language:EN-AU'></</span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F;mso-fareast-language:EN-AU'>code</span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:teal;mso-fareast-language:EN-AU'>></span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-AU'><o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:teal;mso-fareast-language:EN-AU'></</span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F;background:silver;mso-highlight:silver;mso-fareast-language:EN-AU'>script</span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;color:teal;mso-fareast-language:EN-AU'>></span></span><span style='mso-bookmark:_MailEndCompose'><span style='font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-AU'><o:p></o:p></span></span></p><p class=MsoNormal><span style='mso-bookmark:_MailEndCompose'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-bookmark:_MailEndCompose'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-bookmark:_MailEndCompose'>Regards,<o:p></o:p></span></p><p class=MsoNormal><span style='mso-bookmark:_MailEndCompose'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-bookmark:_MailEndCompose'>Brad<o:p></o:p></span></p><p class=MsoNormal><span style='mso-bookmark:_MailEndCompose'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-bookmark:_MailEndCompose'><o:p> </o:p></span></p><span style='mso-bookmark:_MailEndCompose'></span><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='mso-fareast-language:EN-AU'>From:</span></b><span lang=EN-US style='mso-fareast-language:EN-AU'> midPoint [mailto:midpoint-bounces@lists.evolveum.com] <b>On Behalf Of </b>Brad Fardig<br><b>Sent:</b> Tuesday, 14 March 2017 10:22 AM<br><b>To:</b> midpoint (midpoint@lists.evolveum.com) <midpoint@lists.evolveum.com><br><b>Subject:</b> [midPoint] reading a binary (jpeg) from a csv file<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Hi,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I have a csv file that contains a hex encoded binary string which is a jpeg image.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Is it possible to read this in via the connector with the following schema definition:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:Consolas;color:teal'><</span><span style='font-size:10.0pt;font-family:Consolas;color:#3F7F7F'>xsd:element</span><span style='font-size:10.0pt;font-family:Consolas'> <span style='color:#7F007F'>maxOccurs</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"1"</span></i> <span style='color:#7F007F'>minOccurs</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"0"</span></i> <span style='color:#7F007F'>name</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"Photo"</span></i> <span style='color:#7F007F'>type</span><span style='color:black'>=</span><i><span style='color:#2A00FF'>"xsd:hexBinary"</span></i><span style='color:teal'>><o:p></o:p></span></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:Consolas;color:teal'><o:p> </o:p></span></p><p class=MsoNormal>I have tried this and receive the error below, should I persist with trying this or look for another approach?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  at org.quartz.core.JobRunShell.run(JobRunShell.java:213) [quartz-2.1.3.jar:na]<o:p></o:p></p><p class=MsoNormal>        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557) [quartz-2.1.3.jar:na]<o:p></o:p></p><p class=MsoNormal>Caused by: java.lang.IllegalArgumentException: Expected class [B type, but got class java.lang.String in inbound expression for {http://midpoint.evolveum.com/xml/ns/public/resource/instance-3}Photo in resource:9086df29-fd0c-4797-8de8-d64cad7fab76(PACSCSVConnector)<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.model.impl.lens.projector.MappingEvaluator.evaluateMapping(MappingEvaluator.java:99) ~[model-impl-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.model.impl.lens.projector.InboundProcessor.evaluateInboundMapping(InboundProcessor.java:490) ~[model-impl-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.model.impl.lens.projector.InboundProcessor.processInboundExpressionsForProjection(InboundProcessor.java:353) ~[model-impl-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.model.impl.lens.projector.InboundProcessor.processInboundFocal(InboundProcessor.java:186) ~[model-impl-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.model.impl.lens.projector.InboundProcessor.processInbound(InboundProcessor.java:128) ~[model-impl-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.model.impl.lens.projector.FocusProcessor.processFocusFocus(FocusProcessor.java:212) ~[model-impl-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.model.impl.lens.projector.FocusProcessor.processFocus(FocusProcessor.java:146) ~[model-impl-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.model.impl.lens.projector.Projector.projectInternal(Projector.java:208) ~[model-impl-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.model.impl.lens.projector.Projector.project(Projector.java:106) ~[model-impl-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.model.impl.lens.Clockwork.click(Clockwork.java:302) ~[model-impl-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.model.impl.lens.Clockwork.run(Clockwork.java:214) ~[model-impl-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.model.impl.sync.SynchronizationServiceImpl.reactToChange(SynchronizationServiceImpl.java:766) ~[model-impl-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.model.impl.sync.SynchronizationServiceImpl.notifyChange(SynchronizationServiceImpl.java:299) ~[model-impl-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        ... 33 common frames omitted<o:p></o:p></p><p class=MsoNormal>Caused by: java.lang.IllegalArgumentException: Expected class [B type, but got class java.lang.String<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.prism.util.JavaTypeConverter.convert(JavaTypeConverter.java:249) ~[prism-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.model.common.expression.ExpressionUtil.convertValue(ExpressionUtil.java:186) ~[model-common-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.model.common.expression.ExpressionUtil$1.visit(ExpressionUtil.java:135) ~[model-common-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.prism.PrismValue.accept(PrismValue.java:171) ~[prism-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.prism.delta.PrismValueDeltaSetTriple.acceptSet(PrismValueDeltaSetTriple.java:266) ~[prism-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.prism.delta.PrismValueDeltaSetTriple.accept(PrismValueDeltaSetTriple.java:256) ~[prism-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.model.common.expression.ExpressionUtil.toOutputTriple(ExpressionUtil.java:122) ~[model-common-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.model.common.expression.evaluator.AsIsExpressionEvaluator.evaluate(AsIsExpressionEvaluator.java:93) ~[model-common-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.model.common.expression.Expression.evaluate(Expression.java:133) ~[model-common-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.model.common.mapping.Mapping.evaluateExpression(Mapping.java:985) ~[model-common-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.model.common.mapping.Mapping.evaluate(Mapping.java:520) ~[model-common-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        at com.evolveum.midpoint.model.impl.lens.projector.MappingEvaluator.evaluateMapping(MappingEvaluator.java:95) ~[model-impl-3.4.jar:na]<o:p></o:p></p><p class=MsoNormal>        ... 45 common frames omitted<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Regards,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Brad<o:p></o:p></p></div></body></html>