| java.lang.Object com.sun.portal.providers.ProviderAdapter
All known Subclasses: __PACKAGE__.__NAME__, com.sun.portal.providers.portletwindowprocess.PortletWindowProcessProvider, com.sun.portal.providers.ProfileProviderAdapter, com.sun.portal.desktop.test.TestProvider,
ProviderAdapter | abstract public class ProviderAdapter implements Provider,ProviderWidths,ProviderEditTypes(Code) | | This class provides default implementations of methods in the Provider
interface implemented using a ProviderContext object as the
persistent store.
Developers who wish to implement a provider should extend this class
or ProfileProviderAdapter.
The advantage of extending this class versus implementing the
Provider interface directly
is that you will maintain forward
compatability as additions are made to the Provider API. Existing
code will by default call the methods in this class. Eventually,
code should be written to implement all of the methods in the
Provider interface.
For method details, see the descriptions in the Provider
interface.
See Also: com.sun.portal.providers.context.ProviderContext See Also: com.sun.portal.providers.Provider |
Method Summary | |
String | getClientTypeProperty(String propertyName) This method has package-scope and is used here
and in ProfileProviderAdapter
for retrieving property values based on the session's clientType. | public StringBuffer | getContent(HttpServletRequest request, HttpServletResponse response) Calls the getContent(Map ) method in this object to provide backwards
compatibility.
The implementation of this method provides backwards compatibility
for providers that only implement the deprecated getContent(Map)
method. | public StringBuffer | getContent(Map m) This method has no effect. | public String | getDescription() Gets the description for the channel. | public StringBuffer | getEdit(HttpServletRequest request, HttpServletResponse response) Calls the getEdit(Map) method in this object to provide backwards
compatibility.
The implementation of this method provides backwards compatibility
for providers that only implement the deprecated getEdit(Map)
method. | public StringBuffer | getEdit(Map m) This method has no effect. | public int | getEditType() Gets the edit type for the channel. | public URL | getHelp(HttpServletRequest req, String key) Gets the named help URL for the channel that this object is
providing an environment for.
The request object parameter is included to facilitate implementations.
It can be used to get the server name, port, and protocol. | public URL | getHelp(HttpServletRequest req) Gets the default help URL for the channel that this object is providing an
environment for. | public String | getName() | public ProviderContext | getProviderContext() Gets the ProviderContext for the provider. | public long | getRefreshTime() Gets the refresh time for the channel. | public ResourceBundle | getResourceBundle(String base) Gets a specified ResourceBundle file for the provider based on User's
locale.
A provider can specify on-screen strings to be localized in a resource
bundle file, as described in the Java ResourceBundle class.
Parameters: base - a specified ResourceBundle name. See Also: java.util.ResourceBundle. | public ResourceBundle | getResourceBundle() Gets the well-knowned ResourceBundle for the provider based on User's
locale. | public String | getTitle() Gets the title for the channel. | public int | getWidth() Gets the width for the channel that this is
providing an environment for. | public void | init(String n, HttpServletRequest req) | public boolean | isEditable() Gets if the channel is editable. | public boolean | isPresentable() Dictates whether the provider is presentable. | public boolean | isPresentable(HttpServletRequest req) Dictates whether the provider is presentable.
Searches for the key genericHTML with the value
true on the client data for the session's client
type and returns true.
If there is no such key, method will return true if
the session's client type is named genericHTML .
In both cases, the content-type for the session's client type must
equal text/html in order for the method to return true.
Parameters: request - An HttpServletRequest that containsthe request the client made of the provider. | public URL | processEdit(HttpServletRequest request, HttpServletResponse response) Calls the processEdit(Map) method in this object to provide backwards
compatibility.
The implementation of this method provides backwards compatibility
for providers that only implement the deprecated processEdit(Map)
method. | public URL | processEdit(Map m) This method has no effect. |
getClientTypeProperty | String getClientTypeProperty(String propertyName) throws ProviderException(Code) | | This method has package-scope and is used here
and in ProfileProviderAdapter
for retrieving property values based on the session's clientType.
Parameters: propertyName - client property name The client property value exception: ClientException - When propertyName is null or when there was an exceptiongetting the client property. |
getContent | public StringBuffer getContent(HttpServletRequest request, HttpServletResponse response) throws ProviderException(Code) | | Calls the getContent(Map ) method in this object to provide backwards
compatibility.
The implementation of this method provides backwards compatibility
for providers that only implement the deprecated getContent(Map)
method. It logs a warning informing the administrator that calling
this method has performance implications, and that it should be
re-implemented using the non-deprecated version of this method.
Each time this method is called, the HTTP parameter data in the request
object must be converted to the Map form that is accepted by the
getContent(Map) version of this method.
|
getEdit | public StringBuffer getEdit(HttpServletRequest request, HttpServletResponse response) throws ProviderException(Code) | | Calls the getEdit(Map) method in this object to provide backwards
compatibility.
The implementation of this method provides backwards compatibility
for providers that only implement the deprecated getEdit(Map)
method. It logs a warning informing the administrator that calling
this method has performance implications, and that it should be
re-implemented using the non-deprecated version of this method.
Each time this method is called, the HTTP parameter data in the request
object must be converted to the Map form that is accepted by the
getEdit(Map) version of this method.
|
getEditType | public int getEditType() throws UnknownEditTypeException(Code) | | Gets the edit type for the channel. The edit type for
a channel informs clients of the channel (such as a container channel)
what sort of content to be returned for its edit view; either a
fragment or a complete document.
The edit type; either EDIT_COMPLETE or EDIT_SUBSET. exception: UnknownEditTypeException - if an error occurs when getting theedit type of the channel. See Also: com.sun.portal.providers.ProviderEditTypes |
getHelp | public URL getHelp(HttpServletRequest req, String key) throws ProviderException(Code) | | Gets the named help URL for the channel that this object is
providing an environment for.
The request object parameter is included to facilitate implementations.
It can be used to get the server name, port, and protocol. These can
be used to transform a relative URL to absolute. It is not required
that the request object be used as such.
If the named help page is not supported, then the default help URL
is returned (see getHelp(HttpServletRequest) ).
Parameters: key - Key name that maps to a help URL. Parameters: req - Request object containing information for buildingthe URL. A URL object. exception: ProviderException - If there was an error constructing theURL. |
getHelp | public URL getHelp(HttpServletRequest req) throws ProviderException(Code) | | Gets the default help URL for the channel that this object is providing an
environment for. This method must return an absolute URL.
The request object parameter is included to facilitate implementations.
It can be used to get the server name, port, and protocol. These can
be used to transform a relative URL to absolute. It is not required
that the request object be used as such.
Parameters: req - Request object containing information for buildingthe URL. URL object that points to the channel's help page. exception: ProviderException - If there was an error constructing theURL. See Also: ProviderAdapter.getHelp(HttpServletRequest) |
getName | public String getName()(Code) | | The name of the provider, as it was passed in to the init()method. |
getRefreshTime | public long getRefreshTime() throws ProviderException(Code) | | Gets the refresh time for the channel. The refresh time for a channel
is used to allow containers to implement caching of content
for their contained channels. This value is used to indicate
the validity of the cached content.
>0, refresh time in number of seconds that a container shouldwait before expiring a content cache.0, container should never cache channel's content.-1, container may cache channel's content indefinitely. exception: ProviderException - If there was an error getting the refreshtime for the channel. |
getResourceBundle | public ResourceBundle getResourceBundle(String base) throws ProviderException(Code) | | Gets a specified ResourceBundle file for the provider based on User's
locale.
A provider can specify on-screen strings to be localized in a resource
bundle file, as described in the Java ResourceBundle class.
Parameters: base - a specified ResourceBundle name. See Also: java.util.ResourceBundle. ResourceBundle . |
getResourceBundle | public ResourceBundle getResourceBundle() throws ProviderException(Code) | | Gets the well-knowned ResourceBundle for the provider based on User's
locale.
A provider can specify on-screen strings to be localized in a resource
bundle file, as described in the Java ResourceBundle class.
The well-knowned name is the provider name.
ResourceBundle . |
getWidth | public int getWidth() throws ProviderException(Code) | | Gets the width for the channel that this is
providing an environment for. The channel width is used as a
suggestion to the container of the channel as to how much screen
real estate it requires.
The width; either WIDTH_THIN, WIDTH_THICK,WIDTH_FULL_TOP, or WIDTH_FULL_BOTTOM. exception: ProviderException - If there was an error getting the widthof the channel. See Also: com.sun.portal.providers.ProviderWidths |
isEditable | public boolean isEditable() throws ProviderException(Code) | | Gets if the channel is editable. If a provider is editable, it is capable
of providing an edit view to clients.
true if the channel is editable, otherwisefalse . exception: ProviderException - if error occurs when getting if the channelis editable. |
isPresentable | public boolean isPresentable()(Code) | | Dictates whether the provider is presentable.
Searches for the key genericHTML with the value
true on the client data for the session's client
type and returns true.
If there is no such key, method will return true if
the session's client type is named genericHTML .
In both cases, the content-type for the session's client type must
equal text/html in order for the method to return true.
A boolean value dictating presentability See Also: com.sun.portal.providers.Provider.isPresentable |
isPresentable | public boolean isPresentable(HttpServletRequest req)(Code) | | Dictates whether the provider is presentable.
Searches for the key genericHTML with the value
true on the client data for the session's client
type and returns true.
If there is no such key, method will return true if
the session's client type is named genericHTML .
In both cases, the content-type for the session's client type must
equal text/html in order for the method to return true.
Parameters: request - An HttpServletRequest that containsthe request the client made of the provider. A boolean value dictating presentability See Also: com.sun.portal.providers.Provider.isPresentable |
processEdit | public URL processEdit(HttpServletRequest request, HttpServletResponse response) throws ProviderException(Code) | | Calls the processEdit(Map) method in this object to provide backwards
compatibility.
The implementation of this method provides backwards compatibility
for providers that only implement the deprecated processEdit(Map)
method. It logs a warning informing the administrator that calling
this method has performance implications, and that it should be
re-implemented using the non-deprecated version of this method.
Each time this method is called, the HTTP parameter data in the request
object must be converted to the Map form that is accepted by the
processEdit(Map) version of this method.
|
|
|