Package org.imixs.workflow.faces.data
Class AbstractDataController
- java.lang.Object
-
- org.imixs.workflow.faces.data.AbstractDataController
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DocumentController,WorkflowController
public abstract class AbstractDataController extends Object implements Serializable
This is the abstract base class for the CDI beans DocumentController and WorkflowController.To load a document the methods load(id) and onLoad() can be used. The method load expects the uniqueId of a document to be loaded. The onLoad() method extracts the uniqueid from the query parameter 'id'. This is the recommended way to support bookmarkable URLs. To load a document the onLoad method can be triggered by an jsf viewAction placed in the header of a JSF page:
<f:metadata> <f:viewAction action="... documentController.onLoad()" /> </f:metadata>A bookmarkable URL looks like this:
/myForm.xthml?id=[UNIQUEID]In combination with the viewAction the DocumentController is automatically initialized.
https://stackoverflow.com/questions/6377798/what-can-fmetadata-fviewparam-and-fviewaction-be-used-for
- Version:
- 1.0
- Author:
- rsoika
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected org.imixs.workflow.ItemCollectiondata
-
Constructor Summary
Constructors Constructor Description AbstractDataController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMessage(String ressourceBundleName, String messageKey, Object param)This method can be used to add a Error Messege to the Application Context during an actionListener Call.voidclose()Closes the current conversation and reset the data item.StringgetDefaultType()This method returns the Default 'type' attribute of the local workitem.DocumentServicegetDocumentService()booleanisNewWorkitem()Returns true if the current document was never saved before by the DocumentService.voidload(String uniqueid)Loads a workitem by a given $uniqueid and starts a new conversaton.voidonLoad()This method extracts a $uniqueid from the query param 'id' and loads the workitem.voidreset()Reset current documentvoidsetDefaultType(String type)This method set the default 'type' attribute of the local workitem.protected voidstartConversation()Starts a new conversation
-
-
-
Method Detail
-
getDocumentService
public DocumentService getDocumentService()
-
getDefaultType
public String getDefaultType()
This method returns the Default 'type' attribute of the local workitem.
-
setDefaultType
public void setDefaultType(String type)
This method set the default 'type' attribute of the local workitem. Subclasses may overwrite the type- Parameters:
type-
-
reset
public void reset()
Reset current document
-
isNewWorkitem
public boolean isNewWorkitem()
Returns true if the current document was never saved before by the DocumentService. This is indicated by the time difference of $modified and $created.- Returns:
-
addMessage
public void addMessage(String ressourceBundleName, String messageKey, Object param)
This method can be used to add a Error Messege to the Application Context during an actionListener Call. Typical this method is used in the doProcessWrktiem method to display a processing exception to the user. The method expects the Ressoruce bundle name and the message key inside the bundle.- Parameters:
ressourceBundleName-messageKey-param-
-
onLoad
public void onLoad()
This method extracts a $uniqueid from the query param 'id' and loads the workitem. After the workitm was loaded, a new conversation is started.The method is not running during a JSF Postback of in case of a JSF validation error.
-
load
public void load(String uniqueid)
Loads a workitem by a given $uniqueid and starts a new conversaton. The conversaion will be ended after the workitem was processed or after the MaxInactiveInterval from the session.- Parameters:
uniqueid-
-
close
public void close()
Closes the current conversation and reset the data item. A conversation is automatically started by the methods load() and onLoad(). You can call the close() method in a actionListener on any JSF navigation action.
-
startConversation
protected void startConversation()
Starts a new conversation
-
-