Attributes from queries vs. schema mapping

Hi,

On the output transform of a driver, I am using a query against the source (edir), to get an instance object (for further processing).
I have the following schema mappings.

<?xml version="1.0" encoding="UTF-8"?><attr-name-map>
<attr-name>
<nds-name>Description</nds-name>
<app-name>name</app-name>
</attr-name>
<attr-name>
<nds-name>STSActive</nds-name>
<app-name>active</app-name>
</attr-name>
<attr-name>
<nds-name>STSGUID</nds-name>
<app-name>primaryIdentifier</app-name>
</attr-name>
<attr-name>
<nds-name>XATTRIBNexusId</nds-name>
<app-name>id</app-name>
</attr-name>
</attr-name-map>


The query looks like this:

<token-query class-name="Group" datastore="src" scope="entry">
<arg-dn>
<token-src-dn/>
</arg-dn>
<arg-match-attr name="CN">
<arg-value type="string">
<token-src-name/>
</arg-value>
</arg-match-attr>
<arg-string>
<token-text xml:space="preserve">active</token-text>
</arg-string>
<arg-string>
<token-text xml:space="preserve">id</token-text>
</arg-string>
<arg-string>
<token-text xml:space="preserve">name</token-text>
</arg-string>
</token-query>


The result is an instance, without any attributes.

If I however uses this query, now with the source attribute "Description" added, like this:

<token-query class-name="Group" datastore="src" scope="entry">
<arg-dn>
<token-src-dn/>
</arg-dn>
<arg-match-attr name="CN">
<arg-value type="string">
<token-src-name/>
</arg-value>
</arg-match-attr>
<arg-string>
<token-text xml:space="preserve">active</token-text>
</arg-string>
<arg-string>
<token-text xml:space="preserve">id</token-text>
</arg-string>
<arg-string>
<token-text xml:space="preserve">name</token-text>
</arg-string>
<arg-string>
<token-text xml:space="preserve">Description</token-text>
</arg-string>
</token-query>


The result is my source object with the Description attribute.

Questions: Are the SMP not able to honor schema mappings as results of reading attributes in queries, or should I do something differently to get this to work (and if so, does anyone have any ideas?)
  • 6525036;2484544 wrote:
    Hi,

    On the output transform of a driver, I am using a query against the source (edir), to get an instance object (for further processing).
    I have the following schema mappings.

    <?xml version="1.0" encoding="UTF-8"?><attr-name-map>
    <attr-name>
    <nds-name>Description</nds-name>
    <app-name>name</app-name>
    </attr-name>
    <attr-name>
    <nds-name>STSActive</nds-name>
    <app-name>active</app-name>
    </attr-name>
    <attr-name>
    <nds-name>STSGUID</nds-name>
    <app-name>primaryIdentifier</app-name>
    </attr-name>
    <attr-name>
    <nds-name>XATTRIBNexusId</nds-name>
    <app-name>id</app-name>
    </attr-name>
    </attr-name-map>


    The query looks like this:

    <token-query class-name="Group" datastore="src" scope="entry">
    <arg-dn>
    <token-src-dn/>
    </arg-dn>
    <arg-match-attr name="CN">
    <arg-value type="string">
    <token-src-name/>
    </arg-value>
    </arg-match-attr>
    <arg-string>
    <token-text xml:space="preserve">active</token-text>
    </arg-string>
    <arg-string>
    <token-text xml:space="preserve">id</token-text>
    </arg-string>
    <arg-string>
    <token-text xml:space="preserve">name</token-text>
    </arg-string>
    </token-query>


    The result is an instance, without any attributes.

    If I however uses this query, now with the source attribute "Description" added, like this:

    <token-query class-name="Group" datastore="src" scope="entry">
    <arg-dn>
    <token-src-dn/>
    </arg-dn>
    <arg-match-attr name="CN">
    <arg-value type="string">
    <token-src-name/>
    </arg-value>
    </arg-match-attr>
    <arg-string>
    <token-text xml:space="preserve">active</token-text>
    </arg-string>
    <arg-string>
    <token-text xml:space="preserve">id</token-text>
    </arg-string>
    <arg-string>
    <token-text xml:space="preserve">name</token-text>
    </arg-string>
    <arg-string>
    <token-text xml:space="preserve">Description</token-text>
    </arg-string>
    </token-query>


    The result is my source object with the Description attribute.

    Questions: Are the SMP not able to honor schema mappings as results of reading attributes in queries, or should I do something differently to get this to work (and if so, does anyone have any ideas?)


    Pretty sure you need to query for the actual attribute names there, not the application namespace names for them.
  • On 7/23/2018 10:24 AM, 6525036 wrote:
    >
    > Hi,
    >
    > On the output transform of a driver, I am using a query against the
    > source (edir), to get an instance object (for further processing).
    > I have the following schema mappings.
    >
    >
    > Code:
    > --------------------
    > <?xml version="1.0" encoding="UTF-8"?><attr-name-map>
    > <attr-name>
    > <nds-name>Description</nds-name>
    > <app-name>name</app-name>
    > </attr-name>
    > <attr-name>
    > <nds-name>STSActive</nds-name>
    > <app-name>active</app-name>
    > </attr-name>
    > <attr-name>
    > <nds-name>STSGUID</nds-name>
    > <app-name>primaryIdentifier</app-name>
    > </attr-name>
    > <attr-name>
    > <nds-name>XATTRIBNexusId</nds-name>
    > <app-name>id</app-name>
    > </attr-name>
    > </attr-name-map>
    > --------------------
    >
    >
    > The query looks like this:
    >
    >
    > Code:
    > --------------------
    > <token-query class-name="Group" datastore="src" scope="entry">
    > <arg-dn>
    > <token-src-dn/>
    > </arg-dn>
    > <arg-match-attr name="CN">
    > <arg-value type="string">
    > <token-src-name/>
    > </arg-value>
    > </arg-match-attr>
    > <arg-string>
    > <token-text xml:space="preserve">active</token-text>
    > </arg-string>
    > <arg-string>
    > <token-text xml:space="preserve">id</token-text>
    > </arg-string>
    > <arg-string>
    > <token-text xml:space="preserve">name</token-text>
    > </arg-string>
    > </token-query>
    > --------------------
    >
    >
    > The result is an instance, without any attributes.
    >
    > If I however uses this query, now with the source attribute
    > "Description" added, like this:
    >
    >
    > Code:
    > --------------------
    > <token-query class-name="Group" datastore="src" scope="entry">
    > <arg-dn>
    > <token-src-dn/>
    > </arg-dn>
    > <arg-match-attr name="CN">
    > <arg-value type="string">
    > <token-src-name/>
    > </arg-value>
    > </arg-match-attr>
    > <arg-string>
    > <token-text xml:space="preserve">active</token-text>
    > </arg-string>
    > <arg-string>
    > <token-text xml:space="preserve">id</token-text>
    > </arg-string>
    > <arg-string>
    > <token-text xml:space="preserve">name</token-text>
    > </arg-string>
    > <arg-string>
    > <token-text xml:space="preserve">Description</token-text>
    > </arg-string>
    > </token-query>
    > --------------------
    >
    >
    > The result is my source object with the Description attribute.
    >
    > Questions: Are the SMP not able to honor schema mappings as results of
    > reading attributes in queries, or should I do something differently to
    > get this to work (and if so, does anyone have any ideas?)


    So in general, if you do a <query> that has an attribute name, the
    Schema Map will look for names it knows in the current namespace
    (usually eDir to App) and convert the value.

    If you used the native App Name attrname, SChema Map ignores it.

    On the return you get back the app name, but now the Schema Map sees the
    App name and converts it to the eDir name.

    This makes a big difference if you do, If dest/src attribute = some
    value (Or available/not available) and you started with AppName, but it
    returns as eDir Name, then the If test will fail, since there is no
    instance of the App NAme in the returned doc it processes.


  • Thanks,

    I sort of had that feeling.