Package org.ametys.web.repository.page
Class ZoneItemManager
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.web.repository.page.ZoneItemManager
-
- All Implemented Interfaces:
LogEnabled,Component,Contextualizable,Serviceable
public class ZoneItemManager extends AbstractLogEnabled implements Component, Serviceable, Contextualizable
Class containing callables to retrieve and configure service parameters
-
-
Field Summary
Fields Modifier and Type Field Description protected static String__SERVICE_PARAM_UNTOUCHED_BINARYConstant for untouched binary metadata.private Context_contextprivate CurrentUserProvider_currentUserProviderprivate ObservationManager_observationManagerprivate ParametersManager_parametersManagerprivate AmetysObjectResolver_resolverprivate ServiceExtensionPoint_serviceExtensionPointprivate ViewParametersManager_viewParametersManagerstatic StringROLEAvalon Role
-
Constructor Summary
Constructors Constructor Description ZoneItemManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,Object>_getServiceViewParametersValues(ZoneItem zoneItem)Get the service view parameters valuesprivate Pair<ViewItemContainer,Integer>_getXSLTViewItemContainerAndIndex(ViewItemContainer viewItemContainer)protected Map<String,List<I18nizableText>>_setParameterValues(Map<String,Object> parameterValues, Service service, ModifiableZoneItem zoneItem)Set the parameter values for the service (with view parameters)private void_setRequestAttribute(String serviceId, String pageId, String zoneItemId, String zoneName)Map<String,Object>addService(String pageId, String zoneName, String serviceId, Map<String,Object> parameterValues)Add the service to the given zone on given pagevoidcontextualize(Context context)Map<String,Object>editServiceParameterValues(String zoneItemId, String serviceId, Map<String,Object> parameterValues)Edit the parameter values of the given serviceMap<String,Object>getServiceParameterDefinitions(String serviceId, String pageId, String zoneItemId, String zoneName)Retrieves the parameter definitions of the given serviceMap<String,Object>getServiceParameterValues(String zoneItemId, String serviceId)Get the service parameter valuesvoidservice(ServiceManager manager)-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
__SERVICE_PARAM_UNTOUCHED_BINARY
protected static final String __SERVICE_PARAM_UNTOUCHED_BINARY
Constant for untouched binary metadata.- See Also:
- Constant Field Values
-
_serviceExtensionPoint
private ServiceExtensionPoint _serviceExtensionPoint
-
_resolver
private AmetysObjectResolver _resolver
-
_observationManager
private ObservationManager _observationManager
-
_currentUserProvider
private CurrentUserProvider _currentUserProvider
-
_parametersManager
private ParametersManager _parametersManager
-
_viewParametersManager
private ViewParametersManager _viewParametersManager
-
-
Constructor Detail
-
ZoneItemManager
public ZoneItemManager()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
getServiceParameterDefinitions
public Map<String,Object> getServiceParameterDefinitions(String serviceId, String pageId, String zoneItemId, String zoneName) throws ProcessingException
Retrieves the parameter definitions of the given service- Parameters:
serviceId- Identifier of the servicepageId- the page idzoneItemId- the zone item idzoneName- the zone name- Returns:
- the parameter definitions
- Throws:
ProcessingException- if an error occurs
-
_getXSLTViewItemContainerAndIndex
private Pair<ViewItemContainer,Integer> _getXSLTViewItemContainerAndIndex(ViewItemContainer viewItemContainer)
-
_setRequestAttribute
private void _setRequestAttribute(String serviceId, String pageId, String zoneItemId, String zoneName)
-
getServiceParameterValues
public Map<String,Object> getServiceParameterValues(String zoneItemId, String serviceId)
Get the service parameter values- Parameters:
zoneItemId- the zone item idserviceId- the service Id- Returns:
- the values
-
_getServiceViewParametersValues
protected Map<String,Object> _getServiceViewParametersValues(ZoneItem zoneItem)
Get the service view parameters values- Parameters:
zoneItem- the zone item- Returns:
- the values
-
addService
public Map<String,Object> addService(String pageId, String zoneName, String serviceId, Map<String,Object> parameterValues) throws IOException
Add the service to the given zone on given page- Parameters:
pageId- The page identifierzoneName- The zone nameserviceId- The identifier of the service to addparameterValues- the service parameter values. Can be empty- Returns:
- The result with the identifiers of updated page, zone and zone item
- Throws:
IOException- if an error occurred while saving parameters
-
editServiceParameterValues
public Map<String,Object> editServiceParameterValues(String zoneItemId, String serviceId, Map<String,Object> parameterValues) throws IOException
Edit the parameter values of the given service- Parameters:
zoneItemId- The identifier of the zone item holding the serviceserviceId- The service identifierparameterValues- the service parameter values to update- Returns:
- The result with the identifiers of updated page, zone and zone item
- Throws:
IOException- if an error occurs while saving parameters
-
_setParameterValues
protected Map<String,List<I18nizableText>> _setParameterValues(Map<String,Object> parameterValues, Service service, ModifiableZoneItem zoneItem)
Set the parameter values for the service (with view parameters)- Parameters:
parameterValues- the parameter valuesservice- the servicezoneItem- the zone item- Returns:
- the map of error
-
-