Klasse DocumentController
- Alle implementierten Schnittstellen:
Serializable
The DocumentController fires CDI events from the type WorkflowEvent. A CDI bean can observe these events to participate in the processing life cycle.
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.
After a document is loaded, a new conversation is started and the CDI event WorkflowEvent.DOCUMENT_CHANGED is fired.
After a document was saved, the conversation is automatically closed. Stale conversations will automatically timeout with the default session timeout.
After each call of the method save the Post-Redirect-Get is initialized with the default URL from the start of the conversation. This guarantees bookmakrable URLs.
Within a JSF form, the items of a document can be accessed by the getter method getDocument().
#{documentController.document.item['$workflowstatus']}
The default type of a entity created with the DataController is 'workitem'. This property can be changed from a client.
- Version:
- 0.0.1
- Autor:
- rsoika
- Siehe auch:
-
Feldübersicht
FelderVon Klasse geerbte Felder org.imixs.workflow.faces.data.AbstractDataController
data -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidcreate()This method creates an empty workItem with the default type property and the property '$Creator' holding the current RemoteUser This method should be overwritten to add additional Business logic here.voidThis action method deletes a workitem.Returns the current workItem.voidLoads a workitem by a given $uniqueid and starts a new conversaton.voidsave()This method saves the current document.voidsetDocument(ItemCollection document) Set the current worktItemVon Klasse geerbte Methoden org.imixs.workflow.faces.data.AbstractDataController
close, getDefaultType, getDocumentService, isNewWorkitem, onLoad, reset, setDefaultType, startConversation
-
Felddetails
-
events
-
-
Konstruktordetails
-
DocumentController
public DocumentController()
-
-
Methodendetails
-
getDocument
Returns the current workItem. If no workitem is defined the method Instantiates a empty ItemCollection.- Gibt zurück:
- - current workItem or null if not set
-
setDocument
Set the current worktItem- Parameter:
workitem- - new reference or null to clear the current workItem.
-
create
public void create()This method creates an empty workItem with the default type property and the property '$Creator' holding the current RemoteUser This method should be overwritten to add additional Business logic here. -
save
This method saves the current document.The method fires the WorkflowEvents WORKITEM_BEFORE_SAVE and WORKITEM_AFTER_SAVE.
- Löst aus:
AccessDeniedException- - if user has insufficient access rights.
-
delete
This action method deletes a workitem. The Method also deletes also all child workitems recursive- Parameter:
currentSelection- - workitem to be deleted- Löst aus:
AccessDeniedException
-
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.- Setzt außer Kraft:
loadin KlasseAbstractDataController- Parameter:
uniqueid-
-