Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jasig.portal
Class ChannelRuntimeData

    java.lang.Object
      java.util.Dictionary
          java.util.Hashtable
              org.jasig.portal.ChannelRuntimeData

All Implemented Interfaces:
  java.io.Serializable, java.lang.Cloneable, java.util.Map

    public class ChannelRuntimeData

extends java.util.Hashtable
implements java.lang.Cloneable

A set of runtime data accessible by a channel.

Version:
  $Revision: 1.49.2.2 $
Author:
  Peter Kharchenko
See Also:
  Serialized Form

Field Summary
`private java.lang.String` | `baseActionURL`
`private BrowserInfo` | `binfo`
`static java.lang.String` | `CAR_BASE`
`private UPFileSpec` | `channelUPFile`
`private java.lang.String` | `httpRequestMethod`
`private java.lang.String` | `keywords`
`private java.util.Locale[]` | `locales`
`private static org.apache.commons.logging.Log` | `log`
`private java.lang.String` | `remoteAddress`
`private boolean` | `renderingAsRoot`
`private boolean` | `targeted`
`private static java.lang.String` | `TRADITIONAL_MEDIA_BASE`
`static java.lang.String` | `WEB_APP_BASE`

Constructor Summary
`ChannelRuntimeData()` Default empty constructor

Method Summary
`java.lang.Object` | `clone()` Create a new instance of ourself Used by the CError channel
`private java.lang.String` | `createBaseCarMediaURL()` Creates the CAR media base URL.
`java.lang.String` | `getBaseActionURL()` Returns a baseActionURL - parameters of a request coming in on the baseActionURL will be placed into the ChannelRuntimeData object for channel's use.
`java.lang.String` | `getBaseActionURL(boolean idempotent)` Returns a baseActionURL - parameters of a request coming in on the baseActionURL will be placed into the ChannelRuntimeData object for channel's use.
`java.lang.String` | `getBaseMediaURL(java.lang.Class aChannelClass)` Returns a media base appropriate for web-visible resources used by and deployed with the passed in class.
`java.lang.String` | `getBaseMediaURL(java.lang.Object aChannelObject)` Returns a media base appropriate for web-visible resources used by and deployed with the passed in object.
`java.lang.String` | `getBaseMediaURL(java.lang.String resourcePath)` Returns a media base appropriate for the resource path passed in.
`java.lang.String` | `getBaseWorkerURL(java.lang.String worker)` Returns the URL to invoke one of the workers specified in PortalSessionManager.
`java.lang.String` | `getBaseWorkerURL(java.lang.String worker, boolean idempotent)` Returns the URL to invoke one of the workers specified in PortalSessionManager.
`BrowserInfo` | `getBrowserInfo()` Provides information about a user-agent associated with the current request/response.
`java.lang.String` | `getFnameActionURL(java.lang.String fname)` Returns an idempotent URL that includes a single query parameter that targets a channel for focus mode by functional name.
`java.lang.String` | `getHttpRequestMethod()` Get HTTP request method (i.e.
`java.lang.String` | `getKeywords()` Returns the keywords
`java.util.Locale[]` | `getLocales()` Accessor method for ordered set of locales.
`java.lang.Object` | `getObjectParameter(java.lang.String pName)` Obtain an `Object` parameter value.
`java.lang.Object[]` | `getObjectParameterValues(java.lang.String pName)` Obtain all values for a given parameter as `Object`s.
`java.lang.String` | `getParameter(java.lang.String pName)` Get a parameter value.
`java.util.Enumeration` | `getParameterNames()` Get an enumeration of parameter names.
`java.util.Map` | `getParameters()` Get the parameters as a Map
`java.lang.String[]` | `getParameterValues(java.lang.String pName)` Obtain all values for a given parameter.
`java.lang.String` | `getRemoteAddress()`
`UPFileSpec` | `getUPFile()` Get the UPFileSpec
`boolean` | `isRenderingAsRoot()` Tells whether or not the channel is rendering as the root of the layout.
`boolean` | `isTargeted()` Tells whether or not the channel is currently targeted.
`void` | `setBaseActionURL(java.lang.String baseActionURL)` Sets the base action URL.
`void` | `setBrowserInfo(BrowserInfo bi)` Setter method for browser info object.
`void` | `setHttpRequestMethod(java.lang.String method)` Set the HTTP Request method.
`void` | `setKeywords(java.lang.String keywords)` Sets the keywords
`void` | `setLocales(java.util.Locale[] locales)` Setter method for array of locales.
`void` | `setParameter(java.lang.String key, com.oreilly.servlet.multipart.Part value)`
`void` | `setParameter(java.lang.String pName, java.lang.String value)` Establish a parameter name-value pair.
`void` | `setParameters(java.util.Map params)` A convenience method for setting a whole set of parameters at once.
`void` | `setParametersSingleValued(java.util.Map params)` A convenience method for setting a whole set of parameters at once.
`com.oreilly.servlet.multipart.Part[]` | `setParameterValues(java.lang.String pName, com.oreilly.servlet.multipart.Part[] values)`
`java.lang.String[]` | `setParameterValues(java.lang.String pName, java.lang.String[] values)` Sets multi-valued parameter.
`void` | `setRemoteAddress(java.lang.String string)`
`void` | `setRenderingAsRoot(boolean rar)` Sets whether or not the channel is rendering as the root of the layout.
`void` | `setTargeted(boolean targeted)` Sets whether or not the channel is currently targeted.
`void` | `setUPFile(UPFileSpec upfs)` Set a UPFileSpec which will be used to produce baseActionURL and workerActionURL.
`java.lang.String` | `toString()`

Methods inherited from class java.util.Hashtable
`clear, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, values`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### log

    private static final org.apache.commons.logging.Log log

### binfo

    private BrowserInfo binfo

### locales

    private java.util.Locale[] locales

### channelUPFile

    private UPFileSpec channelUPFile

### baseActionURL

    private java.lang.String baseActionURL

### httpRequestMethod

    private java.lang.String httpRequestMethod

### remoteAddress

    private java.lang.String remoteAddress

### keywords

    private java.lang.String keywords

### renderingAsRoot

    private boolean renderingAsRoot

### targeted

    private boolean targeted

### TRADITIONAL_MEDIA_BASE

    private static final java.lang.String TRADITIONAL_MEDIA_BASE

See Also:
  Constant Field Values

### CAR_BASE

    public static final java.lang.String CAR_BASE

See Also:
  Constant Field Values

### WEB_APP_BASE

    public static final java.lang.String WEB_APP_BASE

Constructor Detail

### ChannelRuntimeData

    public ChannelRuntimeData()

  Default empty constructor

Method Detail

### clone

    public java.lang.Object clone()

  Create a new instance of ourself Used by the CError channel

  Overrides:
    `clone` in class `java.util.Hashtable`
  Returns:
    crd the cloned ChannelRuntimeData object

### setUPFile

    public void setUPFile(UPFileSpec upfs)

  Set a UPFileSpec which will be used to produce baseActionURL and workerActionURL.

  Parameters:
    `upfs` - the UPFileSpec

### getUPFile

    public UPFileSpec getUPFile()

  Get the UPFileSpec

  Returns:
    channelUPFile the UPFileSpec

### setHttpRequestMethod

    public void setHttpRequestMethod(java.lang.String method)

  Set the HTTP Request method.

  Parameters:
    `method` - a `String` value

### getHttpRequestMethod

    public java.lang.String getHttpRequestMethod()

  Get HTTP request method (i.e. GET, POST)

  Returns:
    a `String` value

### setBaseActionURL

    public void setBaseActionURL(java.lang.String baseActionURL)

  Sets the base action URL. This was added back in for the benefit of web services. Not sure if it is going to stay this way.

  Parameters:
    `baseActionURL` - the base action URL

### setRenderingAsRoot

    public void setRenderingAsRoot(boolean rar)

  Sets whether or not the channel is rendering as the root of the layout.

  Parameters:
    `rar` - `true` if channel is rendering as the root, otherwise `false`

### setTargeted

    public void setTargeted(boolean targeted)

  Sets whether or not the channel is currently targeted. A channel is targeted if an incoming request specifies the channel's subscribe ID as the targeted node ID.

  Parameters:
    `targeted` - `true` if channel is targeted, otherwise `false`

### setBrowserInfo

    public void setBrowserInfo(BrowserInfo bi)

  Setter method for browser info object.

  Parameters:
    `bi` - a browser info associated with the current request

### getBrowserInfo

    public BrowserInfo getBrowserInfo()

  Provides information about a user-agent associated with the current request/response.

  Returns:
    a `BrowserInfo` object ecapsulating various user-agent information.

### setLocales

    public void setLocales(java.util.Locale[] locales)

  Setter method for array of locales. A channel should make an effort to render itself according to the order of the locales in this array.

  Parameters:
    `locales` - an ordered list of locales

### getLocales

    public java.util.Locale[] getLocales()

  Accessor method for ordered set of locales.

  Returns:
    locales an ordered list of locales

### setParameters

    public void setParameters(java.util.Map params)

  A convenience method for setting a whole set of parameters at once. The values in the Map must be object arrays. If (name, value[]) is in the Map, then a future call to getParameter(name) will return value[0].

  Parameters:
    `params` - a `Map` of parameter names to parameter value arrays.

### setParametersSingleValued

    public void setParametersSingleValued(java.util.Map params)

  A convenience method for setting a whole set of parameters at once. The Map should contain name-value pairs. The name should be a String and the value should be either a String or a Part. If (name, value) is in the Map then a future call to getParameter(name) will return value.

  Parameters:
    `params` - a `Map` of parameter names to parameter value arrays.

### setParameterValues

    public java.lang.String[] setParameterValues(java.lang.String pName,
                                                 java.lang.String[] values)

  Sets multi-valued parameter.

  Parameters:
    `pName` - parameter name
    `values` - an array of parameter values
  Returns:
    an array of parameter values

### setParameter

    public void setParameter(java.lang.String pName,
                             java.lang.String value)

  Establish a parameter name-value pair.

  Parameters:
    `pName` - parameter name
    `value` - parameter value

### setParameterValues

    public com.oreilly.servlet.multipart.Part[] setParameterValues(java.lang.String pName,
                                                                   com.oreilly.servlet.multipart.Part[] values)

### setParameter

    public void setParameter(java.lang.String key,
                             com.oreilly.servlet.multipart.Part value)

### getBaseActionURL

    public java.lang.String getBaseActionURL()

  Returns a baseActionURL - parameters of a request coming in on the baseActionURL will be placed into the ChannelRuntimeData object for channel's use.

  Returns:
    a value of URL to which parameter sequences should be appended.

### getBaseActionURL

    public java.lang.String getBaseActionURL(boolean idempotent)

  Returns a baseActionURL - parameters of a request coming in on the baseActionURL will be placed into the ChannelRuntimeData object for channel's use.

  Parameters:
    `idempotent` - a `boolean` value specifying if a given URL should be idepotent.
  Returns:
    a value of URL to which parameter sequences should be appended.

### getFnameActionURL

    public java.lang.String getFnameActionURL(java.lang.String fname)

  Returns an idempotent URL that includes a single query parameter that targets a channel for focus mode by functional name. Additional query parameters appended will be passed to the focused channel via the channel's ChannelRuntimeData object.

  Returns:
    a value of URL including a single query parameter.
  Since:
    2.5.1

### getBaseWorkerURL

    public java.lang.String getBaseWorkerURL(java.lang.String worker)

  Returns the URL to invoke one of the workers specified in PortalSessionManager. Typically the channel that is invoked with the worker will have to implement an interface specific for that worker.

  Parameters:
    `worker` - - Worker string must be a UPFileSpec.xxx value.
  Returns:
    URL to invoke the worker.

### getBaseMediaURL

    public java.lang.String getBaseMediaURL(java.lang.Object aChannelObject)
                                     throws PortalException

  Returns a media base appropriate for web-visible resources used by and deployed with the passed in object. If the class of the passed in object was loaded from a CAR then a URL appropriate for accessing images in CARs is returned. Otherwise, a URL to the base media in the web application's document root is returned.

  Throws:
    `PortalException`

### getBaseMediaURL

    public java.lang.String getBaseMediaURL(java.lang.Class aChannelClass)
                                     throws PortalException

  Returns a media base appropriate for web-visible resources used by and deployed with the passed in class. If the class of the passed in object was loaded from a CAR then a URL appropriate for accessing images in CARs is returned. Otherwise, a URL to the base media in the web application's document root is returned.

  Throws:
    `PortalException`

### getBaseMediaURL

    public java.lang.String getBaseMediaURL(java.lang.String resourcePath)
                                     throws PortalException

  Returns a media base appropriate for the resource path passed in. The resource path is the path to the resource within its channel archive. (See org.jasig.portal.car.CarResources class for more information.) If the passed in resourcePath matches that of a resource loaded from CARs then this method returns a URL appropriate to obtain CAR deployed, web-visible resources. Otherwise it returns a URL to the traditional media path under the uPortal web application's document root.

  Throws:
    `PortalException`

### createBaseCarMediaURL

    private java.lang.String createBaseCarMediaURL()
                                            throws PortalException

  Creates the CAR media base URL.

  Throws:
    `PortalException`

### getBaseWorkerURL

    public java.lang.String getBaseWorkerURL(java.lang.String worker,
                                             boolean idempotent)
                                      throws PortalException

  Returns the URL to invoke one of the workers specified in PortalSessionManager. Typically the channel that is invoked with the worker will have to implement an interface specific for that worker.

  Parameters:
    `worker` - - Worker string must be a UPFileSpec.xxx value.
    `idempotent` - a `boolean` value sepcifying if a URL should be idempotent
  Returns:
    URL to invoke the worker.
  Throws:
    `PortalException` - if an error occurs

### isRenderingAsRoot

    public boolean isRenderingAsRoot()

  Tells whether or not the channel is rendering as the root of the layout.

  Returns:
    `true` if channel is rendering as the root, otherwise `false`

### isTargeted

    public boolean isTargeted()

  Tells whether or not the channel is currently targeted. A channel is targeted if an incoming request specifies the channel's subscribe ID as the targeted node ID.

  Returns:
    `true` if channel is targeted, otherwise `false`

### getParameter

    public java.lang.String getParameter(java.lang.String pName)

  Get a parameter value. If the parameter has multiple values, only the first value is returned.

  Parameters:
    `pName` - parameter name
  Returns:
    parameter value

### getObjectParameter

    public java.lang.Object getObjectParameter(java.lang.String pName)

  Obtain an `Object` parameter value. If the parameter has multiple values, only the first value is returned.

  Parameters:
    `pName` - parameter name
  Returns:
    parameter value

### getParameterValues

    public java.lang.String[] getParameterValues(java.lang.String pName)

  Obtain all values for a given parameter.

  Parameters:
    `pName` - parameter name
  Returns:
    an array of parameter string values

### getObjectParameterValues

    public java.lang.Object[] getObjectParameterValues(java.lang.String pName)

  Obtain all values for a given parameter as `Object`s.

  Parameters:
    `pName` - parameter name
  Returns:
    a vector of parameter `Object[]` values

### getParameterNames

    public java.util.Enumeration getParameterNames()

  Get an enumeration of parameter names.

  Returns:
    an `Enumeration` of parameter names.

### getParameters

    public java.util.Map getParameters()

  Get the parameters as a Map

  Returns:
    a Map of parameter name-value pairs

### setKeywords

    public void setKeywords(java.lang.String keywords)

  Sets the keywords

  Parameters:
    `keywords` - a String of keywords

### getKeywords

    public java.lang.String getKeywords()

  Returns the keywords

  Returns:
    a String of keywords, null if there were none

### getRemoteAddress

    public java.lang.String getRemoteAddress()

  Returns:
    the remote address

### setRemoteAddress

    public void setRemoteAddress(java.lang.String string)

  Parameters:
    `string` -

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.util.Hashtable`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD