Package org.ametys.web.filter
Interface PageFilter
- All Known Implementing Classes:
DefaultPageFilter
,StaticPageFilter
public interface PageFilter
This interface represents a filter for
Page
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
The search contextstatic enum
The context language -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMetadata
(String metadataId, String value) Add a metadata filtervoid
addSortCriteria
(String metadataId, boolean ascending, boolean useLowerCase) Add a sort criteriavoid
Add a tag to the filterGet the search contextGet the context languageint
getDepth()
Get the search depthgetId()
Get the filter idint
Get the max number of resultsgetMatchingPages
(String siteName, String lang, Page page) Get the pages matching this filter.Get the metadata id and value to matchGet the parent page idGet the sort criteria allows to sort query results.getTags()
Get the tag keys to match pagesgetTitle()
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
Set the filter id.void
setLength
(int length) Set the max number o resultsvoid
set the parent page Id.void
setResolver
(AmetysObjectResolver resolver) Set the ametys object resolver to execute queryvoid
setTitle
(I18nizableText title) Set the title
-
Method Details
-
getId
Get the filter id- Returns:
- The filter id
-
setId
Set the filter id.- Parameters:
id
- The id to set.
-
getMetadataValues
Get the metadata id and value to match- Returns:
- The metadata to match pages
-
addMetadata
Add a metadata filter- Parameters:
metadataId
- The metadata id.value
- The value to test. Set null to test existence
-
getTags
Get the tag keys to match pages- Returns:
- The tag keys to match pages
-
addTag
Add a tag to the filter- Parameters:
tag
- The tag key to add
-
getContext
Get the search context- Returns:
- The search context
-
setContext
Set the search context- Parameters:
context
- The search context to set
-
getContextLanguage
Get the context language- Returns:
- The context language
-
setContextLanguage
Set the context language- Parameters:
contextLang
- The context language
-
getDepth
int getDepth()Get the search depth- Returns:
- The search depth
-
setDepth
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
Set the max number o results- Parameters:
length
- The max number of results
-
getSortCriteria
Get the sort criteria allows to sort query results.- Returns:
- the sort criteria
-
getPageId
Get the parent page id- Returns:
- The parent page id
-
setPageId
set the parent page Id.- Parameters:
pageId
- Id of the parent page (when fetching child of a page).
-
addSortCriteria
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
Set the ametys object resolver to execute query- Parameters:
resolver
- The ametys object resolver to set
-
getMatchingPages
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
Get the title- Returns:
- The title
-
setTitle
Set the title- Parameters:
title
- The title
-