|
|
Working with Properties
Properties are fields for which values are set. For example, in this chapter you will create an AcmePoints property that represents the number of times a user visits the exampleportal site. You can change the AcmePoints value manually, or, as you will do at the end of the tour, add code to a JSP that automatically increments the value for a user every time the user logs into the site. The number of AcmePoints a user accumulates determines whether the user is classified as an infrequent or frequent visitor, which in turn determines the content the user sees.
Individual properties, like AcmePoints, are grouped into property sets. This chapter describes how to create a property in a property set.
This topic includes the following sections:
Creating a Property Within the exampleportal Property Set
In this section, you will add the AcmePoints property to the existing exampleportal property set. The AcmePoints property will be used to track the number of times a user visits the site.
Follow these steps to add the AcmePoints property to the exampleportal property set:
http://localhost:7501/tools
Enter the following user name and password:
User Name: administrator
Password: password
Note: The default port is 7501. For information on changing port numbers, see "Changing the Listen Ports" in "The Server Configuration" chapter of the Deployment Guide.
Note: Be sure to click the exampleportal property set under the User Property Sets title bar, not under the Application Initialization Property Sets title bar.
Figure 2-1 Creating a property
Property Name: Enter AcmePoints (Make sure you type this exactly as shown.) Description: Enter Number of times user has visited. Type: Select Integer. Selection Option: Select Single. Note: The "single" option refers to those properties having only one choice (for example, Property: FavoriteColor, Attribute: red). The "multiple" option refers to those properties having multiple options (for example, Property: Colors, Attributes: red, green, blue, and so on). Creation Category: Select Unrestricted. Note: Restricted categories refer to user input via a list, radio buttons, check boxes, and so on. Unrestricted categories refer to instances in which users populate a form field. Figure 2-2 Confirmation that the property was created
Adding a Default Value to the AcmePoints Property
Now you will add a default value so the application will always find a value. As users are added to the system, they will receive this default AcmePoints value automatically.
Figure 2-3 Adding a default property value
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|