Class RestFormData
java.lang.Object
org.opencastproject.runtimeinfo.rest.RestFormData
-
Constructor Summary
ConstructorsConstructorDescriptionRestFormData(RestEndpointData endpoint) 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 TypeMethodDescriptiongetItems()Returns the list of form parameters.booleanReturns whether the form submission should be an ajax submission or a normal submission.booleanisBasic()Returns whether this form is for a basic endpoint which has no parameters.booleanisEmpty()Returns true if this form has no parameter in it, false if there is parameter in it.booleanReturns whether the form contains a body parameter (i.e. a file upload option).voidsetAjaxSubmit(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)voidsetFileUpload(boolean fileUpload) Set this to true if the file contains a file upload control, this will be determined automatically for auto-generated forms.toString()Returns a string representation of this form.
-
Constructor Details
-
RestFormData
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
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
Returns the list of form parameters.- Returns:
- a list of form parameters
-