com.ibm.workflow.portlet.client
Class JSPPortletViewer

java.lang.Object
  |
  +--com.ibm.workflow.portlet.client.DefaultViewer
        |
        +--com.ibm.workflow.portlet.client.JSPPortletViewer
All Implemented Interfaces:
java.io.Serializable, Viewer

public class JSPPortletViewer
extends DefaultViewer

This Viewer should be used when your Application server supports the JSP V1.0 standard. It uses JSPs for custom process and activity forms as well as for some other commands. This provides much more flexibility than the propriatary HTML template files used by DefaultViewer and it also supports internationalization.

A lot of control flow logic is inherited from the base class DefaultViewer, here only those methods that actually invoke JSPs are overridden.

You must set DefaultViewer=com.ibm.worklflow.servlet.client.JSPViewer in the PortalClient.properties file to in order to enable this Viewer.

See Also:
Serialized Form

Constructor Summary
JSPPortletViewer()
           
 
Method Summary
 ResponsePage cancelCreateAndStartResponse(RequestContext context)
           
 ResponsePage cancelWorkItemResponse(RequestContext context)
          Creates the page that is displayed when a work item checkout has been canceled.
 ResponsePage checkInWorkItemResponse(RequestContext context)
          Creates the page that is displayed when a work item has been checked in.
 ResponsePage checkOutWorkItemResponse(RequestContext context)
          Creates the page that will be displayed when a work item has been checked out.
 ResponsePage createAndStartInstanceResponse(RequestContext context)
          Creates the page displayed after a new process instance has been created and started.
 ResponsePage createListResponse(RequestContext context)
          This method is called to create the response page for the BuiltinHandler.createList() command.
 java.util.Vector createNavigatorEntries(RequestContext context, boolean enableLogoff)
          Overwrites method from base class and adds a action which causes the link to be display in the same instance.
 ResponsePage errorBasicResponse(RequestContext context)
          Creates the page that is shown in case of an error.
 ResponsePage errorResponse(RequestContext context)
          Creates the page that is shown in case of an error.
 ResponsePage forceFinishActivityResponse(RequestContext context)
          Creates the page that is displayed after an activity instance has been force finished.
 ResponsePage forceFinishWorkItemResponse(RequestContext context)
          Creates the page that is displayed after a work item has been force finished.
 ResponsePage forceRestartActivityResponse(RequestContext context)
          Creates the page that is displayed after an activity instance has been force restarted.
 ResponsePage forceRestartWorkItemResponse(RequestContext context)
          Creates the page that is displayed after a work item has been force restarted.
 ResponsePage getFilterAssistantResponse(RequestContext context)
          Deprecated. - this function will be redesigned in a later release
 ResponsePage getSortCriteriaAssistantResponse(RequestContext context)
          Deprecated. - this function will be redesigned in a later release
 ResponsePage getSystemInfoResponse(RequestContext context)
          Deprecated. - this function will be redesigned in a later release
 ResponsePage getUserInfoResponse(RequestContext context)
          Deprecated. - this function will be redesigned in a later release
 ResponsePage logoffResponse(RequestContext context)
          Creates the page that is shown after logoff.
 ResponsePage logonResponse(RequestContext context)
          Creates the page that is displayed after a successful logon.
 ResponsePage queryActivityInstancesResponse(RequestContext context)
          Creates the page that displays a list of activity instances.
 ResponsePage queryListsResponse(RequestContext context)
          Creates the page that displays the list of lists.
 ResponsePage queryProcessInstancesResponse(RequestContext context)
          Creates the page that displays a process instance list.
 ResponsePage queryProcessTemplatesResponse(RequestContext context)
          Creates the page that displays a process template list.
 ResponsePage queryWorkItemsResponse(RequestContext context)
          Creates the page that displays a worklist.
 ResponsePage setListPropertiesResponse(RequestContext context)
          Creates the page that displays the list of lists.
 ResponsePage showActivityPropertiesResponse(RequestContext context)
          Creates the page that displays activity instance properties.
 ResponsePage showControlConnectorPropertiesResponse(RequestContext context)
          Creates the page that displays control connector properties.
 ResponsePage showEditCredential(RequestContext context)
          Shows the ResponsePage for editing the credentials used for the edit mode of the portlet.
 ResponsePage showEditPreferences(RequestContext context, com.ibm.workflow.portlet.client.RequestPreferences preferences)
          Shows the page for specifying the response page settings.
 ResponsePage showInstancePropertiesResponse(RequestContext context)
          Creates the page that displays process instance properties.
 ResponsePage showListPropertiesResponse(RequestContext context)
          Creates the page that displays list settings.
 ResponsePage showTemplatePropertiesResponse(RequestContext context)
          Creates the page that displays process template properties.
 ResponsePage showWorkItemPropertiesResponse(RequestContext context)
          Creates the page that displays work item properties.
 ResponsePage startInstanceResponse(RequestContext context)
          Creates the page that will be displayed after a process instance has been started.
 ResponsePage suspendInstanceResponse(RequestContext context)
          Creates the page that is displayed after a process instance has been suspended.
 ResponsePage terminateActivityResponse(RequestContext context)
          Creates the page that is displayed after an activity instance has been terminated.
 
Methods inherited from class com.ibm.workflow.portlet.client.DefaultViewer
createInstanceResponse, createPersistentListResponse, deleteInstanceResponse, deleteItemResponse, deleteListResponse, deleteTemplateResponse, finishWorkItemResponse, getContainerData, init, restartInstanceResponse, restartWorkItemResponse, resumeInstanceResponse, setUserSettingsResponse, setViewSettingsResponse, startWorkItemResponse, terminateInstanceResponse, terminateWorkItemResponse, transferItemResponse
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSPPortletViewer

public JSPPortletViewer()
Method Detail

showEditPreferences

public ResponsePage showEditPreferences(RequestContext context,
                                        com.ibm.workflow.portlet.client.RequestPreferences preferences)
Shows the page for specifying the response page settings. See default jsp EditPreferences.jsp for details.
Parameters:
context - The request context.
entry - The Registration.Entry containing information about the preference settings for this instance.
Returns:
The response page.

errorBasicResponse

public ResponsePage errorBasicResponse(RequestContext context)
Creates the page that is shown in case of an error.
Parameters:
context - The request context.
Returns:
The response page.

errorResponse

public ResponsePage errorResponse(RequestContext context)
Creates the page that is shown in case of an error. This method implements 'logon splicing'. Errors other than NoSessionException are passed on to the base class. In the case of an expired session, the original command will be remembered and executed after a successful re-logon.
Overrides:
errorResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page.

logonResponse

public ResponsePage logonResponse(RequestContext context)
                           throws ClientException
Creates the page that is displayed after a successful logon. If this was a spliced logon page (see errorResponse(com.ibm.workflow.portlet.client.RequestContext)), the remembered command is extracted and executed. Otherwise, the base class is called to display the first list. If no list is found, the page to create a new list will be returned.
Overrides:
logonResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page.
Throws:
ClientException - if an error occurred

logoffResponse

public ResponsePage logoffResponse(RequestContext context)
Creates the page that is shown after logoff. This request will be forwarded to Logon.jsp.
Overrides:
logoffResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page.

showEditCredential

public ResponsePage showEditCredential(RequestContext context)
Shows the ResponsePage for editing the credentials used for the edit mode of the portlet.

queryListsResponse

public ResponsePage queryListsResponse(RequestContext context)
                                throws ClientException
Creates the page that displays the list of lists. This request will be forwarded to jsp/ListViewer.jsp which dynamically creates a page that contains a table with a row for each list on the list. This table also contains buttons that allow to invoke other commands, such as deleting a list.
Overrides:
queryListsResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page or null if lists of lists are disabled
Throws:
ClientException - if an error occurred

queryActivityInstancesResponse

public ResponsePage queryActivityInstancesResponse(RequestContext context)
                                            throws ClientException
Creates the page that displays a list of activity instances. This request will be forwarded to forms/ActivityList.jsp which dynamically creates a page that contains a table with a row for each activity on the list. This table also contains buttons that allow to invoke commands on the list entries
Overrides:
queryActivityInstancesResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page or null if activity lists are disabled
Throws:
ClientException - if an error occurred

showListPropertiesResponse

public ResponsePage showListPropertiesResponse(RequestContext context)
                                        throws ClientException
Creates the page that displays list settings. This request will be forwarded to jsp/ListPropertiesViewer.jsp.
Overrides:
showListPropertiesResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page.
Throws:
ClientException - if an error occurred

setListPropertiesResponse

public ResponsePage setListPropertiesResponse(RequestContext context)
                                       throws ClientException
Creates the page that displays the list of lists. This request will be forwarded to jsp/ListViewer.jsp which dynamically creates a page that contains a table with a row for each list.
Overrides:
setListPropertiesResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page.
Throws:
ClientException - if an error occurred

createListResponse

public ResponsePage createListResponse(RequestContext context)
                                throws ClientException
Description copied from interface: Viewer
This method is called to create the response page for the BuiltinHandler.createList() command.
Overrides:
createListResponse in class DefaultViewer
Following copied from interface: com.ibm.workflow.portlet.client.Viewer
Parameters:
context - The request context.
Returns:
The response page.
Throws:
com.ibm.workflow.servlet.client.ClientException - If an error occurred.

queryProcessTemplatesResponse

public ResponsePage queryProcessTemplatesResponse(RequestContext context)
                                           throws ClientException
Creates the page that displays a process template list. This request will be forwarded to jsp/ListViewer.jsp which dynamically creates a page that contains a table with a row for each template on the list. This table also contains buttons that allow to invoke other commands, such as displaying a template's properties.
Overrides:
queryProcessTemplatesResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page or null if template lists are disabled
Throws:
ClientException - if an error occurred

showTemplatePropertiesResponse

public ResponsePage showTemplatePropertiesResponse(RequestContext context)
                                            throws ClientException
Creates the page that displays process template properties. This request will be forwarded to jsp/PropertiesViewer.jsp.
Overrides:
showTemplatePropertiesResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page.
Throws:
ClientException - if an error occurred

createAndStartInstanceResponse

public ResponsePage createAndStartInstanceResponse(RequestContext context)
                                            throws ClientException
Creates the page displayed after a new process instance has been created and started.

If the process instance was not yet started because it required input data, the request will be forwarded to processes/TemplateName.jsp. This JSP should contain a form to fill in the required input container data and then again call BuiltinHandler.createAndStartInstance(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse). For a sample, see the credit request process. If the JSP file could not be found, the request will be passed to the base class DefaultViewer.

If the process instance was started by the web user, the request will be forwarded to the page denoted by the SuccessLocation request parameter if it is a JSP. Note that this JSP must be in the same Web Application as the page containing the createAndStartInstance command. If it is not, you must additionally set the UseRedirect request parameter to true. In this case, the JSP will not have access to the RequestContext bean.

If the process instance was started by the web user, and the SuccessLocation request parameter is not set or does not point to a JSP, the request will be passed to the base class DefaultViewer.

Overrides:
createAndStartInstanceResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page.
Throws:
ClientException - if an error occurred

checkInWorkItemResponse

public ResponsePage checkInWorkItemResponse(RequestContext context)
                                     throws ClientException
Description copied from class: DefaultViewer
Creates the page that is displayed when a work item has been checked in. This page calls BuiltinHandler.queryWorkItems() to show the work list again.
Overrides:
checkInWorkItemResponse in class DefaultViewer
Following copied from class: com.ibm.workflow.portlet.client.DefaultViewer
Parameters:
context - The request context.
Returns:
The response page.
Throws:
ClientException - if an error occurred

cancelWorkItemResponse

public ResponsePage cancelWorkItemResponse(RequestContext context)
                                    throws ClientException
Description copied from class: DefaultViewer
Creates the page that is displayed when a work item checkout has been canceled. This page calls BuiltinHandler.queryWorkItems() to show the work list again.
Overrides:
cancelWorkItemResponse in class DefaultViewer
Following copied from class: com.ibm.workflow.portlet.client.DefaultViewer
Parameters:
context - The request context.
Returns:
The response page.
Throws:
ClientException - if an error occurred

queryProcessInstancesResponse

public ResponsePage queryProcessInstancesResponse(RequestContext context)
                                           throws ClientException
Creates the page that displays a process instance list. This request will be forwarded to jsp/ListViewer.jsp which dynamically creates a page that contains a table with a row for each instance on the list. This table also contains buttons that allow to invoke other commands, such as displaying an instance's properties.
Overrides:
queryProcessInstancesResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page or null if template lists are disabled
Throws:
ClientException - if an error occurred

showInstancePropertiesResponse

public ResponsePage showInstancePropertiesResponse(RequestContext context)
                                            throws ClientException
Creates the page that displays process instance properties. This request will be forwarded to jsp/PropertiesViewer.jsp.
Overrides:
showInstancePropertiesResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page.
Throws:
ClientException - if an error occurred

startInstanceResponse

public ResponsePage startInstanceResponse(RequestContext context)
                                   throws ClientException
Creates the page that will be displayed after a process instance has been started. If the process instance was actually started, base class' startInstanceResponse method will be called. If the process instance was not yet started because it required input data, the request will be forwarded to processes/TemplateName.jsp, if this file exists.
Overrides:
startInstanceResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page.
Throws:
ClientException - if an error occurred

suspendInstanceResponse

public ResponsePage suspendInstanceResponse(RequestContext context)
                                     throws ClientException
Creates the page that is displayed after a process instance has been suspended. If the process instance was actually suspended, the base class' suspendInstanceResponse method will be called. If it has not yet been suspended because the necessary data has not been specified, the request will be forwarded to jsp/SuspendInstance.jsp so the parameters for the suspendInstance command can be specified.
Overrides:
suspendInstanceResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page.
Throws:
ClientException - if an error occurred

showActivityPropertiesResponse

public ResponsePage showActivityPropertiesResponse(RequestContext context)
                                            throws ClientException
Creates the page that displays activity instance properties. This request will be forwarded to jsp/PropertiesViewer.jsp.
Overrides:
showActivityPropertiesResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page.
Throws:
ClientException - if an error occurred

forceRestartActivityResponse

public ResponsePage forceRestartActivityResponse(RequestContext context)
                                          throws ClientException
Creates the page that is displayed after an activity instance has been force restarted. If the activity instance was actually force restarted, the request will be forwarded to jsp/PropertiesViewer.jsp (this is the only page from where activities can be force restarted). If it has not yet been force restarted because the necessary data has not been specified, the request will be forwarded to jsp/ForceRestart.jsp so the parameters for the forceRestartActivity command can be specified.
Overrides:
forceRestartActivityResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page.
Throws:
ClientException - if an error occurred

forceFinishActivityResponse

public ResponsePage forceFinishActivityResponse(RequestContext context)
                                         throws ClientException
Creates the page that is displayed after an activity instance has been force finished. If the activity instance was actually force finished, the request will be forwarded to jsp/PropertiesViewer.jsp (this is the only page from where activities can be force finished). If it has not yet been force finished because the necessary data has not been specified, the request will be forwarded to jsp/ForceFinish.jsp so the parameters for the forceFinishActivity command can be specified.
Overrides:
forceFinishActivityResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page.
Throws:
ClientException - if an error occurred

terminateActivityResponse

public ResponsePage terminateActivityResponse(RequestContext context)
                                       throws ClientException
Creates the page that is displayed after an activity instance has been terminated. This request will be forwarded to jsp/PropertiesViewer.jsp (this is the only page from where activities can be terminated).
Overrides:
terminateActivityResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page.
Throws:
ClientException - if an error occurred

showControlConnectorPropertiesResponse

public ResponsePage showControlConnectorPropertiesResponse(RequestContext context)
                                                    throws ClientException
Creates the page that displays control connector properties. This request will be forwarded to jsp/PropertiesViewer.jsp.
Overrides:
showControlConnectorPropertiesResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page.
Throws:
ClientException - if an error occurred

createNavigatorEntries

public java.util.Vector createNavigatorEntries(RequestContext context,
                                               boolean enableLogoff)
                                        throws ClientException
Overwrites method from base class and adds a action which causes the link to be display in the same instance.
Overrides:
createNavigatorEntries in class DefaultViewer
Following copied from interface: com.ibm.workflow.portlet.client.Viewer
Parameters:
context - The request context.
Returns:
The navigator entries
Throws:
com.ibm.workflow.servlet.client.ClientException - If an error occurred.

queryWorkItemsResponse

public ResponsePage queryWorkItemsResponse(RequestContext context)
                                    throws ClientException
Creates the page that displays a worklist. This request will be forwarded to jsp/ListViewer.jsp which dynamically creates a page that contains a table with a row for each work item on the list. This table also contains buttons that allow to invoke other commands, such as displaying an item's properties.
Overrides:
queryWorkItemsResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page or null if template lists are disabled
Throws:
ClientException - if an error occurred

showWorkItemPropertiesResponse

public ResponsePage showWorkItemPropertiesResponse(RequestContext context)
                                            throws ClientException
Creates the page that displays work item properties. This request will be forwarded to jsp/PropertiesViewer.jsp.
Overrides:
showWorkItemPropertiesResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page.
Throws:
ClientException - if an error occurred

checkOutWorkItemResponse

public ResponsePage checkOutWorkItemResponse(RequestContext context)
                                      throws ClientException
Creates the page that will be displayed when a work item has been checked out.

This request will be forwarded to programs/ProgramName.html (where ProgramName is the name of the program assigned to the activity). This JSP should contain a form to fill in the required input container data and then call BuiltinHandler.checkInWorkItem(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse). For a sample, see the credit request process. If the JSP file could not be found, the request will be passed to the base class DefaultViewer.

Overrides:
checkOutWorkItemResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page.
Throws:
ClientException - if an error occurred

forceFinishWorkItemResponse

public ResponsePage forceFinishWorkItemResponse(RequestContext context)
                                         throws ClientException
Creates the page that is displayed after a work item has been force finished. If the work item was actually force finished, the request will be forwarded to the base class' forceFinishWorkItemResponse method. If it has not yet been force finished because the necessary data has not been specified, the request will be forwarded to jsp/ForceFinish.jsp so the parameters for the forceFinishWorkItem command can be specified.
Overrides:
forceFinishWorkItemResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page.
Throws:
ClientException - if an error occurred

cancelCreateAndStartResponse

public ResponsePage cancelCreateAndStartResponse(RequestContext context)
                                          throws ClientException

forceRestartWorkItemResponse

public ResponsePage forceRestartWorkItemResponse(RequestContext context)
                                          throws ClientException
Creates the page that is displayed after a work item has been force restarted. If the work item was actually force restarted, the request will be forwarded to the base class' forceRestartWorkItemResponse method. If it has not yet been force restarted because the necessary data has not been specified, the request will be forwarded to jsp/ForceRestart.jsp so the parameters for the forceRestartWorkItem command can be specified.
Overrides:
forceRestartWorkItemResponse in class DefaultViewer
Parameters:
context - The request context.
Returns:
The response page.
Throws:
ClientException - if an error occurred

getFilterAssistantResponse

public ResponsePage getFilterAssistantResponse(RequestContext context)
                                        throws ClientException
Deprecated. - this function will be redesigned in a later release

Overrides:
getFilterAssistantResponse in class DefaultViewer

getSortCriteriaAssistantResponse

public ResponsePage getSortCriteriaAssistantResponse(RequestContext context)
                                              throws ClientException
Deprecated. - this function will be redesigned in a later release


getUserInfoResponse

public ResponsePage getUserInfoResponse(RequestContext context)
                                 throws ClientException
Deprecated. - this function will be redesigned in a later release

Overrides:
getUserInfoResponse in class DefaultViewer

getSystemInfoResponse

public ResponsePage getSystemInfoResponse(RequestContext context)
                                   throws ClientException
Deprecated. - this function will be redesigned in a later release

Overrides:
getSystemInfoResponse in class DefaultViewer


© Copyright IBM Corporation 2002, 2007. All Rights Reserved.