![]() |
![]() |
|
|
Using the Catalog Application in a Portal
This chapter describes how to deploy your portal as a webapp, add e-commerce features such as site security and user authorization, use Webflow within a portal,and use pieces of the demo catalog application in a portal.
This topic includes the following sections:
Note: Throughout this chapter, the environment variable WL_COMMERCE_HOME is used to indicate the directory in which you installed the WebLogic Commerce Server 3.1 and WebLogic Personalization Server 3.1 software.
Deploying a Portal as a Webapp
To build a portal webapp using the Portal Framework, follow these steps:
Note: If you do not already have a web.xml file, you may copy the one in webapps/admin/WEB-INF. You must remove the security-constraint and security-role elements from the document.
If you are using tag libraries, copy the tag library descriptor files (*.tld) into the WEB-INF directory. Also copy the portal framework .tld files from portal/WEB-INF/*.tld.
<jsp:forward page="/application/Example" />
where Example should be replaced by the name of your property set.
weblogic.httpd.webApp.wlcs=
Copy this line and paste the copy below the original. Change the word "wlcs" to be the name of your webapp. There are two occurences of "wlcs", you must change both.
Click on the property set name to edit it. You will need to change the following properties:
defaultdest = your portal's main page
homepage = your portal's main page
workingdir = /
PORTAL_NAME = Example
TTL = set low during development, then restore when deploying for service.
You have successfully deployed your portal as a webapp.
Using e-Commerce Functionality Within a Portal
This section discusses the scenerio in which you want to have a portal as the entry point for your users, but also wish to build e-Commerce functionality into your application. An example of this case might be a portal with one portlet showing the user's shopping cart, another portlet allowing a search of the product catalog, and a third portlet showing the user's order history.
An immediate requirement of this type of site is that it be deployed as a web application. This is a requirement of the Commerce components, and therefore this requirement also applies to a portal that includes Commerce components. Before you can begin adding e-Commerce features to your portal, you must deploy your portal as a webapp. This involves a number of steps, including the creation of a web.xml file. For more information, see the previous section Deploying a Portal as a Webapp.
Once your portal is a web application, a major issue to consider is site security. The Portal Framework includes its own security model. Portal page security constraints are defined by personalization rules, the Portal Administrator tools, and the Portal end user personalization tools. The declaritive security model of J2EE is much too simplistic for a portal deployment. For instance, when a user who belongs to more than one group logs onto a portal, the portal needs to be able to query the user on which group to use for personalization. This query action cannot be implemented when declaritive security is employed. Therefore, when working with portals, you should avoid creating security constraints in the web application's web.xml file.
Another security issue is user authentication. When implementing your site, you will want single sign-on capabilities. To do this, the Portal Framework and Commerce features will share the login. To this end, the Portal Framework must perform the login request. Additionally, the Commerce features require the user's unified user type to be WLCS_Customer.
Finally, there are several configuration requirements when assembling your portal. This includes deploying your site as a web application, and also the use of a special Destination Determiner.
The purpose of this section is to guide you step-by-step through the issues discussed previously. As you proceed through the steps, a brief explanation is given. For a more thorough explanation of an individual step, consult the relevent documentation.
Follow these steps before employing Commerce features in your portal:
Using Webflow Within a Portal
In WebLogic Commerce Server with WebLogic Personalization Server, Webflow is a feature that allows you to string together JavaServer Page (JSP) files, input processors (IPs) and pipeline processors (PPs) without hard coding the linkage between them. Instead, the linkage is defined in an external Webflow properties file.
Something to consider is how Webflow works with portals. When using Webflow, your users are conducted through a number of complete JSP pages as they work through a process. The portal, on the other hand, generally keeps the user on a single portal page, while the contents of that page (the portlets) change state. Due to this difference, in the current implementation, you cannot use the Webflow feature of page transitions while you employ the Portal Framework. But you can utilize the power of input processors and pipeline processors from within a portlet. This section details how to do this.
The first requirement of Webflow is that your site must be deployed as a webapp. The first step of this process is to create and deploy your portal as a webapp, as described in the section Using e-Commerce Functionality Within a Portal.
Once you have deployed your portal as a webapp, follow these steps:
com.beasys.commerce.Webflow.WLCSPortalDestinationDeterminer.
In this folder, you need to create transitions from your portlet to input processors and pipeline processors. It is important to understand that the WLCSDestinationDeterminer will route the flow from your portlet to the input processors and pipeline processors. Once Webflow has traversed through the IPs and PPs, it will forward the request to the URL that you specify in the Webflow method call in your portlet JSP (this will be discussed later). An example Webflow property file is as follows:
myportlet.jsp.link(mylink) = myportlet.inputprocessor
myportlet.inputprocessor.success = myportlet.pipeline
myportlet.pipeline.success = myportlet2.pipeline
In this example, once Webflow has traversed through the second pipeline processor, it will allow the default destionation determiner to forward to the URL specified in the request.
In WebLogic Commerce Server with WebLogic Personalization Server, you may have only one webapp that is Webflow enabled. You must identify the property set to be used by Webflow. Do this by adding the following section to your web.xml file located in your web-inf folder:
<context-param>
<param-name>WLCS_APPLICATION_URL</param-name>
<param-value>/application/commercewf</param-value>
</context-param>
Replace commercewf with the name of your property set.
Finally, you need to connect to Webflow from your portlet. In your portlet JSP, you must make a call to createWebflowURL. In this call, you must specify two parameters. Specify a parameter called portalized as true, and a parameter called dest with the URL that Webflow should go to after it has finished. For example:
myportlet.jsp
<%@ page import="com.beasys.commerce.webflow.*" %>
<%@ page extends="com.beasys.commerce.portal.admin.PortalJspBase"%>
<form method="POST"
action="<%= WebflowJSPHelper.createWebflowURL(
pageContext,
"portlet.jsp",
"link(mylink)",
"&portalized=true&dest=/portal.jsp",
true) %>">
...
</form>
In this example, when the user clicks the Submit button the request will be forwarded to the destination of the myportlet.jsp.link(mylink) transition. Once Webflow has finished with all input processors and pipeline processors it has found there, it will forward to portal.jsp. Your dest parameter should refer to your portal page and not your portlet.
If you successfully completed all the steps in this exercise, you should now have Webflow working within your portal.
Reusing Pieces of the Demo Catalog Application in a Portal
If you start your commerce server and use a browser to navigate to http://localhost:7501/application/wlcs, you can experiment with the WebLogic Commerce Server with WebLogic Personalization Server sample catalog application. There are some useful pieces of functionality in this sample application that you may want to build into your portal site as a portlet. This section explains how to do this.
First, note that the WebLogic Commerce Server with WebLogic Personalization Server catalog application relies on Webflow. Therefore, you must integrate Webflow with your portal. See Using Webflow Within a Portal. Also, the Catalog application uses Commerce features, so you must prepare your portal as described in the section Using e-Commerce Functionality Within a Portal.
After you have followed those directions, complete the following steps.
Make your portlet extend PortalJspBase by adding the following line to the top of the JSP file:
<%@ page extends="com.beasys.commerce.portal.admin.PortalJspBase"%>
![]() |
![]() |
![]() |
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|