The Personalization module creates a Profile session-scoped object for each user when the request is processed by the ProfileRequestServlet. This component is a wrapper around the RepositoryItem, which represents the user. In the default configuration, the ProfileRequestServlet creates an anonymous RAM-based profile and sets the dataSource property of the Profile object. Later, if the user logs in or goes through some other authentication process, the instance of the Profile object does not change in the session, but the dataSource value is swapped out with the RepositoryItem that represents the user’s persistent profile.

You should use the Profile component to access the profile properties of the user. A registered property mapper allows the profile properties to be accessible from your site content pages. (See the Setting Up Targeting Services chapter.) The instance of the Profile object is what the targeting engine uses to evaluate business rules in context of the person.

The class that defines this component implements the RepositoryItem interface, and all calls to those methods pass through to the RepositoryItem specified by the dataSource property. In addition, this class adds an extra JavaBean property named transient. The transient property returns true when the profile for the user is anonymous and returns false when the user is authenticated. You may find this property useful with Switch servlet beans within content pages to show content to members of your sites.

You can subclass this component and add your own session-based JavaBean properties. These properties will also be accessible in targeting and visible in the Business Control Center and the ACC. To register your own subclass to be instantiated for the /atg/userprofiling/Profile component, you need to override the $class definition from the default configuration.

You can also add new property types to the SQL repository. Since most Profile objects are RepositoryItems in the SQL repository, adding new property types to an item may be more effective than creating your own subclass of the Profile object. For more information, see User-Defined Property Types in the SQL Repositories chapter of the ATG Repository Guide.