© 2002 BEA Systems, Inc.


examples.e2e.b2b.processors
Class ProductInventory

java.lang.Object
  |
  +--com.bea.portal.appflow.processor.AbstractPortalProcessor
        |
        +--examples.e2e.b2b.processors.AbstractProcessor
              |
              +--examples.e2e.b2b.processors.ProductInventory

public class ProductInventory
extends AbstractProcessor

The ProductInventory processor runs business logic for the product inventory portlet (productinventory.portlet).

This class handles the following portlet webflow events (See PortalAppflowConstants.PORTLET_WEBFLOW_EVENT_PARAMETER) directed to the product inventory portlet:

  1. selectProduct
  2. reset
  3. bea.portal.framework.internal.refresh
  4. null
All paths through the process() method first call the InventoryProvider EJB to obtain a List of products and stores the List in the RequestState object for the current request.

The "selectProduct" portlet webflow event indicates that the user has selected a particular product from the list displayed in the portlet. The Helper.getProductParameter(javax.servlet.http.HttpServletRequest) method is used to obtain the product id from the HttpServletRequest. The product id is compared against the List of products obtained via the InventoryProvider EJB, and the matching Inventory object is stored in the user's SessionState. Following the successful completion of the aforementioned work the StateValue of the SessionState is set to StateValue.PRODUCT_SELECTED and a value of Constants.DISPLAY is returned to the caller.

The "reset" portlet webflow event is used to restart the purchasing process, typically after a purchase order has been submitted and an acknowledgement has been received from the corresponding supplier. When this event is encountered by the process() method the StateValue of the SessionState is set to StateValue.START, XML and data files are deleted and a value of Constants.DISPLAY is returned to the caller.

The "bea.portal.framework.internal.refresh" and "null" portlet webflow events simply return Constants.DISPLAY after obtaining the List of products from the InventoryProvider EJB.


Constructor Summary
ProductInventory()
          Constructs a new processor.
 
Method Summary
 java.lang.Object process(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, PortalRequest portalRequest, java.lang.Object requestContext, PipelineSession session, RequestState rState, SessionState sState)
          Processes webflow events directed to the product inventory portlet (productinventory.portlet).
 
Methods inherited from class examples.e2e.b2b.processors.AbstractProcessor
getAppflowEvent, getInventoryProvider, getParts, getPipelineSession, getPortalEvent, getPortletEvent, getProducts, getPurchaseManager, getRequestState, getSessionState, getTimeoutCalendar, isPortletMaximized, process, submitPO, submitQPA
 
Methods inherited from class com.bea.portal.appflow.processor.AbstractPortalProcessor
getCurrentPortletState, process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProductInventory

public ProductInventory()
Constructs a new processor.
Method Detail

process

public java.lang.Object process(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response,
                                PortalRequest portalRequest,
                                java.lang.Object requestContext,
                                PipelineSession session,
                                RequestState rState,
                                SessionState sState)
                         throws ProcessingException
Processes webflow events directed to the product inventory portlet (productinventory.portlet).

Parameters:
request - an HttpServletRequest to process.
response - the HttpServletRequest associated with the request.
portalRequest - the PortalRequest associated with this http request.
requestContext - the webflow request context.
session - the PipelineSession object associated with this request.
requestState - the RequestState associated with this http request.
sessionState - the SessionState associated with this user session.
Throws:
IllegalStateException - if the product id supplied for a "selectProduct" event is not found in the List of products retrieved from the InventoryProvider EJB.
E2EProcessingException - if unable to create or call the InventoryProvider EJB.
Overrides:
process in class AbstractProcessor

© 2002 BEA Systems, Inc.

Copyright © 2002 BEA Systems, Inc. All Rights Reserved