|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.portal.providers.ProviderAdapter
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.
ProviderContext
,
Provider
Fields inherited from interface com.sun.portal.providers.ProviderWidths |
WIDTH_FULL_BOTTOM, WIDTH_FULL_TOP, WIDTH_THICK, WIDTH_THIN |
Fields inherited from interface com.sun.portal.providers.ProviderEditTypes |
EDIT_COMPLETE, EDIT_SUBSET |
Constructor Summary | |
ProviderAdapter()
|
Method Summary | |
StringBuffer |
getContent(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Calls the getContent( Map ) method in this object to provide backwards
compatibility. |
StringBuffer |
getContent(Map m)
Deprecated. Using this method has negative performance implications. Use getContent(HttpServletRequest, HttpServletResponse) instead. |
String |
getDescription()
Gets the description for the channel. |
StringBuffer |
getEdit(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Calls the getEdit(Map) method in this object to provide backwards compatibility. |
StringBuffer |
getEdit(Map m)
Deprecated. Using this method has negative performance implications. Use getEdit(HttpServletRequest, HttpServletResponse) instead. |
int |
getEditType()
Gets the edit type for the channel. |
URL |
getHelp(javax.servlet.http.HttpServletRequest req)
Gets the default help URL for the channel that this object is providing an environment for. |
URL |
getHelp(javax.servlet.http.HttpServletRequest req,
String key)
Gets the named help URL for the channel that this object is providing an environment for. |
String |
getName()
Gets the name of this provider. |
ProviderContext |
getProviderContext()
Gets the ProviderContext for the provider. |
long |
getRefreshTime()
Gets the refresh time for the channel. |
ResourceBundle |
getResourceBundle()
Gets the well-knowned ResourceBundle for the provider based on User's locale. |
ResourceBundle |
getResourceBundle(String base)
Gets a specified ResourceBundle file for the provider based on User's locale. |
String |
getTitle()
Gets the title for the channel. |
int |
getWidth()
Gets the width for the channel that this is providing an environment for. |
void |
init(String n,
javax.servlet.http.HttpServletRequest req)
Initializes the provider. |
boolean |
isEditable()
Gets if the channel is editable. |
boolean |
isPresentable()
Dictates whether the provider is presentable. |
URL |
processEdit(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Calls the processEdit(Map) method in this object to provide backwards compatibility. |
URL |
processEdit(Map m)
Deprecated. Using this method has negative performance implications. Use processEdit(HttpServletRequest, HttpServletResponse) instead. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ProviderAdapter()
Method Detail |
public void init(String n, javax.servlet.http.HttpServletRequest req) throws ProviderException
Provider
This method must be called by clients of the provider object when the provider object is created (after it is constructed, or before the object is used). This method should not be called more than once per object.
init
in interface Provider
com.sun.portal.providers.Provider
name
- Unique name identifying this provider. This value
should always be returned from getName()
.req
- The HTTP request object corresponding to the HTTP request
that caused this provider object to be created. This request may be
used to extract session or user information that could be used to
gain access to external resources.ProviderException
- If there was an error initializing the
provider. How this exception is handled is up to the client of the
provider object.Provider.getName()
public StringBuffer getContent(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws ProviderException
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.
getContent
in interface Provider
com.sun.portal.providers.Provider
request
- An HttpServletRequest that contains
information related to this request for content.response
- An HttpServletResponse that allows the provider
to influence the
overall response for the desktop page (besides generating the content).ProviderException
- If there was an error generating the
content. How this exception is handled is up to the client of the
provider object.ProviderException
public StringBuffer getContent(Map m) throws ProviderException
getContent
in interface Provider
public StringBuffer getEdit(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws ProviderException
getEdit
in interface Provider
com.sun.portal.providers.Provider
request
- An HttpServletRequest that
contains information related to this request for content.response
- An HttpServletResponse that
allows the provider to influence the
overall response for the desktop page (besides generating the content).ProviderException
- If there was an error generating the
edit form. How this exception is handled is up to the client of the
provider object.Provider.getContent(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
,
Provider.isEditable()
,
Provider.processEdit(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
,
Provider.getEditType()
,
DesktopServlet
,
ProviderException
public StringBuffer getEdit(Map m) throws ProviderException
getEdit
in interface Provider
public int getEditType() throws UnknownEditTypeException
getEditType
in interface Provider
UnknownEditTypeException
- if an error occurs when getting the
edit type of the channel.ProviderEditTypes
public URL processEdit(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws ProviderException
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.
processEdit
in interface Provider
com.sun.portal.providers.Provider
request
- An HttpServletRequest that contains
information related to this
request for content.response
- An HttpServletResponse that allows the
provider to influence the
overall response for the desktop page (besides generating the content).ProviderException
- If there was an error processing
the edit form. How this exception is handled is up to the client of the
provider object.Provider.getEdit(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
,
Provider.isEditable()
,
InvalidEditFormDataException
,
DesktopServlet
public URL processEdit(Map m) throws ProviderException
processEdit
in interface Provider
public boolean isEditable() throws ProviderException
isEditable
in interface Provider
true
if the channel is editable, otherwise
false
.ProviderException
- if error occurs when getting if the channel
is editable.public boolean isPresentable()
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.
isPresentable
in interface Provider
Provider.isPresentable()
public String getTitle() throws ProviderException
getTitle
in interface Provider
ProviderException
- if error occurs when getting the title for
the channel.public String getName()
Provider
The name returned from this method must match the name of the provider that it was initialized with.
getName
in interface Provider
public String getDescription() throws ProviderException
getDescription
in interface Provider
ProviderException
- if error occurs when getting the description
of the channel.public int getWidth() throws ProviderException
getWidth
in interface Provider
ProviderException
- If there was an error getting the width
of the channel.ProviderWidths
public URL getHelp(javax.servlet.http.HttpServletRequest req, String key) throws ProviderException
getHelp(HttpServletRequest)
).key
- Key name that maps to a help URL.req
- Request object containing information for building
the URL.ProviderException
- If there was an error constructing the
URL.public URL getHelp(javax.servlet.http.HttpServletRequest req) throws ProviderException
getHelp
in interface Provider
req
- Request object containing information for building
the URL.ProviderException
- If there was an error constructing the
URL.getHelp(HttpServletRequest)
public long getRefreshTime() throws ProviderException
getRefreshTime
in interface Provider
ProviderException
- If there was an error getting the refresh
time for the channel.public ProviderContext getProviderContext()
ProviderContext
for the provider.ProviderContext
.ProviderContext
public ResourceBundle getResourceBundle(String base) throws ProviderException
A provider can specify on-screen strings to be localized in a resource
bundle file, as described in the Java ResourceBundle
class.
base
- a specified ResourceBundle
name.ResourceBundle
.java.util.ResourceBundle.
public ResourceBundle getResourceBundle() throws ProviderException
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
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |