public class ZoneItemManager extends AbstractLogEnabled implements Component, Serviceable, Contextualizable
Modifier and Type | Field and Description |
---|---|
protected static String |
__SERVICE_PARAM_UNTOUCHED_BINARY
Constant for untouched binary metadata.
|
private Context |
_context |
private CurrentUserProvider |
_currentUserProvider |
private ObservationManager |
_observationManager |
private AmetysObjectResolver |
_resolver |
private ServiceExtensionPoint |
_serviceExtensionPoint |
static String |
ROLE
Avalon Role
|
Constructor and Description |
---|
ZoneItemManager() |
Modifier and Type | Method and Description |
---|---|
private void |
_getAndSaveParameter(ModelItem def,
Map<String,Object> values,
ModifiableModelAwareDataHolder dataHolder,
String prefix,
Map<String,List<I18nizableText>> allErrors) |
private Map<String,DefinitionAndValue> |
_getBrothersDefinitionAndValues(String prefix,
Map<String,Object> values,
ElementDefinition definition)
Get the definition and value pairs of the given definition brothers.
|
private Map<Integer,Integer> |
_getRepeaterPositionsMapping(Map<String,Object> values,
String repeaterPath) |
private List<Map<String,Object>> |
_getRepeaters(Collection<ModelItem> items,
ModelAwareDataHolder dataHolder,
String prefix) |
private Map<String,Object> |
_getValues(Collection<ModelItem> items,
ModelAwareDataHolder dataHolder,
String prefix) |
(package private) void |
_setParameterValues(ModifiableModelAwareDataHolder serviceDataHolder,
Service service,
Map<String,Object> values,
Map<String,List<I18nizableText>> allErrors) |
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 page
|
void |
contextualize(Context context) |
Map<String,Object> |
editServiceParameterValues(String zoneItemId,
String serviceId,
Map<String,Object> parameterValues)
Edit the parameter values of the given service
|
Map<String,Object> |
getServiceParameterDefinitions(String serviceId,
String pageId,
String zoneItemId,
String zoneName)
Retrieves the parameter definitions of the given service
|
Map<String,Object> |
getServiceParameterValues(String zoneItemId,
String serviceId)
Get the service parameter values
|
void |
service(ServiceManager manager) |
getLogger, setLogger
protected static final String __SERVICE_PARAM_UNTOUCHED_BINARY
private ServiceExtensionPoint _serviceExtensionPoint
private AmetysObjectResolver _resolver
private ObservationManager _observationManager
private CurrentUserProvider _currentUserProvider
public ZoneItemManager()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public Map<String,Object> getServiceParameterDefinitions(String serviceId, String pageId, String zoneItemId, String zoneName) throws ProcessingException
serviceId
- Identifier of the servicepageId
- the page idzoneItemId
- the zone item idzoneName
- the zone nameProcessingException
- if an error occursprivate void _setRequestAttribute(String serviceId, String pageId, String zoneItemId, String zoneName)
public Map<String,Object> getServiceParameterValues(String zoneItemId, String serviceId)
zoneItemId
- the zone item idserviceId
- the service Idprivate Map<String,Object> _getValues(Collection<ModelItem> items, ModelAwareDataHolder dataHolder, String prefix)
private List<Map<String,Object>> _getRepeaters(Collection<ModelItem> items, ModelAwareDataHolder dataHolder, String prefix)
public Map<String,Object> addService(String pageId, String zoneName, String serviceId, Map<String,Object> parameterValues) throws IOException
pageId
- The page identifierzoneName
- The zone nameserviceId
- The identifier of the service to addparameterValues
- the service parameter values. Can be emptyIOException
- if an error occurred while saving parameterspublic Map<String,Object> editServiceParameterValues(String zoneItemId, String serviceId, Map<String,Object> parameterValues) throws IOException
zoneItemId
- The identifier of the zone item holding the serviceserviceId
- The service identifierparameterValues
- the service parameter values to updateIOException
- if an error occurs while saving parametersvoid _setParameterValues(ModifiableModelAwareDataHolder serviceDataHolder, Service service, Map<String,Object> values, Map<String,List<I18nizableText>> allErrors)
private void _getAndSaveParameter(ModelItem def, Map<String,Object> values, ModifiableModelAwareDataHolder dataHolder, String prefix, Map<String,List<I18nizableText>> allErrors)
private Map<String,DefinitionAndValue> _getBrothersDefinitionAndValues(String prefix, Map<String,Object> values, ElementDefinition definition)
prefix
- prefix to get the parameter valuesvalues
- all the parameter valuesdefinition
- the definition