public interface ContentFilter
Content
Modifier and Type | Interface and Description |
---|---|
static class |
ContentFilter.Condition
The condition.
|
static class |
ContentFilter.ContextLanguage
The context language
|
Modifier and Type | Method and Description |
---|---|
void |
addContentType(String cTypeId)
Add a content type to the filter
|
void |
addMetadata(String metadataId,
String value)
Add a metadata filter
|
void |
addSortCriteria(String metadataId,
boolean ascending,
boolean useLowerCase)
Add a sort criteria
|
Expression |
getAdditionalFilterExpression()
Get the current filter expression
|
List<String> |
getContentTypes()
Get the content types to match contents
|
ContentFilter.ContextLanguage |
getContextLanguage()
Get the context language
|
String |
getId()
Get the filter id
|
int |
getLength()
Get the max number of results
|
AmetysObjectIterable<Content> |
getMatchingContents()
Get the contents matching this filter.
|
AmetysObjectIterable<Content> |
getMatchingContents(String lang)
Get the contents matching this filter.
|
ContentFilter.Condition |
getMetadataCondition()
The metadata condition
|
Map<String,String> |
getMetadataValues()
Get the content types to match contents
|
SortCriteria |
getSortCriteria()
Get the sort criteria allows to sort query results.
|
String |
getView()
Get the name of
MetadataSet used for matching contents |
void |
setAdditionalFilterExpression(Expression expression)
Set the filter expression that should complete metadata filtering (by doing an AND between both)
|
void |
setContextLanguage(ContentFilter.ContextLanguage context)
Set the context language
|
void |
setId(String id)
Set the filter id.
|
void |
setLength(int length)
Set the max number o results
|
void |
setMetadataCondition(ContentFilter.Condition condition)
Set the metadata condition
|
void |
setResolver(AmetysObjectResolver resolver)
Set the ametys object resolver to execute query
|
void |
setView(String metadataSetName)
Set the filter view
|
List<String> getContentTypes()
void addContentType(String cTypeId)
cTypeId
- The content type id to addMap<String,String> getMetadataValues()
ContentFilter.Condition getMetadataCondition()
void addMetadata(String metadataId, String value)
metadataId
- The metadata id.value
- The value to test. Set null to test existencevoid setMetadataCondition(ContentFilter.Condition condition)
condition
- The condition to setExpression getAdditionalFilterExpression()
void setAdditionalFilterExpression(Expression expression)
expression
- The expression to set. Can be null to remove curren expressionContentFilter.ContextLanguage getContextLanguage()
void setContextLanguage(ContentFilter.ContextLanguage context)
context
- The context language to setString getView()
MetadataSet
used for matching contentsMetadataSet
used for matching contentsvoid setView(String metadataSetName)
metadataSetName
- The name of MetadataSet
int getLength()
void setLength(int length)
length
- The max number of resultsSortCriteria getSortCriteria()
void addSortCriteria(String metadataId, boolean ascending, boolean useLowerCase)
metadataId
- The metadata id to sortascending
- true to ascending sortuseLowerCase
- true
for case insensitive order on a string propertyvoid setResolver(AmetysObjectResolver resolver)
resolver
- The ametys object resolver to setAmetysObjectIterable<Content> getMatchingContents()
AmetysObjectIterable<Content> getMatchingContents(String lang)
lang
- The current language.