com.sun.portal.providers.context
Interface ProviderContext

All Known Subinterfaces:
ContainerProviderContext

public interface ProviderContext

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:
ProviderAdapter, ContainerProviderContext

Method Summary
 void allContentChanged()
           
 void contentChanged(String channelName)
           
 void debugError(Object o)
          Logs a message if the debugging level is "error".
 void debugError(Object o, Throwable t)
          Logs a message and stack trace, if the debugging level is "error".
 void debugMessage(Object o)
          logs a message if the debugging level is "message" or higher.
 void debugMessage(Object o, Throwable t)
          Logs a message and stack trace if the debugging level is "message" or higher.
 void debugWarning(Object o)
          Logs a message if the debugging level is "warning" or higher.
 void debugWarning(Object o, Throwable t)
          Logs a message and stack trace if the debugging level is "warning" or higher.
 String encodeURL(String url)
          Encodes a URL.
 boolean existsBooleanProperty(String channel, String name)
          Tests for the existence of a boolean property.
 boolean existsCollectionProperty(String channel, String name)
          Tests for the existence of a collection property.
 boolean existsCollectionProperty(String channel, String name, boolean localized)
          Tests for the existence of a collection property.
 boolean existsIntegerProperty(String channel, String name)
          Tests for the existence of an integer property.
 boolean existsStringProperty(String channel, String name)
          Tests for the existence of a string property.
 boolean existsStringProperty(String channel, String name, boolean localized)
          Tests for the existence of a string property.
 boolean getBooleanProperty(String channel, String name)
          Gets a boolean property property.
 boolean getBooleanProperty(String channel, String name, boolean def)
          Gets a boolean property property.
 String getCharset()
          Gets the character set.
 String getClassName(String channel)
          Gets the class name for the provider class that this object will be providing an environment for.
 String getClientPath()
          Gets the client path.
 String getClientProperty(String name)
          Get a client property.
 String getClientType()
          Gets the client type.
 String getClientTypeProperty(String key)
          Gets a client type property for the user's client type.
 String getClientTypeProperty(String clientType, String key)
          Gets a client type property for the given client type.
 Map getCollectionProperty(String channel, String name)
          Gets a collection property.
 Map getCollectionProperty(String channel, String name, boolean localized)
          Gets the localized version of a collection property.
 Map getCollectionProperty(String channel, String name, Map def)
          Gets a collection property.
 Map getCollectionProperty(String channel, String name, Map def, boolean localized)
          Gets the localized version of a collection property.
 String getConfigProperty(String key)
          Gets the named configuration property.
 String getContentType()
          Gets the content type.
 String getDefaultChannelName()
          Gets the default channel name.
 String getDefaultClientType()
          Gets the default client type.
 String getDesktopType()
          Gets the Desktop type.
 String getDesktopURL(javax.servlet.http.HttpServletRequest req)
          Gets the Desktop URL.
 int getIntegerProperty(String channel, String name)
          Gets an integer property.
 int getIntegerProperty(String channel, String name, int def)
          Gets an integer property.
 Locale getLocale()
          Gets the locale.
 String getLocaleString()
          Gets the string form of the locale.
 String getLogoutURL()
          Gets the logout URL.
 Iterator getNames(String channel)
          Gets property names for the channel.
 Object getProperty(String channel, String name)
          Gets a property.
 Object getProperty(String channel, String name, Object def)
          Gets a property.
 String getProviderName(String channel)
          Gets the name of the provider that backs the channel that this object provides an environment for.
 StringBuffer getRequestServer(javax.servlet.http.HttpServletRequest req)
          Gets the request server.
 javax.servlet.ServletConfig getServletConfig()
          Gets the ServletConfig.
 String getSessionID()
          Gets the unique session identifier.
 Object getSessionProperty(String name)
          Get a session property.
 String getStaticContentPath()
          Gets the URI prefix to web server static content.
 String getStringAttribute(String name)
          Gets a string attribute.
 String getStringProperty(String channel, String name)
          Gets a String property.
 String getStringProperty(String channel, String name, boolean localized)
          Gets the localized version of a String property.
 String getStringProperty(String channel, String name, String def)
          Gets a String property.
 String getStringProperty(String channel, String name, String def, boolean localized)
          Gets the localized version of a String property.
 StringBuffer getTemplate(String name, String file)
          Gets a desktop template.
 StringBuffer getTemplate(String name, String file, Hashtable table)
          Gets and tag swaps a desktop template.
 File getTemplateMostSpecificPath(String name, String file)
          Gets the most specific template path for the given channel name and the given template name.
 File getTemplatePath(String name, String file)
          Gets the template path for the given channel name and the given template name.
 String getUserID()
          Get the user identifier.
 void init(javax.servlet.http.HttpServletRequest req)
          Initializes this provider context.
 boolean isDebugEnabled()
          Gets if the debug is enabled
 boolean isDebugErrorEnabled()
          Gets if the debug is set to error
 boolean isDebugMessageEnabled()
          Gets if the debug level is set to message or higher.
 boolean isDebugWarningEnabled()
          Gets if the debug level is set to warning or higher.
 void refresh()
           
 void setBooleanProperty(String channel, String name, boolean value)
          Sets a boolean property.
 void setClientProperty(String name, String value)
          Set a client property.
 void setCollectionProperty(String channel, String name, List value)
          Sets a collection property.
 void setCollectionProperty(String channel, String key, Map val)
          Sets a collection property.
 void setIntegerProperty(String channel, String name, int value)
          Sets an integer property.
 void setProperty(String channel, String key, Object val)
          TBD
 void setSessionProperty(String name, Object val)
          Set a session property.
 void setStringAttribute(String name, String val)
          Sets a string attribute.
 void setStringProperty(String channel, String key, String val)
          Sets a string property.
 

Method Detail

init

public void init(javax.servlet.http.HttpServletRequest req)
Initializes 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.

refresh

public void refresh()

contentChanged

public void contentChanged(String channelName)

allContentChanged

public void allContentChanged()

getDesktopURL

public String getDesktopURL(javax.servlet.http.HttpServletRequest req)
Gets 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 implementation does not use the request object, this parameter may be null.
Returns:
String representation of the URL.

getLocaleString

public String getLocaleString()
Gets 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".
Returns:
String representation of the locale.

getLocale

public Locale getLocale()
Gets the locale.
Returns:
Java Locale object representation of the locale.
See Also:
Locale

getDesktopType

public String getDesktopType()
Gets 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.
Returns:
Desktop type as a string.

getLogoutURL

public String getLogoutURL()
Gets 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.
Returns:
Logout URL as a string.

getStringAttribute

public String getStringAttribute(String name)
Gets 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.
Returns:
Attribute value as a string. If attribute is not not found, null is returned.

setStringAttribute

public void setStringAttribute(String name,
                               String val)
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.
name - Attribute value.

encodeURL

public String encodeURL(String url)
Encodes a URL. Rewrite the URL to include the session id.
Parameters:
url - The URL to be encoded.

getRequestServer

public StringBuffer getRequestServer(javax.servlet.http.HttpServletRequest req)
Gets 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.
Returns:
Buffer containing the request server.
See Also:
javax.servlet.http.HttpUtils#getRequestURL(HttpServletRequest)

getClientTypeProperty

public String getClientTypeProperty(String key)
Gets a client type property for the user's client type.
Parameters:
key - Property key.
Returns:
Property value.
See Also:
getClientType()

getClientTypeProperty

public String getClientTypeProperty(String clientType,
                                    String key)
Gets a client type property for the given client type.
Parameters:
clientType - Client type to get the property from.
key - Property key.
Returns:
Property value.

getDefaultClientType

public String getDefaultClientType()
Gets the default client type.
Returns:
Default client type.

getClientType

public String getClientType()
Gets 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.
Returns:
Client type.

getCharset

public String getCharset()
Gets the character set. The character set is used for decoding input and encoding output.
Returns:
Character set.

getClientPath

public String getClientPath()
Gets 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.
Returns:
Client path.

getContentType

public String getContentType()
Gets the content type. This value is used to determine if a provider is able to produce content for the client's device.
Returns:
a String value

getSessionProperty

public Object getSessionProperty(String name)
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.
Returns:
Property value. If the property is not not found, then null is returned.

setSessionProperty

public void setSessionProperty(String name,
                               Object val)
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.
value - The property value.

getSessionID

public String getSessionID()
Gets 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).
Returns:
Session ID.

getUserID

public String getUserID()
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).
Returns:
User identifier.

getClientProperty

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. Lifespan of the clientProperty is per session.
Parameters:
name - a String, the property name.
Returns:
a String, the property value.

setClientProperty

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.
Parameters:
name - a String, the property name.
value - String, the property value.

isDebugEnabled

public boolean isDebugEnabled()
Gets if the debug is enabled
Returns:
true if the debugging is on, otherwise false.

isDebugErrorEnabled

public boolean isDebugErrorEnabled()
Gets if the debug is set to error
Returns:
true if the debugging level is set to error, otherwise false.

isDebugWarningEnabled

public boolean isDebugWarningEnabled()
Gets if the debug level is set to warning or higher.
Returns:
true if the debugging level is set to warning or higher, otherwise false.

isDebugMessageEnabled

public boolean isDebugMessageEnabled()
Gets if the debug level is set to message or higher.
Returns:
true if the debugging level is set to message or higher, otherwise false.

debugMessage

public void debugMessage(Object o)
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).

debugWarning

public void debugWarning(Object o)
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).

debugError

public void debugError(Object o)
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).

debugMessage

public void debugMessage(Object o,
                         Throwable t)
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).
t - Throwable object to log a stack trace of.

debugWarning

public void debugWarning(Object o,
                         Throwable t)
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).
t - Throwable object to log a stack trace of.

debugError

public void debugError(Object o,
                       Throwable t)
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).
t - Throwable object to print a stack trace of.

getTemplate

public StringBuffer getTemplate(String name,
                                String file)
                         throws ProviderContextException
Gets 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
file - Template name to return.
Returns:
Buffer containng the template.
Throws:
ProviderContextException - if an error occurs in getting the desktop template.

getTemplate

public StringBuffer getTemplate(String name,
                                String file,
                                Hashtable table)
                         throws ProviderContextException
Gets 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
file - Template name to return
table - Tag table to use for tag swapping.
Returns:
Buffer containng the template.
Throws:
ProviderContextException - if an error occurs in getting or tag swapping the desktop template.

getTemplatePath

public File getTemplatePath(String name,
                            String file)
                     throws ProviderContextException
Gets 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.
file - The template name, or null if the template for the name does not exist.
Returns:
Path key to access the template.
Throws:
ProviderContextException - if an error occurs in getting the template path.

getTemplateMostSpecificPath

public File getTemplateMostSpecificPath(String name,
                                        String file)
                                 throws ProviderContextException
Gets 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.
file - The template name, or null if the template for the name does not exist.
Returns:
Path key to access the template.
Throws:
ProviderContextException - if an error occurs in getting the most specific template path.

getClassName

public String getClassName(String channel)
                    throws ProviderContextException
Gets 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.
Returns:
String fully qualified class name (com.sun.portal.providers.foo.FooProvider).
Throws:
ProviderContextException - if an error occurs in getting the class name.

getProviderName

public String getProviderName(String channel)
                       throws ProviderContextException
Gets 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.
Returns:
Provider name.
Throws:
ProviderContextException - if an error occurs in getting the provider name.

getNames

public Iterator getNames(String channel)
                  throws ProviderContextException
Gets property names for the channel.
Parameters:
channel - Channel name.
Returns:
Iterator over String objects.
Throws:
ProviderContextException - if an error occurs in getting the property names.

getProperty

public Object getProperty(String channel,
                          String name)
                   throws ProviderContextException
Gets a property. The value retured from this method is a Java Object, of type String, Integer, Boolean, or Map.
Parameters:
channel - Channel name.
name - Property name.
Returns:
Property value.
Throws:
ProviderContextException - if an error occurs in getting the property.

setProperty

public void setProperty(String channel,
                        String key,
                        Object val)
                 throws ProviderContextException
TBD

getProperty

public Object getProperty(String channel,
                          String name,
                          Object def)
                   throws ProviderContextException
Gets 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.
name - Property name.
def - Default value.
Returns:
Property value.
Throws:
ProviderContextException - if an error occurs in setting the property.

getStringProperty

public String getStringProperty(String channel,
                                String name)
                         throws ProviderContextException
Gets a String property.
Parameters:
channel - Channel name.
name - Property name.
Returns:
Property value.
Throws:
ProviderContextException - if an error occurs in getting the String property.

getStringProperty

public String getStringProperty(String channel,
                                String name,
                                String def)
                         throws ProviderContextException
Gets a String property. This method returns a default value if the property does not exist.
Parameters:
channel - Channel name.
name - Property name.
def - Default value.
Returns:
Property value.
Throws:
ProviderContextException - if an error occurs in getting the String property.

getStringProperty

public String getStringProperty(String channel,
                                String name,
                                boolean localized)
                         throws ProviderContextException
Gets 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.
name - Property name.
localized - Search for a localized version?
Returns:
Property value.
Throws:
ProviderContextException - if an error occurs in getting the localized version of the String property.

getStringProperty

public String getStringProperty(String channel,
                                String name,
                                String def,
                                boolean localized)
                         throws ProviderContextException
Gets 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.
name - Property name.
def - Default value.
localized - Search for a localized version?
Returns:
Property value.
Throws:
ProviderContextException - if an error occurs in getting the localized version of the String property.

setStringProperty

public void setStringProperty(String channel,
                              String key,
                              String val)
                       throws ProviderContextException
Sets a string property.
Parameters:
channel - Channel name.
name - Property name.
value - Property value.
Throws:
ProviderContextException - if an error occurs in setting the String property.

getCollectionProperty

public Map getCollectionProperty(String channel,
                                 String name)
                          throws ProviderContextException
Gets 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 fronts the persistent store for the property. Changes to this object are immediately reflected in the persistent store. Because of this, it is not necessary to call setCollectionProperty() to persist changes made to a property returned from this method. However, if you are setting a new collection value, you must call setCollectionProperty(). For example, it is not necessary to call setCollectionProperty() in the following example:

Map m = pc.getCollectionProperty("foo");
m.put("a", "1");

This is because the Map m is returned from getCollectionProperty() and is therefore persistent. However, in the example below, you must call setCollectionProperty():

Map m = new HashMap();
m.put("a", "1");

Map m is not persistent because it was not returned from getCollectionProperty() method. The following line is required to persist the changes:

pc.setCollectionProperty("foo", m);

Parameters:
channel - Channel name.
name - Property name.
Returns:
Property value, a Java Map that maps Strings to Java objects, either String, Integer, Boolean, or Map.
Throws:
ProviderContextException - if an error occurs in getting the Collection property.
See Also:
setCollectionProperty(String, String, Map), setCollectionProperty(String, String, List)

getCollectionProperty

public Map getCollectionProperty(String channel,
                                 String name,
                                 boolean localized)
                          throws ProviderContextException
Gets 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.
name - Property name.
localized - Search for a localized version?
Returns:
Property value, a Java Map that maps Strings to Java objects, either String, Integer, Boolean, or Map.
Throws:
ProviderContextException - if an error occurs in getting localized version of the Collection property.
See Also:
getCollectionProperty(String, String)

getCollectionProperty

public Map getCollectionProperty(String channel,
                                 String name,
                                 Map def)
                          throws ProviderContextException
Gets a collection property. This method returns a default value if the property does not exist.
Parameters:
channel - Channel name.
name - Property name.
def - Default value.
Returns:
Property value, a Java Map that maps Strings to Java objects, either String, Integer, Boolean, or Map.
Throws:
ProviderContextException - if an error occurs in getting the Collection property.
See Also:
getCollectionProperty(String, String)

getCollectionProperty

public Map getCollectionProperty(String channel,
                                 String name,
                                 Map def,
                                 boolean localized)
                          throws ProviderContextException
Gets the localized version of a collection property.
Parameters:
channel - Channel name.
name - Property name.
def - Default value.
localized - Search for a localized version?
Returns:
Property value, a Java Map that maps Strings to Java objects, either String, Integer, Boolean, or Map.
Throws:
ProviderContextException - if an error occurs in getting the localized version of the Collection property.
See Also:
getCollectionProperty(String, String)

setCollectionProperty

public void setCollectionProperty(String channel,
                                  String key,
                                  Map val)
                           throws ProviderContextException
Sets a collection property.
Parameters:
channel - Channel name.
name - Property name.
value - Property value.
Returns:
New property value.
Throws:
ProviderContextException - if an error occurs in setting the Collection property.
See Also:
getCollectionProperty(String, String)

setCollectionProperty

public void setCollectionProperty(String channel,
                                  String name,
                                  List value)
                           throws ProviderContextException
Sets a collection property.
Parameters:
channel - Channel name.
name - Property name.
value - Proeprty value.
Returns:
New property value.
Throws:
ProviderContextException - if an error occurs in setting the Collection property.
See Also:
getCollectionProperty(String, String)

getBooleanProperty

public boolean getBooleanProperty(String channel,
                                  String name)
                           throws ProviderContextException
Gets a boolean property property.
Parameters:
channel - Channel name.
name - Property name.
Returns:
Property value.
Throws:
ProviderContextException - if an error occurs in getting the boolean property.

getBooleanProperty

public boolean getBooleanProperty(String channel,
                                  String name,
                                  boolean def)
                           throws ProviderContextException
Gets a boolean property property. This method returns a default value if the property does not exist.
Parameters:
channel - Channel name.
name - Property name.
def - Default value.
Returns:
Property value.
Throws:
ProviderContextException - if an error occurs in getting the boolean property.

setBooleanProperty

public void setBooleanProperty(String channel,
                               String name,
                               boolean value)
                        throws ProviderContextException
Sets a boolean property.
Parameters:
channel - Channel name.
name - Property name.
value - Property value.
Throws:
ProviderContextException - if an error occurs in setting the boolean property.

getIntegerProperty

public int getIntegerProperty(String channel,
                              String name)
                       throws ProviderContextException
Gets an integer property.
Parameters:
channel - Channel name.
name - Property name.
Returns:
Property value.
Throws:
ProviderContextException - if an error occurs in getting the integer property.

getIntegerProperty

public int getIntegerProperty(String channel,
                              String name,
                              int def)
                       throws ProviderContextException
Gets an integer property. This method returns a default value if the property does not exist.
Parameters:
channel - Channel name.
name - Property name.
def - Default value.
Returns:
Property value.
Throws:
ProviderContextException - if an error occurs in getting the integer property.

setIntegerProperty

public void setIntegerProperty(String channel,
                               String name,
                               int value)
                        throws ProviderContextException
Sets an integer property.
Parameters:
channel - Channel name.
name - Property name.
value - Property value.
Throws:
ProviderContextException - if an error occurs in setting the integer property.

existsStringProperty

public boolean existsStringProperty(String channel,
                                    String name)
                             throws ProviderContextException
Tests for the existence of a string property.
Parameters:
channel - Channel name.
name - a String, the property name.
Returns:
a boolean, true if the property exists, otherwise false.
Throws:
ProviderContextException - if an error occurs in testing for the existence of a String property.

existsStringProperty

public boolean existsStringProperty(String channel,
                                    String name,
                                    boolean localized)
                             throws ProviderContextException
Tests 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.
name - a String, the property name.
localized - a boolean, whether to check the existence of localized properties.
Returns:
a boolean, true if the property exists, otherwise false.
Throws:
ProviderContextException - if an error occurs in testing for the existence of a String property.

existsBooleanProperty

public boolean existsBooleanProperty(String channel,
                                     String name)
                              throws ProviderContextException
Tests for the existence of a boolean property.
Parameters:
channel - Channel name.
name - a String, the property name.
Returns:
a boolean, true if the property exists, otherwise false.
Throws:
ProviderContextException - if an error occurs in testing for the existence of a boolean property.

existsIntegerProperty

public boolean existsIntegerProperty(String channel,
                                     String name)
                              throws ProviderContextException
Tests for the existence of an integer property.
Parameters:
channel - Channel name.
name - a String, the property name.
Returns:
a boolean, true if the property exists, otherwise false.
Throws:
ProviderContextException - if an error occurs in testing for the existence of an integer property.

existsCollectionProperty

public boolean existsCollectionProperty(String channel,
                                        String name)
                                 throws ProviderContextException
Tests for the existence of a collection property.
Parameters:
channel - Channel name.
name - a String, the property name.
Returns:
a boolean, true if the property exists, otherwise false.
Throws:
ProviderContextException - if an error occurs in testing for the existence of a Collection property.

existsCollectionProperty

public boolean existsCollectionProperty(String channel,
                                        String name,
                                        boolean localized)
                                 throws ProviderContextException
Tests 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.
name - a String, the property name.
localized - a boolean, whether to check the existence of localized properties.
Returns:
a boolean, true if the property exists, otherwise false.
Throws:
ProviderContextException - if an error occurs in testing for the existence of a Collection property.

getStaticContentPath

public String getStaticContentPath()
Gets 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
Returns:
URI prefix.

getServletConfig

public javax.servlet.ServletConfig getServletConfig()
Gets the ServletConfig.
Returns:
ServletConfig object.

getDefaultChannelName

public String getDefaultChannelName()
Gets the default channel name. This method returns the channel name from the session using getSessionProperty if exists. If not returns the defaultChannelName attribute using getStringAtribute
Returns:
a String, name of the channel
See Also:
getSessionProperty(String), getStringAttribute(String)

getConfigProperty

public String getConfigProperty(String key)
Gets the named configuration property.
Parameters:
key - a String, the property name.
Returns:
a String, the property value.