Retrieving All Groups via JavaScript in Identity Manager
search cancel

Retrieving All Groups via JavaScript in Identity Manager

book

Article ID: 10495

calendar_today

Updated On:

Products

CA Identity Manager CA Identity Portal CA Identity Suite

Issue/Introduction

Identity Manager administrators often need to dynamically list all available groups within an Identity Portal form without the overhead of external plugins. This article provides a method to programmatically retrieve and display all defined groups using Screen Logical Attributes.

Environment

Identity Manager 14.5

Resolution

Use the following JavaScript implementation to retrieve and populate groups in your Identity Portal form:

  1. Configure Screen Logical Attribute In the Administrative Task used by the Identity Portal form, add a Screen Logical Attribute with the following initialization script:
function init(FieldContext) {     var gp = FieldContext.getGroupProvider();     var groupsInScope = new java.util.Vector();     var result = "";     groupsInScope = gp.findGroups(null, null, null);     for (var i = 0; i < groupsInScope.size(); i++) {         result += groupsInScope.get(i).getFriendlyName() + "$$";     }     FieldContext.setValue(result); }
  1. Initialize Form Property
    • Restart the Identity Manager connector on the Portal side.
    • In the Identity Portal form, map a property to the attribute created in Step 1.
    • Parse the string in the property’s Initialization handler:
var groups = prop.value.split('$$'); prop.options = []; for (var i = 0; i < groups.length; i++) {     if (groups[i]){         prop.options.push({name:groups[i], value:groups[i]});     } }

Additional Information

To speak with a customer representative or a Support Engineer see Contact Support. Scroll to the bottom of the page and click on your respective region.