Package com.day.cq.wcm.foundation.forms
Interface FormStructureHelper
public interface FormStructureHelper
Interface for retrieving form properties from different form node structures. A form node structure consists
of following kinds of nodes:
-
Form node which has form properties like
FormsConstants.START_PROPERTY_ACTION_TYPE,FormsConstants.START_PROPERTY_LOAD_PATH. - Form field node which correspond to various input elements which can be present in form.
FormStructureHelper whose
canManage(Resource) returns true for a given resource, will get used.
For getting an instance of this interface check FormStructureHelperFactory-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests whether thisFormStructureHelpercan obtain form properties from the given node.getFormElements(Resource resource) Gets the resources corresponding to fields of given form resource.getFormResource(Resource resource) Gets the resource corresponding to form element i.e.updateFormStructure(Resource resource) Updates necessary changes to the form resource.
-
Method Details
-
canManage
Tests whether thisFormStructureHelpercan obtain form properties from the given node.- Parameters:
resource-Resource.- Returns:
- true if this
FormStructureHelpercan obtain form properties, false otherwise.
-
getFormResource
Gets the resource corresponding to form element i.e. the resource with form properties. -
getFormElements
Gets the resources corresponding to fields of given form resource. -
updateFormStructure
Updates necessary changes to the form resource. Can be used to set minimal default values for the form (e.g. action type) and to ensure additional mandatory resources (e.g. form start and form end resource)- Parameters:
resource-Resourceany resource.- Returns:
- updated form resource or null if it wasn't a form related resource or nothing has to be adapted.
-