Setting multi-value attribute values to query results

I am writing a policy where I need to run a query to get a list of one or
more DNs, then place those DNs as the values of a multi-valued attribute in
my destination datasource.  How do I do this?  Can I use the
do-add-dest-attr-value action and just specify the query as the values to
add, or do I need to place the results of the query in a local variable and
do something with that?

I'm using IDM 3.5.

Here is the query that I'm running:
<token-query class-name="Locality">
  <arg-dn>
    <token-parse-dn dest-dn-format="dest-dn" src-dn-format="ldap">
      <token-text xml:space="preserve">o=foo, l=bar, dc=County,
dc=Organizations, dc=baz</token-text>
    </token-parse-dn>
  </arg-dn>
  <arg-string>
    <token-text xml:space="preserve">DN</token-text>
  </arg-string>
</token-query>

Thanks!
0
Scott
4/11/2007 2:05:44 PM
novell.id-manager.drivers 10360 articles. 2 followers. Follow

5 Replies
690 Views

Similar Articles

[PageSpeed] 56
Get it on Google Play
Get it on Apple App Store

Sorry for the double-post - I had my newsreader fouled up.

Have a great day!

> I am writing a policy where I need to run a query to get a list of one or
> more DNs, then place those DNs as the values of a multi-valued attribute in
> my destination datasource.  How do I do this?  Can I use the
> do-add-dest-attr-value action and just specify the query as the values to
> add, or do I need to place the results of the query in a local variable and
> do something with that?
> 
> I'm using IDM 3.5.
> 
> Here is the query that I'm running:
> <token-query class-name="Locality">
>   <arg-dn>
>     <token-parse-dn dest-dn-format="dest-dn" src-dn-format="ldap">
>       <token-text xml:space="preserve">o=foo, l=bar, dc=County,
> dc=Organizations, dc=baz</token-text>
>     </token-parse-dn>
>   </arg-dn>
>   <arg-string>
>     <token-text xml:space="preserve">DN</token-text>
>   </arg-string>
> </token-query>
> 
> Thanks!

0
Scott
4/11/2007 2:09:58 PM
You need to use do-for-each to iterate over the values you are expecting 
to get back. It isn't 100% clear what you are expecting to get back, 
where you are expecting to put it, and what system you are querying. 
With that information I could probably provide you an example.

--

Father Ramon


Scott Kronheim [c-skronhei@state.pa.us] wrote:
> I am writing a policy where I need to run a query to get a list of one or
> more DNs, then place those DNs as the values of a multi-valued attribute in
> my destination datasource.  How do I do this?  Can I use the
> do-add-dest-attr-value action and just specify the query as the values to
> add, or do I need to place the results of the query in a local variable and
> do something with that?
> 
> I'm using IDM 3.5.
> 
> Here is the query that I'm running:
> <token-query class-name="Locality">
>   <arg-dn>
>     <token-parse-dn dest-dn-format="dest-dn" src-dn-format="ldap">
>       <token-text xml:space="preserve">o=foo, l=bar, dc=County,
> dc=Organizations, dc=baz</token-text>
>     </token-parse-dn>
>   </arg-dn>
>   <arg-string>
>     <token-text xml:space="preserve">DN</token-text>
>   </arg-string>
> </token-query>
> 
> Thanks!
0
Father
4/11/2007 3:39:42 PM
I'll try to provide some more information.

I am writing a driver that loads User objects into eDirectory from a JDBC
data source.  We have a custom multi-valued attribute on each of these
users that lists a number of locations for which the user has some
administrative responsibilities.  To find the list of those locations, I
can run a query against eDirectory to find all of the Locality objects
underneath a particular base DN (that base DN is derived from information
from the JDBC data source).  The query that I described in my first post
does this lookup, I think.  I then need to take the DNs of all those
localities and place that list into the custom multi-valued attribute on
the user.

As an example, the query might return the following DNs:
l=123 Main Street, o=foo, l=bar, dc=County, dc=Organizations, dc=baz
l=456 Side Street, o=foo, l=bar, dc=County, dc=Organizations, dc=baz
l=987 Anywhere Road, ou=suborganization, o=foo, l=bar, dc=County,
dc=Organizations, dc=baz

I need to place those three DNs as three values in the multi-valued
attribute for the user.  The order is not important, the values just need
to exist.

Please let me know if you need anything else.  Thanks for the help!

> You need to use do-for-each to iterate over the values you are expecting 
> to get back. It isn't 100% clear what you are expecting to get back, 
> where you are expecting to put it, and what system you are querying. 
> With that information I could probably provide you an example.
> 
> --
> 
> Father Ramon
> 
> 
> Scott Kronheim [c-skronhei@state.pa.us] wrote:
> > I am writing a policy where I need to run a query to get a list of one or
> > more DNs, then place those DNs as the values of a multi-valued attribute in
> > my destination datasource.  How do I do this?  Can I use the
> > do-add-dest-attr-value action and just specify the query as the values to
> > add, or do I need to place the results of the query in a local variable and
> > do something with that?
> > 
> > I'm using IDM 3.5.
> > 
> > Here is the query that I'm running:
> > <token-query class-name="Locality">
> >   <arg-dn>
> >     <token-parse-dn dest-dn-format="dest-dn" src-dn-format="ldap">
> >       <token-text xml:space="preserve">o=foo, l=bar, dc=County,
> > dc=Organizations, dc=baz</token-text>
> >     </token-parse-dn>
> >   </arg-dn>
> >   <arg-string>
> >     <token-text xml:space="preserve">DN</token-text>
> >   </arg-string>
> > </token-query>
> > 
> > Thanks!

0
Scott
4/11/2007 4:11:22 PM
Something like the following:

<do-for-each>
  <arg-node-set>
   <token-query class-name="Locality">
    <arg-dn>
     <token-parse-dn dest-dn-format="dest-dn" src-dn-format="ldap">
      <token-text>o=foo, l=bar, dc=County, dc=Organizations, 
dc=baz</token-text>
     </token-parse-dn>
    </arg-dn>
   </token-query>
  </arg-node-set>
  <arg-actions>
   <do-add-dest-attr-value name="xxx">
    <arg-value>
     <token-xpath expression="$current-node/@src-dn"/>
    </arg-value>
   </do-add-dest-attr-value>
  </arg-actions>
</do-for-each>

It isn't clear what syntax your custom attribute is. If DN then the 
above should work. If it is a string and you want it in LDAP format, 
then you'll want to change the the value to something more like:

<token-parse-dn src-dn-format="qualified-slash" dest-dn-format="ldap">
     <token-xpath expression="$current-node/@qualified-src-dn"/>
</token-parse-dn>

--

Father Ramon


Scott Kronheim [c-skronhei@state.pa.us] wrote:
> I'll try to provide some more information.
> 
> I am writing a driver that loads User objects into eDirectory from a JDBC
> data source.  We have a custom multi-valued attribute on each of these
> users that lists a number of locations for which the user has some
> administrative responsibilities.  To find the list of those locations, I
> can run a query against eDirectory to find all of the Locality objects
> underneath a particular base DN (that base DN is derived from information
> from the JDBC data source).  The query that I described in my first post
> does this lookup, I think.  I then need to take the DNs of all those
> localities and place that list into the custom multi-valued attribute on
> the user.
> 
> As an example, the query might return the following DNs:
> l=123 Main Street, o=foo, l=bar, dc=County, dc=Organizations, dc=baz
> l=456 Side Street, o=foo, l=bar, dc=County, dc=Organizations, dc=baz
> l=987 Anywhere Road, ou=suborganization, o=foo, l=bar, dc=County,
> dc=Organizations, dc=baz
> 
> I need to place those three DNs as three values in the multi-valued
> attribute for the user.  The order is not important, the values just need
> to exist.
> 
> Please let me know if you need anything else.  Thanks for the help!
> 
>> You need to use do-for-each to iterate over the values you are expecting 
>> to get back. It isn't 100% clear what you are expecting to get back, 
>> where you are expecting to put it, and what system you are querying. 
>> With that information I could probably provide you an example.
>>
>> --
>>
>> Father Ramon
>>
>>
>> Scott Kronheim [c-skronhei@state.pa.us] wrote:
>>> I am writing a policy where I need to run a query to get a list of one or
>>> more DNs, then place those DNs as the values of a multi-valued attribute in
>>> my destination datasource.  How do I do this?  Can I use the
>>> do-add-dest-attr-value action and just specify the query as the values to
>>> add, or do I need to place the results of the query in a local variable and
>>> do something with that?
>>>
>>> I'm using IDM 3.5.
>>>
>>> Here is the query that I'm running:
>>> <token-query class-name="Locality">
>>>   <arg-dn>
>>>     <token-parse-dn dest-dn-format="dest-dn" src-dn-format="ldap">
>>>       <token-text xml:space="preserve">o=foo, l=bar, dc=County,
>>> dc=Organizations, dc=baz</token-text>
>>>     </token-parse-dn>
>>>   </arg-dn>
>>>   <arg-string>
>>>     <token-text xml:space="preserve">DN</token-text>
>>>   </arg-string>
>>> </token-query>
>>>
>>> Thanks!
> 
0
Father
4/11/2007 7:24:32 PM
This worked for me.  Thank you very much!

"Father Ramon" <devforums@novell.com> wrote in message 
news:QBaTh.7572$1G3.3822@prv-forum2.provo.novell.com...
> Something like the following:
>
> <do-for-each>
>  <arg-node-set>
>   <token-query class-name="Locality">
>    <arg-dn>
>     <token-parse-dn dest-dn-format="dest-dn" src-dn-format="ldap">
>      <token-text>o=foo, l=bar, dc=County, dc=Organizations, 
> dc=baz</token-text>
>     </token-parse-dn>
>    </arg-dn>
>   </token-query>
>  </arg-node-set>
>  <arg-actions>
>   <do-add-dest-attr-value name="xxx">
>    <arg-value>
>     <token-xpath expression="$current-node/@src-dn"/>
>    </arg-value>
>   </do-add-dest-attr-value>
>  </arg-actions>
> </do-for-each>
>
> It isn't clear what syntax your custom attribute is. If DN then the above 
> should work. If it is a string and you want it in LDAP format, then you'll 
> want to change the the value to something more like:
>
> <token-parse-dn src-dn-format="qualified-slash" dest-dn-format="ldap">
>     <token-xpath expression="$current-node/@qualified-src-dn"/>
> </token-parse-dn>
>
> --
>
> Father Ramon
>
>
> Scott Kronheim [c-skronhei@state.pa.us] wrote:
>> I'll try to provide some more information.
>>
>> I am writing a driver that loads User objects into eDirectory from a JDBC
>> data source.  We have a custom multi-valued attribute on each of these
>> users that lists a number of locations for which the user has some
>> administrative responsibilities.  To find the list of those locations, I
>> can run a query against eDirectory to find all of the Locality objects
>> underneath a particular base DN (that base DN is derived from information
>> from the JDBC data source).  The query that I described in my first post
>> does this lookup, I think.  I then need to take the DNs of all those
>> localities and place that list into the custom multi-valued attribute on
>> the user.
>>
>> As an example, the query might return the following DNs:
>> l=123 Main Street, o=foo, l=bar, dc=County, dc=Organizations, dc=baz
>> l=456 Side Street, o=foo, l=bar, dc=County, dc=Organizations, dc=baz
>> l=987 Anywhere Road, ou=suborganization, o=foo, l=bar, dc=County,
>> dc=Organizations, dc=baz
>>
>> I need to place those three DNs as three values in the multi-valued
>> attribute for the user.  The order is not important, the values just need
>> to exist.
>>
>> Please let me know if you need anything else.  Thanks for the help!
>>
>>> You need to use do-for-each to iterate over the values you are expecting 
>>> to get back. It isn't 100% clear what you are expecting to get back, 
>>> where you are expecting to put it, and what system you are querying. 
>>> With that information I could probably provide you an example.
>>>
>>> --
>>>
>>> Father Ramon
>>>
>>>
>>> Scott Kronheim [c-skronhei@state.pa.us] wrote:
>>>> I am writing a policy where I need to run a query to get a list of one 
>>>> or
>>>> more DNs, then place those DNs as the values of a multi-valued 
>>>> attribute in
>>>> my destination datasource.  How do I do this?  Can I use the
>>>> do-add-dest-attr-value action and just specify the query as the values 
>>>> to
>>>> add, or do I need to place the results of the query in a local variable 
>>>> and
>>>> do something with that?
>>>>
>>>> I'm using IDM 3.5.
>>>>
>>>> Here is the query that I'm running:
>>>> <token-query class-name="Locality">
>>>>   <arg-dn>
>>>>     <token-parse-dn dest-dn-format="dest-dn" src-dn-format="ldap">
>>>>       <token-text xml:space="preserve">o=foo, l=bar, dc=County,
>>>> dc=Organizations, dc=baz</token-text>
>>>>     </token-parse-dn>
>>>>   </arg-dn>
>>>>   <arg-string>
>>>>     <token-text xml:space="preserve">DN</token-text>
>>>>   </arg-string>
>>>> </token-query>
>>>>
>>>> Thanks!
>> 


0
Scott
4/12/2007 1:00:56 PM
Reply:

Similar Artilces:

Mutli-valued attribute to multi-valued attribute
We want to synchronize a multi-valued attribute (created by our own) to a multi-valued attribute in the other edirectory store. But when we are adding attributes we only have the changed values. The previous one is lost. When deleting one value in the Identity Vault then it removes the attribute from the object. Any ideas ? > We want to synchronize a multi-valued attribute (created by our own) to a > multi-valued attribute in the other edirectory store. But when we are > adding attributes we only have the changed values. The previous one is > lost. When deleting ...

Placing results from query into a multi-value attribute
Within a policy, I need to run a query to get a set of DNs and place those DNs as the values of a multi-value attribute. I'm not sure how to go about this. Here is the query that I'm running: <token-query class-name="Locality"> <arg-dn> <token-parse-dn dest-dn-format="dest-dn" src-dn-format="ldap"> <token-text xml:space="preserve">o=Allegheny Co 911, l=Allegheny, dc=County, dc=Organizations, dc=jnet</token-text> </token-parse-dn> </arg-dn> <arg-string> <t...

Single Value to Multi Value attribute
Hi all I have an attribute 'source', in my eDirectory dn: cn=schema changetype: modify add: attributeTypes attributeTypes: ( source-oid NAME 'source' DESC 'to capture the source where the user or group is pulled from' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) - I need to modify this attribute from Single valued to Multi-value attribute, - I also need to modify the name of this attribute from 'source' to 'uniqueSource' can any one please give me the exact syntax for the the above modifications ...

Query a multivalued attribute and store part of each value in a single valued string/attribute
Hello hello again, so I am trying to cook something again and obviously I am failing. I have a mutlivalued attribute in eDirectory and I need to store a part from each value into a single valued attribute. Example: Attribute A - value1: 001-I - value2: 002-D - value3: 003-M I need the I and the D and the M and store in a single valued attribute Attribute B -value: IDM I managed to query the destination user to get the attribute I want from the user ... WOHOO :-) Yet everythin after fails Here is what I cooked up: <actions> <do-set-local-variable n...

ID-Provider Driver
Novell Identity Manager 3.6 Windows Server 2003 R2 eDirectoy 8.8. SP3 Hi I want to develop a ID-policy based on followin rules: Prefix-GivenName[1]Surname[1]-AutoIcremnetNumber And these policies will be consumed by ID-Client(Identity Manager). So long , I have created ID Provider-driver, and configured it to be run as a RMI server (without ID Generation-Map) and Without defining Attributes in the ID-provider driver Filter. And I have created a NULL driver with some policies which invokes id:getNextID() method to get a Unique ID for newly created users. But my...

PickList field with values from a multi-valued attribute
Hello there, I have a PickList field in my form that I want to fill with a list of values. Let's call that field "department". The values must be dynamically obtained from a multi-valued attribute of a given Organizational Unit. Let's call that attribute "list-of-departments". I have a DAL entity that exposes the object class (Organizational Unit) and its attribute. Let's call the DAL entity "OU" and let's call the exposed attribute key "list-of-departments" (like the attribute itself). Of course, I have a field that cont...

unable to evaluate values in an multi-valued attribute
Dear Forum, we are running UA 4.0.1. We have to search through all values of an given attribute for evaluation purpose. According to the documentation either form.getValues() and idvault.get should return an array when multiple-values are found. Unfortunately this seams not to work. var contracts = IDVault.get(null, dn, "eCampus-User", "eCAssigmentsJStr"); form.setValues("AssigmentJStrs", contracts); var numOfContracts = contracts.length(); Testing has shown that the variable contracts is set correct, 'cos the form field AssigmentJStr is sh...

How to return value from dynamic query or set the value
Hii I am Varun  i have a problem with the dynamic stored procedure This is my stored procedureALTER PROCEDURE dbo.sp_TimeTableAdjustment1 (@TeacherID_OnLeave numeric(9), @DateFrom datetime ,@DateTo datetime , @UserID numeric(9) ) AS declare @flag as numeric(9) declare @year as varchar(4) set @year=(select batch from batchmaster where iscurrent=1 and isdeleted=0) if( @year=null or len(@year)=0) set @year = year(getdate())exec ('if not exists(select * from timetableadjustments_'+@year+' where datefrom='''+@datefrom+''' and dateto=''...

Multi value attribute from query
hi, I've got a problem where i'm trying to extract values from a multi value attribute result. the query result is below. <nds dtdversion="3.5" ndsversion="8.x"> <source> <product version="3.5.0.20070315 ">DirXML</product> <contact>Novell, Inc.</contact> </source> <output> <instance class-name="Organizational Unit" event-id="0" qualified-src-dn="O=Org\OU=Groups\CN=DPI-FSV-ADS3" src-dn="\LDAP\Org\Groups\DPI-FSV-ADS3" src-entry-id="69257">...

How to set selected value in drop down based on query value
i have a dropdownlist populated with values frm database   when i want to view or edit a particular record i populated the textbox with the needed record details same way i wan the dropdown to display the selected value as the first index received frm the query  If you palced it inside a data control , then you can bind it's selected value with a database field like this :<asp:DropDownList id=...  SelectedVale='<%# Eval("DataBaseField") %>'  .... Regards,Anas Ghanem.Note:Please Don't hesitate to click "Report Abuse" ...

Converting single-valued attribute to normal (multi-valued)
In order to add additional attributes to a User object I have created an Auxiliary Class. Within that class I created a single-valued numeric string with an ASN1 ID. Due to changing requirements it is now necessary to change this attribute to a multi-valued case ignore string. I usually use Designer to do work such as this but, as I'm having some problems, what I describe here is done with iManager (to remove Designer from the equation). There was one object in my tree utilising this auxiliary class (we're still in development) which I have deleted. I then deleted the aux...

op-attr when only removing value from multi-value attribute
IDM 3.5 When I remove only a value from a mulit-value attribute, condition "op-attr available" is FALSE, shouldn't this result as TRUE? Never noticed this behaviour in previous versions of IDM. Any hints? Thanks Rudi --- Trace snippet --- RBM-Manager ST:Applying policy: Sub-ET2-Determine resource-bundle role actions. RBM-Manager ST: Applying to modify #1. RBM-Manager ST: Evaluating selection criteria for rule 'Check change in ResourceBundles'. RBM-Manager ST: (if-op-attr 'rbmSubObjects' available) = FALSE. RBM-Manager ST: Rule rejected. RBM...

Write GroupMembership values to custom multi-value attribute
I need to be able to take the multiple group membership values of a user and write them to a custom multi-attribute called "CTGroups". The problem I am running into is if you add two or more groups to a user at once, it will only grab the first group and skip all the others. If I add the groups one at a time, I am ok but I cannot rely on our user community to add just one group at a time. Any help would be appreciated . -- mlarocco Depending on exactly what you are trying to do and where you are trying to do it, you'll either need to use For Each or Clone Oper...

Textbox value set by query results
What is the syntax to display the results of a sql query in textboxes? I'm populating a datagrid with the results of a query, then when a user clicks the select button, it opens a new page with the textboxes populated by the results of the selection. I'm carrying the PK field to the next page for the where clause in my query, so that only one record will be displayed. I need to be able to fill the textbox with the corresponding field's info. This should be pretty simple, I just am having trouble finding examples of this, even though every data access page that uses text boxes should be d...

Web resources about - Setting multi-value attribute values to query results - novell.id-manager.drivers

Resources last updated: 1/22/2016 9:09:02 AM