Map LDAP Attributes to Items on the Geoportal Registration Page

Release 9.3.1 E-mail This Topic Printable Version Give Us Feedback

Map LDAP Attributes to Items on the Geoportal Registration Page

Out of the box, the Geoportal Registration page looks like the screenshot below. The Username and Password are mandatory because they are required for logging in. Email is mandatory so the Geoportal administrator can contact a user if necessary. Other fields are optional. Additional fields can be added or removed from this page.

This customization assumes an understanding of LDAP concepts outlined in the article Important LDAP Concepts








Investigate how these items, called "attributes", are mapped in LDAP, by opening up JXplorer and selecting one of the users. Click the "Table Editor" tab in the window to the right. All of the attributes assigned to that user are displayed. Every user or group in the LDAP structure has attributes associated with it. These attributes are defined by LDAP Data Interchange Format, and map information to the user or group. The Geoportal's gpt.xml file uses attributes defined in LDAP to define fields in the Geoportal Registration page.



Notice the name of the attributes in the "attribute type" column to the left. These correspond to the attributes' "ldapName" values defined in the <userAttributeMap> section in the gpt.xml file.







Not all of the attributes shown in JXplorer are listed in gpt.xml, and not every attribute in gpt.xml is listed in this example with JXplorer. How these items are defined should be discussed with the LDAP administrator in your organization.





Add an Additional Field to the Geoportal Registration Page

Follow the steps below to add an additional field to the Geoportal registration page:
  1. Navigate to the \\geoportal\WEB-INF\classes\gpt\config folder and open the gpt.xml file in a text editor.
  2. Create a new <attribute> tag in the <userAttributeMap> section of the gpt.xml file


  3. Now, navigate to the \\geoportal\catalog\identity folder, and open userAttributes.jsp in a text editor. Add a new set of output label tags, taking care to use the attribute's key name in the parameters:

    <% // home phone number %> <h:outputLabel for="home_phone" rendered="#{SelfCareController.hasUserAttribute['home_phone']}" value="#{gptMsg['catalog.identity.profile.label.home_phone']}"/> <h:inputText id="home_phone" size="30" maxlength="128" rendered="#{SelfCareController.hasUserAttribute['home_phone']}" value="#{SelfCareController.activeUserAttributes['home_phone'].value}"/>


  4. Notice that the 'catalog.identity.profile.label.home_phone' is used to generate the name of the label on the Registration page. You need to add this entry to your gpt.properties file in the \\geoportal\WEB-INF\classes\gpt\resources folder. The new entry in gpt.properties for our Home Phone Number example is:

    catalog.identity.profile.label.home_phone = Home Phone Number:


  5. After updating both userAttributes.jsp and gpt.properties, save both files and close them. Then restart your geoportal web application.
  6. To see how your Registration page relates to LDAP, launch the Geoportal site and click the "Register" button.
  7. Register a new user:







  8. Refresh your view in JXplorer to see the new user added to the tree. Click on the new user, and see how the properties - including the new Home Phone Number - are mapped in LDAP.