bea.com | products | dev2dev | support | askBEA

Download Docs | Site Map | Glossary
Search

Commerce and Campaign Features Tour

Registered User Buys a Product

Because you were impressed by the large selection and low prices when you visited the e-commerce Web site, you decide to return and buy a drill for a friend who is starting a home improvement project. Your return trip to the Web site takes you along the following path:

- Registered User Roadmap

Note: Consider opening the Registered User Roadmap link in a separate browser window; you may want to refer to it frequently during the tour.

- Step 1: Browse the Catalog and Select an Item

- Step 2: Review the Shopping Cart and Check Out

- Detour: Review the Home Page for Authenticated Users

- Step 3: Choose Shipping Options

- Step 4: Enter and Select a New Shipping Address

- Step 5: Select a Credit Card

- Step 6: Purchase the Items

- Step 7: Review Order Confirmation

Note: In this chapter, the product name is referred to as WebLogic Portal. If you are licensed for BEA Campaign services, this product package includes Commerce services.

Registered User Roadmap

Before starting this section of the tour, review the following maps of the JSP templates (Figure 4-1, Figure 4-2, and Figure 4-3). The arrows in the maps represent navigation options that Webflow provides; the darker arrows show the path that this section of the tour describes.

Figure 4-1 JSPs for Browsing the Catalog

Figure 4-2 JSPs for the Shopping Cart and User Login

Figure 4-3 JSPs for Completing the Order

Step 1: Browse the Catalog and Select an Item

If you are not still logged in to the tour, log in again. When you arrive at the Home page for your return shopping trip, you decide to browse for drills in the catalog.

To continue the tour...

Click Power Tools.

When you click Power Tools, WebLogic Portal displays the contents of the Power Tools category in browse.jsp (see Figure 4-4).

Features of browse.jsp (Part 1 of 2)

Figure 4-4 Second Level of the Catalog

Notice the following features of browse.jsp:

- The file's full pathname is
  <BEA_HOME>/weblogic700/samples/portal/wlcsDomain/beaApps/wlcsApp/wlcs/commerce/catalog/browse.jsp (UNIX)

- Pipeline JSP tags query the product catalog for a list of sibling categories. The name of the current category and links to its siblings are displayed above the category name.

- A JSP tag in the center column constructs a tree view from the current category to the top level of the catalog:

<jsp:include page="/commerce/catalog/includes/navigation.jsp" flush="true"/>

- Listing 4-1 shows that browse.jsp includes a JSP file that the Catalog generates to describe the contents of the current category.

Listing 4-1 Catalog Tags to Display Current Category

>     	<!-- main content -->

>     	<%-- Get the summary JSP from the current category --%>

>     	<catalog:getProperty object="<%= category %>"

>     		propertyName="Jsp"

>     		id="displayJsp"

>     		returnType="com.beasys.commerce.ebusiness.catalog.JspInfo"/>

>     	<%-- Include the category layout JSP for this category --%>

>     	<jsp:include page="<%= displayJsp.getUrl() %>" flush="true"/>

To continue the tour...

Click Drills.

When you click Drills, WebLogic Portal displays the contents of the Drills category in browse.jsp (see Figure 4-5).

More Features of browse.jsp (Part 2 of 2)

Figure 4-5 Third Level of the Catalog

Notice the following additional features of browse.jsp:

- It is the same source file that Figure 4-4 illustrates, but the content is different because the user's context is different.

- The Pipeline JSP tags query the product catalog for the list of sibling categories. Because the page now displays a category different from the category illustrated in Figure 4-4, the list changes.

- In the center column, the JSP tags modify the tree view to reflect the current category.

- In the second row of the center column, the Catalog generates a different JSP file than in Figure 4-4, hence the contents and layout in Figure 4-5 changes.

- All the items in the drill category are displayed using category and summary JSPs. Each drill includes a link to detailed product information.

To continue the tour...

Click the name of a drill.

When you click the name of a drill, WebLogic Portal displays a product description in details.jsp (see Figure 4-6).

Features of details.jsp

Figure 4-6 Item Details

Notice the following features of details.jsp:

- The file's full pathname is
  <BEA_HOME>/weblogic700/samples/portal/wlcsDomain/beaApps/wlcsApp/wlcs/commerce/catalog/details.jsp (UNIX)

- It can be accessed from either browse.jsp or searchresults.jsp (see Figure 4-1).

- It includes a JSP file (navigation2.jsp) that constructs a tree view only if users access the page from browse.jsp. If the Pipeline mechanism determines that a user accessed the page from searchresults.jsp, the JSP file does not construct the tree view.

- It includes a summary JSP file for the item being displayed. The product catalog generates this summary JSP file based on the information it stores about the item.

To continue the tour...

Click Add to Cart.

Step 2: Review the Shopping Cart and Check Out

When you click Add to Cart, WebLogic Portal displays your selections in shoppingcart.jsp (see Figure 4-7).

Figure 4-7 Shopping Cart

For a description of shoppingcart.jsp, see Features of shoppingcart.jsp.

To continue the tour...

Click Check Out.

When you click Check Out, WebLogic Portal prompts you to log in (see Figure 4-8). Because you created a user profile in New User Buys a Product, you are now a registered user.

Figure 4-8 Log In

For a description of login.jsp, see Features of login.jsp.

Technical Note: The Security Model

How does WebLogic Portal determine if users must log in when they click a link? Instead of using Webflow to implement security, WebLogic Portal follows the J2EE specification for security. With this specification, the Web site administrator determines which set of files can be accessed only by authenticated users. By default, all JSP templates below the order and user directories can be accessed only by authenticated users.

When an anonymous user tries to access one of these files, WebLogic Portal displays login.jsp, from which the user can either log in or create a new user account. After authentication, Webflow determines the remaining succession of pages.

To continue the tour...

Enter the username and password you set up in Step 4: Create a New User Profile. Then click Log In.

When you click Log In, WebLogic Portal displays shipping options in shipping.jsp (see Figure 4-9).

Figure 4-9 Shipping Page Detour

For a description of shipping.jsp, see Features of shipping.jsp.

Taking a detour...

Before continuing the tour, take a minute to review the Home page. Now that you have logged in (authenticated), the Home page shows options that are available only to authenticated users.

To take the detour, click Home (see Figure 4-9).

Detour: Review the Home Page for Authenticated Users

When you click Home, WebLogic Portal displays main.jsp (see Figure 4-10).

Features of main.jsp for Authenticated Users

Figure 4-10 Home Page for Authenticated Users

Notice the following features of main.jsp:

- Now that you are authenticated, main.jsp displays your username along with links to your order and payment history. If a name is associated with the Pipeline session, User Management JSP tags in the leftside.inc file query the database for your username and display the results.

>     From the header.inc file

>     <%-- Get the username --%>

>     <pipeline:getPipelineProperty
>     propertyName="<%= PipelineSessionConstants.USER_NAME %>"
>     returnName="userName"
>     returnType="String" />

>     <%-- if the user is not null, get the customer's profile --%>

>     <% if(userName != null) { %>

>     <um:getProfile profileKey="<%=request.getRemoteUser()%>" profileType="WLCS_Customer" />

>     <% } %>

>     From the leftside.inc file

>     <%-- Get the username. The customer 's profile should have already been loaded --%>
>     <%-- obtained from the um:getProfile tag in the header.inc --%>

>     <pipeline:getPipelineProperty
>     propertyName="<%= PipelineSessionConstants.USER_NAME %>"
>     returnName="userName"
>     returnType="String" />

>     <% if (userName != null && userName.length() != 0) { %>

>     <p><b>Welcome<br>

>     <um:getPropertyAsString
>     propertyName="firstName" />
>     <um:getPropertyAsString
>     propertyName="lastName" /></b></p>

>     <p>&nbsp;&nbsp;<a href="<%=

>     WebflowJSPHelper.createWebflowURL(pageContext, pageContext.getAttribute("AboutFileName") + ".jsp", "link(viewCustomerProfile)", true) %>">View Profile</a></p>

>     <p>&nbsp;&nbsp;<a href="<%= WebflowJSPHelper.createWebflowURL(pageContext, "main.jsp", "link(logout)", true) %>">Logout</a></p>

>     <div class="mid" align="center">
>     <img src="<%=WebflowJSPHelper.createGIFURL(request, response, "/commerce/images/left_rule.gif")%>" width="120" height="14" align="absmiddle"></div>

>     <p><b>View History</b></p>

>     <p>&nbsp;&nbsp;<a href="<%= WebflowJSPHelper.createWebflowURL(pageContext, "main.jsp", "link(viewOrderHistory)", true)%>">Orders</a></p>

>     <p>&nbsp;&nbsp;<a href="<%= WebflowJSPHelper.createWebflowURL(pageContext, "main.jsp", "link(viewPaymentHistory)", true) %>">Payments</a></p>

>     <div class="mid" align="center">
>     <img src="<%=WebflowJSPHelper.createGIFURL(request, response, "/commerce/images/left_rule.gif")%>" width="120" height="14" align="absmiddle"></div>

>     <% } %>

>     <%-- End of log-in conditional links. --%>

To continue the tour...

1. Click View Cart.

2. In the shopping cart, click Check Out.

Step 3: Choose Shipping Options

When you click Check Out from shoppingcart.jsp, WebLogic Portal displays shipping options in shipping.jsp (see Figure 4-9).

For a description of shipping.jsp, see Features of shipping.jsp.

To continue the tour...

From shipping.jsp, click Continue.

Step 4: Enter and Select a New Shipping Address

When you click Continue in shipping.jsp, WebLogic Portal displays shipping addresses in selectaddress.jsp.

To ship the item to someone other than yourself, you must enter a new address.

For a description of selectaddress.jsp, see Features of selectaddress.jsp.

To continue the tour...

Click Add Address.

When you click Add Address, WebLogic Portal prompts you to enter a new shipping address in addaddress.jsp (see Figure 4-11).

Figure 4-11 Enter the New Address

To continue the tour...

Enter an address that contains the following information:

- City: Denver

- Zip Code: 80212

- Country: United States

Then click Save.

This particular zip code spans multiple tax jurisdictions. Later in this step of the tour, you must select which tax jurisdiction applies.

When you click Save, WebLogic Portal displays the addresses from your user profile in selectaddress.jsp (see Figure 4-12).

Figure 4-12 Select the New Address

For a description of selectaddress.jsp, see Features of selectaddress.jsp.

To continue the tour...

Click Use next to the Denver, CO address that you created.

When you click Use, the Pipeline sends data to a Taxation Service. Because the zip code 80212 covers different tax jurisdictions, WebLogic Portal prompts you to choose a specific area within the zip code from selecttaxcaddress.jsp (see Figure 4-13).

Features of selecttaxaddress.jsp

Figure 4-13 Select Tax Jurisdiction

Note the following features of selecttaxaddress.jsp:

- The file's full pathname is
  <BEA_HOME>/weblogic700/samples/portal/wlcsDomain/beaApps/wlcsApp/wlcs/commerce/order/selecttaxaddress.jsp (UNIX)

- It uses a Pipeline JSP tag to collect the tax jurisdiction data from the Pipeline session.

- It uses Java scriptlets and HTML to display and format the data.

- Clicking Use sends data to the WebLogic Portal Taxation Service for tax calculation.

To continue the tour...

Click Use next to an address.

Step 5: Select a Credit Card

When you click Use, WebLogic Portal displays payment.jsp, which lists the credit cards in your user profile (see Figure 4-14).

Figure 4-14 Select a Credit Card

For a description of payment.jsp, see Features of payment.jsp.

To continue the tour...

Click Use.

Step 6: Purchase the Items

When you click Use in payment.jsp, WebLogic Portal displays the final purchase information in checkout.jsp (see Figure 4-15).

Figure 4-15 Purchase the Items

For a description of checkout.jsp, see Features of checkout.jsp.

To continue the tour...

Click Complete Purchase.

Step 7: Review Order Confirmation

When you click Complete Purchase, WebLogic Portal completes the purchase and displays the confirmation number in confirmorder.jsp (see Figure 4-16).

Figure 4-16 Review the Order Confirmation

For a description of confirmorder.jsp, see Features of confirmorder.jsp.

To continue the tour...

This concludes the tour for a registered user buying a product.

To continue the tour of the JSP templates, click View Profile in the header and go to Registered User Adds a Credit Card.