| com.sun.portal.providers.context.ProviderContext
All known Subclasses: com.sun.portal.desktop.context.PSProviderContext,
ProviderContext | public interface ProviderContext (Code) | | An environment for provider execution. More formally,
this class provides information pertaining to the container that
a provider object executes within. Such information may be specific to
the user, to the web container, or be global (shared between multiple
users). This interface does not define what information falls into
each of these categories; this is left up to the implementation. For
example, it is up to the implementation whether a user's locale
(see getLocaleString()
and getLocale() ) is specific to the user
or is a global for all users.
At runtime, a single provider context object is shared between
all channels in the system. Methods in this interface that target
a specific channel require the channel name to be passed in as
a parameter to the method (see get*Property() ).
Any container channel that wishes to make a provider context available to
its contained leaf channels must do so using an agreed-upon contract between
the container and the leaf channels. Any channels that
extends ProviderAdapter falls
into this category. See the ProviderAdapter
Javadocs for details.
A provider context forms the layer between the services used by the
provider and the provider code. A provider context isolates provider code
from specific service interfaces and implementations.
All methods in this interface may throw errors. Errors are thrown when
a serious problem arises such that a reasonable application either should
not try, or there is no clear way to resolve. The actual object thrown
will be a subclass of Error . This error may be caught,
if it can be handled reasonably in the application.
Applications that wish to try and
resolve such errors may catch Error .
The get*Property() and set*Property() methods
deserve special mention. It is considered a serious error when
an application attempts to get or set a property that does not exist.
Again, an error is thrown from these methods if the property does not exist.
The set of properties that an application uses is a
contract between the persistent store providing the properties and the
application. To avoid application errors,
the exists*Property() methods can be used to check for the
existence of a property. Additionally, the get*Property()
method versions that accept a default value may be used.
There is a 1-1 mapping between a session and a ProviderContext object.
Typically, there is a unique session for every client accessing the Desktop.
However, there are exceptions to this. When accessed in authless mode,
multiple clients access the same ProviderContext object and therefore
the same session.
A subset of methods in
this interface access session functionality.
These include getSessionProperty(), setSessionProperty(),
getSessionID(), and getUserID() .
The getSessionProperty() and setSessionProperty()
methods get and set properties per session,
or per ProviderContext object.
A session property is shared between all clients using the session.
In the case of authless, a session property is shared for all
authless clients.
In some cases it is desirable to set properties such that there is a
1-1 mapping between client and property. An example of this is a
selected tab name. In the case of authless, it would not do to
have the selected tab name shared between all authless clients
because this would cause all authless clients to have the same
selected tab. To set / get properties per accessing client, use the
setClientProperty() and getClientProperty()
methods.
ProviderContext
is a generic interface, the documentation here describes
it in this light. There are implementation classes as well.
To make use of this interface, it is necessary to expose aspects of the
implementation.
While the implementation classes are private,
their semantics are documented.
Please see the iPS product documentation for details.
See Also: com.sun.portal.providers.ProviderAdapter See Also: com.sun.portal.providers.context.ContainerProviderContext |
Method Summary | |
public void | allContentChanged() Flags content for all channels as changed. | public void | contentChanged(String channelName) Flags channel content as changed. | public void | debugError(Object o) Logs a message if the debugging level is "error". | public void | debugError(Object o, Throwable t) Logs a message and stack trace, if the debugging level is "error". | public void | debugMessage(Object o) logs a message if the debugging level is "message" or higher. | public void | debugMessage(Object o, Throwable t) Logs a message and stack trace
if the debugging level is "message" or higher. | public void | debugWarning(Object o) Logs a message if the debugging level is "warning" or higher. | public void | debugWarning(Object o, Throwable t) Logs a message and stack trace if the debugging
level is "warning" or higher. | public String | decodeURLParameter(String dec) | public String | encodeURL(String url) Encodes a URL. | public String | encodeURLParameter(String enc) URL encodes a unicode string
This method is used for encoding multi-byte characters
to be passed as arguments in a URL. | public String | escape(String unescaped) Escapes a String
This method escapes the string using an encoder class that encodes a
specific type of markup. | public boolean | existsBooleanProperty(String channel, String name) Test for the existence of a boolean property.
Parameters: channel - Channel name. Parameters: name - a String , the property name. | public boolean | existsBooleanProperty(String channel, String name, List pflist) Test for the existence of the filtered boolean property.
Filter criteria can be specified using a series of PropertiesFilter
objects. | public boolean | existsCollectionProperty(String channel, String name) Test for the existence of a collection property.
Parameters: channel - Channel name. Parameters: name - a String , the property name. | public boolean | existsCollectionProperty(String channel, String name, List pflist) Test for the existence of the filtered collection property.
Filter criteria can be specified using a series of PropertiesFilter
objects. | public boolean | existsCollectionProperty(String channel, String name, boolean localized) Test for the existence of a collection property. | public boolean | existsIntegerProperty(String channel, String name) Test for the existence of an integer property.
Parameters: channel - Channel name. Parameters: name - a String , the property name. | public boolean | existsIntegerProperty(String channel, String name, List pflist) Test for the existence of the filtered integer property.
Filter criteria can be specified using a series of PropertiesFilter
objects. | public boolean | existsStringProperty(String channel, String name) Test for the existence of a string property.
Parameters: channel - Channel name. Parameters: name - a String , the property name. | public boolean | existsStringProperty(String channel, String name, List pflist) Test for the existence of a filtered string property.
Filter criteria can be specified using a series of PropertiesFilter
objects. | public boolean | existsStringProperty(String channel, String name, boolean localized) Test for the existence of a string property. | public String | getAuthenticationType() Get the authentication type.
The method returns a string denoting the authentication type that was
used for the current session. | public boolean | getBooleanProperty(String channel, String name) Get a boolean property property.
Parameters: channel - Channel name. Parameters: name - Property name. | public boolean | getBooleanProperty(String channel, String name, List pflist) Get the filtered boolean property property.
Filter criteria can be specified using a series of PropertiesFilter
objects. | public boolean | getBooleanProperty(String channel, String name, boolean def) Get a boolean property property.
This method returns a default value if the
property does not exist.
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: def - Default value. | public boolean | getBooleanProperty(String channel, String name, boolean def, List pflist) Get the filtered boolean property property.
This method returns a default value if the
property does not exist.
Filter criteria can be specified using a series of PropertiesFilter
objects. | public String | getCharset() Get the character set. | public String | getClassName(String channel) Get the class name for the provider class that this object will be
providing an environment for. | public List | getClientAndLocalePropertiesFilters() Get the client and locale in the form of PropertiesFilter 's.
Each client and locale suffix is used to create PropertiesFilter .
Note that by default, the PropertiesFilter objects return
in the list are constructed with their "required" flag set to
false . | public String | getClientPath() Get the client path.
The client path is one of several components used to lookup Desktop
templates and JSPs. | public List | getClientPropertiesFilters() Get the client PropertiesFilter 's.
The hierarchy of client PropertiesFilter is returned.
Note that by default, the PropertiesFilter objects return
in the list are constructed with their "required" flag set to
false . | public List | getClientPropertiesFilters(String clientType) Get the client PropertiesFilter 's for a given clientType.
The hierarchy of client PropertiesFilter is returned.
Note that by default, the PropertiesFilter objects return
in the list are constructed with their "required" flag set to
false . | public String | getClientProperty(String name) Get a client property.
Client properties are specific to the particular client
accessing the portal, not to the ProviderContext object
used to access them.
Client properties are only guaranteed to persist for the
life of the request, although typically they will
persist for the life of the session.
Parameters: name - a String , the property name. | public String | getClientType() Get the client type. | public Set | getClientTypeProperties(String clientType, String key) Get a set of client type properties for the given client type.
Parameters: clientType - Client type to get the property keys from. Parameters: key - Property key. | public String | getClientTypeProperty(String key) Get a client type property for the user's client type.
Parameters: key - Property key. | public String | getClientTypeProperty(String clientType, String key) Get a client type property for the given client type.
Parameters: clientType - Client type to get the property from. Parameters: key - Property key. | public Map | getCollectionProperty(String channel, String name) Get a collection property.
Here, a collection is used to refer to a multi-value property.
Depending on the context, it is either the analogue of
Java Maps or List . | public Map | getCollectionProperty(String channel, String name, Map def) Get a collection property.
This method returns a default value if the
property does not exist.
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: def - Default value. | public Map | getCollectionProperty(String channel, String name, List pflist) Get the filtered Collection property.
Filter criteria can be specified using a series of PropertiesFilter
objects. | public Map | getCollectionProperty(String channel, String name, Map def, List pflist) Get the filtered Collection property.
This method returns a default value if the property does not exist.
Filter criteria can be specified using a series of PropertiesFilter
objects. | public Map | getCollectionProperty(String channel, String name, boolean localized) Get the localized version of a collection property.
Locales are searched from more to less
specific. | public Map | getCollectionProperty(String channel, String name, Map def, boolean localized) Get the localized version of a collection property. | public String | getConfigProperty(String key) Get the named configuration property.
Parameters: key - a String , the property name. | public String | getContentType() Get the content type. | public String | getDefaultChannelName() Get the default channel name.
This method returns the channel name from the session
using getSessionProperty if exists. | public String | getDefaultClientType() Get the default client type. | public String | getDesktopType() Get the Desktop type.
The Desktop type, or also known as template type, is a string that
is one of several indexes used to lookup Desktop templates and JSP
files. | public String | getDesktopURL(HttpServletRequest req) Get the Desktop URL. | public String | getDesktopURL(HttpServletRequest req, Map query, Map pathInfo) Get the Desktop URL. | public String | getDesktopURL(HttpServletRequest req, Map query, Map pathInfo, boolean escape) Get the Desktop URL. | public String | getDesktopURL(HttpServletRequest req, String query, boolean escape) Get the Desktop URL. | public int | getIntegerProperty(String channel, String name) Get an integer property.
Parameters: channel - Channel name. Parameters: name - Property name. | public int | getIntegerProperty(String channel, String name, List pflist) Get the filtered integer property.
Filter criteria can be specified using a series of PropertiesFilter
objects. | public int | getIntegerProperty(String channel, String name, int def) Get an integer property.
This method returns a default value if the
property does not exist.
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: def - Default value. | public int | getIntegerProperty(String channel, String name, int def, List pflist) Get an integer property.
This method returns a default value if the
property does not exist.
Filter criteria can be specified using a series of PropertiesFilter
objects. | public Locale | getLocale() Get the locale. | public List | getLocalePropertiesFilters() Get the locale in the form of PropertiesFilter 's.
Each locale suffix is used to create PropertiesFilter .
Note that by default, the PropertiesFilter objects return
in the list are constructed with their "required" flag set to
false . | public String | getLocaleString() Get the string form of the locale. | public String | getLoginURL() Get the login URL. | public String | getLogoutURL() Get the logout URL.
The result of making a connection to the logout URL is typcically
the termination of the user's session. | public Iterator | getNames(String channel) Get property names for the channel.
Parameters: channel - Channel name. | public String | getParentContainerName(String channel) Get the display container name for the named channel.
A display container visually holds another channel.
This method returns the parent container name in which
this channel is contained on the desktop page.
returns null if this channel is the parent container or if
this method is called outside getContent() in
Provider class.
A channel only has a display container when it is being visually
displayed within a container channel. | public Object | getProperty(String channel, String name) Get a property. | public Object | getProperty(String channel, String name, Object def) Get a property. | public String | getProviderName(String channel) Get the name of the provider that backs the channel that this object
provides an environment for.
The format of the provider name is implementation dependent.
The provider name is not necessarily equal to the provider class name
(see getProviderClassName() ).
Parameters: channel - Channel name. | public int | getProviderVersion(String channel) Get the version of the provider schema for the named channel. | public StringBuffer | getRequestServer(HttpServletRequest req) Get the request server.
This is a replacement for
HttpUtils.getRequestURL() because the version of
that method does not use the
Host HTTP header field to reconstruct the URL.
The difference in this
version is that it grabs the servername:port
from the Host header if it is
there.
Parameters: req - HTTP request object to grab the server information from. | public Set | getRoles() Get the roles the user is in. | public ServletConfig | getServletConfig() Get the Servlet Config. | public ServletContext | getServletContext() Get the Servlet Context. | public String | getSessionID() Get the unique session identifier.
The format of the return value is implementation specific. | public Object | getSessionProperty(String name) Get a session property.
There is a 1-1 mapping between a session and a ProviderContext
object. | public String | getStaticContentPath() Get the URI prefix to web server static content.
Static content may be located separately from dynamic content
such as servlets and JSP.
This
URI prefix is used to access static web content such as
images and HTML files. | public String | getStringAttribute(String name) Get a string attribute.
"Attributes" are settings that are not
channel-specific. | public String | getStringAttribute(String name, Locale locale) Get a localised string attribute if available.
"Attributes" are settings that are not
channel-specific. | public String | getStringProperty(String channel, String name) Get a String property.
Parameters: channel - Channel name. Parameters: name - Property name. | public String | getStringProperty(String channel, String name, List pflist) Get the filtered String property.
Filter criteria can be specified using a series of PropertiesFilter
objects. | public String | getStringProperty(String channel, String name, List pflist, boolean exact) Get the filtered String property.
Filter criteria can be specified using a series of PropertiesFilter
objects. | public String | getStringProperty(String channel, String name, String def) Get a String property. | public String | getStringProperty(String channel, String name, String def, List pflist) Get the filtered String property.
This method returns a default value if the property does not exist.
Filter criteria can be specified using a series of PropertiesFilter
objects. | public String | getStringProperty(String channel, String name, boolean localized) Get the localized version of a String property.
Locales are searched from more to less
specific. | public String | getStringProperty(String channel, String name, String def, boolean localized) Get the localized version of a String property.
This method returns a default value if the
property does not exist.
Locales are searched from more to less
specific. | public StringBuffer | getTemplate(String name, String file) Get a desktop template.
The actual template buffer returned is based on the Desktop type,
locale, channel, client type, and the template name.
Parameters: name - Channel name Parameters: file - Template name to return. | public StringBuffer | getTemplate(String desktopType, String locale, String name, String clientType, String file, String baseDir) Get a desktop template.
The actual template buffer returned is based on the Desktop type,
locale, channel, client type, and the template name.
Parameters: desktopType - Desktop type. Parameters: locale - Locale. Parameters: name - Channel name. Parameters: cilentType - client type. Parameters: file - Template name to return. Parameters: baseDir - the base directory from which the lookup mechanismbegins its lookup. | public StringBuffer | getTemplate(String name, String file, Hashtable table) Get and tag swaps a desktop template.
The actual template buffer returned is based on the the name,
locale, client path, and Desktop type.
Parameters: name - Channel name Parameters: file - Template name to return Parameters: table - Tag table to use for tag swapping. | public StringBuffer | getTemplate(String desktopType, String locale, String name, String clientType, String file, Hashtable table, String baseDir) Get and tag swaps a desktop template.
The actual template buffer returned is based on the the name,
locale, client path, and Desktop type.
Parameters: desktopType - Desktop type. Parameters: locale - Locale. Parameters: name - Channel name. Parameters: cilentType - client type. Parameters: file - Template name to return. Parameters: table - Tag table to use for tag swapping. Parameters: baseDir - the base directory from which the lookup mechanismbegins its lookup. | public File | getTemplateMostSpecificPath(String name, String file) Get the most specific template path for the given channel name and the
given template name. | public File | getTemplateMostSpecificPath(String desktopType, String locale, String name, String clientType, String file, String baseDir) Get the most specific template path for the given channel name and the
given template name. | public File | getTemplatePath(String name, String file) Get the template path for the given channel name and the given
template name.
If non-null, the key returned by this method will map to a valid
template file. | public File | getTemplatePath(String desktopType, String locale, String name, String clientType, String file, String baseDir) Get the template path for the given channel name and the given
template name.
If non-null, the key returned by this method will map to a valid
template file. | public String | getTopChannelName(HttpServletRequest req) Get the top channel name. | public String | getUserID() Get the user identifier.
The format of the return value is implementation specific. | public void | init(HttpServletRequest req) Initialize this provider context.
The request object must contain the service specific data to allow
the underlying implementation to be initialized. | public boolean | isAuthless(HttpServletRequest req) Get if the current Desktop session is non-authenticated (authless).
Authless Desktop sessions are created by the Desktop and are not subject
to the normal authentication process that is required for authenticated
Desktop sessions. | public boolean | isDebugEnabled() | public boolean | isDebugErrorEnabled() | public boolean | isDebugMessageEnabled() Get if the debug level is set to message or higher. | public boolean | isDebugWarningEnabled() Get if the debug level is set to warning or higher. | public void | refresh() Causes Provider Context to throw away any cached data. | public void | setBooleanProperty(String channel, String name, boolean value) Sets a boolean property. | public void | setBooleanProperty(String channel, String name, boolean value, List pflist) Sets a boolean property according to the given filter criteria.
Filter criteria can be specified using a series of PropertiesFilter
objects. | public void | setClientProperty(String name, String value) Set a client property.
Client properties are specific to the particular client
accessing the portal, not to the ProviderContext object
used to access them. | public void | setCollectionProperty(String channel, String key, Map val) Sets a collection property.
Parameters: channel - Channel name. Parameters: key - Property name. Parameters: value - Property value. | public void | setCollectionProperty(String channel, String key, Map val, List pflist) Sets a collection property according to the given filter criteria.
Filter criteria can be specified using a series of PropertiesFilter
objects. | public void | setCollectionProperty(String channel, String name, List value) Sets a collection property. | public void | setCollectionProperty(String channel, String key, List val, List pflist) Sets a collection property according to the given filter criteria.
Filter criteria can be specified using a series of PropertiesFilter
objects. | public void | setIntegerProperty(String channel, String name, int value) Sets an integer property. | public void | setIntegerProperty(String channel, String name, int value, List pflist) Sets an integer property according to the given filter criteria.
Filter criteria can be specified using a series of PropertiesFilter
objects. | public void | setProperty(String channel, String key, Object val) | public void | setSessionProperty(String name, Object val) Set a session property.
There is a 1-1 mapping between a session and a ProviderContext
object. | public void | setStringAttribute(String name, String val) Sets a string attribute.
"Attributes" are settings that are not
channel-specific. | public void | setStringProperty(String channel, String key, String val) Sets a string property. | public void | setStringProperty(String channel, String key, String val, List pflist) Sets a string property according to the given filter criteria.
Filter criteria can be specified using a series of PropertiesFilter
objects. |
allContentChanged | public void allContentChanged()(Code) | | Flags content for all channels as changed. Clients should
use this method to inform the Provider Context that the
content for all channels has been updated and any cached
content for the channels should be considered stale.
This method should be used with caution because of the obvious
performance implications. Content caching is done for channels
as an optimization to prevent potentially expensive calls
to get content. This method forces fresh content
to be fetched from all channels.
For an example of when it makes sense to use this method,
consider the case where the locale has changed. A new
locale value means that any cached content is specific
to the old locale value. Each channel must generate new
content based on the new locale value.
|
contentChanged | public void contentChanged(String channelName)(Code) | | Flags channel content as changed. Clients should use this method
to inform the Provider Context that the content for a channel
has been updated and any cached content for the channel
should be considered stale.
This method should be used with caution because of the obvious
performance implications. Content caching is done for channels
as an optimization to prevent potentially expensive calls
to get content. This method forces fresh content
to be fetched for the named channel upon the next request.
For an example of when it makes sense to use this method,
consider the case where a channel's content is affected
(only) when it's edit page is processed. For desktop
reloads, the content for the channel can be cached
indefinetly, because we know the only thing that can cause
the content to be changed is processing of its
edit page.
When the edit page is processed, we call this method
to cause any cached content for this channel to be
discarded, so the content will be regenerated based on
the processed edit page.
Parameters: String - the channel name who's content has changed. |
debugError | public void debugError(Object o)(Code) | | Logs a message if the debugging level is "error". The location
to store debugging messages is implementation dependent.
Parameters: o - Object to debug (o.toString() is logged). |
debugError | public void debugError(Object o, Throwable t)(Code) | | Logs a message and stack trace, if the debugging level is "error".
The location
to store debugging messages is implementation dependent.
Parameters: o - Object to debug (o.toString() is logged). Parameters: t - Throwable object to print a stack trace of. |
debugMessage | public void debugMessage(Object o)(Code) | | logs a message if the debugging level is "message" or higher.
The location
to store debugging messages is implementation dependent.
Parameters: o - Object to debug (o.toString() is logged). |
debugMessage | public void debugMessage(Object o, Throwable t)(Code) | | Logs a message and stack trace
if the debugging level is "message" or higher.
The location
to store debugging messages is implementation dependent.
Parameters: o - Object to debug (o.toString() is logged). Parameters: t - Throwable object to log a stack trace of. |
debugWarning | public void debugWarning(Object o)(Code) | | Logs a message if the debugging level is "warning" or higher.
The location
to store debugging messages is implementation dependent.
Parameters: o - Object to debug (o.toString() is logged). |
debugWarning | public void debugWarning(Object o, Throwable t)(Code) | | Logs a message and stack trace if the debugging
level is "warning" or higher.
The location
to store debugging messages is implementation dependent.
Parameters: o - Object to debug (o.toString() is logged). Parameters: t - Throwable object to log a stack trace of. |
decodeURLParameter | public String decodeURLParameter(String dec)(Code) | | Decodes the URL encoded
Unicode string
This method is used for decoding
urlencoded multi-byte characters
that were passed as arguments in a URL
Parameters: dec - string to decode a String , decoded string This method just returns the argument back.Desktop handles the decoding of the url parameters, henceclients doesn't need to do decoding anymore. See Also: ProviderContext.encodeURLParameter |
encodeURL | public String encodeURL(String url)(Code) | | Encodes a URL.
Rewrite the URL to include the session id.
Parameters: url - The URL to be encoded. |
encodeURLParameter | public String encodeURLParameter(String enc)(Code) | | URL encodes a unicode string
This method is used for encoding multi-byte characters
to be passed as arguments in a URL.
This method converts the string to encode into a sequence of
bytes using the default charset UTF-8() and then the
sequence is converted to urlencoded format.
All URL parameter values that are passed to the desktop
and that may be localized (non-ascii) must be url encoded using
this method and should be decoded using decodeURLParameter
when getting it back from the request.
Parameters: enc - string to encode a String , encoded string See Also: ProviderContext.decodeURLParameter |
escape | public String escape(String unescaped) throws ProviderContextException(Code) | | Escapes a String
This method escapes the string using an encoder class that encodes a
specific type of markup. This method is used to allow provider code to
encode content in a device-unaware manner.
The following is an example usage of this method, and
illustrates how to encode content in a device-unaware
fashion:
String unencoded = "";
String encoded = escape(unencoded);
The encoder class name used by this method is read from a client type
property keyed "encoderClassName". If this property does not
exist, EncoderClassNames.ENCODER_DEFAULT
is assumed.
unescaped. String to escape String. escaped String |
existsBooleanProperty | public boolean existsBooleanProperty(String channel, String name) throws ProviderContextException(Code) | | Test for the existence of a boolean property.
Parameters: channel - Channel name. Parameters: name - a String , the property name. a boolean , true if theproperty exists, otherwise false . exception: ProviderContextException - if an error occurs in testingfor the existence of a boolean property. |
existsBooleanProperty | public boolean existsBooleanProperty(String channel, String name, List pflist) throws ProviderContextException(Code) | | Test for the existence of the filtered boolean property.
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If the property that matches the filter criteria does not exist,
a new property will be created.
Note that the "exact" flag in the PropertiesFilter s has no meaning
and will be ignored.
Parameters: channel - Channel name. Parameters: name - a String , the property name. Parameters: pflist - An ordered list of PropertiesFilter objects a boolean , true if theproperty exists, otherwise false . exception: ProviderContextException - if an error occurs in testingfor the existence of a boolean property. |
existsCollectionProperty | public boolean existsCollectionProperty(String channel, String name) throws ProviderContextException(Code) | | Test for the existence of a collection property.
Parameters: channel - Channel name. Parameters: name - a String , the property name. a boolean , true if theproperty exists, otherwise false . exception: ProviderContextException - if an error occurs in testingfor the existence of a Collection property. |
existsCollectionProperty | public boolean existsCollectionProperty(String channel, String name, List pflist) throws ProviderContextException(Code) | | Test for the existence of the filtered collection property.
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If the property that matches the filter criteria does not exist,
a new property will be created.
Note that the "exact" flag in the PropertiesFilter s has no meaning
and will be ignored.
Parameters: channel - Channel name. Parameters: name - a String , the property name. Parameters: pflist - An ordered list of PropertiesFilter objects a boolean , true if theproperty exists, otherwise false . exception: ProviderContextException - if an error occurs in testingfor the existence of a Collection property. |
existsCollectionProperty | public boolean existsCollectionProperty(String channel, String name, boolean localized) throws ProviderContextException(Code) | | Test for the existence of a collection property. This method will also
check for the existence of the localized version of the property.
Parameters: channel - Channel name. Parameters: name - a String , the property name. Parameters: localized - a boolean , whether to check theexistence oflocalized properties. a boolean , true if theproperty exists, otherwise false . exception: ProviderContextException - if an error occurs in testingfor the existence of a Collection property. |
existsIntegerProperty | public boolean existsIntegerProperty(String channel, String name) throws ProviderContextException(Code) | | Test for the existence of an integer property.
Parameters: channel - Channel name. Parameters: name - a String , the property name. a boolean , true if theproperty exists, otherwise false . exception: ProviderContextException - if an error occurs in testingfor the existence of an integer property. |
existsIntegerProperty | public boolean existsIntegerProperty(String channel, String name, List pflist) throws ProviderContextException(Code) | | Test for the existence of the filtered integer property.
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If the property that matches the filter criteria does not exist,
a new property will be created.
Note that the "exact" flag in the PropertiesFilter s has no meaning
and will be ignored.
Parameters: channel - Channel name. Parameters: name - a String , the property name. Parameters: pflist - An ordered list of PropertiesFilter objects a boolean , true if theproperty exists, otherwise false . exception: ProviderContextException - if an error occurs in testingfor the existence of an integer property. |
existsStringProperty | public boolean existsStringProperty(String channel, String name) throws ProviderContextException(Code) | | Test for the existence of a string property.
Parameters: channel - Channel name. Parameters: name - a String , the property name. a boolean , true if theproperty exists, otherwise false . exception: ProviderContextException - if an error occurs in testingfor the existence of a String property. |
existsStringProperty | public boolean existsStringProperty(String channel, String name, List pflist) throws ProviderContextException(Code) | | Test for the existence of a filtered string property.
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If the property that matches the filter criteria does not exist,
a new property will be created.
Note that the "exact" flag in the PropertiesFilter s has no meaning
and will be ignored.
Parameters: channel - Channel name. Parameters: name - a String , the property name. Parameters: pflist - An ordered list of PropertiesFilter objectsexistence oflocalized properties. a boolean , true if theproperty exists, otherwise false . exception: ProviderContextException - if an error occurs in testingfor the existence of a String property. |
existsStringProperty | public boolean existsStringProperty(String channel, String name, boolean localized) throws ProviderContextException(Code) | | Test for the existence of a string property. This method will also
check for the existence of the localized version of the property.
Parameters: channel - Channel name. Parameters: name - a String , the property name. Parameters: localized - a boolean , whether to check theexistence oflocalized properties. a boolean , true if theproperty exists, otherwise false . exception: ProviderContextException - if an error occurs in testingfor the existence of a String property. |
getAuthenticationType | public String getAuthenticationType()(Code) | | Get the authentication type.
The method returns a string denoting the authentication type that was
used for the current session. No assumptions can be made about the
format of the returned string.
a String , the authentication type. |
getBooleanProperty | public boolean getBooleanProperty(String channel, String name, List pflist) throws ProviderContextException(Code) | | Get the filtered boolean property property.
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If there is no property that exactly matches the filter criteria,
the best partial match is returned. When there is not even a
partial match, an unfiltered property is returned.
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: pflist - An ordered list of PropertiesFilter objects Property value. exception: ProviderContextException - if an error occurs in gettingthe boolean property. |
getBooleanProperty | public boolean getBooleanProperty(String channel, String name, boolean def) throws ProviderContextException(Code) | | Get a boolean property property.
This method returns a default value if the
property does not exist.
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: def - Default value. Property value. exception: ProviderContextException - if an error occurs in gettingthe boolean property. |
getBooleanProperty | public boolean getBooleanProperty(String channel, String name, boolean def, List pflist) throws ProviderContextException(Code) | | Get the filtered boolean property property.
This method returns a default value if the
property does not exist.
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If there is no property that exactly matches the filter criteria,
the best partial match is returned. When there is not even a
partial match, an unfiltered property is returned.
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: def - Default value. Parameters: pflist - An ordered list of PropertiesFilter objects Property value. exception: ProviderContextException - if an error occurs in gettingthe boolean property. |
getCharset | public String getCharset()(Code) | | Get the character set.
The character set is used for decoding input and encoding output.
Character set. |
getClassName | public String getClassName(String channel) throws ProviderContextException(Code) | | Get the class name for the provider class that this object will be
providing an environment for. This class name returned must implement
the provider interface.
This method is used to construct the provider object. It is used
by container channels.
Parameters: channel - Channel name. String fully qualified class name(com.sun.portal.providers.foo.FooProvider). exception: ProviderContextException - if an error occurs in getting theclass name. |
getClientAndLocalePropertiesFilters | public List getClientAndLocalePropertiesFilters() throws ProviderContextException(Code) | | Get the client and locale in the form of PropertiesFilter 's.
Each client and locale suffix is used to create PropertiesFilter .
Note that by default, the PropertiesFilter objects return
in the list are constructed with their "required" flag set to
false . See the javadocs for PropertiesFilter
for more information on the semantics of the required flag. Use
getPropertiesFilter() method should you need to customize the
required flag.
This method is a convenience for putting together a list of properties filters
for the current session's locale and client type. the property filter list
returned from this method can be used as input to the to access properties in a locale and client type specific manner.
List of PropertiesFilter objects representingthe client and locale setting. exception: ProviderContextException - if an error occurs in creatingPropertiesFilter objects. See Also: PropertiesFilter See Also: PropertiesFilter.isRequired See Also: ProviderContext.getClientPropertiesFilters() See Also: ProviderContext.getLocalePropertiesFilters() |
getClientPath | public String getClientPath()(Code) | | Get the client path.
The client path is one of several components used to lookup Desktop
templates and JSPs. This allows the lookup to be client-specific.
Client path. |
getClientPropertiesFilters | public List getClientPropertiesFilters() throws ProviderContextException(Code) | | Get the client PropertiesFilter 's.
The hierarchy of client PropertiesFilter is returned.
Note that by default, the PropertiesFilter objects return
in the list are constructed with their "required" flag set to
false . See the javadocs for PropertiesFilter
for more information on the semantics of the required flag. Use
getPropertiesFilter() method should you need to customize the
required flag.
List of PropertiesFilter objects representingthe client. exception: ProviderContextException - if an error occurs in creatingPropertiesFilter objects. See Also: PropertiesFilter See Also: PropertiesFilter.isRequired |
getClientPropertiesFilters | public List getClientPropertiesFilters(String clientType)(Code) | | Get the client PropertiesFilter 's for a given clientType.
The hierarchy of client PropertiesFilter is returned.
Note that by default, the PropertiesFilter objects return
in the list are constructed with their "required" flag set to
false . See the javadocs for PropertiesFilter
for more information on the semantics of the required flag. Use
getPropertiesFilter() method should you need to customize the
required flag.
It is advisable to use getClientPropertiesFilters() if getting the
filters for the current clientType.
Parameters: clientType - client type. List of PropertiesFilter objects representingthe client. See Also: PropertiesFilter See Also: PropertiesFilter.isRequired See Also: ProviderContext.getClientPropertiesFilters() |
getClientProperty | public String getClientProperty(String name)(Code) | | Get a client property.
Client properties are specific to the particular client
accessing the portal, not to the ProviderContext object
used to access them.
Client properties are only guaranteed to persist for the
life of the request, although typically they will
persist for the life of the session.
Parameters: name - a String , the property name. a String , the property value. |
getClientType | public String getClientType()(Code) | | Get the client type. There is no requirement as to how the client
type is determined. It may be hardcoded, derived from the session,
or otherwise.
Client type. |
getClientTypeProperties | public Set getClientTypeProperties(String clientType, String key)(Code) | | Get a set of client type properties for the given client type.
Parameters: clientType - Client type to get the property keys from. Parameters: key - Property key. Set of property values. |
getClientTypeProperty | public String getClientTypeProperty(String clientType, String key)(Code) | | Get a client type property for the given client type.
Parameters: clientType - Client type to get the property from. Parameters: key - Property key. Property value. |
getCollectionProperty | public Map getCollectionProperty(String channel, String name) throws ProviderContextException(Code) | | Get a collection property.
Here, a collection is used to refer to a multi-value property.
Depending on the context, it is either the analogue of
Java Maps or List . For List ,
the returned Java Map object
contains key-value pairs where the key equals the value. For example,
to treat the Map object as a List, do the following:
Set list = map.keySet();
The Java Map object returned from this method
does not fronts the persistent store for the property.
Changes to the return value are not persisted.
Changes must be persisted with
setMapProperty() call.
For example,
Map m = pc.getCollectionProperty("foo");
m.put("a", "1");
pc.setCollectionProperty("foo", m);
Parameters: channel - Channel name. Parameters: name - Property name. Property value, a Java Map that mapsString s to Java objects, either String ,Integer , Boolean , or Map . exception: ProviderContextException - if an error occurs in getting theCollection property. See Also: ProviderContext.setCollectionProperty(String,String,Map) See Also: ProviderContext.setCollectionProperty(String,String,List) |
getCollectionProperty | public Map getCollectionProperty(String channel, String name, List pflist) throws ProviderContextException(Code) | | Get the filtered Collection property.
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If there is no property that exactly matches the filter criteria,
a partial match is returned.
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: pflist - An ordered list of PropertiesFilter objects Property value. exception: ProviderContextException - if an error occurs in getting thethe filtered String property. See Also: PropertiesFilter |
getCollectionProperty | public Map getCollectionProperty(String channel, String name, Map def, List pflist) throws ProviderContextException(Code) | | Get the filtered Collection property.
This method returns a default value if the property does not exist.
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If there is no property that exactly matches the filter criteria,
a partial match is returned.
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: def - Default value. Parameters: pflist - An ordered list of PropertiesFilter objects Property value. exception: ProviderContextException - if an error occurs in getting thethe filtered String property. See Also: PropertiesFilter |
getCollectionProperty | public Map getCollectionProperty(String channel, String name, boolean localized) throws ProviderContextException(Code) | | Get the localized version of a collection property.
Locales are searched from more to less
specific. For example, for a locale setting of "en_US_WE", the search
order would be: en_US_WE, en_US, en. If the locale-specific property
is not found, then the non-locale-specific version is returned
(if it exists).
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: localized - Search for a localized version? Property value, a Java Map that mapsString s to Java objects, either String ,Integer , Boolean , or Map . exception: ProviderContextException - if an error occurs in gettinglocalized version of the Collection property. See Also: ProviderContext.getCollectionProperty(String,String) |
getCollectionProperty | public Map getCollectionProperty(String channel, String name, Map def, boolean localized) throws ProviderContextException(Code) | | Get the localized version of a collection property.
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: def - Default value. Parameters: localized - Search for a localized version? Property value, a Java Map that mapsString s to Java objects, either String ,Integer , Boolean , or Map . exception: ProviderContextException - if an error occurs in gettingthe localized version of the Collection property. See Also: ProviderContext.getCollectionProperty(String,String) |
getConfigProperty | public String getConfigProperty(String key)(Code) | | Get the named configuration property.
Parameters: key - a String , the property name. a String , the property value. |
getContentType | public String getContentType()(Code) | | Get the content type.
This value is used to determine if a provider is able to produce content
for the client's device.
a String value |
getDefaultClientType | public String getDefaultClientType()(Code) | | Get the default client type.
Default client type. |
getDesktopType | public String getDesktopType()(Code) | | Get the Desktop type.
The Desktop type, or also known as template type, is a string that
is one of several indexes used to lookup Desktop templates and JSP
files. The Desktop type is typically used to group such Desktop
customization files to provide different themes.
Desktop type as a string. |
getDesktopURL | public String getDesktopURL(HttpServletRequest req)(Code) | | Get the Desktop URL. The Desktop URL is the absolute URL used
to access the Desktop application. For example:
http://SERVER:PORT/ps/desktop .
The request object parameter is included to facilitate implementations.
It may be used to build the Desktop URL by supplying the
server, port, and protocol of the request. It is not required
that the request object be utilizied to generate the Desktop URL.
Parameters: req - Request object containing the protocol, server, port, etc.information required to build the Desktop URL. If the implementationdoes not use the request object, this parameter may be null. String representation of the URL. |
getDesktopURL | public String getDesktopURL(HttpServletRequest req, Map query, Map pathInfo)(Code) | | Get the Desktop URL. The Desktop URL is the absolute URL used
to access the Desktop application. For example:
http://SERVER:PORT/ps/desktop/pathinfo?query .
The request object parameter is included to facilitate implementations.
It may be used to build the Desktop URL by supplying the
server, port, and protocol of the request. It is not required
that the request object be utilizied to generate the Desktop URL.
The pathInfo Map passed in as an argument will be encoded and appended
as a pathInfo to the desktopURL. The key/value pairs in the pathInfo Map
can be accessed by calling req.getParameter() .
path info parameters are overriden by query string params, which are
overriden by post parameters.
query Map passed in as an argument will be appended as query string to the
desktopURL.
This method is equivalent to calling getDesktopURL() if
pathInfo and query are null.
Parameters: req - Request object containing the protocol, server, port, etc.information required to build the Desktop URL. If the implementationdoes not use the request object, this parameter may be null. Parameters: pathInfo - Map. Parameters: query - Map. queryString key/value pairs to be appended to URL. String representation of the URL. See Also: ProviderContext.getDesktopURL(HttpServletRequest req) |
getDesktopURL | public String getDesktopURL(HttpServletRequest req, Map query, Map pathInfo, boolean escape)(Code) | | Get the Desktop URL. The Desktop URL is the absolute URL used
to access the Desktop application. For example:
http://SERVER:PORT/ps/desktop/pathinfo?query .
This method internally calls escape to escape the desktop
url using a client specific encoder if escape flag is true.
This method is equivalent to calling getDesktopURL(req, query, pathInfo)
if escape flag is false.
Parameters: req - Request object containing the protocol, server, port, etc.information required to build the Desktop URL. If the implementationdoes not use the request object, this parameter may be null. Parameters: pathInfo - Map. Parameters: query - Map. queryString key/value pairs to be appended to URL. Parameters: escape - Boolean. flag specifying whether to escape the url stringspecific to the client using a client specific encoder. String representation of the URL. See Also: ProviderContext.getDesktopURL(HttpServletRequest req,Map query,Map pathInfo) See Also: ProviderContext.escape(String unescaped) |
getDesktopURL | public String getDesktopURL(HttpServletRequest req, String query, boolean escape)(Code) | | Get the Desktop URL. The Desktop URL is the absolute URL used
to access the Desktop application. For example:
http://SERVER:PORT/ps/desktop?queryString .
query String passed in as an argument will be appended as query string to the
desktopURL.
This method is equivalent to calling getDesktopURL() if
query is null and escape flag false.
Parameters: req - Request object containing the protocol, server, port, etc.information required to build the Desktop URL. If the implementationdoes not use the request object, this parameter may be null. Parameters: query - String. queryString to be appended to URL. Parameters: escape - Boolean. flag specifying whether to escape the url stringspecific to the client using a client specific encoder. String representation of the URL. See Also: ProviderContext.getDesktopURL(HttpServletRequest req) See Also: ProviderContext.escape(String unescaped) |
getIntegerProperty | public int getIntegerProperty(String channel, String name, List pflist) throws ProviderContextException(Code) | | Get the filtered integer property.
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If the property that matches the filter criteria does not exist,
a new property will be created.
Note that the "exact" flag in the PropertiesFilter s has no meaning
and will be ignored.
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: pflist - An ordered list of PropertiesFilter objects Property value. exception: ProviderContextException - if an error occurs in gettingthe integer property. |
getIntegerProperty | public int getIntegerProperty(String channel, String name, int def) throws ProviderContextException(Code) | | Get an integer property.
This method returns a default value if the
property does not exist.
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: def - Default value. Property value. exception: ProviderContextException - if an error occurs in gettingthe integer property. |
getIntegerProperty | public int getIntegerProperty(String channel, String name, int def, List pflist) throws ProviderContextException(Code) | | Get an integer property.
This method returns a default value if the
property does not exist.
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If the property that matches the filter criteria does not exist,
a new property will be created.
Note that the "exact" flag in the PropertiesFilter s has no meaning
and will be ignored.
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: def - Default value. Parameters: pflist - An ordered list of PropertiesFilter objects Property value. exception: ProviderContextException - if an error occurs in gettingthe integer property. |
getLocalePropertiesFilters | public List getLocalePropertiesFilters() throws ProviderContextException(Code) | | Get the locale in the form of PropertiesFilter 's.
Each locale suffix is used to create PropertiesFilter .
Note that by default, the PropertiesFilter objects return
in the list are constructed with their "required" flag set to
false . See the javadocs for PropertiesFilter
for more information on the semantics of the required flag. Use
getPropertiesFilter() method should you need to customize the
required flag.
List of PropertiesFilter objects representingthe locale setting. exception: ProviderContextException - if an error occurs in creatingPropertiesFilter objects. See Also: PropertiesFilter See Also: PropertiesFilter.isRequired |
getLocaleString | public String getLocaleString()(Code) | | Get the string form of the locale.
The various locale suffixes are combined together using the
underscore character ("_") as:
LANG_COUNTRY_VARIANT
If a particular suffix is not present, then it is ommited from the string.
An example for a language setting of "en", and country setting of "US"
is "en_US".
String representation of the locale. |
getLoginURL | public String getLoginURL()(Code) | | Get the login URL.
Providers may use this value to generate links to the login url.
The URL returned from this method is encoded.
Login URL as a string. |
getLogoutURL | public String getLogoutURL()(Code) | | Get the logout URL.
The result of making a connection to the logout URL is typcically
the termination of the user's session. What actually happens is
dependent on the application receiving the URL connection.
Providers may use this value to generate links that allow the user
to end their session.
Logout URL as a string. |
getParentContainerName | public String getParentContainerName(String channel)(Code) | | Get the display container name for the named channel.
A display container visually holds another channel.
This method returns the parent container name in which
this channel is contained on the desktop page.
returns null if this channel is the parent container or if
this method is called outside getContent() in
Provider class.
A channel only has a display container when it is being visually
displayed within a container channel. This method relies on
CPC.getContent() to set up the display container name.
Calling this method in a call stack that does not include CPC.getContent()
somewhere above the current stack frame will result in a return value of null.
For an example of where it makes sense to use this method, consider this:
container A calls CPC.getContent() to gather content for the channels
that is visually contains. CPC.getContent() calls channel X's getContent() method.
Channel X may now call PC.getParentContainerName().
For an exmaple of where it *does not* make sense to us this method, consider this:
channel X calls PC.getParentContainerName() from within it's getEdit() method.
When a channel is displaying it's edit page, it is not visually contained.
At this point, channel X has no display container as PC.getParentContainerName()
will return null.
Parameters: channel - Channel name for which the parent is requested. a String , name of the parent containeror null if parent is not known. See Also: ContainerProviderContext.getContent() |
getProperty | public Object getProperty(String channel, String name) throws ProviderContextException(Code) | | Get a property. The value retured from this method is a Java
Object , of type String , Integer ,
Boolean , or Map .
Parameters: channel - Channel name. Parameters: name - Property name. Property value. exception: ProviderContextException - if an error occurs in getting theproperty. |
getProperty | public Object getProperty(String channel, String name, Object def) throws ProviderContextException(Code) | | Get a property. The value retured from this method is a Java
Object , of type String , Integer ,
Boolean , or Map .
If the property does not exist, then the default value is
returned.
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: def - Default value. Property value. exception: ProviderContextException - if an error occurs in setting theproperty. |
getProviderName | public String getProviderName(String channel) throws ProviderContextException(Code) | | Get the name of the provider that backs the channel that this object
provides an environment for.
The format of the provider name is implementation dependent.
The provider name is not necessarily equal to the provider class name
(see getProviderClassName() ).
Parameters: channel - Channel name. Provider name. exception: ProviderContextException - if an error occurs in getting theprovider name. |
getProviderVersion | public int getProviderVersion(String channel) throws ProviderContextException(Code) | | Get the version of the provider schema for the named channel.
The provider schema defines what properties are available to a provider.
Depending on the schema version number, the provider can assume the
existence of and appropriate defaults for particular channel properties.
The exact set of properties that a particular schema version maps to is
documented in the product manuals, for each provider.
Additionally, the exists*Property() methods may be used to determine
the presence or absence of specific properties.
The return value from this method does not indicate the version of the
provider class being used for the channel.
Provider version. See Also: ProviderContext.existsStringProperty(String,String) See Also: ProviderContext.existsStringProperty(String,String,List) See Also: ProviderContext.existsStringProperty(String,String,boolean) See Also: ProviderContext.existsBooleanProperty(String,String) See Also: ProviderContext.existsBooleanProperty(String,String,List) See Also: ProviderContext.existsIntegerProperty(String,String) See Also: ProviderContext.existsIntegerProperty(String,String,List) See Also: ProviderContext.existsCollectionProperty(String,String) See Also: ProviderContext.existsCollectionProperty(String,String,List) See Also: ProviderContext.existsCollectionProperty(String,String,boolean) |
getRequestServer | public StringBuffer getRequestServer(HttpServletRequest req)(Code) | | Get the request server.
This is a replacement for
HttpUtils.getRequestURL() because the version of
that method does not use the
Host HTTP header field to reconstruct the URL.
The difference in this
version is that it grabs the servername:port
from the Host header if it is
there.
Parameters: req - HTTP request object to grab the server information from. Buffer containing the request server. See Also: javax.servlet.http.HttpUtils.getRequestURL(HttpServletRequest) |
getRoles | public Set getRoles()(Code) | | Get the roles the user is in.
This method returns the set of strings where
each string corresponds to the role the user is in.
Set of roles the user is in. |
getServletContext | public ServletContext getServletContext()(Code) | | Get the Servlet Context.
ServletContext object. |
getSessionID | public String getSessionID()(Code) | | Get the unique session identifier.
The format of the return value is implementation specific. The only
guarantee is that it is unique (each user session has a unique
session ID).
Session ID. |
getSessionProperty | public Object getSessionProperty(String name)(Code) | | Get a session property.
There is a 1-1 mapping between a session and a ProviderContext
object. Session properties are therefore specific to a
and instance of a ProviderContext object.
Session properties are made available for garbage
collection when the session ends.
Parameters: name - Property name. Property value. If the property isnot not found, then null is returned. |
getStaticContentPath | public String getStaticContentPath()(Code) | | Get the URI prefix to web server static content.
Static content may be located separately from dynamic content
such as servlets and JSP.
This
URI prefix is used to access static web content such as
images and HTML files. For example, to reference an image, a the
href might look like:
http://server:port/STATIC_URI/images/foo.gif
URI prefix. |
getStringAttribute | public String getStringAttribute(String name)(Code) | | Get a string attribute.
"Attributes" are settings that are not
channel-specific. An example of an attribute might be the user's
first and last name. Channel-specific settings are called
"properties".
Properties can be retrieved by calling the
get*Property() methods.
Whether
a particular value is considered a property or an attribute depends
on the underlying implementation of ProviderContext .
Parameters: name - Attribute name. Attribute value as a string. If attribute isnot not found, null is returned. |
getStringAttribute | public String getStringAttribute(String name, Locale locale)(Code) | | Get a localised string attribute if available.
"Attributes" are settings that are not
channel-specific. An example of an attribute might be the user's
first and last name. This API will check if localized sub attribute
is available for any given locale. If the sub attribute(ex:cn;lang-ja) is available,
the value of sub attribute is returned. If the sub-attribute is NULL,
it will fetch the value of the attribute.Also note that this API performs fallback
mechanism to find out the localised value. Hence the value returned by
getStringAttribute("cn", Locale.Japanese) is not necessarily the value
of the attribute cn;lang-ja, it might be the value of attribte "cn"
Channel-specific settings are called
"properties".
Properties can be retrieved by calling the
get*Property() methods.
Whether
a particular value is considered a property or an attribute depends
on the underlying implementation of ProviderContext .
Parameters: name - Attribute name. Attribute value as a string. If attribute isnot not found, null is returned. |
getStringProperty | public String getStringProperty(String channel, String name, List pflist) throws ProviderContextException(Code) | | Get the filtered String property.
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If there is no property that exactly matches the filter criteria,
the best partial match is returned. When there is not even a
partial match, an unfiltered property is returned.
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: pflist - An ordered list of PropertiesFilter objects Property value. exception: ProviderContextException - if an error occurs in getting thethe filtered String property. See Also: PropertiesFilter |
getStringProperty | public String getStringProperty(String channel, String name, List pflist, boolean exact) throws ProviderContextException(Code) | | Get the filtered String property.
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If there is no property that exactly matches the filter criteria,
null value is returned
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: pflist - An ordered list of PropertiesFilter objects Property value. exception: ProviderContextException - if an error occurs in getting thethe filtered String property. See Also: PropertiesFilter |
getStringProperty | public String getStringProperty(String channel, String name, String def) throws ProviderContextException(Code) | | Get a String property. This method returns a default value if the
property does not exist.
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: def - Default value. Property value. exception: ProviderContextException - if an error occurs in getting theString property. |
getStringProperty | public String getStringProperty(String channel, String name, String def, List pflist) throws ProviderContextException(Code) | | Get the filtered String property.
This method returns a default value if the property does not exist.
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If there is no property that exactly matches the filter criteria,
the best partial match is returned. When there is not even a
partial match, an unfiltered property is returned.
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: def - Default value. Parameters: pflist - An ordered list of PropertiesFilter objects Property value. exception: ProviderContextException - if an error occurs in getting thethe filtered String property. See Also: PropertiesFilter |
getStringProperty | public String getStringProperty(String channel, String name, boolean localized) throws ProviderContextException(Code) | | Get the localized version of a String property.
Locales are searched from more to less
specific. For example, for a locale setting of "en_US_WE", the search
order would be: en_US_WE, en_US, en. If the locale-specific property
is not found, then the non-locale-specific version is returned
(if it exists).
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: localized - Search for a localized version? Property value. exception: ProviderContextException - if an error occurs in getting thelocalized version of the String property. |
getStringProperty | public String getStringProperty(String channel, String name, String def, boolean localized) throws ProviderContextException(Code) | | Get the localized version of a String property.
This method returns a default value if the
property does not exist.
Locales are searched from more to less
specific. For example, for a locale setting of "en_US_WE", the search
order would be: en_US_WE, en_US, en. If the locale-specific property
is not found, then the non-locale-specific version is returned
(if it exists).
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: def - Default value. Parameters: localized - Search for a localized version? Property value. exception: ProviderContextException - if an error occurs in getting thelocalized version of the String property. |
getTemplate | public StringBuffer getTemplate(String name, String file) throws ProviderContextException(Code) | | Get a desktop template.
The actual template buffer returned is based on the Desktop type,
locale, channel, client type, and the template name.
Parameters: name - Channel name Parameters: file - Template name to return. Buffer containng the template. exception: ProviderContextException - if an error occurs in getting thedesktop template. |
getTemplate | public StringBuffer getTemplate(String desktopType, String locale, String name, String clientType, String file, String baseDir) throws ProviderContextException(Code) | | Get a desktop template.
The actual template buffer returned is based on the Desktop type,
locale, channel, client type, and the template name.
Parameters: desktopType - Desktop type. Parameters: locale - Locale. Parameters: name - Channel name. Parameters: cilentType - client type. Parameters: file - Template name to return. Parameters: baseDir - the base directory from which the lookup mechanismbegins its lookup. Buffer containng the template. exception: ProviderContextException - if an error occurs in getting thedesktop template. |
getTemplate | public StringBuffer getTemplate(String name, String file, Hashtable table) throws ProviderContextException(Code) | | Get and tag swaps a desktop template.
The actual template buffer returned is based on the the name,
locale, client path, and Desktop type.
Parameters: name - Channel name Parameters: file - Template name to return Parameters: table - Tag table to use for tag swapping. Buffer containng the template. exception: ProviderContextException - if an error occurs in getting ortag swapping the desktop template. |
getTemplate | public StringBuffer getTemplate(String desktopType, String locale, String name, String clientType, String file, Hashtable table, String baseDir) throws ProviderContextException(Code) | | Get and tag swaps a desktop template.
The actual template buffer returned is based on the the name,
locale, client path, and Desktop type.
Parameters: desktopType - Desktop type. Parameters: locale - Locale. Parameters: name - Channel name. Parameters: cilentType - client type. Parameters: file - Template name to return. Parameters: table - Tag table to use for tag swapping. Parameters: baseDir - the base directory from which the lookup mechanismbegins its lookup. Buffer containng the template. exception: ProviderContextException - if an error occurs in getting ortag swapping the desktop template. |
getTemplateMostSpecificPath | public File getTemplateMostSpecificPath(String name, String file) throws ProviderContextException(Code) | | Get the most specific template path for the given channel name and the
given template name. The file returned may not exist at all.
If non-null, the key returned by this method will map to the most specific
template file. The file may or may not exist. The format of the returned
path is implementation
dependent.
Parameters: name - Channel name. Parameters: file - The template name, or null if the templatefor the name does not exist. Path key to access the template. exception: ProviderContextException - if an error occurs in getting themost specific template path. |
getTemplateMostSpecificPath | public File getTemplateMostSpecificPath(String desktopType, String locale, String name, String clientType, String file, String baseDir) throws ProviderContextException(Code) | | Get the most specific template path for the given channel name and the
given template name. The file returned may not exist at all.
If non-null, the key returned by this method will map to the most specific
template file. The file may or may not exist. The format of the returned
path is implementation
dependent.
Parameters: desktopType - Desktop type. Parameters: locale - Locale. Parameters: name - Channel name. Parameters: cilentType - client type. Parameters: file - The template name. Parameters: baseDir - the base directory from which the lookup mechanismbegins its lookup. Path key to access the template. exception: ProviderContextException - if an error occurs in getting themost specific template path. |
getTemplatePath | public File getTemplatePath(String name, String file) throws ProviderContextException(Code) | | Get the template path for the given channel name and the given
template name.
If non-null, the key returned by this method will map to a valid
template file. The format of the returned path is implementation
dependent.
Parameters: name - Channel name. Parameters: file - The template name, or null if the templatefor the name does not exist. Path key to access the template. exception: ProviderContextException - if an error occurs in getting thetemplate path. |
getTemplatePath | public File getTemplatePath(String desktopType, String locale, String name, String clientType, String file, String baseDir) throws ProviderContextException(Code) | | Get the template path for the given channel name and the given
template name.
If non-null, the key returned by this method will map to a valid
template file. The format of the returned path is implementation
dependent.
Parameters: desktopType - Desktop type. Parameters: locale - Locale. Parameters: name - Channel name. Parameters: cilentType - client type. Parameters: file - The template name. Parameters: baseDir - the base directory from which the lookup mechanismbegins its lookup. Path key to access the template. exception: ProviderContextException - if an error occurs in getting thetemplate path. |
getTopChannelName | public String getTopChannelName(HttpServletRequest req)(Code) | | Get the top channel name.
This method returns the top channel for the
current request, identified by the request object argument.
The top channel is responsible for directly rendering the
portal page or by partially or wholly delegating
the rendering to one or more channels.
Parameters: req - HttpServletRequest a String , name of the channel |
getUserID | public String getUserID()(Code) | | Get the user identifier.
The format of the return value is implementation specific. There is
no guarantee that this value is unique (there may be multiple user
sessions for a given user identifier).
User identifier. |
init | public void init(HttpServletRequest req)(Code) | | Initialize this provider context.
The request object must contain the service specific data to allow
the underlying implementation to be initialized. This data might be
cookies, HTTP headers, etc.
The details of how the request object is used is
specific to the implementation of this interface.
Parameters: req - Request object containing service specific data. |
isAuthless | public boolean isAuthless(HttpServletRequest req)(Code) | | Get if the current Desktop session is non-authenticated (authless).
Authless Desktop sessions are created by the Desktop and are not subject
to the normal authentication process that is required for authenticated
Desktop sessions. When writing providers to be used in the context of
an authless Desktop, it is important to keep several factors in mind.
It is typical that many clients will be accessing a single authless
Desktop session. The implication is that changing properties for an
authless channel affects all accessing clients. Normally, authless
providers are configured to hold state in client properties instead of
provider properties. Desktop session properties are per-Desktop session;
any Desktop session properties that are set for an authless user are
shared among all authless users. There can be many authless Desktop
sessions; such sessions are associated with a particular user ID.
Parameters: req - Request object . true if the current Desktop session is an authlesssession otherwise false . |
isDebugEnabled | public boolean isDebugEnabled()(Code) | | Get if the debug is enabled
true if the debugging is on,otherwise false . |
isDebugErrorEnabled | public boolean isDebugErrorEnabled()(Code) | | Get if the debug is set to error
true if the debugging level is set to error,otherwise false . |
isDebugMessageEnabled | public boolean isDebugMessageEnabled()(Code) | | Get if the debug level is set to message or higher.
true if the debugging level is set to messageor higher, otherwise false . |
isDebugWarningEnabled | public boolean isDebugWarningEnabled()(Code) | | Get if the debug level is set to warning or higher.
true if the debugging level is set to warningor higher, otherwise false . |
refresh | public void refresh()(Code) | | Causes Provider Context to throw away any cached data. This
method informs the Provider Context that the system has changed
state in a such a way that cached data (if any) should be considered
stale.
This method should be used with caution because of the obvious
performance implications. If a Provider Context caches data,
it is most likely doing so as a performance optimization.
Calling this method causes such optimizations to be negated,
until the Provider Context can re-cache the data.
For an exaple of when it makes sense to call this method,
consider the following: the Provider Context implementation
is driven by a single large chunk of data that is
read from an LDAP server. The raw data is passed to the
Provider Context by the Desktop. To be useful,
the Provider Context must parse the raw data into an
internal representation. Parsing the raw data is
expensive, so the Provider Context caches the
internal representation and does not re-generate
it every request. However, the Provider Context
must throw away the internal representation if the
raw data changes. The Desktop notifies the
Provider Context when the raw data changes
by calling refresh. This informs the Provider
Context that is must throw away the internal
representation and re-generate.
|
setBooleanProperty | public void setBooleanProperty(String channel, String name, boolean value) throws ProviderContextException(Code) | | Sets a boolean property.
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: value - Property value. exception: ProviderContextException - if an error occurs in settingthe boolean property. |
setBooleanProperty | public void setBooleanProperty(String channel, String name, boolean value, List pflist) throws ProviderContextException(Code) | | Sets a boolean property according to the given filter criteria.
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If the property that matches the filter criteria does not exist,
the most specific, existing property gets set.
If only the default value existed, it sets the default value. If the default
and filtered properties existed, it sets the most specific existing filtered
property.
Note that the "exact" flag in the PropertiesFilter s has no meaning
and will be ignored.
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: value - Property value. Parameters: pflist - An ordered list of PropertiesFilter objects exception: ProviderContextException - if an error occurs in settingthe boolean property. |
setClientProperty | public void setClientProperty(String name, String value)(Code) | | Set a client property.
Client properties are specific to the particular client
accessing the portal, not to the ProviderContext object
used to access them. In some cases, there is a 1-1
mapping between client device and ProviderContext
object, however, client code cannot make this assumption.
Client properties are only guaranteed to persist for the
life of the request, although typically they will
persist for the life of the session.
Parameters: name - a String , the property name. Parameters: value - String , the property value. |
setCollectionProperty | public void setCollectionProperty(String channel, String key, Map val, List pflist) throws ProviderContextException(Code) | | Sets a collection property according to the given filter criteria.
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If the property that matches the filter criteria does not exist,
the most specific, existing property gets set.
If only the default value existed, it sets the default value. If the default
and filtered properties existed, it sets the most specific existing filtered
property.
Note that the "exact" flag in the PropertiesFilter s has no meaning
and will be ignored.
Parameters: channel - Channel name. Parameters: key - Property name. Parameters: value - Property value. Parameters: pflist - An ordered list of PropertiesFilter objects exception: ProviderContextException - if an error occurs in setting thecollection property. See Also: PropertiesFilter |
setCollectionProperty | public void setCollectionProperty(String channel, String key, List val, List pflist) throws ProviderContextException(Code) | | Sets a collection property according to the given filter criteria.
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If the property that matches the filter criteria does not exist,
the most specific, existing property gets set.
If only the default value existed, it sets the default value. If the default
and filtered properties existed, it sets the most specific existing filtered
property.
Note that the "exact" flag in the PropertiesFilter s has no meaning
and will be ignored.
Parameters: channel - Channel name. Parameters: key - Property name. Parameters: value - Property value. Parameters: pflist - An ordered list of PropertiesFilter objects exception: ProviderContextException - if an error occurs in setting thecollection property. See Also: PropertiesFilter |
setIntegerProperty | public void setIntegerProperty(String channel, String name, int value) throws ProviderContextException(Code) | | Sets an integer property.
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: value - Property value. exception: ProviderContextException - if an error occurs in settingthe integer property. |
setIntegerProperty | public void setIntegerProperty(String channel, String name, int value, List pflist) throws ProviderContextException(Code) | | Sets an integer property according to the given filter criteria.
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If the property that matches the filter criteria does not exist,
the most specific, existing property gets set.
If only the default value existed, it sets the default value. If the default
and filtered properties existed, it sets the most specific existing filtered
property.
Note that the "exact" flag in the PropertiesFilter s has no meaning
and will be ignored.
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: value - Property value. Parameters: pflist - An ordered list of PropertiesFilter objects exception: ProviderContextException - if an error occurs in settingthe integer property. |
setSessionProperty | public void setSessionProperty(String name, Object val)(Code) | | Set a session property.
There is a 1-1 mapping between a session and a ProviderContext
object. Session properties are therefore specific to a
and instance of a ProviderContext object.
Session properties are made available for garbage
collection when the session ends.
Parameters: name - The property name. Parameters: value - The property value. |
setStringAttribute | public void setStringAttribute(String name, String val)(Code) | | Sets a string attribute.
"Attributes" are settings that are not
channel-specific. An example of an attribute might be the user's
first and last name. Channel-specific settings are called
"properties".
Properties can be set by calling the
set*Property() methods.
Whether
a particular value is considered a property or an attribute depends
on the underlying implementation of ProviderContext .
Parameters: name - Attribute name. Parameters: name - Attribute value. |
setStringProperty | public void setStringProperty(String channel, String key, String val, List pflist) throws ProviderContextException(Code) | | Sets a string property according to the given filter criteria.
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If the property that matches the filter criteria does not exist,
the most specific, existing property gets set.
If only the default value existed, it sets the default value. If the default
and filtered properties existed, it sets the most specific existing filtered
property.
Note that the "exact" flag in the PropertiesFilter s has no meaning
and will be ignored.
Parameters: channel - Channel name. Parameters: name - Property name. Parameters: value - Property value. Parameters: pflist - An ordered list of PropertiesFilter objects exception: ProviderContextException - if an error occurs in setting theString property. See Also: PropertiesFilter |
|
|