Creating group expansion pipeline stages (Aspire 2)

From wiki.searchtechnologies.com
Jump to: navigation, search

For Information on Aspire 3.1 Click Here

Note: Old Information - Needs Update

Group expansion components are regular Aspire pipeline stages. See here for details on how to create a pipeline stage.

A Group Expansion Router component will create an AspireObject and pass it to group expansion stages. The document will be similar to this:

<doc>
   <username dn="cn=Jo Berry,cn=Users,dc=contoso,dc=com">job</username>
   <groups>
      <group source="someGroupSource">groupNameA</group>
   </groups>
</doc>
  • Username element contains the user name (element value) and the user distinguished name (attribute).
  • You may receive accumulated groups from other group-expansion components, so first fetch the <groups> element and then add new groups to it.

This is a code example of how that can be achieved:

     Element groupsElement = doc.get("groups");
     if(groupsElement != null) {
       doc.push(groupsElement);
     }
     else {
       groupsElement = doc.push("groups");
     }

The output of this stages should be similar to this:

<doc>
   <username dn="cn=Jo Berry,cn=Users,dc=contoso,dc=com">job</username>
      <groups>
         <group source="someGroupSource">groupName</group>
         <group source="yourGroupSource">groupNameB</group>
         <group source="yourGroupSource">groupNameC</group>
      </groups>
</doc>
  • Notice the source attribute on <group> elements. This attribute specifies the name of the group source (for example LDAP, SharePoint, Documentum, Quickr, …).
  • The value of <group> elements is the group name (which can require name mangling for the GSA).

Is very important that groups have unique names, since there can be duplicated groups from different group sources (for example Active Directory and SharePoint).