[midPoint] How to create user avatar from database table resource.

Болат Казыбаев B.kazybayev at ktg.kz
Fri Oct 28 17:15:12 CEST 2016


Good afternoon, community!

I need to create user avatar from database table resource. What I did are:

1.       Created resource of type DatabaseTableConnector and configured it with postgresql table. I have a "bytea" column named "avatar" for avatar.

2.       Configured Schema Handling with text:



<attribute>

            <c:ref>ri:avatar</c:ref>

            <displayName>avatar</displayName>

            <tolerant>true</tolerant>

            <exclusiveStrong>false</exclusiveStrong>

            <inbound>

               <authoritative>true</authoritative>

               <exclusive>false</exclusive>

               <strength>normal</strength>

               <target>

                  <c:path>$user/jpegPhoto</c:path>

               </target>

            </inbound>

         </attribute>



<reaction>

            <situation>unmatched</situation>

            <reconcile>false</reconcile>

            <objectTemplateRef oid="c0c010c0-d34d-b33f-f00d-777222555781" type="c:ObjectTemplateType">

               <targetName>

                  <t:orig>User Template Postgre HR KTGA</t:orig>

                  <t:norm>user template postgre hr ktga</t:norm>

               </targetName>

            </objectTemplateRef>

            <action>

               <handlerUri>http://midpoint.evolveum.com/xml/ns/public/model/action-3#addUser</handlerUri>

            </action>

         </reaction>



3.       Created object template:
...
<source>
         <c:path>$user/nickName</c:path>
      </source>
      <source>
         <c:path>$user/organization</c:path>
      </source>
      <source>
         <c:path>$user/organizationalUnit</c:path>
      </source>
      <source>
         <c:path>$user/jpegPhoto</c:path>
      </source>
...

4.       Created import task. In fact, midpoint created user but without photo/avatar.

Any ideas how to do that?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20161028/f0b88bbd/attachment.htm>


More information about the midPoint mailing list