Package org.ametys.web.parameters.view
Class ViewParametersDAO
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.web.parameters.view.ViewParametersDAO
-
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
public class ViewParametersDAO extends AbstractLogEnabled implements Component, Serviceable
Manager for view parameters
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
ViewParametersDAO.ModelItemViewsWrapper
Class representing a model item and its view parameters
-
Field Summary
Fields Modifier and Type Field Description protected ContentViewParametersManager
_contentViewParametersManager
The content view parameters managerprotected CurrentUserProvider
_currentUserProvider
The current user providerprotected ObservationManager
_observationManager
The observation managerprotected ParametersManager
_parametersManager
The parameters managerprotected AmetysObjectResolver
_resolver
The Ametys object resolverprotected ServiceExtensionPoint
_serviceEP
The service extension pointprotected ServiceViewParametersManager
_serviceViewParametersManager
The service view parameters managerprotected SkinsManager
_skinsManager
The skins managerprotected ViewParametersManager
_viewParametersManager
The view parameter managerstatic String
MODEL_ITEM_NAME_SEPARATOR
The separator for model item namestatic String
PREFIX_CONTENT
The prefix for content view parametersstatic String
PREFIX_SERVICE
The prefix for service view parametersstatic String
PREFIX_TEMPLATE
The prefix for template view parametersstatic String
PREFIX_ZONE
The prefix for zone view parametersstatic String
PREFIX_ZONE_ITEM
The prefix for zoneItem view parametersstatic String
ROLE
Avalon Role
-
Constructor Summary
Constructors Constructor Description ViewParametersDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_addContentViewParameters(ViewParametersDAO.ModelItemViewsWrapper modelItemViews, ZoneItem zoneItem, String skinId)
Add content view parameters to the model item views wrapperprotected void
_addServiceViewParameters(ViewParametersDAO.ModelItemViewsWrapper modelItemViews, ZoneItem zoneItem, String skinId)
Add service view parameters to the model item views wrapperprotected void
_addTemplateViewItem(Page page, Skin skin, SkinTemplate template, SimpleViewItemGroup mainGroup)
Add template view itemprotected void
_addZoneItemViewItem(Skin skin, SkinTemplate template, SkinTemplateZone zone, ZoneItem zoneItem, SimpleViewItemGroup mainGroup)
Add zone item view item and the service or content view itemsprotected void
_addZoneItemViewParameters(ViewParametersDAO.ModelItemViewsWrapper modelItemViews, SkinTemplateZone zone, ZoneItem zoneItem, SimpleViewItemGroup mainGroup)
Add all view parameters of the zone itemprotected void
_addZoneViewItem(Page page, Skin skin, SkinTemplate template, SkinTemplateZone zone, SimpleViewItemGroup mainGroup)
Add zone view itemprotected View
_createViewParametersDialogView(String pageId, String zoneName, String zoneItemId)
Create the view of all view parametersprotected Map<String,Object>
_getContentViewParametersValues(Skin skin, ModifiableZoneItem zoneItem)
Get the content view parameters valuesprotected ModifiablePage
_getModifiablePage(String pageId)
Get the modifiable page from idprotected Optional<ModifiableZoneItem>
_getModifiableZoneItem(String zoneItemId)
Get the modifiable zone item from idprotected Map<String,Object>
_getServiceViewParametersValues(Skin skin, ModifiableZoneItem zoneItem)
Get the service view parameters valuesprotected Optional<SkinTemplateZone>
_getSkinTemplateZone(SkinTemplate template, String zoneName, Optional<ModifiableZoneItem> zoneItem)
Get the skin template zoneprotected Map<String,Object>
_getTemplateViewParametersValues(ModifiablePage page, SkinTemplate template)
Get the template view parameters valuesprotected Map<String,Object>
_getZoneItemViewParametersValues(ModifiablePage page, Skin skin, SkinTemplateZone skinZone, ModifiableZoneItem zoneItem)
Get the zone item view parameters valuesprotected Map<String,Object>
_getZoneViewParametersValues(ModifiablePage page, SkinTemplateZone skinZone)
Get the zone view parameters valuesprotected Map<String,List<I18nizableText>>
_setContentViewParameters(Skin skin, ModifiableZoneItem zoneItem, Map<String,Object> parameterValues)
Set content view parameters valuesprotected Map<String,List<I18nizableText>>
_setServiceViewParameters(Skin skin, ModifiableZoneItem zoneItem, Map<String,Object> parameterValues)
Set service view parameters valuesprotected Map<String,List<I18nizableText>>
_setTemplateViewParameters(ModifiablePage page, SkinTemplate template, Map<String,Object> parameterValues)
Set template view parameters valuesprotected Map<String,List<I18nizableText>>
_setZoneItemViewParameters(ModifiablePage page, Skin skin, SkinTemplateZone skinZone, ModifiableZoneItem zoneItem, Map<String,Object> parameterValues)
Set zone item view parameters valuesprotected Map<String,List<I18nizableText>>
_setZoneViewParameters(ModifiablePage page, SkinTemplateZone skinZone, Map<String,Object> parameterValues)
Set zone view parameters valuesMap<String,Object>
getViewParametersDefinitions(String pageId, String zoneName, String zoneItemId)
Get the definition of the created view of all view parametersMap<String,Object>
getViewParametersValues(String pageId, String zoneName, String zoneItemId)
Get the view parameters valuesvoid
service(ServiceManager manager)
Map<String,Object>
setViewParametersValues(String pageId, String zoneName, String zoneItemId, Map<String,Object> parameterValues)
Set view parameters values-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
MODEL_ITEM_NAME_SEPARATOR
public static final String MODEL_ITEM_NAME_SEPARATOR
The separator for model item name- See Also:
- Constant Field Values
-
PREFIX_TEMPLATE
public static final String PREFIX_TEMPLATE
The prefix for template view parameters- See Also:
- Constant Field Values
-
PREFIX_ZONE
public static final String PREFIX_ZONE
The prefix for zone view parameters- See Also:
- Constant Field Values
-
PREFIX_ZONE_ITEM
public static final String PREFIX_ZONE_ITEM
The prefix for zoneItem view parameters- See Also:
- Constant Field Values
-
PREFIX_CONTENT
public static final String PREFIX_CONTENT
The prefix for content view parameters- See Also:
- Constant Field Values
-
PREFIX_SERVICE
public static final String PREFIX_SERVICE
The prefix for service view parameters- See Also:
- Constant Field Values
-
_resolver
protected AmetysObjectResolver _resolver
The Ametys object resolver
-
_skinsManager
protected SkinsManager _skinsManager
The skins manager
-
_serviceViewParametersManager
protected ServiceViewParametersManager _serviceViewParametersManager
The service view parameters manager
-
_contentViewParametersManager
protected ContentViewParametersManager _contentViewParametersManager
The content view parameters manager
-
_serviceEP
protected ServiceExtensionPoint _serviceEP
The service extension point
-
_parametersManager
protected ParametersManager _parametersManager
The parameters manager
-
_observationManager
protected ObservationManager _observationManager
The observation manager
-
_currentUserProvider
protected CurrentUserProvider _currentUserProvider
The current user provider
-
_viewParametersManager
protected ViewParametersManager _viewParametersManager
The view parameter manager
-
-
Constructor Detail
-
ViewParametersDAO
public ViewParametersDAO()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getViewParametersDefinitions
public Map<String,Object> getViewParametersDefinitions(String pageId, String zoneName, String zoneItemId) throws ProcessingException
Get the definition of the created view of all view parameters- Parameters:
pageId
- the page idzoneName
- the zone name (can be null)zoneItemId
- the zone item id (can be null)- Returns:
- the JSON of view parameters
- Throws:
ProcessingException
- if a processing error occurred
-
_createViewParametersDialogView
protected View _createViewParametersDialogView(String pageId, String zoneName, String zoneItemId)
Create the view of all view parameters- Parameters:
pageId
- the page idzoneName
- the zone name (can be null)zoneItemId
- the zone item id (can be null)- Returns:
- the view of all view parameters
-
_addTemplateViewItem
protected void _addTemplateViewItem(Page page, Skin skin, SkinTemplate template, SimpleViewItemGroup mainGroup)
Add template view item- Parameters:
page
- the page (to determine inheritance)skin
- the skintemplate
- the templatemainGroup
- the main group to add the template view
-
_addZoneViewItem
protected void _addZoneViewItem(Page page, Skin skin, SkinTemplate template, SkinTemplateZone zone, SimpleViewItemGroup mainGroup)
Add zone view item- Parameters:
page
- the page (to determine inheritance)skin
- the skintemplate
- the templatezone
- the zonemainGroup
- the main group to add the zone view
-
_addZoneItemViewItem
protected void _addZoneItemViewItem(Skin skin, SkinTemplate template, SkinTemplateZone zone, ZoneItem zoneItem, SimpleViewItemGroup mainGroup)
Add zone item view item and the service or content view items- Parameters:
skin
- the skintemplate
- the templatezone
- the zonezoneItem
- the zone itemmainGroup
- the main group to add the zone item view
-
_addZoneItemViewParameters
protected void _addZoneItemViewParameters(ViewParametersDAO.ModelItemViewsWrapper modelItemViews, SkinTemplateZone zone, ZoneItem zoneItem, SimpleViewItemGroup mainGroup)
Add all view parameters of the zone item- Parameters:
modelItemViews
- the model item viewszone
- the zonezoneItem
- the zone itemmainGroup
- the main group to add the zone item view
-
_addServiceViewParameters
protected void _addServiceViewParameters(ViewParametersDAO.ModelItemViewsWrapper modelItemViews, ZoneItem zoneItem, String skinId)
Add service view parameters to the model item views wrapper- Parameters:
modelItemViews
- the model item views wrapperzoneItem
- the zone itemskinId
- the skin id
-
_addContentViewParameters
protected void _addContentViewParameters(ViewParametersDAO.ModelItemViewsWrapper modelItemViews, ZoneItem zoneItem, String skinId)
Add content view parameters to the model item views wrapper- Parameters:
modelItemViews
- the model item views wrapperzoneItem
- the zone itemskinId
- the skin id
-
getViewParametersValues
public Map<String,Object> getViewParametersValues(String pageId, String zoneName, String zoneItemId)
Get the view parameters values- Parameters:
pageId
- the page idzoneName
- the zone name (Can be null)zoneItemId
- the zone item id (Can be null)- Returns:
- the values
-
_getTemplateViewParametersValues
protected Map<String,Object> _getTemplateViewParametersValues(ModifiablePage page, SkinTemplate template)
Get the template view parameters values- Parameters:
page
- the pagetemplate
- the template- Returns:
- the values
-
_getZoneViewParametersValues
protected Map<String,Object> _getZoneViewParametersValues(ModifiablePage page, SkinTemplateZone skinZone)
Get the zone view parameters values- Parameters:
page
- the pageskinZone
- the zone- Returns:
- the values
-
_getZoneItemViewParametersValues
protected Map<String,Object> _getZoneItemViewParametersValues(ModifiablePage page, Skin skin, SkinTemplateZone skinZone, ModifiableZoneItem zoneItem)
Get the zone item view parameters values- Parameters:
page
- the pageskin
- the skinskinZone
- the zonezoneItem
- the zone item- Returns:
- the values
-
_getServiceViewParametersValues
protected Map<String,Object> _getServiceViewParametersValues(Skin skin, ModifiableZoneItem zoneItem)
Get the service view parameters values- Parameters:
skin
- the skinzoneItem
- the zone item- Returns:
- the values
-
_getContentViewParametersValues
protected Map<String,Object> _getContentViewParametersValues(Skin skin, ModifiableZoneItem zoneItem)
Get the content view parameters values- Parameters:
skin
- the skinzoneItem
- the zone item- Returns:
- the values
-
setViewParametersValues
public Map<String,Object> setViewParametersValues(String pageId, String zoneName, String zoneItemId, Map<String,Object> parameterValues) throws IOException
Set view parameters values- Parameters:
pageId
- the page idzoneName
- the zone name (Can be null)zoneItemId
- the zone item id (Can be null)parameterValues
- the parameter values- Returns:
- results map
- Throws:
IOException
- If an error occurred
-
_setTemplateViewParameters
protected Map<String,List<I18nizableText>> _setTemplateViewParameters(ModifiablePage page, SkinTemplate template, Map<String,Object> parameterValues)
Set template view parameters values- Parameters:
page
- the pagetemplate
- the templateparameterValues
- the parameter values- Returns:
- the errors
-
_setZoneViewParameters
protected Map<String,List<I18nizableText>> _setZoneViewParameters(ModifiablePage page, SkinTemplateZone skinZone, Map<String,Object> parameterValues)
Set zone view parameters values- Parameters:
page
- the pageskinZone
- the zoneparameterValues
- the parameter values- Returns:
- the errors
-
_setZoneItemViewParameters
protected Map<String,List<I18nizableText>> _setZoneItemViewParameters(ModifiablePage page, Skin skin, SkinTemplateZone skinZone, ModifiableZoneItem zoneItem, Map<String,Object> parameterValues)
Set zone item view parameters values- Parameters:
page
- the pageskin
- the skinskinZone
- the zonezoneItem
- the zone itemparameterValues
- the parameter values- Returns:
- the errors
-
_setServiceViewParameters
protected Map<String,List<I18nizableText>> _setServiceViewParameters(Skin skin, ModifiableZoneItem zoneItem, Map<String,Object> parameterValues)
Set service view parameters values- Parameters:
skin
- the skinzoneItem
- the zone itemparameterValues
- the parameter values- Returns:
- the errors
-
_setContentViewParameters
protected Map<String,List<I18nizableText>> _setContentViewParameters(Skin skin, ModifiableZoneItem zoneItem, Map<String,Object> parameterValues)
Set content view parameters values- Parameters:
skin
- the skinzoneItem
- the zone itemparameterValues
- the parameter values- Returns:
- the errors
-
_getModifiablePage
protected ModifiablePage _getModifiablePage(String pageId)
Get the modifiable page from id- Parameters:
pageId
- the page id- Returns:
- the modifiable page
-
_getModifiableZoneItem
protected Optional<ModifiableZoneItem> _getModifiableZoneItem(String zoneItemId)
Get the modifiable zone item from id- Parameters:
zoneItemId
- the zone item id- Returns:
- the modifiable zone item
-
_getSkinTemplateZone
protected Optional<SkinTemplateZone> _getSkinTemplateZone(SkinTemplate template, String zoneName, Optional<ModifiableZoneItem> zoneItem)
Get the skin template zone- Parameters:
template
- the templatezoneName
- the zone namezoneItem
- the zone item- Returns:
- the skin template zone
-
-