uPortal 2.4.1
API Documentation

org.jasig.portal
Class ChannelRuntimeData

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended byorg.jasig.portal.ChannelRuntimeData
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class ChannelRuntimeData
extends java.util.Hashtable
implements java.lang.Cloneable

A set of runtime data accessible by a channel.

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

Constructor Summary
ChannelRuntimeData()
          Default empty constructor
 
Method Summary
 java.lang.Object clone()
          Create a new instance of ourself Used by the CError channel
 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 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 Objects.
 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 Reqeust 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.
 
Methods inherited from class java.util.Hashtable
clear, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, remove, size, toString, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

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

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 Reqeust 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.

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

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 Objects.

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 -

uPortal 2.4.1
API Documentation