Package org.ametys.web.filter
Interface PageFilter
-
- All Known Implementing Classes:
DefaultPageFilter
,StaticPageFilter
public interface PageFilter
This interface represents a filter forPage
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
PageFilter.Context
The search contextstatic class
PageFilter.ContextLanguage
The context language
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addMetadata(String metadataId, String value)
Add a metadata filtervoid
addSortCriteria(String metadataId, boolean ascending, boolean useLowerCase)
Add a sort criteriavoid
addTag(String tag)
Add a tag to the filterPageFilter.Context
getContext()
Get the search contextPageFilter.ContextLanguage
getContextLanguage()
Get the context languageint
getDepth()
Get the search depthString
getId()
Get the filter idint
getLength()
Get the max number of resultsAmetysObjectIterable<Page>
getMatchingPages(String siteName, String lang, Page page)
Get the pages matching this filter.Map<String,String>
getMetadataValues()
Get the metadata id and value to matchString
getPageId()
Get the parent page idSortCriteria
getSortCriteria()
Get the sort criteria allows to sort query results.List<String>
getTags()
Get the tag keys to match pagesI18nizableText
getTitle()
Get the titlevoid
setContext(PageFilter.Context context)
Set the search contextvoid
setContextLanguage(PageFilter.ContextLanguage contextLang)
Set the context languagevoid
setDepth(int depth)
Set the search depthvoid
setId(String id)
Set the filter id.void
setLength(int length)
Set the max number o resultsvoid
setPageId(String pageId)
set the parent page Id.void
setResolver(AmetysObjectResolver resolver)
Set the ametys object resolver to execute queryvoid
setTitle(I18nizableText title)
Set the title
-
-
-
Method Detail
-
getMetadataValues
Map<String,String> getMetadataValues()
Get the metadata id and value to match- Returns:
- The metadata to match pages
-
addMetadata
void addMetadata(String metadataId, String value)
Add a metadata filter- Parameters:
metadataId
- The metadata id.value
- The value to test. Set null to test existence
-
getContext
PageFilter.Context getContext()
Get the search context- Returns:
- The search context
-
setContext
void setContext(PageFilter.Context context)
Set the search context- Parameters:
context
- The search context to set
-
getContextLanguage
PageFilter.ContextLanguage getContextLanguage()
Get the context language- Returns:
- The context language
-
setContextLanguage
void setContextLanguage(PageFilter.ContextLanguage contextLang)
Set the context language- Parameters:
contextLang
- The context language
-
getDepth
int getDepth()
Get the search depth- Returns:
- The search depth
-
setDepth
void setDepth(int depth)
Set the search depth- Parameters:
depth
- The search depth. Set to0
for no depth limitation.
-
getLength
int getLength()
Get the max number of results- Returns:
- The max number of results
-
setLength
void setLength(int length)
Set the max number o results- Parameters:
length
- The max number of results
-
getSortCriteria
SortCriteria getSortCriteria()
Get the sort criteria allows to sort query results.- Returns:
- the sort criteria
-
setPageId
void setPageId(String pageId)
set the parent page Id.- Parameters:
pageId
- Id of the parent page (when fetching child of a page).
-
addSortCriteria
void addSortCriteria(String metadataId, boolean ascending, boolean useLowerCase)
Add a sort criteria- Parameters:
metadataId
- The metadata id to sortascending
- true to ascending sortuseLowerCase
-true
for case insensitive order on a string property
-
setResolver
void setResolver(AmetysObjectResolver resolver)
Set the ametys object resolver to execute query- Parameters:
resolver
- The ametys object resolver to set
-
getMatchingPages
AmetysObjectIterable<Page> getMatchingPages(String siteName, String lang, Page page)
Get the pages matching this filter.- Parameters:
siteName
- The current site name.lang
- The current language. Can be null.page
- The current page.- Returns:
- The matching pages.
-
getTitle
I18nizableText getTitle()
Get the title- Returns:
- The title
-
setTitle
void setTitle(I18nizableText title)
Set the title- Parameters:
title
- The title
-
-