Class RestFormData

java.lang.Object
org.opencastproject.runtimeinfo.rest.RestFormData

public class RestFormData extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor which will auto-populate the form using the data in the endpoint, this will enable the ajax submit if it is possible to do so.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the list of form parameters.
    boolean
    Returns whether the form submission should be an ajax submission or a normal submission.
    boolean
    Returns whether this form is for a basic endpoint which has no parameters.
    boolean
    Returns true if this form has no parameter in it, false if there is parameter in it.
    boolean
    Returns whether the form contains a body parameter (i.e. a file upload option).
    void
    setAjaxSubmit(boolean ajaxSubmit)
    Controls whether the form will be submitted via ajax and the content rendered on the page, NOTE that uploading any files or downloading any content that is binary will require not using ajax submit, also note that there may be other cases where ajax submission will fail to work OR where normal submission will fail to work (using PUT/DELETE)
    void
    setFileUpload(boolean fileUpload)
    Set this to true if the file contains a file upload control, this will be determined automatically for auto-generated forms.
    Returns a string representation of this form.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • RestFormData

      public RestFormData(RestEndpointData endpoint) throws IllegalArgumentException
      Constructor which will auto-populate the form using the data in the endpoint, this will enable the ajax submit if it is possible to do so.
      Parameters:
      endpoint - a RestEndpointData object populated with all parameters it needs
      Throws:
      IllegalArgumentException - when endpoint is null
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Returns true if this form has no parameter in it, false if there is parameter in it.
      Returns:
      a boolean indicating whether this form contains any parameter
    • setAjaxSubmit

      public void setAjaxSubmit(boolean ajaxSubmit)
      Controls whether the form will be submitted via ajax and the content rendered on the page, NOTE that uploading any files or downloading any content that is binary will require not using ajax submit, also note that there may be other cases where ajax submission will fail to work OR where normal submission will fail to work (using PUT/DELETE)
      Parameters:
      ajaxSubmit - a boolean indicating whether ajax submit is used
    • setFileUpload

      public void setFileUpload(boolean fileUpload)
      Set this to true if the file contains a file upload control, this will be determined automatically for auto-generated forms.
      Parameters:
      fileUpload - a boolean indicating whether there is file upload in this test
    • toString

      public String toString()
      Returns a string representation of this form.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this form
    • isAjaxSubmit

      public boolean isAjaxSubmit()
      Returns whether the form submission should be an ajax submission or a normal submission.
      Returns:
      a boolean indicating whether the form submission should be an ajax submission or a normal submission
    • isFileUpload

      public boolean isFileUpload()
      Returns whether the form contains a body parameter (i.e. a file upload option).
      Returns:
      a boolean indicating whether the form contains a body parameter (i.e. a file upload option)
    • isBasic

      public boolean isBasic()
      Returns whether this form is for a basic endpoint which has no parameters.
      Returns:
      a boolean indicating whether this form is for a basic endpoint which has no parameters
    • getItems

      public List<RestParamData> getItems()
      Returns the list of form parameters.
      Returns:
      a list of form parameters