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
Class Helper

    java.lang.Object
      |
      +--examples.e2e.b2b.Helper

public class Helper
extends java.lang.Object
implements JspConstants

The `Helper` class provides a collection of static utility methods for the portal. Functionality provided includes:

1. obtaining `RequestState` and `SessionState` objects from the `PipelineSession`.
2. obtaining the `ResourceBundle` for the web application (portal).
3. obtaining the `Locale` for the portal.
4. obtaining the currency name and currency `java.text.NumberFormat` for the portal.
5. obtaining the values for various `HttpServletRequest` parameters.

Field Summary
`static java.lang.String` | `CURRENCY_KEY` This constant is used as a key to retrieve the currency string from the portals `ResourceBundle`.
`static java.lang.String` | `ISO_3166` `ResourceBundle` property for designating the language for a `Locale`.
`static java.lang.String` | `ISO_639` `ResourceBundle` property for designating the language for a `Locale`.
`static java.lang.String` | `STATE_KEY` `STATE_KEY` is used in conjunction with `STATE_NAMESPACE` to retrieve `RequestState` and `SessionState` objects from the `PipelineSession`
`static java.lang.String` | `STATE_NAMESPACE` `STATE_NAMESPACE` is used in conjunction with `STATE_KEY` to retrieve `RequestState` and `SessionState` objects from the `PipelineSession`

Method Summary
`static java.util.ResourceBundle` | `getBundle()` Obtains the `ResourceBundle` for this web application.
`static java.lang.String` | `getCurrency()` Provides the currency string associatied with this portal (web application).
`static java.text.NumberFormat` | `getCurrencyNumberFormat()` Returns the `java.text.NumberFormat` associated with the `Locale` for this portal (web application).
`static java.lang.String` | `getDayParameter(javax.servlet.http.HttpServletRequest request)` Obtains the `String` describing the desired delivery day for the QPA.
`static java.util.Locale` | `getLocale()` Provides the `Locale` object associatied with this portal (web application).
`static java.lang.String` | `getMonthParameter(javax.servlet.http.HttpServletRequest request)` Obtains the `String` describing the desired delivery month offset for the QPA.
`static java.lang.String` | `getPartParameter(javax.servlet.http.HttpServletRequest request)` Obtains the `String` describing the part chosen by the user in the part inventory portlet.
`static PipelineSession` | `getPipelineSession(javax.servlet.http.HttpServletRequest request)` Obtains the ``PipelineSession`` associated with the specified servlet request.
`static java.lang.String` | `getPortletEvent(javax.servlet.http.HttpServletRequest request)` Obtains the portlet webflow event for the given request.
`static java.lang.String` | `getProductParameter(javax.servlet.http.HttpServletRequest request)` Obtains the `String` describing the product chosen by the user in the product inventory portlet.
`static java.lang.String` | `getQuantityParameter(javax.servlet.http.HttpServletRequest request)` Obtains the `String` describing the quantity of product to be quoted.
`static java.lang.String` | `getQuoteParameter(javax.servlet.http.HttpServletRequest request)` Obtains the `String` containing a quote identifier the identifies the quote selected by the user in the quote portlet.
`static RequestState` | `getRequestState(PipelineSession session, java.lang.Object requestContext)` Obtain the ``RequestState`` from the ``PipelineSession`` supplied.
`static SessionState` | `getSessionState(PipelineSession session)` Obtain the ``SessionState`` from the ``PipelineSession`` supplied.
`static java.lang.String` | `getUnitPriceParameter(javax.servlet.http.HttpServletRequest request)` Obtains the `String` describing the desired unit price for the QPA.
`static java.lang.Object` | `getWebflowContext(javax.servlet.http.HttpServletRequest request)` Obtains the webflow request context object for this servlet request.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### STATE_KEY

    public static final java.lang.String STATE_KEY

  `STATE_KEY` is used in conjunction with `STATE_NAMESPACE` to retrieve `RequestState` and `SessionState` objects from the `PipelineSession`

### STATE_NAMESPACE

    public static final java.lang.String STATE_NAMESPACE

  `STATE_NAMESPACE` is used in conjunction with `STATE_KEY` to retrieve `RequestState` and `SessionState` objects from the `PipelineSession`

### CURRENCY_KEY

    public static final java.lang.String CURRENCY_KEY

  This constant is used as a key to retrieve the currency string from the portals `ResourceBundle`.
  See Also:
    `getCurrency()`

### ISO_639

    public static final java.lang.String ISO_639

  `ResourceBundle` property for designating the language for a `Locale`. The `Locale` is used for formatting text in the web application. The base file containing the resources is `<web app directory>/portlets/b2b.properties`.

### ISO_3166

    public static final java.lang.String ISO_3166

  `ResourceBundle` property for designating the language for a `Locale`. The `Locale` is used for formatting text in the web application. The base file containing the resources is `<web app directory>/portlets/b2b.properties`.

Method Detail

### getBundle

    public static java.util.ResourceBundle getBundle()
                                              throws java.util.MissingResourceException

  Obtains the `ResourceBundle` for this web application. The bundle name is defined as `JspConstants.localizedPropertiesFile`.

  Returns:
    the `ResourceBundle` for this web application.
  Throws:
    `MissingResourceException` - if the resource cannot be obtained.

### getCurrency

    public static java.lang.String getCurrency()
                                        throws java.util.MissingResourceException

  Provides the currency string associatied with this portal (web application). The value is obtained through a resource bunlde and is therefore localizable. The base file containing the resources is `<web app directory>/portlets/b2b.properties`.

  Returns:
    a string representing the currency for this portal.
  Throws:
    `MissingResourceException` - if the resource cannot be obtained.

### getLocale

    public static java.util.Locale getLocale()

  Provides the `Locale` object associatied with this portal (web application). The value is obtained through a resource bundle and is therefore localizable. The base file containing the resources is `<web app directory>/portlets/b2b.properties`. Set the property keys defined in this class by constants `ISO_639` and `ISO_3166` to configure the `Locale` as necessary.

  Returns:
    `Locale` object for this portal. If the properties are not defined the resource file the default `Locale` for the JVM will be returned.
  Throws:
    `MissingResourceException` - if the resource cannot be obtained.

### getCurrencyNumberFormat

    public static java.text.NumberFormat getCurrencyNumberFormat()

  Returns the `java.text.NumberFormat` associated with the `Locale` for this portal (web application).

### getPipelineSession

    public static PipelineSession getPipelineSession(javax.servlet.http.HttpServletRequest request)

  Obtains the ``PipelineSession`` associated with the specified servlet request.

### getWebflowContext

    public static java.lang.Object getWebflowContext(javax.servlet.http.HttpServletRequest request)

  Obtains the webflow request context object for this servlet request. The request context disambiguates two requests associated with the same `HttpSession`.

  See Also:
    `PipelineSession`

### getRequestState

    public static RequestState getRequestState(PipelineSession session,
                                               java.lang.Object requestContext)
                                        throws ProcessingException

  Obtain the ``RequestState`` from the ``PipelineSession`` supplied. The ``STATE_NAMESPACE`` and ``STATE_KEY`` along with the `requestContext` are used as inputs to the ``PipelineSession`` when retrieving the ``RequestState``.

  Parameters:
    `session` - the ``PipelineSession`` from which to obtain the ``RequestState``.
    `requestContext` - the webflow request context to use when retrieving the ``RequestState``.
  Returns:
    a ``RequestState`` object associated with the given webflow request context. If a ``RequestState`` object does not exist in the ``PipelineSession`` a new object will be created, added to the ``PipelineSession`` and returned to the caller.
  Throws:
    ProcessingException - if a new ``RequestState`` object is created but an exception is encounted when adding the object to the ``PipelineSession``. The exception thrown by the ``PipelineSession`` is passed along to the caller.

### getSessionState

    public static SessionState getSessionState(PipelineSession session)
                                        throws ProcessingException

  Obtain the ``SessionState`` from the ``PipelineSession`` supplied. The ``STATE_NAMESPACE`` and ``STATE_KEY`` are used as inputs to the ``PipelineSession`` when retrieving the ``SessionState``.

  Parameters:
    `session` - the ``PipelineSession`` from which to obtain the ``SessionState``.
  Returns:
    a ``SessionState`` obtained from ``PipelineSession``. If a ``SessionState`` object does not exist in the ``PipelineSession`` a new object will be created, added to the ``PipelineSession`` and returned to the caller.
  Throws:
    ProcessingException - if a new ``SessionState`` object is created but an exception is encounted when adding the object to the ``PipelineSession``. The exception thrown by the ``PipelineSession`` is passed along to the caller.

### getPortletEvent

    public static java.lang.String getPortletEvent(javax.servlet.http.HttpServletRequest request)

  Obtains the portlet webflow event for the given request.

  Parameters:
    `request` - the `HttpServletRequest` for which to obtain the portlet event.
  See Also:
    `PortalAppflowConstants.PORTLET_WEBFLOW_EVENT_PARAMETER`

### getProductParameter

    public static java.lang.String getProductParameter(javax.servlet.http.HttpServletRequest request)

  Obtains the `String` describing the product chosen by the user in the product inventory portlet. The value is obtained from the `HttpServletRequest` as a parameter using the key `JspConstants.PRODUCT_PARAMETER`.

  See Also:
    `ProductInventory`

### getPartParameter

    public static java.lang.String getPartParameter(javax.servlet.http.HttpServletRequest request)

  Obtains the `String` describing the part chosen by the user in the part inventory portlet. The value is obtained from the `HttpServletRequest` as a parameter using the key `JspConstants.PART_PARAMETER`.

  See Also:
    `PartInventory`

### getQuantityParameter

    public static java.lang.String getQuantityParameter(javax.servlet.http.HttpServletRequest request)

  Obtains the `String` describing the quantity of product to be quoted. This value is entered in the QPA portlet form. The value is obtained from the `HttpServletRequest` as a parameter using the key `JspConstants.QTY_PARAMETER`.

  See Also:
    `QpaProcessor`, `QPA`

### getUnitPriceParameter

    public static java.lang.String getUnitPriceParameter(javax.servlet.http.HttpServletRequest request)

  Obtains the `String` describing the desired unit price for the QPA. This value is entered in the QPA portlet form. The value is obtained from the `HttpServletRequest` as a parameter using the key `JspConstants.UNIT_PRICE_PARAMETER`.

  See Also:
    `QpaProcessor`, `QPA`

### getMonthParameter

    public static java.lang.String getMonthParameter(javax.servlet.http.HttpServletRequest request)

  Obtains the `String` describing the desired delivery month offset for the QPA. This value is entered in the QPA portlet form. The value is obtained from the `HttpServletRequest` as a parameter using the key `JspConstants.MONTH_PARAM`.

  See Also:
    `QpaProcessor`, `QPA`

### getDayParameter

    public static java.lang.String getDayParameter(javax.servlet.http.HttpServletRequest request)

  Obtains the `String` describing the desired delivery day for the QPA. This value is entered in the QPA portlet form. The value is obtained from the `HttpServletRequest` as a parameter using the key `JspConstants.DAY_PARAM`.

  See Also:
    `QpaProcessor`, `QPA`

### getQuoteParameter

    public static java.lang.String getQuoteParameter(javax.servlet.http.HttpServletRequest request)

  Obtains the `String` containing a quote identifier the identifies the quote selected by the user in the quote portlet. The value is obtained from the `HttpServletRequest` as a parameter using the key `JspConstants.QUOTE_PARAM`.

  See Also:
    `QuoteProcessor`

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