|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Provider defines the interface for
implementing Content Providers (provider).
A provider is the programmatic entity responsible for generating channels on the desktop. There is not necessarily a one to one mapping between providers and channels; a single provider can generate one or more channels depending on how it is configured.
A content provider must implement this interface. The desktop calls these methods to query information about or to cause an action in the provider.
There are essentially three types of methods in this interface;
init()
on each of them. This is done only once per user session.
ProfileProviderAdapter,
ProviderAdapter| Field Summary | |
static int |
EDIT_COMPLETE
Edit page is a complete HTML document. |
static int |
EDIT_SUBSET
Edit page is not a complete HTML document. |
static int |
WIDTH_FULL_BOTTOM
Provider can be displayed in a "full" frame at the bottom. |
static int |
WIDTH_FULL_TOP
Provider can be displayed in a "full" frame at the top. |
static int |
WIDTH_THICK
Provider can be displayed in a "thick" frame. |
static int |
WIDTH_THIN
Provider can be displayed in a "thin" frame. |
| Method Summary | |
java.lang.String |
getBackgroundColor()
Get the background color for this provider. |
int |
getColumn()
Get the column in which this provider should be displayed in. |
java.lang.StringBuffer |
getContent(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Get the provider's content. |
java.lang.StringBuffer |
getContent(java.util.Map m)
Get the provider's content (alternate form). |
java.lang.String |
getDescription()
Get the description of this provider. |
java.lang.StringBuffer |
getEdit(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Get the edit page of the provider. |
java.lang.StringBuffer |
getEdit(java.util.Map m)
Get the edit page of the provider (alternate form). |
int |
getEditType()
Get the edit form type of the provider. |
java.net.URL |
getHelp()
Get the help link for this provider. |
java.lang.String |
getName()
Get the name of this provider. |
long |
getRefreshTime()
Get the refresh time for this provider, in seconds. |
int |
getRow()
Get the row in which this provider should be displayed in. |
java.lang.String |
getTitle()
Get the title of this provider. |
int |
getWidth()
Get the width of this provider. |
boolean |
hasBorder()
Should this provider have a border drawn around it? The desktop calls this method when the front page is drawn. |
boolean |
hasFrame()
Should this provider have a window frame around it? A frame is defined as the "window" frame containing a title and channel controls that surround provider content. |
boolean |
hasHelp()
Determine if the provider has a help page associated with it. |
void |
init(java.lang.String name,
Session session)
Initializes the provider. |
boolean |
isDetachable()
Determine if the provider can be detached from the Desktop. |
boolean |
isDetached()
Determine if the provider is detached from the Desktop. |
boolean |
isEditable()
Determine if the provider has an edit page. |
boolean |
isMinimizable()
Determine if the provider can be minimized on the Desktop. |
boolean |
isMinimized()
Determine if the provider is minimized on the Desktop. |
boolean |
isMovable()
Determine if the user can move this channel around on the desktop This method is called by the desktop when the user attempts to change the layout to see if they are allowed to move said channels. |
boolean |
isPresentable()
Determine if the provider is presentable based on the client device type. |
boolean |
isRemovable()
Determine if the user can remove this provider from the desktop This method is called by the desktop when it draws the front page. |
void |
load()
Load persistently stored attributes for this provider. |
java.net.URL |
processEdit(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Process the edit form for this provider. |
java.net.URL |
processEdit(java.util.Map m)
|
int |
setColumn(int column)
Sets the column for this provider to be displayed in. |
boolean |
setDetached(boolean detached)
Set the detached state of this provider. |
boolean |
setMinimized(boolean minimized)
Set the minimized state of this provider. |
int |
setRow(int row)
Sets the row for this provider to be displayed in. |
void |
store()
Persistently store attributes for this provider. |
| Field Detail |
public static final int WIDTH_THICK
public static final int WIDTH_THIN
public static final int WIDTH_FULL_TOP
public static final int WIDTH_FULL_BOTTOM
public static final int EDIT_SUBSET
.getEdit()
to signify that the buffer returned is only a subset of an
HTML document.public static final int EDIT_COMPLETE
.getEdit()
to signify that the buffer returned is a complete
HTML document.| Method Detail |
public void init(java.lang.String name,
Session session)
throws ProviderException
session - The Session object corresponding to the request
received by the desktop. This object allows the provider to query
the webtop profile service for information about itself
or the user who initiated the request. This parameter can be
ignored if your provider does not query the profile service.name - Unique name identifying this provider. This value
should always be returned from getName().getName()
public java.lang.StringBuffer getContent(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws ProviderException
Note: the request and response parameters are not the objects that passed by the web server to the DesktopServlet. Rather, they are wrappers for those objects. There are certain methods on these objects that are not allowed from providers. These include:
HttpServletRequest
HttpServletResponse
If these methods are called, an UnsupportedOperationException is thrown.
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
public java.lang.StringBuffer getContent(java.util.Map m)
throws ProviderException
m - A key-value mapping of GET parameters passed to the desktop
by the requesting browser.ProviderException
public java.lang.StringBuffer getEdit(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws ProviderException
This method must generate either a complete document, or a subset,
depending on the return value of .getEditType().
A subset document should include all code that goes between
the FORM tags. The exception is that the
submit and cancel buttons should not be
generated. A subset document is always submitted back to the
desktop servlet, where control is passed to the provider's
.processEdit() method for processing the
form data.
If a complete document is returned, there are several restrictions:
The above restrictions only apply if the form is to be submitted to the desktop servlet. If the form is submitted to a third-party CGI or servlet, the format will depend on what this entity is expecting.
Note: The same restrictions apply to the arguments for this method as for the arguments of the getContent method that takes a request and response.
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).getContent(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse),
isEditable(),
processEdit(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse),
getEditType(),
DesktopURL,
ProviderException
public java.lang.StringBuffer getEdit(java.util.Map m)
throws ProviderException
m - A key-value mapping of GET parameters passed to the desktop
by the requesting browser.
public int getEditType()
throws UnknownEditTypeException
.getEdit().EDIT_SUBSET or
EDIT_COMPLETEgetEdit(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse),
EDIT_SUBSET,
EDIT_COMPLETE
public java.net.URL processEdit(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws ProviderException
Form data, passed into this method in the request, has been decoded into Unicode.
When the iPS desktop receives a POST request, it looks at the parameters to identify which provider will handle the post, through this method. The request passed in contains the parameters.
After calling this method, the desktop will re-direct to the URL
returned from this method. Therefore, the result of a provider post
can be any desktop action, or the content of an arbitrary URL.
For more information on constructing iPS desktop URLs, see
DesktopURL.
Note: The same restrictions apply to the arguments for this method as for the arguments of the getContent method that takes a request and response.
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).InvalidEditFormData causes the
desktop to re-display the provider's edit page, otherwise,
the front page is returned.getEdit(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse),
isEditable(),
com.iplanet.portalserver.providers.InvalidEditFormData,
DesktopURL
public java.net.URL processEdit(java.util.Map m)
throws ProviderException
public boolean isEditable()
true or false, indicating if the
provider has an edit page.getEdit(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse),
processEdit(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse),
com.iplanet.portalserver.desktop.util.DtConstantspublic boolean isPresentable()
true or false, indicating if the
provider is presentable to the user's client device.public boolean hasHelp()
true if this provider has an help page, otherwise
falsepublic boolean isDetachable()
true if this provider can be detached,
otherwise falseisDetached(),
setDetached(boolean)public boolean isMinimizable()
true from this method, then it must
persistently store the detached state.
This method is called by the desktop when it draws the front page.true if this provider can be minimized,
otherwise falseisMinimized(),
setMinimized(boolean)public boolean isRemovable()
true if this provider can be removed
otherwise falsepublic boolean isMovable()
true if this provider is movable.
otherwise falsepublic boolean setDetached(boolean detached)
This method is called by the desktop when the user chooses to detach this provider.
detached - whether the provider is detached or not.isDetached(),
isDetachable()public boolean isDetached()
true from the isDetachable()
method, then is must then persistently store the detached
state.
The desktop calls this method when the front page is drawn.
true if this provider is detached,
otherwise falseisDetachable(),
setDetached(boolean)public boolean isMinimized()
true from isMinimizable(), it must then
persistently store the minimized state.
The desktop calls this method when the front page is drawn.true if this provider is minimized,
otherwise falseisMinimizable(),
setMinimized(boolean)public java.lang.String getTitle()
public java.lang.String getName()
public java.lang.String getDescription()
init(java.lang.String, com.iplanet.portalserver.session.Session)public java.lang.String getBackgroundColor()
public boolean hasBorder()
public boolean hasFrame()
public int getWidth()
WIDTH_THICK
or WIDTH_THIN.WIDTH_THIN,
WIDTH_THICKpublic int getColumn()
setColumn(int)public int getRow()
public java.net.URL getHelp()
hasHelp()public boolean setMinimized(boolean minimized)
The desktop calls this method when the user chooses to minimize a channel drawn by this provider.
minimized - whether the provider is minimized or not.isMinimizable(),
isMinimized()public int setColumn(int column)
column - The new column.getColumn()public int setRow(int row)
row - The new row.getRow()
public void load()
throws ProviderException
public void store()
throws ProviderException
public long getRefreshTime()
If provider content is expected to change very infrequently, this method can return some value so that the provider's content is not fetched every time the front page is drawn, thereby saving significant processing time.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||