Package org.ametys.web.parameters
Class ViewAndParametersParser
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.web.parameters.ViewAndParametersParser
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
Helper to parse parameters from configuration
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
The view and parameters object -
Field Summary
Modifier and TypeFieldDescriptionprotected ServiceManager
The service managerstatic final String
Avalon Role -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
_parseChildren
(Configuration containerConfiguration, ViewItemContainer viewItemContainer, ModelItemGroup modelParent, String pluginName, String catalog, View view, Map<String, ModelItem> modelItems, Model model, ElementDefinitionParser elementDefinitionParser, RepeaterDefinitionParser repeaterDefinitionParser) Parses children of a view item containerprotected I18nizableText
_parseI18nizableText
(Configuration config, String name, String pluginName, String catalog) Parse an i18n text.protected SimpleViewItemGroup
_parseSimpleViewItemGroup
(Configuration groupConfiguration, ModelItemGroup modelParent, String pluginName, String catalog, View view, Map<String, ModelItem> modelItems, Model model, ElementDefinitionParser elementDefinitionParser, RepeaterDefinitionParser repeaterDefinitionParser) Parses a simple view item group (group or fieldset)parseParameter
(Configuration paramConfiguration, ModelItemGroup parent, String pluginName, String catalog, View view, Map<String, ModelItem> modelItems, Model model, ElementDefinitionParser elementDefinitionParser, RepeaterDefinitionParser repeaterDefinitionParser) Parses a service parameterparseParameters
(Configuration parametersConfiguration, String pluginName, String catalog, Model model, ElementDefinitionParser elementDefinitionParser, RepeaterDefinitionParser repeaterDefinitionParser) Parse the configuration to get parameters.parseRepeater
(Configuration repeaterConfiguration, ModelItemGroup parent, String pluginName, String catalog, View view, Map<String, ModelItem> modelItems, Model model, ElementDefinitionParser elementDefinitionParser, RepeaterDefinitionParser repeaterDefinitionParser) Parses a repeatervoid
service
(ServiceManager smanager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
Avalon Role -
_manager
The service manager
-
-
Constructor Details
-
ViewAndParametersParser
public ViewAndParametersParser()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
parseParameters
public ViewAndParametersParser.ViewAndParameters parseParameters(Configuration parametersConfiguration, String pluginName, String catalog, Model model, ElementDefinitionParser elementDefinitionParser, RepeaterDefinitionParser repeaterDefinitionParser) throws ConfigurationException Parse the configuration to get parameters.- Parameters:
parametersConfiguration
- the parameters configuration.pluginName
- the plugin namecatalog
- the catalogmodel
- the modelelementDefinitionParser
- the element definition parserrepeaterDefinitionParser
- the repeater definition parser- Returns:
- the parameters
- Throws:
ConfigurationException
- if an error occurs.
-
_parseSimpleViewItemGroup
protected SimpleViewItemGroup _parseSimpleViewItemGroup(Configuration groupConfiguration, ModelItemGroup modelParent, String pluginName, String catalog, View view, Map<String, ModelItem> modelItems, Model model, ElementDefinitionParser elementDefinitionParser, RepeaterDefinitionParser repeaterDefinitionParser) throws ConfigurationExceptionParses a simple view item group (group or fieldset)- Parameters:
groupConfiguration
- the item group configurationmodelParent
- The last model item group to use as parent for next definitionspluginName
- the plugin namecatalog
- the catalogview
- the viewmodelItems
- the map of model itemsmodel
- the modelelementDefinitionParser
- the element definition parserrepeaterDefinitionParser
- the repeater definition parser- Returns:
- the parsed simple view item group
- Throws:
ConfigurationException
- if an error occurs
-
parseParameter
public ViewElement parseParameter(Configuration paramConfiguration, ModelItemGroup parent, String pluginName, String catalog, View view, Map<String, ModelItem> modelItems, Model model, ElementDefinitionParser elementDefinitionParser, RepeaterDefinitionParser repeaterDefinitionParser) throws ConfigurationExceptionParses a service parameter- Parameters:
paramConfiguration
- the parameter configurationparent
- the parent of the service parameter. Can benull
if the parameter has no parentpluginName
- the plugin namecatalog
- the catalogview
- the viewmodelItems
- the map of model itemmodel
- the modelelementDefinitionParser
- the element definition parserrepeaterDefinitionParser
- the repeater definition parser- Returns:
- the parsed parameter
- Throws:
ConfigurationException
- if an error occurs
-
parseRepeater
public ModelViewItemGroup parseRepeater(Configuration repeaterConfiguration, ModelItemGroup parent, String pluginName, String catalog, View view, Map<String, ModelItem> modelItems, Model model, ElementDefinitionParser elementDefinitionParser, RepeaterDefinitionParser repeaterDefinitionParser) throws ConfigurationExceptionParses a repeater- Parameters:
repeaterConfiguration
- the repeater configurationparent
- the parent of the repeater. Can benull
if the repeater has no parentpluginName
- the plugin namecatalog
- the catalogview
- the viewmodelItems
- the map of model itemmodel
- the modelelementDefinitionParser
- the element definition parserrepeaterDefinitionParser
- the repeater definition parser- Returns:
- the parsed repeater
- Throws:
ConfigurationException
- if an error occurs
-
_parseChildren
protected void _parseChildren(Configuration containerConfiguration, ViewItemContainer viewItemContainer, ModelItemGroup modelParent, String pluginName, String catalog, View view, Map<String, ModelItem> modelItems, Model model, ElementDefinitionParser elementDefinitionParser, RepeaterDefinitionParser repeaterDefinitionParser) throws ConfigurationExceptionParses children of a view item container- Parameters:
containerConfiguration
- the item container configurationviewItemContainer
- the item containermodelParent
- The last model item container to use as parent for next definitionspluginName
- the plugin namecatalog
- the catalogview
- the viewmodelItems
- the map of model itemsmodel
- the modelelementDefinitionParser
- the element definition parserrepeaterDefinitionParser
- the repeater definition parser- Throws:
ConfigurationException
- if an error occurs
-
_parseI18nizableText
protected I18nizableText _parseI18nizableText(Configuration config, String name, String pluginName, String catalog) Parse an i18n text.- Parameters:
config
- the configuration to use.name
- the child name.pluginName
- the plugin namecatalog
- the catalog- Returns:
- the i18n text.
-