Class FormContext

java.lang.Object
com.groiss.dms.FormContext

public class FormContext extends Object
A context object containing some information about the context in which a form is shown or edited.
  • Field Details

    • UPDATE

      public static final short UPDATE
      The form is shown for update: fields read-write, update button
      See Also:
    • INSERT

      public static final short INSERT
      The form is shown for insert: fields read-write, insert button
      See Also:
    • DELETE

      public static final short DELETE
      The form will be deleted.
      See Also:
    • VIEW

      public static final short VIEW
      The form is shown for view: fields read-only, close or back button
      See Also:
    • EMPTY

      public static final int EMPTY
      Show form with empty form object
      See Also:
    • VIEW_WITHOUT_BUTTONS

      public static final short VIEW_WITHOUT_BUTTONS
      The form is shown for view: fields read-only,no button
      See Also:
    • VIEW_FOR_VERSION

      public static final short VIEW_FOR_VERSION
      The form is shown for view versions
      See Also:
    • VIEW_TEXT

      public static final short VIEW_TEXT
      The form is shown for view: fields in text mode
      See Also:
  • Constructor Details

    • FormContext

      public FormContext(ActivityInstance ai, DMSFolder folder, DMSForm mainform, int mode)
      Create a form context object.
      Parameters:
      ai -
      folder -
      mainform -
      mode - the mode is used to determine how the form should be rendered: with or without buttons, readonly, etc. See the constants in this class.
    • FormContext

      public FormContext(HttpServletRequest req)
      Create a form context object.
  • Method Details

    • getActivityInstance

      public ActivityInstance getActivityInstance()
      Get the activity instance.
    • getProcessInstance

      public ProcessInstance getProcessInstance()
      Get the process instance.
    • getFolder

      public DMSFolder getFolder()
      Get the DMS-folder. Returns null, if form not in a folder.
    • getMainform

      public DMSForm getMainform()
      Get the main form. Returns null, if form is not a subform
    • setMainform

      public void setMainform(DMSForm mainform)
      Set the mainform.
    • getSubid

      public String getSubid()
      Get the id of this form in the mainform-subform relation.
    • setSubid

      public void setSubid(String subid)
      Set the id of this form in the mainform-subform relation.
    • getMode

      public int getMode()
      Get the view mode, one of the constants in this class.
    • setMode

      public void setMode(int mode)
      Set the view mode.
    • getFieldModes

      public Map<String,Short> getFieldModes()
      Get field modes for form fields.
      Returns:
      A map where the keys are the field names, the values are WfEngine.INVISIBLE, WfEngine.READ_ONLY, WfEngine.READ_WRITE, WfEngine.TEXT, WfEngine.MUST, WfEngine.NO_ADDDEL as short objects.
    • setFieldModes

      public void setFieldModes(Map<String,Short> modes)
      Set the filed modes. See getFieldModes for content.
    • setSubmitValidation

      public void setSubmitValidation(Boolean validate)
      Set the default for validation for submit buttons. This is evaluated only in Xforms.
    • getSubmitValidation

      public Boolean getSubmitValidation()
      Get the submitValidation value.
    • isBeforeShowCalled

      public boolean isBeforeShowCalled()
      Ask whether beforeShow is alreafy called.
    • setBeforeShowCalled

      public void setBeforeShowCalled(boolean c)
      Set the beforeShowCalled field.
    • setUserAgent

      public void setUserAgent(UserAgent ag)
    • getUserAgent

      public UserAgent getUserAgent()