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
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:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the current conversation and reset the data item.This method returns the Default 'type' attribute of the local workitem.boolean
Returns true if the current document was never saved before by the DocumentService.void
Loads a workitem by a given $uniqueid and starts a new conversaton.void
onLoad()
This method extracts a $uniqueid from the query param 'id' and loads the workitem.void
reset()
Reset current documentvoid
setDefaultType
(String type) This method set the default 'type' attribute of the local workitem.protected void
Starts a new conversation
-
Field Details
-
data
-
-
Constructor Details
-
AbstractDataController
public AbstractDataController()
-
-
Method Details
-
getDocumentService
-
getDefaultType
This method returns the Default 'type' attribute of the local workitem. -
setDefaultType
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:
-
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
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
-