Class AbstractDataController

All Implemented Interfaces:
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:viewAction action="... documentController.onLoad()" />

A bookmarkable URL looks like this:


In combination with the viewAction the DocumentController is automatically initialized.

See Also:
  • Field Details

  • 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
      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.
    • 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.
      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.
      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