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 classViewAndParametersParser.ViewAndParametersThe view and parameters object
-
Field Summary
Fields Modifier and Type Field Description protected ServiceManager_managerThe service managerstatic StringROLEAvalon Role
-
Constructor Summary
Constructors Constructor Description ViewAndParametersParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void_parseChildren(Configuration groupConfiguration, ViewItemGroup viewItemGroup, ModelItemGroup modelParent, String pluginName, String catalog, View view, Map<String,ModelItem> modelItems, Model model, ElementDefinitionParser elementDefinitionParser, RepeaterDefinitionParser repeaterDefinitionParser)Parses children of a view item groupprotected 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)ViewElementparseParameter(Configuration paramConfiguration, ModelItemGroup parent, String pluginName, String catalog, View view, Map<String,ModelItem> modelItems, Model model, ElementDefinitionParser elementDefinitionParser, RepeaterDefinitionParser repeaterDefinitionParser)Parses a service parameterViewAndParametersParser.ViewAndParametersparseParameters(Configuration parametersConfiguration, String pluginName, String catalog, Model model, ElementDefinitionParser elementDefinitionParser, RepeaterDefinitionParser repeaterDefinitionParser)Parse the configuration to get parameters.ModelViewItemGroupparseRepeater(Configuration repeaterConfiguration, ModelItemGroup parent, String pluginName, String catalog, View view, Map<String,ModelItem> modelItems, Model model, ElementDefinitionParser elementDefinitionParser, RepeaterDefinitionParser repeaterDefinitionParser)Parses a repeatervoidservice(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:
servicein 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 benullif 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 benullif 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 groupConfiguration, ViewItemGroup viewItemGroup, 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 group- Parameters:
groupConfiguration- the item group configurationviewItemGroup- the item groupmodelParent- 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- 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.
-
-