The My Profile page (my_profile.jsp
) allows site customers to modify their own profiles (for example, update e-mail addresses). In addition, customers can monitor their own orders and check on the status of or cancel an order.
The My Profile page enables a member to edit her personal information. It is divided into three functional areas:
My personal profile maintains personal contact information.
My commerce profile holds information about a customer’s shopping experiences on this site, including shopping cart information, alternate shipping addresses, saved credit cards, lists of recently viewed items, and the customer’s product preferences.
My orders lists the number of orders the customer has placed and how many of them have been shipped.
The bulk of the My Profile page is static html text and links. The section under “My Personal Profile” has dynamic content that is rendered by the file ProfileFragment.jsp
a portion of which is shown below. First, the personal profile information is displayed using dsp:valueof
tags for several properties of the /atg/userprofiling/Profile
component. Second, there is a static link to edit my profile and a Logout button. The Logout button is a very simple form that submits to the B2CProfileFormHandler
handleLogout
method. We simply provided a URL to which the form handler redirects the user upon success.
A portion of ProfileFragment.jsp
:
<table width=100% cellpadding=0 cellspacing=0 border=0> <tr><td class=box-top-profile>My personal profile</td></tr></table> <p> <dsp:valueof bean="Profile.firstName"/> <dsp:valueof bean="Profile.middleName"/> <dsp:valueof bean="Profile.lastName"/><br> My birthday is <dsp:valueof bean="Profile.dateOfBirth" date="MMMM d, yyyy">??</dsp:valueof>.<br> <dsp:valueof bean="Profile.email"/><br> Member since <dsp:valueof bean="Profile.registrationDate" date="MMMM d, yyyy">January 1, 1900</dsp:valueof>. <p> > <dsp:a href="edit_profile.jsp">edit my profile</dsp:a><br> > <dsp:a href="change_password.jsp">change my password</dsp:a><br> <p> <dsp:form action="../store_home.jsp"> <dsp:input bean="/atg/userprofiling/B2CProfileFormHandler.logoutSuccessURL" beanvalue="/OriginatingRequest.requestURI" type="HIDDEN"/> <dsp:input bean="/atg/userprofiling/B2CProfileFormHandler.logout" type="submit" value="Logout"/> </dsp:form>
We extended the userProfile.xml
file in the Pioneer Cycling configuration layer to add additional attributes to the profile definition. We extended the userProfile
repository definition file to add the following properties to the user item-descriptor:
Clothing size
Weight preference
Price preference
Number of orders
Cumulative order amount
Bikes owned
User keywords
Items bought
Categories viewed recently
Products viewed recently
Recent user searches
The SQL Repository Architecture chapter in the ATG Repository Guide explains the XML definition language syntax.
PioneerCycling/config/atg/userprofiling/userProfile.xml
<gsa-template xml-combine="append"> <header> <name>Bikestore Related Profile Changes</name> <author>DCS Team</author> <version>$Id: userProfile.xml,v 1.35 2000/07/17 18:14:03 astreb Exp $</version> </header> <item-descriptor name="user"> <table name="b2c_user" type="auxiliary" id-column-name="id"> <property category="Pioneer Cycling" name="size" data-type="enumerated" default="unknown" column-name="clothing_size" display-name="Clothing size"> <attribute name="useCodeForValue" value="false"/> <option value="unknown" code="0"/> <option value="extra small" code="1"/> <option value="small" code="2"/> <option value="medium" code="3"/> <option value="large" code="4"/> <option value="extra large" code="5"/> </property> <property category="Pioneer Cycling" name="weightPreference" data-type="int" column-name="weight_preference" display-name="Weight preference"/> <property category="Pioneer Cycling" name="pricePreference" data-type="int" column-name="price_preference" display-name="Price preference"/> <property category="Pioneer Cycling" name="numOrders" display-name="Number of orders" data-type="int" column-name="num_orders" default="0"/> <property category="Pioneer Cycling" name="cumulativeOrderAmount" display-name="Cumulative order amount" data-type="double" column-name="cum_order_amt" default="0"/> </table> <table name="b2c_bike_owned" type="multi" id-column-name="id" multi-column-name="sequence_num"> <property category="Pioneer Cycling" name="bikesYouOwn" data-type="list" component-data-type="String" column-name="bike" display-name="Bikes owned"/> </table> <table name="b2c_user_keyword" type="multi" id-column-name="id" multi-column-name="sequence_num"> <property category="Pioneer Cycling" name="userKeywords" data-type="list" component-data-type="String" column-name="keyword" display-name="User keywords"/> </table> <table name="b2c_item_bought" type="multi" id-column-name="id" multi-column-name="sequence_num"> <property category="Pioneer Cycling" name="itemsBought" data-type="list" component-item-type="sku" repository="/atg/commerce/catalog/ProductCatalog" column-name="item" display-name="Items bought"/> </table> <!-- The following transient properties are used to record categories & pages viewed, and recent searches --> <property category="Pioneer Cycling" name="categoriesViewed" display-name="Categories viewed recently" data-type="set" component-data-type="String" /> <property category="Pioneer Cycling" name="productsViewed" display-name="Products viewed recently" data-type="set" component-data-type="String" /> <property category="Pioneer Cycling" name="recentSearches" display-name="Recent user searches" data-type="set" component-data-type="String" /> </item-descriptor> </gsa-template>