[midPoint] Mapping to specific ObjectClass

Jiri Brom bromjiri at gmail.com
Wed Nov 23 15:00:31 CET 2016


Hi all,

I want to write a connector which will work with attributes of midPoint
Users and Services. In my CreateOP I need to do something like the
following pseudocode:

Uid create(oc, attr, oo) {
    if (attr.name from User){
        doCreateUser(attr.name);
    }
    else{
        doCreateService(attr.name);
    }
}


The problem is that I can't distinguish between attribute __name__ of User
and Service. They both have the same name so I can't call the proper
function. Is there a way to distinguish them using only one connector? (I
know I can do it easily by implementing two connectors)

I tried to solve it using two ObjectClasses but I can't figure out how to
setup SchemaHandler so User maps to UserClass and Service maps to
ServiceClass. They both map to the one which I set as default.

<schemaHandling>
      <objectType>
         <kind>account</kind>
         <intent>Service</intent>
         <displayName>Service</displayName>
         <default>false</default>
         <objectClass>ri:ServiceClass</objectClass>
         <attribute>
            <c:ref>icfs:name</c:ref>
            <tolerant>true</tolerant>
            <exclusiveStrong>false</exclusiveStrong>
            <outbound>
               <authoritative>true</authoritative>
               <exclusive>false</exclusive>
               <strength>normal</strength>
               <source>
                  <c:path>name</c:path>      ###*(here I need it to map
icfs:name of Service)*
               </source>
            </outbound>
         </attribute>
      </objectType>
      <objectType>
         <kind>account</kind>
         <intent>User</intent>
         <displayName>User</displayName>
         <default>true</default>
         <objectClass>ri:UserClass</objectClass>
         <attribute>
            <c:ref>icfs:name</c:ref>
            <tolerant>true</tolerant>
            <exclusiveStrong>false</exclusiveStrong>
            <outbound>
               <authoritative>true</authoritative>
               <exclusive>false</exclusive>
               <strength>normal</strength>
               <source>
                  <c:path>name</c:path>      ###*(here I need it to map
icfs:name of User)*
               </source>
            </outbound>
         </attribute>
      </objectType>
   </schemaHandling>


Thank you for your answers,

Jiri

Jiří Brom

e-mail: bromjiri at gmail.com
CZ: +420723860707
AT: +436607144324
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20161123/1c5b22b2/attachment.htm>


More information about the midPoint mailing list