BEA Logo BEA WLCS Release 3.5

  BEA Home  |  Events  |  Solutions  |  Partners  |  Products  |  Services  |  Download  |  Developer Center  |  WebSUPPORT

 

   WLCS Documentation   |   Creating Portals and Portlets   |   Previous Topic   |   Next Topic   |   Contents   |   Index

Advanced Portal Topics

 

This chapter describes how to deploy your portal as a Web application and use Webflow within 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 and WebLogic Personalization Server software.

 


Deploying New Portals as Web Applications

Beginning with WebLogic Server version 6.0, all public HTML-based applications must be deployed as Web applications. The sample applications shipped with this product are all Web applications and serve as examples to follow.

Building a New Portal Web Application Using the Portal Framework

In the following steps, you will create a new portal called `myAcme' within the wlcsApp application. You can use this procedure to create new portals with any name you choose:

  1. Create a new Web application directory named myAcme by copying and pasting the exampleportal directory and renaming it myAcme in the wlcsApp directory.

  2. Delete any _tmp* directories and the classes directory in the
    myAcme/WEB-INF directory. (Optional)

  3. Edit the config.xml file in the wlcsDomain directory and add the following entry within the <Application Deployed="true" Name="wlcsApp"....> element:
            <WebAppComponent Name="myAcme"
    ServletReloadCheckSecs="300" Targets="wlcsServer"
    URI="myAcme"/>

  4. Start the WebLogic Commerce Server.

  5. Use the Portal Administration tool to create a new portal myAcme; make desired portlets visible.

  6. Use the Property Set Administration tool to create a new Application Init property set named myAcme. Change the portalName property value to myAcme and save the property set.

  7. Enter the following URL in your browser:
    http://localhost:7501/myAcme

You have successfully deployed your portal as a Web application.

For a detailed discussion of these steps, see Creating the Framework for Your Custom Portal in Building a Custom Portal Step-by-Step.

 


Using Webflow Within a Portal

In WebLogic Commerce Server, Webflow is a feature that allows you to string together JavaServer Page (JSP) files, input processors (IPs) and pipelines (PLs) 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.

Using Input Processors and Pipeline Processors from Within a Portlet

The first requirement of Webflow is that your site must be deployed as a Web application. For more information, refer to the section Deploying New Portals as Web Applications. Once you have deployed your portal as a Web application, follow these steps:

  1. Start your server and log on to the administration client.

  2. Navigate to the Property Set Manager. Click on your property set to edit it.

  3. You need to use a special destination determiner. Edit your destinationdeterminer property, and set it to be:
    com.beasys.commerce.Webflow.WLCSPortalDestinationDeterminer.

  4. In a text editor, open or create your Webflow.properties located in your %WL_COMMERCE_HOME% folder.

    In this folder, you need to create transitions from your portlet to input processors and pipeline processors. It is important to understand that the destination determiner 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:

    destinmyportlet.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 destination determiner to forward to the URL specified in the request.

    In WebLogic Commerce Server, you may have only one Web application 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.

  5. Test your portal.

If you successfully completed all the steps in this exercise, you should now have Webflow working within your portal.

 


Cache Control in the Portal

When a portal is accessed by large numbers of users, its performance is affected dramatically by the caching scheme employed. There are many areas in the WebLogic Commerce Server product where caching is utilized. This section describes one scheme used by the portal framework.

The Flow Manager Cache Tags

The portal framework uses the Flow Manager cache tags <fm:> to cache various portal objects that are required frequently (during each page hit on the portal) but are not modified as often. The Flow Manager cache tags are described in detail in the chapter "Personalization Server JSP Tag Library Reference" in the Guide to Building Personalized Applications.

The Flow Manager Caching Scheme Helps to Manage Performance

The Flow Manager caching scheme is also sensitive to the underlying performance characteristics of the WebLogic server. It is tempting for JSP developers to use the HttpSession as a temporary cache to store objects. However, if you plan to scale your application deployment on a WebLogic cluster, overuse of the HttpSession is costly in terms of performance since its contents are replicated across the clustered nodes. The Flow Manager maintains its own cache and does not store objects into the HttpSession.

The Parameters Governing the Flow Manager Cache

The caching scheme allows you to set a global attribute which makes the object you cache accessible to other users via the same name. You may also limit the accessibility of the object by setting the scoped attribute. This prepends the Flow Manager's servlet name (application for the default portal) to the object's name, providing a Web application scope. Finally, you can limit the scope to the `current user only' by setting the global attribute to false.

The parameters governing the Flow Manager cache are located in the weblogicCommerce.properties file, as follows:

#cache of session values
_sessionCache.ttl=900000
_sessionCache.capacity=10000
_sessionCache.enabled=true

#cache of values across multiple users
_globalCache.ttl=600000
_globalCache.capacity=1000
_globalCache.enabled=true

The first set of parameters is used when the global attribute is set to false, the second set is used when true.

Portal Framework Objects Stored in the Cache

The following portal framework objects are stored in the cache:

Table 6-1 Portal Framework Objects Stored in the Cache

Object

Scope

com.beasys.commerce.portal.Portal

scope = global

com.beasys.commerce.portal.Portlet[][]

scope = global if user not logged in, else scope is user

com.beasys.commerce.portal.PortalColumnInformation[]

scope = global


 

 

back to top previous page next page