Change the Order of Search Attributes in IDM DNLookup Controls

wschreiber

By: wschreiber

August 2, 2011 3:07 pm

Reads: 298

Comments:5

Rating:0

Background

The DNLookup search control is a frequently used form control in custom forms, but it can also be found in several native IDM dialogs and is used to search and retrieve DNs from the Identity Vault.

The way a DNLookup control shows up depends on the definition of the corresponding entity (e.g., the ‘user’ entity) and the attributes declared for that entity (e.g., ‘Given Name’, ‘Surname’).

The attributes shown in the drop-down list are specified in the directory abstraction layer (DAL): Attributes that are declared with the “Search” and “Required” flags set, will show in the drop-down list for searchable attributes, as well as in the result table of the identified matches.

cs-reorder_08.jpg

Now, there have been numerous requests to change the order in which these attributes are displayed when pressing the DNLookup, but the order of the attributes is predefined and cannot be changed. Often it depends on the order in which the selected attributes where added to the entity.

Well, in fact the order is stored in the xmlData attribute of each entity object in eDirectory:
For each entity, you’ll find an eDirectory object of the type ‘srvprvEntity’ which is located in a container underneath the user application driver container (CN=EntityDefs,CN=DirectoryModel,CN=AppConfig,CN=User Application Driver,[your driver set container])

Much of the declaration of the entity is stored in the ‘xmlData’ attribute of the entity object. You can manually edit the xmlData string, search for the “<attributes>..</attributes>” tag and find each entity attribute declaration in a separate “<attribute>..</attribute>” tag.
Changing the sequence of the “<attribute>..</attribute>” tags will modify the order in which the respective attributes are displayed in the search control.

The hard way

There have been several comments in the Novell forums that explain extensively how you could use iManager or other tools to locate and edit the entity objects and change the xmlData. To find such instructions, Google for “Sequencing of DAL Entity Attributes for a DN Lookup Control”

While the approach suggested there works fine, there are some smaller drawbacks:

  • not everybody feels comfortable editing the objects,
  • the procedure is prone to human error
  • the procedure is time consuming

The easy way

This Cool Solution presents a simple User Application form that provides an quick and easy-to-use GUI to update your entities and change the attribute order of your DNLookups.

How it works:

  • The form presents a GUI showing the entities of your system that can be used in a DNLookup control.

    cs-reorder_01.jpg
  • You select any of the available entities
  • The form reads and decodes the xmlData and presents you with the searchable attributes in their current order

    cs-reorder_02.jpg
  • You may re-order the list according to your needs

    cs-reorder_03.jpg
  • You may view the effects of changing the attribute order on the xmlData contents by selecting the ‘Show xmlData’ check box.
  • cs-reorder_04.jpg

  • To save your changes, press ‘Submit’ and the updated xmlData will be stored within a no-approval workflow

    cs-reorder_05.jpg
  • Before the applied changes get visible in your DNLookup controls, you need to flush the User Application cache (‘Administration’ tab in User Application)

    cs-reorder_06.jpg

How to install this Cool Solution on your system

  • To be on the safe side you should import the current DAL entities into IDM Designer before changing any attributes, and backup the entities (e.g., into Subversion or by exporting them to a file)
  • Use IDM Designer to import the entity definition “srvprvEntity.xml” and the query definition “query_srvprvEntity.xml” into your DAL
  • Check the imported entity definition for “srvprvEntity” and modify the “Search Container” location to reflect the location of the “EntityDefs” container on your system under the driver set container.

    cs-reorder_07.jpg
  • Deploy both, entity and query, to your IDM system
  • Flush the User Application cache
  • Import the workflow PRD into your Provisioning Request Definitions
  • Optionally update the trustees of the form
  • Test the form

    cs-reorder_09.jpg
  • As usual, when externally modifying DAL objects, make sure to re-import the modified entity into your Designer project

Troubleshooting

  • If the form shows no entities, make sure that you have updated the search path for the entity definition “srvprvEntity”
  • If the form shows the entities, but no search attributes, make sure that you have sufficient rights to read the entity definition and the xmlData attribute
  • If the changes you’ve made seem to not be reflected in User Application, make sure you have flushed the UA cache
  • If the problems persist, check the status of your re-order request and check the jboss server log for errors
VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

Categories: Uncategorized

Disclaimer: As with everything else at NetIQ Cool Solutions, this content is definitely not supported by NetIQ, so Customer Support will not be able to help you if it has any adverse effect on your environment.  It just worked for at least one person, and perhaps it will be useful for you too.  Be sure to test in a non-production environment.

5 Comments

  1. By:jtl

    Extremely useful and easy to use. As you say not everyone feels comfortable in editing xml-data using external tools and this method is both faster and easier to use.
    Add a note (important one) that Designer needs to get updated with the changes made, otherwise they will get lost on next deploy of the entity.

    Keep up your good work!!

  2. By:kjhurni

    Wish I’d had this sooner, but I can still use this in the future. Thank you!!!

  3. By:syracuseping

    Hi,
    I was able to do everything else, but the ncsCustom.js file. How do I attach to the form? Should I copy it as inline script or global script. Not sure how to do it either way. Can you help?

    Thanks.

    • By:wschreiber

      Yes, the easiest way is to save the contents of ncsCustom.js as inline form script.

      More experienced users may consider storing the script file into some library and use it as external script.

Comment