|
|
Customer Self-Service
Customers who make purchases from an e-commerce site often want access to their order and payment history. In many cases, customers expect to have this information available. To meet this need, the Registration and User Processing package provides you with a series of JSPs designed specifically for this purpose. The customer self-service pages allow registered customers who have previously placed orders with your e-business to locate information about their past orders and payments, and to check on the status of these orders. The customer self-service pages can help you maintain a high level of service for all your customers by giving them the information they require. This topic describes each of the customer self-service pages in detail.
This topic includes the following sections:
JavaServer Pages (JSPs)
Like the other services available in the Registration and User Processing package, customer self-service is implemented through a number of JavaServer Pages (JSPs). You can use these JSPs as an out-of-the-box solution, or customize them to meet your unique business requirements. This section describes each of these pages in detail.
main.jsp Template
The gateway into the customer self-service pages is via the main.jsp template (shown in Figure 4-1), or the home page for the product catalog. A customer must be logged into your e-commerce site for the customer self-service options to be available. For more information about the main.jsp template, see "The Product Catalog JSP Templates and JSP Tags" in the BEA WebLogic Commerce Server Product Catalog Management documentation.
Figure 4-1 The main.jsp Template's Customer Self-Service Section
The orderhistory.jsp template (shown in Figure 4-2) displays a list of order summaries (including order date, order number, and order amount) for each of the customer's orders. It also provides the customer with a View button for each order in the list, which allows the customer to view details about the order, including its status.
Sample Browser View
Figure 4-2 shows an annotated version of the orderhistory.jsp template. The dashed lines and numbers in the diagram are not part of the template; they are referenced in the explanation that follows the screen shot.
Figure 4-2 Annotated orderhistory.jsp Template
The numbers in the following list refer to the numbered regions in the figure:
<%@ include file="/commerce/includes/header2.jsp" %>
<%@ include file="/commerce/includes/footer2.jsp" %>
footer2.jsp consists of the horizontal footer at the bottom of the page, plus the right-side vertical column that describes (for the benefit of you and your development team) the name of the current template and links to its About information. In the footer2.jsp file, the right-side vertical column is an include file:
<%@ include file="/commerce/includes/rightside.jsp" %>
Location in the WebLogic Commerce Server Directory Structure
You can find the orderhistory.jsp template file at the following location, where WL_COMMERCE_HOME is the directory in which you installed WebLogic Commerce Server:
%WL_COMMERCE_HOME%\server\webapps\wlcs\commerce\order\
orderhistory.jsp (Windows)
$WL_COMMERCE_HOME/server/webapps/wlcs/commerce/order/
orderhistory.jsp (UNIX)
Tag Library Imports
The orderhistory.jsp template uses WebLogic and Pipeline JSP tags. Therefore, the template includes the following JSP tag libraries:
<%@ taglib uri="weblogic.tld" prefix="wl" %>
<%@ taglib uri="pipeline.tld" prefix="pipeline" %>
Note: For more information about the Pipeline JSP tags, see BEA WebLogic Commerce Server Webflow and Pipeline Management. For more information on the WebLogic Server JSP tags, see "JSP Tag Reference" in the BEA WebLogic Personalization Server documentation.
These files reside in the following directory for the WebLogic Commerce Server Web application:
%WL_COMMERCE_HOME%\server\webapps\wlcs\WEB-INF (Windows)
$WL_COMMERCE_HOME/server/webapps/wlcs/WEB-INF (UNIX)
Java Package Imports
The orderhistory.jsp template uses Java classes in the following packages and therefore includes these import statements:
<%@ page import="java.util.*" %>
<%@ page import="java.text.*" %>
<%@ page import="com.beasys.commerce.foundation.pipeline.*" %>
<%@ page import="com.beasys.commerce.axiom.units.*" %>
<%@ page import="com.beasys.commerce.ebusiness.shipping.*" %>
<%@ page import="com.beasys.commerce.ebusiness.order.*" %>
<%@ page import="com.beasys.commerce.ebusiness.customer.*" %>
<%@ page import="com.beasys.commerce.webflow.*" %>
Location in Default Webflow
Customers arrive at the orderhistory.jsp template from the product catalog home page (main.jsp). From here, customers can return back to the product catalog home page, or display the details of a specific order by selecting it (orderstatus.jsp).
Note: For more information about the default Webflow, see Overview of the Registration and User Processing Package.
Included JSP Templates
The following JSP templates are included in the orderhistory.jsp template:
Every time a customer clicks a button to view more detail about an order, it is considered an event. Each event triggers a particular response in the default Webflow that allows them to continue. While this response can be to load another JSP, it is usually the case that an input processor and/or Pipeline is invoked first. Table 4-1 provides information about these events and the business logic they invoke.
Event |
Webflow Response(s) |
---|---|
-- |
RefreshOrderHistory |
button(viewOrderStatus) |
SelectOrderForViewingIP |
Table 4-2 briefly describes each of the Pipelines from Table 4-1, as they are defined in the pipeline.properties file. For more information about individual Pipeline components, see Pipeline Components.
Pipeline |
Description |
---|---|
RefreshOrderHistory |
Contains RefreshOrderHistoryPC and is not transactional. |
Note: Although the RefreshOrderHistory Pipeline is associated with the orderhistory.jsp template, it is not triggered by an event on the page. Rather, the RefreshOrderHistory Pipeline is executed before the orderhistory.jsp is viewed, to locate the orders associated with the customer requesting the information.
Dynamic Data Display
One purpose of the orderhistory.jsp template is to display the data specific to a customer's orders for their review and possible selection. This is accomplished on orderhistory.jsp using a combination of WebLogic Server JSP tags, Pipeline JSP tags, and attributes/methods.
First, the getPipelineProperty JSP tag retrieves the ORDER_HISTORY attribute from the Pipeline session. Table 4-3 provides more detailed information on this attribute.
Attribute |
Type |
Description |
---|---|---|
PipelineSessionConstants.ORDER_HISTORY |
List of com.beasys.commerce. |
List of the orders available for the customer. |
Listing 4-1 illustrates how this attribute is retrieved from the Pipeline session using the getPipelineProperty JSP tag.
Listing 4-1 Retrieving the Order History Attribute
<pipeline:getPipelineProperty propertyName="<%=PipelineSessionConstants.ORDER_HISTORY%>" returnName="orderHistory" returnType="java.util.List"/>
Note: For more information on the getPipelineProperty JSP tag, see BEA WebLogic Commerce Server Webflow and Pipeline Management.
The data stored within the Pipeline session attribute is then accessed by using accessor methods/attributes within Java scriptlets. Table 4-4 provides more detailed information about these methods/attributes for OrderValue.
Method/Attribute |
Description |
---|---|
createdDate |
The date the customer's order was created. |
identifier |
Key in the database for the order. |
getTotal(int totalType) |
The total amount specified by the totalType parameter. Valid parameters include: Note: The getTotal() method also allows you to combine different total types. For more information, see the Javadoc. |
Listing 4-2 illustrates how these accessor methods/attributes are used within Java scriptlets along with the WebLogic Server JSP tags to display the information.
Listing 4-2 Using Accessor Methods/Attributes Within orderhistory .jsp Java Scriptlets
<wl:repeat set="<%=orderHistory%>" id="orderValue" type="OrderValue" count="100">
<table>
<tr>
<td>
<div class="tabletext"><%=orderValue.createdDate%></div>
</td>
<td>
<div class="tabletext"><%=orderValue.identifier%></div>
</td>
<td>
<div class="tabletext">
<% Money total =
orderValue.getTotal(OrderConstants.LINE_UNIT_PRICE_TIMES_QUANTITY
+ OrderConstants.LINE_SHIPPING + OrderConstants.LINE_TAX); %>
<%=total.getCurrency()%>
<%=WebflowJSPHelper.priceFormat(total.getValue())%>
</div>
</td>
</tr>
</table>
</wl:repeat>
Note: For more information on the WebLogic Server JSP tags, see "JSP Tag Reference" in the BEA WebLogic Personalization Server documentation.
Form Field Specification
No form fields are used in the orderhistory.jsp template.
orderstatus.jsp Template
The orderstatus.jsp template (shown in Figure 4-3) displays a variety of information for the order summary the customer selected from the list presented on the orderhistory.jsp template. This order information includes the order confirmation number, the order status, the date the order was placed, splitting instructions, special instructions, the shipping address, information related to the specific shopping cart items (name, description, quantity, unit price), and total amounts (shipping and handling, tax, and total order cost).
Sample Browser View
Figure 4-3 shows an annotated version of the orderstatus.jsp template. The dashed lines and numbers in the diagram are not part of the template; they are referenced in the explanation that follows the screen shot.
Figure 4-3 Annotated orderstatus.jsp Template
The numbers in the following list refer to the numbered regions in the figure:
<%@ include file="/commerce/includes/header2.jsp" %>
<%@ include file="/commerce/includes/footer2.jsp" %>
footer2.jsp consists of the horizontal footer at the bottom of the page, plus the right-side vertical column that describes (for the benefit of you and your development team) the name of the current template and links to its About information. In the footer2.jsp file, the right-side vertical column is an include file:
<%@ include file="/commerce/includes/rightside.jsp" %>
Location in WebLogic Commerce Server Directory Structure
You can find the orderstatus.jsp template file at the following location, where WL_COMMERCE_HOME is the directory in which you installed WebLogic Commerce Server:
%WL_COMMERCE_HOME%\server\webapps\wlcs\commerce\order\
orderstatus.jsp (Windows)
$WL_COMMERCE_HOME/server/webapps/wlcs/commerce/order/
orderstatus.jsp (UNIX)
Tag Library Imports
The orderstatus.jsp template uses WebLogic and Pipeline JSP tags. Therefore, the template includes the following JSP tag libraries:
<%@ taglib uri="weblogic.tld" prefix="wl" %>
<%@ taglib uri="pipeline.tld" prefix="pipeline" %>
Note: For more information on the WebLogic Server JSP tags, see "JSP Tag Reference" in the BEA WebLogic Personalization Server documentation. For more information about the Pipeline JSP tags, see BEA WebLogic Commerce Server Webflow and Pipeline Management.
These files reside in the following directory for the WebLogic Commerce Server Web application:
%WL_COMMERCE_HOME%\server\webapps\wlcs\WEB-INF (Windows)
$WL_COMMERCE_HOME/server/webapps/wlcs/WEB-INF (UNIX)
Java Package Imports
The orderstatus.jsp template uses Java classes in the following packages and therefore includes these import statements:
<%@ page import="java.util.*" %>
<%@ page import="java.text.*" %>
<%@ page import="com.beasys.commerce.webflow.*" %>
<%@ page import="com.beasys.commerce.axiom.units.*" %>
<%@ page import="com.beasys.commerce.axiom.contact.*" %>
<%@ page import="com.beasys.commerce.ebusiness.order.*" %>
<%@ page import="com.beasys.commerce.ebusiness.payment.*" %>
<%@ page import="com.beasys.commerce.foundation.pipeline.*" %>
Location in Default Web Flow
Customers arrive at the orderstatus.jsp template from the page that displays summaries of their past orders (orderhistory.jsp). The default Webflow does not define a subsequent JSP template.
Note: For more information about the default Webflow, see Overview of the Registration and User Processing Package.
Included JSP Templates
The following JSP templates are included in the orderstatus.jsp template:
There are no events on the orderstatus.jsp template.
Dynamic Data Display
The purpose of the orderstatus.jsp template is to display the data specific to a customer's order for their review. This is accomplished on orderstatus.jsp using a combination of WebLogic Server JSP tags, Pipeline JSP tags, and accessor methods/attributes.
First, the getPipelineProperty JSP tag retrieves the SELECTED_ORDER attribute from the Pipeline session. Table 4-5 provides more detailed information on this attribute.
Attribute |
Type |
Description |
---|---|---|
PipelineSessionConstants.SELECTED_ORDER |
com.beasys.commerce. |
Contains a variety of information about the order selected by the customer. |
Listing 4-3 illustrates how this attribute is retrieved from the Pipeline session using the getPipelineProperty JSP tag.
Listing 4-3 Retrieving the Selected Order Attribute
<pipeline:getPipelineProperty
propertyName="<%=PipelineSessionConstants.SELECTED_ORDER%>"
returnName="orderValue"
returnType="com.beasys.commerce.ebusiness.order.OrderValue"/>
Note: For more information on the getPipelineProperty JSP tag, see BEA WebLogic Commerce Server Webflow and Pipeline Management.
The data stored within the Pipeline session attribute is then accessed by using accessor methods/attributes within Java scriptlets. Table 4-6 provides more detailed information about these methods/attributes for OrderValue.
Method/Attribute |
Description |
---|---|
createdDate |
The date the customer's order was created. |
identifier |
Key in the database for the order; the order confirmation number. |
orderStatus |
The status of the order. |
splittingPreference |
The splitting preference for the order. |
specialInstructions |
Any special instructions for the order. |
shippingAddress |
The shipping address for the order. |
orderLines |
A collection of the lines in the shopping cart that make up the customer's order. |
getTotal(int totalType) |
The total amount specified by the totalType parameter. Valid parameters include: Note: The getTotal() method also allows you to combine different total types. For more information, see the Javadoc. |
Table 4-7 describes the accessor methods/attributes available within the shippingAddress attribute of OrderValue.
Method/Attribute |
Description |
---|---|
getStreet1() |
The first line of the customer's street address. |
getStreet2() |
The second line of the customer's street address. |
getCity() |
The city in the customer's address. |
getCounty() |
The county in the customer's address. |
getState() |
The state in the customer's address. |
getPostalCode() |
The zip/postal code in the customer's address. |
getCountry() |
The country in the customer's address. |
Table 4-8 describes the accessor methods/attributes available for each OrderLine of the OrderLines attribute.
Method/Attribute |
Description |
---|---|
getProductIdentifier() |
The name (identifier) for the shopping cart item. |
getDescription() |
A description of the shopping cart item. |
getQuantity() |
The quantity of the shopping cart item. |
getUnitPrice() |
The unit price for the shopping cart item. |
The getUnitPrice() method also has accessor methods/attributes that you can use. These are shown in Table 4-9.
Method/Attribute |
Description |
---|---|
getCurrency() |
Obtains the currency associated with the amount. |
getValue() |
Obtains the value of the amount. |
Listing 4-4 illustrates how these accessor methods/attributes are used within Java scriptlets along with the WebLogic Server JSP tags to display the information.
Listing 4-4 Using Accessor Methods/Attributes Within orderstatus .jsp Java Scriptlets
<table border="0" width="90%" cellpadding="5" cellspacing="0">
<tr>
<td><div class="tabletext"><b>Confirmation number</b></div></td>
<td><div class="tabletext"><%=orderValue.identifier%></div></td>
</tr>
.
.
.
<tr>
<td><div class="tabletext"><b>Shipping address</b></div></td>
<td><div class="tabletext">
<%=orderValue.shippingAddress.getStreet1()%><br>
<%=orderValue.shippingAddress.getStreet2()%><br>
<%=orderValue.shippingAddress.getCity()%><br>
<%String stateZip = orderValue.shippingAddress.getState()+
"-" + orderValue.shippingAddress.getPostalCode();%><br>
<%=stateZip%></div>
</td>
</tr>
</table>
.
.
.
<wl:repeat set="<%=orderValue.orderLines.iterator()%>" id="orderLine" type="OrderLine" count="100">
<table>
<tr>
<td>
<div class="tabletext">
<%=orderLine.getProductIdentifier()%>
</div>
</td>
<td>
<div class="tabletext"><%=orderLine.getDescription()%></div>
</td>
<td align="right">
<div class="tabletext">
<%=quantityFormat.format(orderLine.getQuantity())%>
</div>
</td>
<td align="right">
<div class="tabletext">
<%=orderLine.getUnitPrice().getCurrency()%>
<%=WebflowJSPHelper.priceFormat(orderLine.getUnitPrice().
getValue())%>
</div>
</td>
</tr>
</table>
</wl:repeat>
Note: For more information on the WebLogic Server JSP tags, see the "JSP Tag Reference" in the BEA WebLogic Personalization Server documentation.
Form Field Specification
No form fields are used in the orderstatus.jsp template.
paymenthistory.jsp Template
The paymenthistory.jsp template (shown in Figure 4-4) allows the customer to view information regarding the payments that have been made. This information includes the date, the payment transaction ID, the credit card used, and the amount that was billed to the credit card.
Sample Browser View
Figure 4-4 shows an annotated version of the paymenthistory.jsp template. The dashed lines and numbers in the diagram are not part of the template; they are referenced in the explanation that follows the screen shot.
Figure 4-4 Annotated paymenthistory.jsp Template
The numbers in the following list refer to the numbered regions in the figure:
<%@ include file="/commerce/includes/header2.jsp" %>
<%@ include file="/commerce/includes/footer2.jsp" %>
footer2.jsp consists of the horizontal footer at the bottom of the page, plus the right-side vertical column that describes (for the benefit of you and your development team) the name of the current template and links to its About information. In the footer2.jsp file, the right-side vertical column is an include file:
<%@ include file="/commerce/includes/rightside.jsp" %>
Location in the WebLogic Commerce Server Directory Structure
You can find the paymenthistory.jsp template file at the following location, where WL_COMMERCE_HOME is the directory in which you installed WebLogic Commerce Server:
%WL_COMMERCE_HOME%\server\webapps\wlcs\commerce\order\
paymenthistory.jsp (Windows)
$WL_COMMERCE_HOME/server/webapps/wlcs/commerce/order/
paymenthistory.jsp (UNIX)
Tag Library Imports
The paymenthistory.jsp template uses WebLogic and Pipeline JSP tags. Therefore, the template includes the following JSP tag libraries:
<%@ taglib uri="weblogic.tld" prefix="wl" %>
<%@ taglib uri="pipeline.tld" prefix="pipeline" %>
Note: For more information on the WebLogic Server JSP tags, see "JSP Tag Reference" in the BEA WebLogic Personalization Server documentation. For more information about the Pipeline JSP tags, see BEA WebLogic Commerce Server Webflow and Pipeline Management.
These files reside in the following directory for the WebLogic Commerce Server Web application:
%WL_COMMERCE_HOME%\server\webapps\wlcs\WEB-INF (Windows)
$WL_COMMERCE_HOME/server/webapps/wlcs/WEB-INF (UNIX)
Java Package Imports
The paymenthistory.jsp template uses Java classes in the following packages and therefore includes these import statements:
<%@ page import="java.util.*" %>
<%@ page import="java.text.*" %>
<%@ page import="com.beasys.commerce.foundation.pipeline.*" %>
<%@ page import="com.beasys.commerce.ebusiness.payment.*" %>
<%@ page import="com.beasys.commerce.webflow.*" %>
Location in Default Webflow
Customers arrive at paymenthistory.jsp from the product catalog home page (main.jsp). The default Webflow does not define a subsequent JSP template.
Note: For more information about the default Webflow, see Overview of the Registration and User Processing Package.
Included JSP Templates
The following JSP templates are included in the paymenthistory.jsp template:
There are no events on the paymenthistory.jsp template that trigger input processors or Pipelines in the Webflow. However, Table 4-10 briefly describes each of the Pipelines associated with the paymenthistory.jsp template, as they are defined in the pipeline.properties file. For more information about individual Pipeline components, see Pipeline Components.
Pipeline |
Description |
---|---|
RefreshPaymentHistory |
Contains RefreshPaymentHistoryPC and is not transactional. |
Note: Although the RefreshPaymentHistory Pipeline is associated with the paymenthistory.jsp template, it is not triggered by an event on the page. Rather, the RefreshPaymentHistory Pipeline is executed before the paymenthistory.jsp is viewed, to locate the payments associated with the customer requesting the information.
Dynamic Data Display
The purpose of the paymenthistory.jsp template is to display the data specific to a customer's payments for their review. This is accomplished on paymenthistory.jsp using a combination of WebLogic Server JSP tags, Pipeline JSP tags, and accessor methods/attributes.
First, the getPipelineProperty JSP tag retrieves the PAYMENT_HISTORY attribute from the Pipeline session. Table 4-11 provides more detailed information on this attribute.
Attribute |
Type |
Description |
---|---|---|
PipelineSessionConstants.PAYMENT_HISTORY |
List of com.beasys.commerce. |
List of the payments available for the customer. |
Listing 4-5 illustrates how this attribute is retrieved from the Pipeline session using the getPipelineProperty JSP tag.
Listing 4-5 Retrieving the Payment History Attribute
<pipeline:getPipelineProperty
propertyName="<%=PipelineSessionConstants.PAYMENT_HISTORY%>"
returnName="paymentHistory" returnType="java.util.List"
attributeScope="<%=PipelineConstants.REQUEST_SCOPE%>"/>
Note: For more information on the getPipelineProperty JSP tag, see BEA WebLogic Commerce Server Webflow and Pipeline Management.
The data stored within the Pipeline session attribute is then accessed by using accessor methods/attributes within Java scriptlets. Table 4-12 provides more detailed information about these methods/attributes for PaymentTransactionValue.
Method/Attribute |
Description |
---|---|
transactionDate |
The date of the payment transaction. |
transactionId |
Key in the database for the transaction; the payment confirmation number. |
creditCard |
The status of the order. |
transactionAmount |
The splitting preference for the order. |
The creditCard and transactionAmount attributes also have accessor methods/attributes, as shown in Table 4-13 and Table 4-14.
Method/Attribute |
Description |
---|---|
getDisplayNumber() |
Obtains the displayable version of the credit card number (12 Xs and last 4 digits). |
Method/Attribute |
Description |
---|---|
getCurrency() |
Obtains the currency associated with the transaction amount. |
getValue() |
Obtains the value of the transaction amount. |
Listing 4-6 illustrates how these accessor methods/attributes are used within Java scriptlets along with the WebLogic Server JSP tags to display the information.
Listing 4-6 Using Accessor Methods/Attributes Within paymenthistory.jsp Java Scriptlets
<wl:repeat set="<%=paymentHistory%>" id="paymentTransactionValue" type="PaymentTransactionValue" count="100">
<table>
<tr>
<td align="left">
<div class="tabletext">
<%=paymentTransactionValue.transactionDate%>
</div>
</td>
<td align="center">
<div class="tabletext">
<%=paymentTransactionValue.transactionId%>
</div>
</td>
<td align="center">
<div class="tabletext">
<%=paymentTransactionValue.creditCard.getDisplayNumber()%>
</div>
</td>
<td align="right">
<div class="tabletext">
<%=paymentTransactionValue.transactionAmount.getCurrency()%>
<%=WebflowJSPHelper.priceFormat(paymentTransactionValue.
transactionAmount.getValue())%></div>
</td>
</tr>
</table>
</wl:repeat>
Note: For more information on the WebLogic Server JSP tags, see "JSP Tag Reference" in the BEA WebLogic Server Personalization documentation.
Form Field Specification
No form fields are used in the paymenthistory.jsp template.
Input Processors
This section provides a brief description of each input processor associated with the Customer Self-Service JSP template(s).
SelectOrderForViewingIP
Class Name |
com.beasys.commerce.ebusiness.order. |
Description |
Reads the order identifier and uses it to locate an OrderValue object from the ORDER_HISTORY attribute, then places the object in the Pipeline session. |
Required HTTPServletRequest Parameters |
HttpRequestConstants.ORDER_IDENTIFIER |
Required Pipeline |
PipelineSessionConstants.ORDER_HISTORY |
Updated Pipeline |
PipelineSessionConstants.SELECTED_ORDER |
Removed Pipeline |
None |
Validation |
None |
Exceptions |
ProcessingException, thrown when the required Pipeline session attributes are not available. |
Pipeline Components
This section provides a brief description of each Pipeline component associated with the Customer Self-S ervice JSP template(s).
Note: Some Pipeline components extend other, base Pipeline components. For more information on the base classes, see the Javadoc.
RefreshOrderHistoryPC
Class Name |
com.beasys.commerce.ebusiness.order.pipeline. RefreshOrderHistoryPC |
Description |
Uses the USER_NAME Pipeline session attribute to obtain the customer's order history. |
Required Pipeline |
PipelineSessionConstants.USER_NAME |
Updated Pipeline |
PipelineSessionConstants.ORDER_HISTORY |
Removed Pipeline |
None |
Type |
Java class |
JNDI Name |
None |
Exceptions |
PipelineFatalException, thrown when required Pipeline session attributes are not available. |
Class Name |
com.beasys.commerce.ebusiness.order.pipeline. RefreshPaymentHistoryPC |
Description |
Uses the USER_NAME Pipeline session attribute to obtain the customer's payment history. |
Required Pipeline |
PipelineSessionConstants.USER_NAME |
Updated Pipeline |
PipelineSessionConstants.PAYMENT_HISTORY |
Removed Pipeline |
None |
Type |
Java class |
JNDI Name |
None |
Exceptions |
PipelineFatalException, thrown when required Pipeline session attributes are not available. |
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|