When an administrator such as Mary Granger of USMW logs in and selects the Company Admin pages, she is brought to business_units.jsp where a list of all the business units that she is authorized to administer is displayed. Each business unit in the list is a link; clicking on any of these links brings the user to company_admin.jsp for that business unit. On that page, the admin sees a list of various options for administration.

Any specific action performed thereafter is related to that business unit.

We used the atg/userdirectory/droplet/TargetPrincipals component on company_admin.jsp to determine the organization that the user selected in business_units.jsp. When the user selects the link of the business unit, the ID of that organization is passed as a parameter. TargetPrincipals retrieves an array of organizations for which the user is assigned an admin role. We compare the ID of each one to the ID of the organization that was passed in as a parameter. When the correct match is found, that organization is assigned to the Profile.currentOrganization property.

This snippet from company_admin.jsp illustrates how we used TargetPrincipals:

<%-- Set the Profile.currentOrganization property to the organization
which was selected in the business_units.jsp page --%>

<dsp:droplet name="IsEmpty">
  <dsp:param name="value" param="organizationId"/>
  <dsp:oparam name="false">
    <dsp:droplet name="TargetPrincipals">
      <dsp:param bean="Profile.id" name="userId"/>
      <dsp:param name="roleName" value="admin"/>
      <dsp:oparam name="output">
        <dsp:droplet name="ForEach">
        <dsp:param name="array" param="principals"/>
        <dsp:oparam name="output">
          <dsp:droplet name="Compare">
            <dsp:param name="obj1" param="organizationId"/>
              <dsp:param name="obj2" param=
               "element.repositoryItem.repositoryid"/>
            <dsp:oparam name="equal">
            <dsp:setvalue bean="Profile.currentOrganization"
              paramvalue="element.repositoryItem"/>

            </dsp:oparam>
          </dsp:droplet>

          </dsp:oparam>
        </dsp:droplet>  <%-- End of ForEach --%>
      </dsp:oparam>
    </dsp:droplet>  <%-- End of TargetPricipals --%>
  </dsp:oparam>
</dsp:droplet> <%-- End of IsEmpty --%>

Copyright © 1997, 2019 Oracle and/or its affiliates. All rights reserved. Legal Notices