<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hi,</p>
    <p>assignment of resource from GUI always uses default kind
      (account) and default intent. This will be probably enhanced in
      the future. If you create a role and specify kind/intent in the
      inducement, it will work. Which is what you have already done :-)</p>
    <p>Ivan<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 11/23/2016 05:27 PM, Jiri Brom
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAM4=MfoQh4JFLkWv9VqTv-9bMTtV_cBZHkUSUQN0FkMT5OW3Qg@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi again,
        <div><br>
        </div>
        <div>Finally it seems working. </div>
        <div>The mistake I did was that I was assigning the Resource
          directly to the Service using Assignment. But now I tried
          adding the Resource as Inducement to a Role and there I placed
          the mentioned <kind> and <intent> together with
          the requested <attribute> from schemaHandling. Then I
          assigned the Role to the Service and it works.</div>
        <div><br>
        </div>
        <div>
          <div><inducement id="1"></div>
          <div>      <construction></div>
          <div>         <resourceRef
            oid="9488ffd0-0c22-4863-af4f-c3a4fd64d509"
            type="c:ResourceType"><!-- freeipa
            --></resourceRef></div>
          <div>         <kind>entitlement</kind></div>
          <div>         <intent>Service</intent></div>
          <div>         <attribute></div>
          <div>            <c:ref>icfs:name</c:ref></div>
          <div>            <outbound></div>
          <div>               <source></div>
          <div>                  <c:path>name</c:path></div>
          <div>               </source></div>
          <div>            </outbound></div>
          <div>         </attribute></div>
          <div>      </construction></div>
          <div>   </inducement></div>
        </div>
        <div><br>
        </div>
        <div>Thank you for your help :)</div>
        <div><br>
        </div>
        <div>J.</div>
      </div>
      <div class="gmail_extra"><br clear="all">
        <div>
          <div class="gmail_signature" data-smartmail="gmail_signature">
            <div dir="ltr">Jiří Brom<br>
              <br>
              e-mail: <a moz-do-not-send="true"
                href="mailto:bromjiri@gmail.com" target="_blank">bromjiri@gmail.com</a><br>
              CZ: +420723860707<br>
              AT: +436607144324</div>
          </div>
        </div>
        <br>
        <div class="gmail_quote">On Wed, Nov 23, 2016 at 4:15 PM, Jiri
          Brom <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:bromjiri@gmail.com" target="_blank">bromjiri@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">Hi Gustav,
              <div><br>
              </div>
              <div>thanks but I tried this and Service attributes still
                keep mapping to UserClass instead of ServiceClass.</div>
              <div><br>
              </div>
              <div>
                <div><schemaHandling></div>
                <div>      <objectType></div>
                <span class="">
                  <div>         <kind>entitlement</kind></div>
                  <div>         <intent>Service</intent></div>
                </span><span class="">
                  <div>         <displayName>Service</<wbr>displayName></div>
                  <div>         <default>false</default></div>
                  <div>         <objectClass>ri:ServiceClass<<wbr>/objectClass></div>
                  <div>         <attribute></div>
                  <div>            <c:ref>icfs:name</c:ref></div>
                  <div>            <tolerant>true</tolerant></div>
                  <div>            <exclusiveStrong>false</<wbr>exclusiveStrong></div>
                  <div>            <outbound></div>
                  <div>               <authoritative>true</<wbr>authoritative></div>
                  <div>             
                     <exclusive>false</exclusive></div>
                  <div>             
                     <strength>normal</strength></div>
                  <div>               <source></div>
                  <div>                 
                    <c:path>name</c:path></div>
                </span><span class="">
                  <div>               </source></div>
                  <div>            </outbound></div>
                  <div>         </attribute></div>
                  <div>      </objectType></div>
                  <div>      <objectType></div>
                  <div>         <kind>account</kind></div>
                </span>
                <div>         <intent>default</intent></div>
                <span class="">
                  <div>         <displayName>User</<wbr>displayName></div>
                  <div>         <default>true</default></div>
                  <div>         <objectClass>ri:UserClass</<wbr>objectClass></div>
                  <div>         <attribute></div>
                  <div>            <c:ref>icfs:name</c:ref></div>
                  <div>            <tolerant>true</tolerant></div>
                  <div>            <exclusiveStrong>false</<wbr>exclusiveStrong></div>
                  <div>            <outbound></div>
                  <div>               <authoritative>true</<wbr>authoritative></div>
                  <div>             
                     <exclusive>false</exclusive></div>
                  <div>             
                     <strength>normal</strength></div>
                  <div>               <source></div>
                  <div>                 
                    <c:path>name</c:path></div>
                </span><span class="">
                  <div>               </source></div>
                  <div>            </outbound></div>
                  <div>         </attribute></div>
                  <div>      </objectType></div>
                  <div>   </schemaHandling></div>
                </span></div>
              <div><br>
              </div>
              <div><br>
              </div>
              <div>Do you know what else could be a problem?</div>
              <div><br>
              </div>
              <div>Thank you,</div>
              <div><br>
              </div>
              <div>Jiri</div>
            </div>
            <div class="gmail_extra"><span class=""><br clear="all">
                <div>
                  <div class="m_-4744540375003747594gmail_signature"
                    data-smartmail="gmail_signature">
                    <div dir="ltr">Jiří Brom<br>
                      <br>
                      e-mail: <a moz-do-not-send="true"
                        href="mailto:bromjiri@gmail.com" target="_blank">bromjiri@gmail.com</a><br>
                      CZ: <a moz-do-not-send="true"
                        href="tel:%2B420723860707" value="+420723860707"
                        target="_blank">+420723860707</a><br>
                      AT: <a moz-do-not-send="true"
                        href="tel:%2B436607144324" value="+436607144324"
                        target="_blank">+436607144324</a></div>
                  </div>
                </div>
                <br>
              </span>
              <div>
                <div class="h5">
                  <div class="gmail_quote">On Wed, Nov 23, 2016 at 3:44
                    PM, Pálos Gustáv <span dir="ltr"><<a
                        moz-do-not-send="true"
                        href="mailto:gustav.palos@evolveum.com"
                        target="_blank">gustav.palos@evolveum.com</a>></span>
                    wrote:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0
                      .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <div dir="ltr">sorry for my fault, in XML you see
                        it as:
                        <div><br>
                        </div>
                        <div><kind>account</kind></div>
                        <div><intent>default</intent></div>
                        <div><br>
                        </div>
                        <div>and services under <b>Entitlement</b></div>
                        <div><br>
                        </div>
                        <div>
                          <div><kind><b>entitlement</b></kind></div>
                          <div><intent>Service</intent></div>
                          <div><br>
                          </div>
                          <div>Best regards,</div>
                          <div><br>
                          </div>
                          <div>Gustav</div>
                          <div>
                            <div class="m_-4744540375003747594h5">
                              <div class="gmail_extra"><br>
                                <div class="gmail_quote">2016-11-23
                                  15:15 GMT+01:00 Pálos Gustáv <span
                                    dir="ltr"><<a
                                      moz-do-not-send="true"
                                      href="mailto:gustav.palos@evolveum.com"
                                      target="_blank">gustav.palos@evolveum.com</a>></span>:<br>
                                  <blockquote class="gmail_quote"
                                    style="margin:0px 0px 0px
                                    0.8ex;border-left:1px solid
                                    rgb(204,204,204);padding-left:1ex">
                                    <div dir="ltr">Hi,
                                      <div><br>
                                      </div>
                                      <div>please see other connectors,
                                        for examle:</div>
                                      <div><a moz-do-not-send="true"
href="https://github.com/Evolveum/connector-drupal/blob/master/src/main/java/com/evolveum/polygon/connector/drupal/DrupalConnector.java"
                                          target="_blank">https://github.com/Evolveum/co<wbr>nnector-drupal/blob/master/src<wbr>/main/java/com/evolveum/polygo<wbr>n/connector/drupal/DrupalConne<wbr>ctor.java</a><br>
                                      </div>
                                      <div><br>
                                      </div>
                                      <div>
                                        <div>public Uid
                                          create(ObjectClass
                                          objectClass,
                                          Set<Attribute>
                                          attributes, OperationOptions
                                          operationOptions) {</div>
                                        <div>if
                                          (objectClass.is(ObjectClass.AC<wbr>COUNT_NAME))
                                          {    // __ACCOUNT__</div>
                                        <div>    return
                                          createOrUpdateUser(null,
                                          attributes);</div>
                                        <div>} else {</div>
                                      </div>
                                      <div>// other object classes...</div>
                                      <div><br>
                                      </div>
                                      <div>but you need </div>
                                      <div><kind>account</kind><br>
                                      </div>
                                      <div><kind>service</kind><br>
                                      </div>
                                      <div><br>
                                      </div>
                                      <div>and not to use <intent>
                                        for this...</div>
                                      <div><br>
                                      </div>
                                      <div>Best regards,</div>
                                      <div><br>
                                      </div>
                                      <div>Gustav</div>
                                      <div class="gmail_extra"><br>
                                      </div>
                                      <div class="gmail_extra"><br>
                                        <div class="gmail_quote">
                                          <div>
                                            <div
                                              class="m_-4744540375003747594m_5030450699646130673gmail-h5">2016-11-23
                                              15:00 GMT+01:00 Jiri Brom
                                              <span dir="ltr"><<a
                                                  moz-do-not-send="true"
href="mailto:bromjiri@gmail.com" target="_blank">bromjiri@gmail.com</a>></span>:<br>
                                            </div>
                                          </div>
                                          <blockquote
                                            class="gmail_quote"
                                            style="margin:0px 0px 0px
                                            0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
                                            <div>
                                              <div
                                                class="m_-4744540375003747594m_5030450699646130673gmail-h5">
                                                <div dir="ltr">
                                                  <div>Hi all,</div>
                                                  <div><br>
                                                  </div>
                                                  <div>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:</div>
                                                  <div><br>
                                                  </div>
                                                  Uid create(oc, attr,
                                                  oo) {
                                                  <div>    if (<a
                                                      moz-do-not-send="true"
href="http://attr.name" target="_blank">attr.name</a> from User){</div>
                                                  <div>       
                                                    doCreateUser(<a
                                                      moz-do-not-send="true"
href="http://attr.name" target="_blank">attr.name</a>);</div>
                                                  <div>    }</div>
                                                  <div>    else{</div>
                                                  <div>       
                                                    doCreateService(<a
                                                      moz-do-not-send="true"
href="http://attr.name" target="_blank">attr.name</a>);</div>
                                                  <div>    }</div>
                                                  <div>}</div>
                                                  <div><br>
                                                  </div>
                                                  <div><br>
                                                    <div>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)</div>
                                                    <div><br>
                                                    </div>
                                                    <div>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.</div>
                                                    <div><br>
                                                    </div>
                                                    <div>
                                                      <div><schemaHandling></div>
                                                      <div>     
                                                        <objectType></div>
                                                      <div>       
                                                         <kind>account</kind></div>
                                                      <div>       
                                                         <intent>Service</intent></div>
                                                      <div>       
                                                         <displayName>Service</display<wbr>Name></div>
                                                      <div>       
                                                         <default>false</default></div>
                                                      <div>       
                                                         <objectClass>ri:ServiceClass<<wbr>/objectClass></div>
                                                      <div>       
                                                         <attribute></div>
                                                      <div>           
                                                        <c:ref>icfs:name</c:ref> </div>
                                                      <div>           
                                                        <tolerant>true</tolerant></div>
                                                      <div>           
                                                        <exclusiveStrong>false</exclus<wbr>iveStrong></div>
                                                      <div>           
                                                        <outbound></div>
                                                      <div>             
 <authoritative>true</authorit<wbr>ative></div>
                                                      <div>             
 <exclusive>false</exclusive></div>
                                                      <div>             
 <strength>normal</strength></div>
                                                      <div>             
                                                         <source></div>
                                                      <div>             
                                                           
                                                        <c:path>name</c:path>
                                                             ###<i>(here
                                                          I need it to
                                                          map icfs:name
                                                          of Service)</i></div>
                                                      <div>             
                                                         </source></div>
                                                      <div>           
                                                        </outbound></div>
                                                      <div>       
                                                         </attribute></div>
                                                      <div>     
                                                        </objectType></div>
                                                      <div>     
                                                        <objectType></div>
                                                      <div>       
                                                         <kind>account</kind></div>
                                                      <div>       
                                                         <intent>User</intent></div>
                                                      <div>       
                                                         <displayName>User</displayNam<wbr>e></div>
                                                      <div>       
                                                         <default>true</default></div>
                                                      <div>       
                                                         <objectClass>ri:UserClass</ob<wbr>jectClass></div>
                                                      <div>       
                                                         <attribute></div>
                                                      <div>           
                                                        <c:ref>icfs:name</c:ref></div>
                                                      <div>           
                                                        <tolerant>true</tolerant></div>
                                                      <div>           
                                                        <exclusiveStrong>false</exclus<wbr>iveStrong></div>
                                                      <div>           
                                                        <outbound></div>
                                                      <div>             
 <authoritative>true</authorit<wbr>ative></div>
                                                      <div>             
 <exclusive>false</exclusive></div>
                                                      <div>             
 <strength>normal</strength></div>
                                                      <div>             
                                                         <source></div>
                                                      <div>             
                                                           
                                                        <c:path>name</c:path>
                                                             ###<i>(here
                                                          I need it to
                                                          map icfs:name
                                                          of User)</i></div>
                                                      <div>             
                                                         </source></div>
                                                      <div>           
                                                        </outbound></div>
                                                      <div>       
                                                         </attribute></div>
                                                      <div>     
                                                        </objectType></div>
                                                      <div> 
                                                         </schemaHandling></div>
                                                    </div>
                                                    <div><br>
                                                    </div>
                                                    <div><br>
                                                    </div>
                                                    <div>Thank you for
                                                      your answers,</div>
                                                    <div><br>
                                                    </div>
                                                    <div>Jiri</div>
                                                    <br clear="all">
                                                    <div>
                                                      <div
class="m_-4744540375003747594m_5030450699646130673gmail-m_-5739010634911868188gmail-m_-3601483585750662134gmail_signature">
                                                        <div dir="ltr">Jiří
                                                          Brom<br>
                                                          <br>
                                                          e-mail: <a
                                                          moz-do-not-send="true"
href="mailto:bromjiri@gmail.com" target="_blank">bromjiri@gmail.com</a><br>
                                                          CZ: <a
                                                          moz-do-not-send="true"
href="tel:%2B420723860707" value="+420723860707" target="_blank">+420723860707</a><br>
                                                          AT: <a
                                                          moz-do-not-send="true"
href="tel:%2B436607144324" value="+436607144324" target="_blank">+436607144324</a></div>
                                                      </div>
                                                    </div>
                                                  </div>
                                                </div>
                                                <br>
                                              </div>
                                            </div>
______________________________<wbr>_________________<br>
                                            midPoint mailing list<br>
                                            <a moz-do-not-send="true"
                                              href="mailto:midPoint@lists.evolveum.com"
                                              target="_blank">midPoint@lists.evolveum.com</a><br>
                                            <a moz-do-not-send="true"
                                              href="http://lists.evolveum.com/mailman/listinfo/midpoint"
                                              rel="noreferrer"
                                              target="_blank">http://lists.evolveum.com/mail<wbr>man/listinfo/midpoint</a><br>
                                            <br>
                                          </blockquote>
                                        </div>
                                        <span
                                          class="m_-4744540375003747594m_5030450699646130673gmail-HOEnZb"><font
                                            color="#888888"><br>
                                            <br clear="all">
                                            <div><br>
                                            </div>
                                            -- <br>
                                            <div
class="m_-4744540375003747594m_5030450699646130673gmail-m_-5739010634911868188gmail_signature">
                                              <div dir="ltr">
                                                <div>Gustáv Pálos</div>
                                                <div>Identity Engineer</div>
                                                <a
                                                  moz-do-not-send="true"
href="http://evolveum.com/" rel="noreferrer"
                                                  style="color:rgb(17,85,204);font-size:12.8px"
                                                  target="_blank">evolveum.com</a><br>
                                              </div>
                                            </div>
                                          </font></span></div>
                                    </div>
                                  </blockquote>
                                </div>
                                <br>
                                <br clear="all">
                                <div><br>
                                </div>
                                -- <br>
                                <div
                                  class="m_-4744540375003747594m_5030450699646130673gmail_signature">
                                  <div dir="ltr">
                                    <div>Gustáv Pálos</div>
                                    <div>Identity Engineer</div>
                                    <a moz-do-not-send="true"
                                      href="http://evolveum.com/"
                                      rel="noreferrer"
                                      style="color:rgb(17,85,204);font-size:12.8px"
                                      target="_blank">evolveum.com</a><br>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                      <br>
                      ______________________________<wbr>_________________<br>
                      midPoint mailing list<br>
                      <a moz-do-not-send="true"
                        href="mailto:midPoint@lists.evolveum.com"
                        target="_blank">midPoint@lists.evolveum.com</a><br>
                      <a moz-do-not-send="true"
                        href="http://lists.evolveum.com/mailman/listinfo/midpoint"
                        rel="noreferrer" target="_blank">http://lists.evolveum.com/mail<wbr>man/listinfo/midpoint</a><br>
                      <br>
                    </blockquote>
                  </div>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Ivan Noris
Senior Identity Engineer
evolveum.com
</pre>
  </body>
</html>