For Motorprise, we added properties to the user
and organization
item types to provide functionality that is specific to its business model. These extensions are defined in <ATG11dir>/Motorprise/config/atg/userprofiling/userProfile.xml
.
Many of the properties in the Motorprise organization
and user
repository items are derived from other properties. A derived property enables one repository item to obtain property values from another repository item or from another property in the same repository item. For more information on derived properties, see the Platform Programming Guide.
For example, the following XML code in <ATG11dir>/Motorprise/config/atg/userprofiling/userProfile.xml
illustrates how we used derived properties for the property invoiceRequestAuthorized
in Motorprise.
Some Motorprise users are authorized to use purchase orders and request invoices, rather than using a corporate credit card. We added certain properties in Motorprise to check if a user or organization has that authorization.
First, we created a derived property, invoiceRequestAuthorized
, in organization
item-descriptor.
<item-descriptor name="organization"> <table name="b2b_org_info" type="auxiliary" id-column-name="org_id"> <property category-resource="categoryB2BStore" name="myInvoiceRequestAuthorized" data-type="boolean" column-name="invoice_auth" display-name-resource="myInvoiceRequestAuthorized" expert="true"> </property> </table> <!-- Derived properties --> <property category-resource="categoryB2BStore" name="invoiceRequestAuthorized" data-type="boolean" display-name-resource="invoiceRequestAuthorized"> <derivation override-property="myInvoiceRequestAuthorized"> <expression>parentOrganization.invoiceRequestAuthorized</expression> </derivation> </property> </item-descriptor>
In Motorprise, all organizations have a Boolean property, invoiceRequestAuthorized
, that indicates whether users from that organization are authorized to use purchase orders. Every organization checks for this property. If the property is not present, then the organization derives the value from its parent organization. As shown in the code sample above, we created an extra property myInvoiceRequestAuthorized
in organization
that contains the value. Then we created the required property, invoiceRequestAuthorized
, that actually checks for the value in myInvoiceRequestAuthorized
using the <derivation override-property="myInvoiceRequestAuthorized">
tag. If this value is null, then we get the value from the parent organization using the tag <expression>parentOrganization.invoiceRequestAuthorized</expression>
.
Based on the invoiceRequestAuthorized
property of organization
, we created another derived property in the user
item-descriptor as shown in the below code:
<item-descriptor name="user"> <table name="b2b_auth_pmnt" type="auxiliary" id-column-name="id"> <property category-resource="categoryB2BStore" name="myInvoiceRequestAuthorized" data-type="boolean" column-name="invoice_auth" expert="true" display-name-resource="myInvoiceRequestAuthorized"> </property> </table> <!--Derived Property --> <property category-resource="categoryB2BStore" name="invoiceRequestAuthorized" data-type="boolean" display-name-resource="invoiceRequestAuthorized"> <derivation override-property="myInvoiceRequestAuthorized"> <expression>parentOrganization.invoiceRequestAuthorized</expression> </derivation> </property> </item-descriptor>
As shown above, when invoiceRequestAuthorized
is retrieved for any user, we first check its value at the user level. If it is null, then we retrieve the value from the parent organization. This allows us to have most users inherit the setting of their parent organization; at the same time, we can override the default behavior for specific users when needed.
We created other derived properties in Motorprise as indicated below.
These are the properties we added to the organization
item type:
Property | Description |
---|---|
| A media item used to display the company logo. |
| This property overrides the |
| Indicates whether the user is authorized to use invoices as a payment method. The checkout pages use this property of the profile to determine whether to display the option to pay for an order with invoices. |
| Indicates whether a user is authorized to use credit cards as a payment option. |
| Indicates whether a user is authorized to use gift certificates as a payment option. |
| Indicates whether a user is authorized to use store credit as a payment option. |
| This is an override property for the |
| This property works the same as |
| This property works the same as |
| This property works the same as |
We also added the following properties to the user
item type:
Property | Description |
---|---|
| Used in the Company Admin section of the site. When an administrator from a buying organization (such as Mary Granger from USMW) logs in, she selects a business unit and this property is set. This property references an organization repository item. For other users, this property is not set. |
| A reference to a user repository item. It is used in the admin pages to work with multiple users. This property keeps track of which user is being updated at a given time. For example, if administrator Mary is editing the properties for user Stuart, then the |
| Indicates the current number of orders placed by the user. This property is used in the 25OverAverage scenario. See the Merchandising chapter in this guide for more information. |
| Tracks the average total of all the user’s orders. This property is used in the 25OverAverage scenario. See the Merchandising chapter in this guide for more information. |
| Indicates whether the user is authorized to use invoices as a payment method. The checkout pages use this property of the profile to determine whether to display the option to pay for an order with invoices. |
| Indicates whether a user is authorized to use credit cards as a payment option. |
| Indicates whether a user is authorized to use gift certificates as a payment option. |
| Indicates whether a user is authorized to use store credit as a payment option. |
| This is an override property for the |
| This property works the same as |
| This property works the same as |
| This property works the same as |
| This property is set to the page that a user requests. It is used to track which page the user is currently requesting. |
For more information on how we set the transient currentLocation
property, see the section on the SetCurrentLocation
servlet in the Request-Handling Pipeline Servlets chapter.
For more information on profile properties, refer to the Working with the Dynamo User Directory chapter of the Personalization Programming Guide.