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_BINARY
Constant for untouched binary metadata.static String
ROLE
Avalon 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 valuesprotected Map<String,List<I18nizableText>>
_setParameterValues(Map<String,Object> parameterValues, Service service, ModifiableZoneItem zoneItem)
Set the parameter values for the service (with view parameters)Map<String,Object>
addService(String pageId, String zoneName, String serviceId, Map<String,Object> parameterValues)
Add the service to the given zone on given pagevoid
contextualize(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 valuesvoid
service(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
-
-
Constructor Detail
-
ZoneItemManager
public ZoneItemManager()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in 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
-
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
-
-