BEA Logo BEA WebLogic Commerce Server Release Beta

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   WebLogic Commerce Server Doc Home   |   Tour of the JSP Templates   |   Previous Topic   |   Next Topic   |   Contents   |   Index

Starting the Tour

 

Note: Before you can start the tour, you or your system administrator must install WebLogic Commerce Server. For installation information, see Installing Commerce Servers.

To see the templates and sample data from a Web browser, do one of the following tasks depending on the type of operating system you use:

Then go to the last topic in this section:

 


Access the Home Page from UNIX

To access the Home page from UNIX, do the following:

  1. If WebLogic Commerce Server is not already running, enter the following command from a WebLogic Commerce Server host:
    $WL_COMMERCE_HOME/StartCommerce.sh

  2. From your workstation, open a Web browser and enter the following URL:
    http://WLCS-host:7501/wlcs

    For example, if the WebLogic Commerce Server host is a workstation named spectacle, enter the following URL in your Web browser:
    http://spectacle:7501/wlcs

    Note: By default, the WebLogic Commerce Server host name is sufficient for the WLCS-host:7501 parameter of the URL. However, if your system administrator changes the weblogic.properties file to require fully qualified domain names, you must supply one. In this case, the URL in Step 2 would change to http://WLCS-host.domain-name:7501/wlcs. For example, if the WebLogic Commerce Server host is a workstation named spectacle and the domain name is sprockets.com, enter the following URL in your Web browser:
    http://spectacle.sprockets.com:7501/wlcs

 


Access the Home Page from Windows

To access the Home page from Windows, do the following:

  1. If WebLogic Commerce Server is not already running, on a WebLogic Commerce Server host do one of the following:

  2. From your computer, open a Web browser and enter the following URL:
    http://WLCS-host:7501/wlcs

    For example, if the WebLogic Commerce Server host is a workstation named spectacle, enter the following URL in your Web browser:
    http://spectacle:7501/wlcs

    Note: By default, the WebLogic Commerce Server host name is sufficient for the WLCS-host:7501 parameter of the URL. However, if your system administrator changes the weblogic.properties file to require fully qualified domain names, you must supply one. In this case, the URL in Step 2 would change to http://WLCS-host.domain-name:7501/wlcs. For example, if the WebLogic Commerce Server host is a workstation named spectacle and the domain name is sprockets.com, enter the following URL in your Web browser:
    http://spectacle.sprockets.com:7501/wlcs

 


Overview of the Home Page

When you access http://WLCS-host:7501/wlcs, your browser displays main.jsp, which is the Web site's home page. Figure 2-1 illustrates the information and navigation options that are available to anonymous users. Registered User Buys a Product, illustrates how main.jsp changes for authenticated users.

Features of main.jsp for Anonymous Users (Part 1 of 2)

Figure 2-1 Home Page for Anonymous Users

Notice the following features of main.jsp:

Technical Note: Importing Tag Libraries and Java Packages

Each JSP template that uses JSP tags begins with a set of lines that import tag libraries. Listing 2-1 shows main.jsp importing Pipeline, Catalog (cat), and User Management (um) tag libraries.

Listing 2-1 Importing Tag Libraries


<%@ taglib uri="pipeline.tld" prefix="pipeline" %>
<%@ taglib uri="cat.tld" prefix="catalog" %>
<%@ taglib uri="um.tld" prefix="um" %>


For a description of JSP tags and tag libraries that the JSP templates use, refer to the following sections:

Likewise, templates that use Java classes must import Java packages. Listing 2-2 shows main.jsp importing Java packages.

Listing 2-2 Importing Java Packages


<%@ page import="com.beasys.commerce.webflow.*" %>
<%@ page import="com.beasys.commerce.foundation.pipeline.*" %>
<%@ page import="com.beasys.commerce.ebusiness.catalog.*" %>
<%@ page import="com.beasys.commerce.webflow.tags.WebFlowTagConstants" %>
<%@ page import="com.beasys.commerce.axiom.contact.*" %>
<%@ page import="com.beasys.commerce.ebusiness.customer.*" %>


More Features of main.jsp for Anonymous Users (Part 2 of 2)

Figure 2-2 Top Level of the Product Catalog

main.jsp is also the top level of the product catalog. Notice the following features of the catalog's top level:

Technical Note: The Product Catalog

WebLogic Commerce Server provides a database schema and set of build scripts for implementing a product catalog. The schema and scripts define commonly used features and attributes found on Web-based catalog sites. For example, the schema specifies metadata that you use to establish a hierarchy of product categories and items. You can use this hierarchy to display product data based on a user's current location in the catalog. Figure 2-2 shows the content that WebLogic Commerce Server generates for the top level of the hierarchy.

Listing 2-3 shows the JSP tags in main.jsp that query the product catalog for categories and display the query results. The listing also shows other HTML elements for formatting and displaying content. (If you are not familiar with JSP syntax, look only at the comment tags, which are surrounded by <%-- and --%>.)

Listing 2-3 JSP Tags that Query the Product Catalog


<%-- Get the top category from the PipelineSession. --%>

<pipeline:getPipelineProperty propertyName="<%= PipelineSessionConstants.CATALOG_CATEGORY %>"
returnName="topCategory"
returnType="com.beasys.commerce.ebusiness.catalog.Category"
attributeScope="<%= PipelineConstants.REQUEST_SCOPE %>"/>

<%-- Get the subcategories of the top category from the PipelineSession. --%>

<pipeline:getPipelineProperty propertyName="<%= PipelineSessionConstants.CATALOG_CATEGORIES %>"
returnName="subcategories"
returnType="com.beasys.commerce.ebusiness.catalog.ViewIterator"
attributeScope="<%= PipelineConstants.REQUEST_SCOPE %>"/>

<%-- Iterate through all the subcategories, one category at a time, and list the name of each category --%>
<p class="head1">Store Catalog</p>
<ul type="square">

<%-- Declare a String containing common browse parameters --%>
<%! static final String commonParameters = "&" +
HttpRequestConstants.CATALOG_SOURCE_KEY + "=" + PipelineSessionConstants.CATALOG_CATEGORIES + "&" +
HttpRequestConstants.CATALOG_DESTINATION_KEY + "=wlcs_siblings&"; %>

<catalog:iterateViewIterator iterator="<%= subcategories %>" id="currentCategory" returnType="com.beasys.commerce.ebusiness.catalog.Category">
<% String browseParameters = commonParameters +
HttpRequestConstants.CATALOG_CATEGORY_ID + "=" + currentCategory.getKey().getIdentifier(); %>
<div class="head2">
<li>
<a href="<%= WebflowJSPHelper.createWebflowURL(pageContext, "main.jsp", "link(browse)", browseParameters, true) %>">
<catalog:getProperty object="<%= currentCategory %>" propertyName="Name"/>
</a>
<br>
</div>

</catalog:iterateViewIterator>

</ul>


WebLogic Commerce Server also includes a utility for importing data from an existing product catalog database, or you can use other utilities to import data. If you already use a catalog system that you prefer to the WebLogic Commerce Server database, you can modify the JSP templates to use your existing catalog system. (However, this low-level modification requires Java programming skills.) For more information about using existing data with WebLogic Commerce Server, see "Using the Product Catalog Database Loader" in Product Catalog Management.

To continue the tour...

Leave main.jsp open in your browser and go to New User Buys a Product. This section shows the JSP templates that new users are likely to encounter.

Other sections of the tour, Registered User Buys a Product, and Registered User Adds a Credit Card, show additional scenarios for using the WebLogic Commerce Server JSP templates.