[midPoint] Exception when translating PP
Martin Lízner - AMI Praha a.s.
martin.lizner at ami.cz
Tue Jan 24 09:57:22 CET 2017
Hi, we just loaded images from MSSQL Image column via scripted SQL adapter
and found no issue in transforming the value. M.
*connector groovy search operation code fragment:*
byte[] image;
image = ((it.Image==null || (it.Image).length>125000)? null :
/*Base64.getEncoder().encode(*/it.Image/*)*/);
*Resource XML:*
<xsd:element minOccurs="0" name="Image" type="xsd:base64Binary">
<xsd:annotation>
<xsd:appinfo>
<a:displayOrder>220</a:displayOrder>
<ra:frameworkAttributeName>Image</ra:frameworkAttributeName>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
...
<attribute>
<ref>ri:Image</ref>
<outbound>
<strength>strong</strength>
<source>
<c:path>$focus/jpegPhoto</c:path>
</source>
</outbound>
</attribute>
Martin Lízner
solution architect
gsm: [+420] 737 745 571
e-mail: martin.lizner at ami.cz
AMI Praha a.s.
Pláničkova 11
162 00 Praha 6
tel.: [+420] 274 783 239
web: www.ami.cz
[image: AMI Praha a.s.] <http://www.skyidentity.com/>
Textem tohoto e-mailu podepisující neslibuje uzavřít ani neuzavírá za
společnost AMI Praha a.s.
jakoukoliv smlouvu. Každá smlouva, pokud bude uzavřena, musí mít výhradně
písemnou formu.
2017-01-08 16:54 GMT+01:00 Wojciech Staszewski <
wojciech.staszewski at diagnostyka.pl>:
> Hello!
>
> Anything about that? I stuck here... and this is something what I really
> need... :(
>
> Thank you!
> Best regards,
> WS
>
> Dnia sobota, 31 grudnia 2016 23:41:29 CET Wojciech Staszewski pisze:
> > Hi....
> >
> > The image (binary) attribute in my ScriptedSQL resource drives me
> crazy...
> > What I did:
> >
> > Custom schema extension:
> > <xsd:element name="stamp" type="xsd:base64Binary"
> minOccurs="0">
> > <xsd:annotation>
> > <xsd:appinfo>
> > <a:indexed>true</a:indexed>
> > <a:displayName>User stamp</a:displayName>
> > <a:displayOrder>370</a:displayOrder>
> > </xsd:appinfo>
> > </xsd:annotation>
> > </xsd:element>
> >
> > SchemaScript.groovy:
> > account.addAttributeInfo(AttributeInfoBuilder.build("userstamp",
> byte[].class));
> >
> > SearchScript.groovy:
> > def stampquery = "select u.stamp from users u" + where;
> > row = sql.firstRow(stampquery);
> > stamp_blob = (oracle.sql.BLOB)row[0];
> > stamp = stamp_blob.getBinaryStream().getBytes();
> >
> > Midpoint GUI: My ScriptedSQL Resource->Accounts->Resource->click on
> some user
> > I see the user stamp attribute, I can download it and open correctly in
> image viewer.
> >
> > I made inbound mapping userstamp -> extension/stamp
> > but reconciliation gives me error:
> >
> > ERROR (com.evolveum.midpoint.web.component.progress.ProgressReporter):
> Error executing changes.
> > com.evolveum.midpoint.util.exception.SchemaException: Exception when
> translating PP({http://midpoint.evolveum.com/xml/ns/story/unix-1}stamp)
> :[PPV(byte[]:byte[-1,-40,-1,-32,0,16,74,70,73,70,0,1,1,1,0,
> 0,0,0,0,0,-1,-37,0,67,0,9,6,7,19,19,18,21,19,18,18,22,22,21,
> 22,23,23,23,25,24,21,25,21,24,24,27,26,26,29,29,23,23,29,26,
> 25,24,30,40,32,25,,... 10849 bytes total])]: Can't extract value for
> saving from prism property value
> > PPV(byte[]:byte[-1,-40,-1,-32,0,16,74,70,73,70,0,1,1,1,0,0,
> 0,0,0,0,-1,-37,0,67,0,9,6,7,19,19,18,21,19,18,18,22,22,21,
> 22,23,23,23,25,24,21,25,21,24,24,27,26,26,29,29,23,23,29,26,25,24,30,40,32,25,,...
> 10849 bytes total])
> >
> > ***** What attribute types should I use for image attribute? In schema
> extension is base64Binary, on resource byte[], I suspect is something wrong
> here ;( ******
> >
> > I know, I'm workaholic...
> > Happy New Year!!!!
> > _______________________________________________
> > midPoint mailing list
> > midPoint at lists.evolveum.com
> > http://lists.evolveum.com/mailman/listinfo/midpoint
> >
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20170124/77de429e/attachment.htm>
More information about the midPoint
mailing list