Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2002 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## examples.e2e.b2b.processors
Class QuoteProcessor

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

public class QuoteProcessor
extends AbstractProcessor

The `QuoteProcessor` runs business logic for the price quote portlet (pricequote.portlet). This class handles the following portlet webflow events (See `PortalAppflowConstants.PORTLET_WEBFLOW_EVENT_PARAMETER`) directed to the price quote portlet:

1. selectQuote
2. bea.portal.framework.internal.refresh
3. null

Events are acted upon by the `process()` method of this class.

The "selectQuote" portlet webflow event indicates that the user has selected a quote from the price quote portlet. The `StateValue` from `SessionState` must be `StateValue.QPA_SENT` or an `IllegalStateException` will be thrown. If a quote was not selected an ``InvalidFormDataException`` will be thrown so the portlet can re-display the quotes to the user. Otherwise, he `examples.e2e.common.PurchaseQuote` for the selected quote is added to the `SessionState` for the user. On successful complettio the `StateValue` of the `SessionState` is set to `StateValue.CREATE_PO` and a value of `Constants.READ_ONLY` is returned by the `process()` method.

The "bea.portal.framework.internal.refresh" and "null" events are handled identically. When encountered the processsor returns an appropriate response based on the `StateValue` of the `SessionState`.

If the `StateValue` is `StateValue.START` or `StateValue.PRODUCT_SELECTED` or `StateValue.PART_SELECTED` a value of `Constants.NOT_SELECTED` is returned by `process()`.

If the `StateValue` is `StateValue.QPA_SENT` and the quote XML file (see `BuyerFactory.QUOTE_FILE`) exists, the quotes are parsed, added to the `RequestState` and a value of `Constants.DISPLAY` is returned by `process()`. If the quote XML does not exist and the timeout (see `QpaProcessor.TIMEOUT_PROP`) has expired a value of `Constants.TIMEOUT` is returned by `process()`. If the quote XML does not exist and the timeout (see `QpaProcessor.TIMEOUT_PROP`) has NOT expired a value of `Constants.NO_DATA` is returned by `process()`.

Otherwise a value of `Constants.READ_ONLY` is returned by `process()`.

Constructor Summary
`QuoteProcessor()` Constructs a 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 events for the price quote 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

### QuoteProcessor

    public QuoteProcessor()

  Constructs a 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 events for the price quote 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.
  Returns:

    if a "selectQuote" event is valid and successfully processed `Constants.READ_ONLY` is returned.

    The a "bea.portal.framework.internal.refresh" or "null" event is processed the value returned is based on the `StateValue` of the `SessionState`.

    1. If the `StateValue` is `StateValue.START` or `StateValue.PRODUCT_SELECTED` or `StateValue.PART_SELECTED` a value of `Constants.NOT_SELECTED` is returned. `process()`.
    2. If the `StateValue` is `StateValue.QPA_SENT` and the quote XML file (see `BuyerFactory.QUOTE_FILE`) exists a value of `Constants.DISPLAY` is returned.
    3. If the `StateValue` is `StateValue.QPA_SENT`, the quote XML file (see `BuyerFactory.QUOTE_FILE`) does NOT exist and the quote timeout has expired `Constants.TIMEOUT` is returned.
    4. If the `StateValue` is `StateValue.QPA_SENT`, the quote XML file (see `BuyerFactory.QUOTE_FILE`) does not exist and the quote timeout has NOT expired `Constants.NO_DATA` is returned.
    5. Otherwise a value of `Constants.READ_ONLY` is returned.
  Throws:
    IllegalStateException - will be thrown for the following errors:

    1. If the "selectQuote" event is encountered but the `StateValue` is NOT `StateValue.QPA_SENT`.
    2. If the "selectQuote" event is encountered but the quote identifier provided in the `HttpServletRequest` is not valid.
    3. If the "selectQuote" event is encountered but the quote file does not exist or does not contain any quotes.
    ParsingException - if unable to parse the quote file.
    InvalidFormDataException - if no quote identifier accompanied the request.
  Overrides:
    process in class AbstractProcessor

Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2002 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002 BEA Systems, Inc. All Rights Reserved