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
whosecanManage(Resource)
returns true for a given resource, will get used. For getting an instance of this interface checkFormStructureHelperFactory
-
Form node which has form properties like
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canManage(Resource resource)
Tests whether thisFormStructureHelper
can obtain form properties from the given node.java.lang.Iterable<Resource>
getFormElements(Resource resource)
Gets the resources corresponding to fields of given form resource.Resource
getFormResource(Resource resource)
Gets the resource corresponding to form element i.e.Resource
updateFormStructure(Resource resource)
Updates necessary changes to the form resource.
-
-
-
Method Detail
-
canManage
boolean canManage(Resource resource)
Tests whether thisFormStructureHelper
can obtain form properties from the given node.- Parameters:
resource
-Resource
.- Returns:
- true if this
FormStructureHelper
can obtain form properties, false otherwise.
-
getFormResource
Resource getFormResource(Resource resource)
Gets the resource corresponding to form element i.e. the resource with form properties.
-
getFormElements
java.lang.Iterable<Resource> getFormElements(Resource resource)
Gets the resources corresponding to fields of given form resource.
-
updateFormStructure
Resource updateFormStructure(Resource resource)
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
-Resource
any resource.- Returns:
- updated form resource or null if it wasn't a form related resource or nothing has to be adapted.
-
-