You can define multiple profile types in a single profile repository definition file. Once you have defined a root profile type, such as user or organization, you can then create sub-types that contain all the properties of their super-type, plus any other properties that you define. Each profile sub-type is represented by an item-descriptor in your profile repository definition XML file. Note: If you add item-descriptors to the userProfile.xml file, make sure that the user item-descriptor is always the first item-descriptor defined in the file.

Consider the following example. The Quincy Funds demo defines some users as “user of type investor” or “user of type broker,” where “investor” and “broker” are simply values of the “type” profile property. Instead, you could create multiple profile sub-types to define distinct kinds of user; each sub-type can then have a range of different properties that are specific to it and define its characteristics.

The following code sample creates two simple profile types, investor and broker. The investor profile type contains all the properties of its super-type user, as well as the property mothersMaidenName. Perhaps you want to require that investors provide this information and use it to log them onto your sites for added security. The broker profile type also contains all the characteristics of its super-type user, and adds the property commissionPercentage. A user who is a broker is the only kind of user who needs this property, so a separate profile type holds such broker-specific properties.

<item-descriptor name="investor" super-type="user" sub-type-value="investor">
  <table name="dss_qf_investor" type="auxiliary" id-column-name="id">
    <property category-resource="categoryQuincyFundsInvestorProperties"
       name="assetValue" data-type="float" default="0.0" column-name="asset_value"
       description-resource="investorPropertiesDescription"
       display-name-resource="assetValue">
      <attribute name="resourceBundle"
           value="atg.projects.dssj2eedemo.UserProfileTemplateResources"/>
    </property>
  </table>
</item-descriptor>

<item-descriptor name="broker" super-type="user" sub-type-value="broker">
  <table name="dss_qf_broker" type="auxiliary" id-column-name="id">
    <property category-resource="categoryQuincyFundsBrokerProperties"
       name="commissionPercentage" data-type="int" default="5"
       column-name="commission_pct"
       description-resource="brokerPropertiesDescription"
       display-name-resource="commissionPercentage">
      <attribute name="resourceBundle"
           value="atg.projects.dssj2eedemo.UserProfileTemplateResources"/>
    </property>
  </table>
</item-descriptor>

Note that the Business Control Center and the ACC do not currently support changing a user’s sub-type after the user has been created. For this reason, it is recommended that you set the uiwritable attribute to false for any sub-types you add to your repository definition files. For information on the appropriate syntax, refer to the gsa_1.0.dtd file in <ATG10dir>\DAS\lib\classes.jar.

Defining multiple profile types allows you to write targeting rules or use queries that sort users by their profile type instead of by a property in the user profile that defines them as an investor or a broker. You can also query a parent item-descriptor for properties that are defined in its children item-descriptors. For example, if you defined the children item-descriptors above, you could search for “all User items whose commissionPercentage is greater than 15%” even though the User item-descriptor does not contains the commissionPercentage property.

For more information about using multiple profile types in targeting rules, see the Creating Rules for Targeting Content chapter in this manual.


Copyright © 1997, 2012 Oracle and/or its affiliates. All rights reserved. Legal Notices