Package org.ametys.plugins.forms.helper
Class FormElementDefinitionHelper
java.lang.Object
org.ametys.plugins.forms.helper.FormElementDefinitionHelper
- All Implemented Interfaces:
Serviceable
Helper to create element definition for form
-
Field Summary
Modifier and TypeFieldDescriptionprotected static Logger
The loggerprotected static FormQuestionDataTypeExtensionPoint
The form question data type extension point -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ElementDefinition
getElementDefinition
(String name, String typeId, String labelKey, String descKey, Validator validator) Create element definitionstatic RepeaterDefinition
getRepeaterDefinition
(String datapath, ElementDefinition[] childElements, String labelKey, String descKey, String addKey, String deleteKey, Integer maxSize) Create repeater definitionvoid
service
(ServiceManager manager)
-
Field Details
-
_formQuestionDataTypeExtensionPoint
The form question data type extension point -
__logger
The logger
-
-
Constructor Details
-
FormElementDefinitionHelper
public FormElementDefinitionHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getElementDefinition
public static ElementDefinition getElementDefinition(String name, String typeId, String labelKey, String descKey, Validator validator) Create element definition- Parameters:
name
- the nametypeId
- the type idlabelKey
- the label i18n key. Can be null.descKey
- the desc i18n key. Can be null.validator
- the validator. Can be null.- Returns:
- the element definition
-
getRepeaterDefinition
public static RepeaterDefinition getRepeaterDefinition(String datapath, ElementDefinition[] childElements, String labelKey, String descKey, String addKey, String deleteKey, Integer maxSize) Create repeater definition- Parameters:
datapath
- path of the parent elementchildElements
- the repeater's childrenlabelKey
- the label i18n key. Can be null.descKey
- the desc i18n key. Can be null.addKey
- the add i18n key. Can be null.deleteKey
- the delete i18n key. Can be null.maxSize
- number maximum of entries- Returns:
- the created repeater
-