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
Manager for view parameters
-
Field Summary
Modifier and TypeFieldDescriptionprotected ContentViewParametersManager
The content view parameters managerprotected CurrentUserProvider
The current user providerprotected ObservationManager
The observation managerprotected ParametersManager
The parameters managerprotected AmetysObjectResolver
The Ametys object resolverprotected ServiceExtensionPoint
The service extension pointprotected ServiceViewParametersManager
The service view parameters managerprotected SkinsManager
The skins managerprotected ViewParametersManager
The view parameter managerstatic final String
The separator for model item namestatic final String
The prefix for content view parametersstatic final String
The prefix for service view parametersstatic final String
The prefix for template view parametersstatic final String
The prefix for zone view parametersstatic final String
The prefix for zoneItem view parametersstatic final String
Avalon Role -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
_addContentViewParameters
(org.ametys.web.parameters.view.ViewParametersDAO.ModelItemViewsWrapper modelItemViews, ZoneItem zoneItem, String skinId) Add content view parameters to the model item views wrapperprotected void
_addServiceViewParameters
(org.ametys.web.parameters.view.ViewParametersDAO.ModelItemViewsWrapper modelItemViews, ZoneItem zoneItem, String skinId) Add service view parameters to the model item views wrapperprotected void
_addTemplateViewItem
(ModifiableSitemapElement page, Skin skin, SkinTemplate template, ViewItemContainer viewItemContainer) Add template view itemprotected void
_addZoneItemViewItem
(Skin skin, SkinTemplate template, SkinTemplateZone zone, ZoneItem zoneItem, ViewItemContainer viewItemContainer) Add zone item view item and the service or content view itemsprotected void
_addZoneItemViewParameters
(org.ametys.web.parameters.view.ViewParametersDAO.ModelItemViewsWrapper modelItemViews, SkinTemplateZone zone, ZoneItem zoneItem, ViewItemContainer viewItemContainer) Add all view parameters of the zone itemprotected void
_addZoneViewItem
(SitemapElement page, Skin skin, SkinTemplate template, SkinTemplateZone zone, ViewItemContainer viewItemContainer) Add zone view itemprotected View
_createViewParametersDialogView
(String pageId, String zoneName, String zoneItemId) Create the view of all view parameters_getContentViewParametersValues
(Skin skin, ModifiableZoneItem zoneItem) Get the content view parameters valuesprotected ModifiableSitemapElement
_getModifiablePage
(String pageId) Get the modifiable page from idprotected Optional<ModifiableZoneItem>
_getModifiableZoneItem
(String zoneItemId) Get the modifiable zone item from id_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 zone_getTemplateViewParametersValues
(ModifiableSitemapElement page, SkinTemplate template) Get the template view parameters values_getZoneItemViewParametersValues
(ModifiableSitemapElement page, Skin skin, SkinTemplateZone skinZone, ModifiableZoneItem zoneItem) Get the zone item view parameters values_getZoneViewParametersValues
(ModifiableSitemapElement 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
(ModifiableSitemapElement page, SkinTemplate template, Map<String, Object> parameterValues) Set template view parameters valuesprotected Map<String,
List<I18nizableText>> _setZoneItemViewParameters
(ModifiableSitemapElement page, Skin skin, SkinTemplateZone skinZone, ModifiableZoneItem zoneItem, Map<String, Object> parameterValues) Set zone item view parameters valuesprotected Map<String,
List<I18nizableText>> _setZoneViewParameters
(ModifiableSitemapElement page, SkinTemplateZone skinZone, Map<String, Object> parameterValues) Set zone view parameters valuesgetViewParametersDefinitions
(String pageId, String zoneName, String zoneItemId) Get the definition of the created view of all view parametersgetViewParametersValues
(String pageId, String zoneName, String zoneItemId) Get the view parameters valuesvoid
service
(ServiceManager manager) setViewParametersValues
(String pageId, String zoneName, String zoneItemId, Map<String, Object> parameterValues) Set view parameters valuesMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
Avalon Role -
MODEL_ITEM_NAME_SEPARATOR
The separator for model item name- See Also:
-
PREFIX_TEMPLATE
The prefix for template view parameters- See Also:
-
PREFIX_ZONE
The prefix for zone view parameters- See Also:
-
PREFIX_ZONE_ITEM
The prefix for zoneItem view parameters- See Also:
-
PREFIX_CONTENT
The prefix for content view parameters- See Also:
-
PREFIX_SERVICE
The prefix for service view parameters- See Also:
-
_resolver
The Ametys object resolver -
_skinsManager
The skins manager -
_serviceViewParametersManager
The service view parameters manager -
_contentViewParametersManager
The content view parameters manager -
_serviceEP
The service extension point -
_parametersManager
The parameters manager -
_observationManager
The observation manager -
_currentUserProvider
The current user provider -
_viewParametersManager
The view parameter manager
-
-
Constructor Details
-
ViewParametersDAO
public ViewParametersDAO()
-
-
Method Details
-
service
- 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
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(ModifiableSitemapElement page, Skin skin, SkinTemplate template, ViewItemContainer viewItemContainer) Add template view item- Parameters:
page
- the page (to determine inheritance)skin
- the skintemplate
- the templateviewItemContainer
- the container in which add the template view
-
_addZoneViewItem
protected void _addZoneViewItem(SitemapElement page, Skin skin, SkinTemplate template, SkinTemplateZone zone, ViewItemContainer viewItemContainer) Add zone view item- Parameters:
page
- the page (to determine inheritance)skin
- the skintemplate
- the templatezone
- the zoneviewItemContainer
- the container in which add the zone view
-
_addZoneItemViewItem
protected void _addZoneItemViewItem(Skin skin, SkinTemplate template, SkinTemplateZone zone, ZoneItem zoneItem, ViewItemContainer viewItemContainer) Add zone item view item and the service or content view items- Parameters:
skin
- the skintemplate
- the templatezone
- the zonezoneItem
- the zone itemviewItemContainer
- the container in which add the zone item view
-
_addZoneItemViewParameters
protected void _addZoneItemViewParameters(org.ametys.web.parameters.view.ViewParametersDAO.ModelItemViewsWrapper modelItemViews, SkinTemplateZone zone, ZoneItem zoneItem, ViewItemContainer viewItemContainer) Add all view parameters of the zone item- Parameters:
modelItemViews
- the model item viewszone
- the zonezoneItem
- the zone itemviewItemContainer
- the container in which add the zone item view
-
_addServiceViewParameters
protected void _addServiceViewParameters(org.ametys.web.parameters.view.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(org.ametys.web.parameters.view.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(ModifiableSitemapElement page, SkinTemplate template) Get the template view parameters values- Parameters:
page
- the pagetemplate
- the template- Returns:
- the values
-
_getZoneViewParametersValues
protected Map<String,Object> _getZoneViewParametersValues(ModifiableSitemapElement page, SkinTemplateZone skinZone) Get the zone view parameters values- Parameters:
page
- the pageskinZone
- the zone- Returns:
- the values
-
_getZoneItemViewParametersValues
protected Map<String,Object> _getZoneItemViewParametersValues(ModifiableSitemapElement 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 IOExceptionSet 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(ModifiableSitemapElement 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(ModifiableSitemapElement 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(ModifiableSitemapElement 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
Get the modifiable page from id- Parameters:
pageId
- the page id- Returns:
- the modifiable page
-
_getModifiableZoneItem
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
-