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:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.imixs.workflow.ItemCollection
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    void
    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
    load(String uniqueid)
    Loads a workitem by a given $uniqueid and starts a new conversaton.
    void
    This method extracts a $uniqueid from the query param 'id' and loads the workitem.
    void
    Reset current document
    void
    This method set the default 'type' attribute of the local workitem.
    protected void
    Starts a new conversation

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • data

      protected org.imixs.workflow.ItemCollection data
  • Constructor Details

    • AbstractDataController

      public AbstractDataController()
  • Method Details

    • 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