public class SetFilterInRequestAttributesAction extends ServiceableAction
Modifier and Type | Field and Description |
---|---|
private static String |
__FILTERS_CONTAINS |
private static String |
__FILTERS_DIFFERENT |
private static String |
__FILTERS_EMPTY |
private static String |
__FILTERS_ENDSWITH |
private static String |
__FILTERS_EQUAL |
private static String |
__FILTERS_FALSE |
private static String |
__FILTERS_FUTURE |
private static String |
__FILTERS_GREATERTHAN |
private static String |
__FILTERS_LESSTHAN |
private static String |
__FILTERS_NONEMPTY |
private static String |
__FILTERS_NOTCONTAINS |
private static String |
__FILTERS_PAST |
private static String |
__FILTERS_STARTSWITH |
private static String |
__FILTERS_TRUE |
protected ContentTypeExtensionPoint |
_contentTypeEP
The extension point for content types
|
private ContentFilterExtensionPoint |
_filterExtPt |
private JSONUtils |
_jsonUtils |
protected AmetysObjectResolver |
_resolver
The Ametys resolver
|
private ServiceExtensionPoint |
_serviceEP |
private SiteManager |
_siteManager |
private TagProviderExtensionPoint |
_tagProviderEP |
manager
EMPTY_MAP
Constructor and Description |
---|
SetFilterInRequestAttributesAction() |
Modifier and Type | Method and Description |
---|---|
private Expression |
_convertToExpression(String metadataName,
boolean lowerCase,
String metadataCondition,
String metadataConditionValue) |
protected WebContentFilter |
_createFilter(String id,
AmetysObjectResolver resolver,
ContentTypeExtensionPoint contentTypeExtensionPoint,
SiteManager siteManager,
TagProviderExtensionPoint tagProviderEP)
Create a WebContentFilter.
|
private List<String> |
_getContentTypes(ZoneItem zoneItem) |
protected WebContentFilter |
_getFilterFromParams(Parameters parameters,
ZoneItem zoneItem,
Map<String,Object> parentContextAttributes)
Get the filter from the action parameters.
|
protected WebContentFilter |
_getFilterFromZoneItem(Parameters parameters,
Map<String,String> result)
Get the content filter from a ZoneItem.
|
protected WebContentFilter |
_getFilterFromZoneItem(ZoneItem zoneItem)
Get the content filter from a ZoneItem.
|
protected Map<String,Object> |
_getFilterMap(CompositeMetadata metadata)
Retrieves the filter map from a metadata (service attribute)
|
protected Map<String,Object> |
_getFilterMap(Parameters parameters,
Map<String,Object> parentContextAttributes)
Retrieves the filter map in the parameters or parent context attribute
|
protected List<Map<String,String>> |
_getSortList(CompositeMetadata metadata)
Retrieves the sort list map from a metadata (service attribute)
|
protected List<Map<String,String>> |
_getSortList(Parameters parameters,
Map<String,Object> parentContextAttributes)
Retrieves the sort list in the parameters or parent context attribute
|
protected ContentFilter |
_getStaticFilterById(String filterId,
String siteName)
Retrieve the content filter with its id
|
protected boolean |
_isValid(ZoneItem zoneItem)
Test if the ZoneItem is valid.
|
protected void |
_setFilterCriteria(ContentFilter contentFilter,
Map<String,Object> filterBy)
Set the filters's filter expression
|
protected void |
_setSearchContext(WebContentFilter filter,
CompositeMetadata serviceMeta)
Set the search contexts in a filter from a service instance attributes.
|
protected void |
_setSearchContext(WebContentFilter filter,
List<Map<String,Object>> searchValues)
Get the search parameters from the search values.
|
protected void |
_setSearchContext(WebContentFilter filter,
Parameters parameters)
Get the search parameters from the search values as parameters.
|
protected void |
_setSortCriteria(ContentFilter filter,
String[] cTypes,
List<Map<String,String>> sortBy)
Set the filter's sort criteria.
|
Map |
act(Redirector redirector,
SourceResolver resolver,
Map objectModel,
String source,
Parameters parameters) |
void |
service(ServiceManager smanager) |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
private static final String __FILTERS_EQUAL
private static final String __FILTERS_DIFFERENT
private static final String __FILTERS_STARTSWITH
private static final String __FILTERS_ENDSWITH
private static final String __FILTERS_CONTAINS
private static final String __FILTERS_NOTCONTAINS
private static final String __FILTERS_EMPTY
private static final String __FILTERS_NONEMPTY
private static final String __FILTERS_LESSTHAN
private static final String __FILTERS_GREATERTHAN
private static final String __FILTERS_PAST
private static final String __FILTERS_FUTURE
private static final String __FILTERS_TRUE
private static final String __FILTERS_FALSE
protected AmetysObjectResolver _resolver
protected ContentTypeExtensionPoint _contentTypeEP
private ContentFilterExtensionPoint _filterExtPt
private ServiceExtensionPoint _serviceEP
private SiteManager _siteManager
private TagProviderExtensionPoint _tagProviderEP
private JSONUtils _jsonUtils
public SetFilterInRequestAttributesAction()
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
service
in class ServiceableAction
ServiceException
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception
Exception
protected WebContentFilter _getFilterFromParams(Parameters parameters, ZoneItem zoneItem, Map<String,Object> parentContextAttributes)
parameters
- The Action parameters.zoneItem
- the zone itemparentContextAttributes
- The parent context attributes.protected Map<String,Object> _getFilterMap(Parameters parameters, Map<String,Object> parentContextAttributes)
parameters
- The parametersparentContextAttributes
- The parent context attributesprotected Map<String,Object> _getFilterMap(CompositeMetadata metadata)
metadata
- The metadataprotected List<Map<String,String>> _getSortList(Parameters parameters, Map<String,Object> parentContextAttributes)
parameters
- The parametersparentContextAttributes
- The parent context attributesprotected List<Map<String,String>> _getSortList(CompositeMetadata metadata)
metadata
- The metadataprivate List<String> _getContentTypes(ZoneItem zoneItem) throws ParameterException
ParameterException
protected WebContentFilter _getFilterFromZoneItem(Parameters parameters, Map<String,String> result) throws ParameterException
parameters
- the action parameters, including the ZoneItem id.result
- the action result.ParameterException
- if parameters are invalidprotected WebContentFilter _getFilterFromZoneItem(ZoneItem zoneItem) throws ParameterException
zoneItem
- the ZoneItem.ParameterException
- if parameters are invalidprotected WebContentFilter _createFilter(String id, AmetysObjectResolver resolver, ContentTypeExtensionPoint contentTypeExtensionPoint, SiteManager siteManager, TagProviderExtensionPoint tagProviderEP)
id
- the filter ID.resolver
- the AmetysObjectResolver.contentTypeExtensionPoint
- The extension point for content typessiteManager
- The site managertagProviderEP
- The tag provider extension pointprotected boolean _isValid(ZoneItem zoneItem)
zoneItem
- the ZoneItem.protected void _setSearchContext(WebContentFilter filter, Parameters parameters) throws ParameterException
filter
- the filter to configure.parameters
- the parameters.ParameterException
- if an error occurs.protected void _setSearchContext(WebContentFilter filter, List<Map<String,Object>> searchValues)
filter
- the filter to configure.searchValues
- the search values.protected void _setSearchContext(WebContentFilter filter, CompositeMetadata serviceMeta)
filter
- the filter.serviceMeta
- the service parameters composite metadata.protected void _setFilterCriteria(ContentFilter contentFilter, Map<String,Object> filterBy)
contentFilter
- The filter to editfilterBy
- The map of filters. Key are the medataname. Value represents the filter.private Expression _convertToExpression(String metadataName, boolean lowerCase, String metadataCondition, String metadataConditionValue)
protected void _setSortCriteria(ContentFilter filter, String[] cTypes, List<Map<String,String>> sortBy)
filter
- The filter to editcTypes
- The content typessortBy
- The sort list. Each entry in the list is a map representing a sort. Map have two keys: name, the name of the metadata, and sort, the name of the sortprotected ContentFilter _getStaticFilterById(String filterId, String siteName)
filterId
- the id of the filter to retrievesiteName
- The site name