Locates all organizations where a user has the specified role.

Class Name

atg.userdirectory.droplet.TargetPrincipalsDroplet

Component

/atg/userdirectory/droplet/TargetPrincipals

Required Input Parameters

userId

The ID of the user to be queried.

roleName

Supplies a relative role that the user is assigned.

Output Parameters

principals

Holds the organizations returned from the query in a java.util.Collection object.

Open Parameters

empty

Rendered when no items are returned from the query.

error

Rendered when an error occurs and the TargetPrincipals servlet bean is unable to perform the query.

output

Rendered when organizations are returned from the query.

Usage Notes

TargetPrincipals locates all organizations where a specific user has a 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 the relevant User Directory component.

Example

In this example, TargetPrincipals 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>

Copyright © 1997, 2012 Oracle and/or its affiliates. All rights reserved.

Legal Notices