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
public class ViewAndParametersParser extends AbstractLogEnabled implements Component, Serviceable
Helper to parse parameters from configuration
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ViewAndParametersParser.ViewAndParameters
The view and parameters object
-
Field Summary
Fields Modifier and Type Field Description protected ServiceManager
_manager
The service managerstatic String
ROLE
Avalon Role
-
Constructor Summary
Constructors Constructor Description ViewAndParametersParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)
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)ViewElement
parseParameter(Configuration paramConfiguration, ModelItemGroup parent, String pluginName, String catalog, View view, Map<String,ModelItem> modelItems, Model model, ElementDefinitionParser elementDefinitionParser, RepeaterDefinitionParser repeaterDefinitionParser)
Parses a service parameterViewAndParametersParser.ViewAndParameters
parseParameters(Configuration parametersConfiguration, String pluginName, String catalog, Model model, ElementDefinitionParser elementDefinitionParser, RepeaterDefinitionParser repeaterDefinitionParser)
Parse the configuration to get parameters.ModelViewItemGroup
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 Detail
-
_manager
protected ServiceManager _manager
The service manager
-
-
Constructor Detail
-
ViewAndParametersParser
public ViewAndParametersParser()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- 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 ConfigurationException
Parses 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 ConfigurationException
Parses 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 ConfigurationException
Parses 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 ConfigurationException
Parses 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.
-
-