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
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe search contextstatic enumThe context language -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMetadata(String metadataId, String value) Add a metadata filtervoidaddSortCriteria(String metadataId, boolean ascending, boolean useLowerCase) Add a sort criteriavoidAdd a tag to the filterGet the search contextGet the context languageintgetDepth()Get the search depthgetId()Get the filter idintGet 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 titlevoidsetContext(PageFilter.Context context) Set the search contextvoidsetContextLanguage(PageFilter.ContextLanguage contextLang) Set the context languagevoidsetDepth(int depth) Set the search depthvoidSet the filter id.voidsetLength(int length) Set the max number o resultsvoidset the parent page Id.voidsetResolver(AmetysObjectResolver resolver) Set the ametys object resolver to execute queryvoidsetTitle(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 to0for 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-truefor 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
-