Previous Topic: Locale Properties File

Next Topic: Example: Collecting the Drink Attribute

Add Fields to Collector Pages

Registration Services uses collector pages to enable users to add or modify a user’s profile. The collector page references a profile page, which defines the presentation of user profiles by specifying the form elements, such as text fields and list boxes, that are displayed in the collector pages.

To collect additional user profile attributes, you must add additional fields to profile_user.jsp.

To add a new text field

  1. Add the following JSP code, which determines whether or not users can view the field based on their administrative role:
    <%
    bVisible = accessProperties.getVisible(role, "IDENTIFIER");
    if (bVisible==true) { %>
    

    In this statement:

  2. Add the following JSP code, which determines the field label that is displayed in the collector JSP page:
    <jsp:setProperty name="localebean" property="key"
    value="IDENTIFIER" />
    <jsp:getProperty name="localebean" property="label"/>
    

    In these statements:

  3. Add the HTML and JSP code that creates the input field:
    <tr>
    <td>
    <%
    String attributeValue = properties.getValue("IDENTIFIER");
    if ( attributeValue != null ) {
    %>
    <td><input type="text" size="42" maxlength="40"
    name="IDENTIFIER" value= "<%= attributeValue %>">
    </td>
    <% } else { %>
    <td><input type="text" size="42" maxlength="40"
    name="IDENTIFIER">
    </td>
    <% } %>
    <td><input type="hidden" size="42" maxlength="40"
    name="INFO_IDENTIFIER">
    </td>
    </tr>
    <% } %>
    

    In these statements:

  4. Add the attribute identifier to the checkForEmptyValues method. This method is located in newuserjs.jsp, which contains Javascript for managing users.

    These files are included by the user_data_collector.jsp page.

    Add the attribute identifier, as follows:

    1. Locate the function declaration for checkForEmptyValues:

      function checkForEmptyValues()

    2. Add the attribute identifier to the list of identifiers, as follows:

      listOfIds.add("IDENTIFIER");