ClassName

atg.userdirectory.droplet.TargetPrincipalsDroplet

Component

/atg/userdirectory/droplet/TargetPrincipals

The TargetPrincipals servlet bean locates all organizations where a specific user has a given relative role. Based on the search results, additional content is rendered by the open parameters you specify.

Be sure to set the userDirectory property to relevant the User Directory component.

Input Parameters

userId
This required parameter specifies the ID for the user that is the subject of the query.

roleName
This required parameter supplies a relative role that the user is assigned.

Output Parameter

principals
This parameter holds the organizations returned from the query in a java.util.Collection object.

Open Parameters

empty
This parameter is rendered when no items are returned from the query.

error
This parameter renders when an error occurs and the TargetPrincipals servlet bean is unable to perform the query.

output
This parameter renders when organizations are returned from the query.

Example

In this example, the TargetPrincipals servlet bean searches the UserDirectory for all organizations where the active user holds the role of admin. If no organizations are returned or an error occurs, text displays reporting this circumstance. Otherwise, a collection of organizations displays.

<dsp:droplet name="/atg/userdirectory/droplet/TargetPrincipals">
   <dsp:param name="userId" beanvalue="/atg/userprofiling/Profile.id"/>
   <dsp:param name="roleName" value="admin"/>

   <dsp:oparam name="empty">
      The user does not have that role in any organization.
   </dsp:oparam>

   <dsp:oparam name="error">
      Cannot perform query. Try again later.
   </dsp:oparam>

   <dsp:oparam name="output">
      <dsp:droplet name="/atg/dynamo/droplet/ForEach">
         <dsp:param name="array" param="principals"/>

         <dsp:oparam name="output">
            <dsp:valueof param="element.name"/>
         </dsp:oparam>

   </dsp:droplet>
</dsp:droplet>
 
loading table of contents...