public class DefaultWebContentFilter.DefaultFilterSearchContext extends Object implements WebContentFilter.FilterSearchContext
Modifier and Type | Field and Description |
---|---|
protected WebContentFilter.Context |
_context
The context for search
|
protected ContentFilter.ContextLanguage |
_contextLang
The list of content languages to match
|
protected int |
_depth
The search depth
|
protected String |
_pageId
The parent page Id
|
protected SiteManager |
_siteManager
The list of content languages to match
|
protected List<String> |
_sites
The list of sites to match
|
protected List<String> |
_tags
The tags.
|
protected boolean |
_tagsAutoPosting
The tags auto posting
|
protected ContentFilter.Condition |
_tagsCondition
The tags condition
|
Constructor and Description |
---|
DefaultFilterSearchContext(SiteManager siteManager)
Build a DefaultFilterSearchContext.
|
Modifier and Type | Method and Description |
---|---|
protected Tag |
_getTag(String currentSiteName,
String tagName)
Internal tag getter given the search context
|
void |
addSite(String siteName)
Add a site to the filter
|
void |
addTag(String tag)
Add a tag to the filter
|
WebContentFilter.Context |
getContext()
Get the search context
|
protected Expression |
getContextExpression(String siteName)
Get the
Expression associated with the given site context |
ContentFilter.ContextLanguage |
getContextLanguage()
Get the context language
|
protected Expression |
getContextLanguagesExpression(String lang)
Get the
Expression associated with the given language context |
int |
getDepth()
Get the search depth
|
Expression |
getFullExpression(String siteName,
String language)
Get the Expression.
|
String |
getPageId()
Get the parent page id
|
protected Expression |
getSharedContentsExpression(String currentSiteName)
Get the expression for shared contents
|
List<String> |
getSites()
Get the site names to match contents
|
List<String> |
getTags()
Get the tag keys to match contents
|
boolean |
getTagsAutoPosting()
Is the tag auto posting enabled?
|
ContentFilter.Condition |
getTagsCondition()
The tags condition
|
Expression |
getTagsExpression(String siteName)
Get the expression corresponding to the filter's tags
|
void |
setContext(WebContentFilter.Context context)
Set the search context
|
void |
setContextLanguage(ContentFilter.ContextLanguage language)
Set the context language
|
void |
setDepth(int depth)
Set the search depth
|
void |
setPageId(String pageId)
set the parent page Id.
|
void |
setTagsAutoPosting(boolean enable)
Enable/disable the tag autoposting feature.
|
void |
setTagsCondition(ContentFilter.Condition condition)
Set the tags condition
|
protected ContentFilter.Condition _tagsCondition
protected boolean _tagsAutoPosting
protected WebContentFilter.Context _context
protected int _depth
protected ContentFilter.ContextLanguage _contextLang
protected SiteManager _siteManager
public DefaultFilterSearchContext(SiteManager siteManager)
siteManager
- the site manager.public int getDepth()
WebContentFilter.FilterSearchContext
getDepth
in interface WebContentFilter.FilterSearchContext
public List<String> getTags()
WebContentFilter.FilterSearchContext
getTags
in interface WebContentFilter.FilterSearchContext
public ContentFilter.Condition getTagsCondition()
WebContentFilter.FilterSearchContext
getTagsCondition
in interface WebContentFilter.FilterSearchContext
public boolean getTagsAutoPosting()
WebContentFilter.FilterSearchContext
getTagsAutoPosting
in interface WebContentFilter.FilterSearchContext
public WebContentFilter.Context getContext()
WebContentFilter.FilterSearchContext
getContext
in interface WebContentFilter.FilterSearchContext
public List<String> getSites()
WebContentFilter.FilterSearchContext
getSites
in interface WebContentFilter.FilterSearchContext
public void addTag(String tag)
WebContentFilter.FilterSearchContext
addTag
in interface WebContentFilter.FilterSearchContext
tag
- The tag key to addpublic void setTagsCondition(ContentFilter.Condition condition)
WebContentFilter.FilterSearchContext
setTagsCondition
in interface WebContentFilter.FilterSearchContext
condition
- The condition to setpublic void setTagsAutoPosting(boolean enable)
WebContentFilter.FilterSearchContext
setTagsAutoPosting
in interface WebContentFilter.FilterSearchContext
enable
- True to enable the autposting, false to remains in strict match mode.public void setContext(WebContentFilter.Context context)
WebContentFilter.FilterSearchContext
setContext
in interface WebContentFilter.FilterSearchContext
context
- The search context to setpublic void addSite(String siteName)
WebContentFilter.FilterSearchContext
addSite
in interface WebContentFilter.FilterSearchContext
siteName
- The site name to addpublic void setDepth(int depth)
WebContentFilter.FilterSearchContext
setDepth
in interface WebContentFilter.FilterSearchContext
depth
- The search depth. Set to 0
for no depth limitation.public ContentFilter.ContextLanguage getContextLanguage()
WebContentFilter.FilterSearchContext
getContextLanguage
in interface WebContentFilter.FilterSearchContext
public void setContextLanguage(ContentFilter.ContextLanguage language)
WebContentFilter.FilterSearchContext
setContextLanguage
in interface WebContentFilter.FilterSearchContext
language
- The context language to setpublic Expression getFullExpression(String siteName, String language)
WebContentFilter.FilterSearchContext
getFullExpression
in interface WebContentFilter.FilterSearchContext
siteName
- the site namelanguage
- the languagepublic Expression getTagsExpression(String siteName)
WebContentFilter.FilterSearchContext
getTagsExpression
in interface WebContentFilter.FilterSearchContext
siteName
- The current site nameprotected Tag _getTag(String currentSiteName, String tagName)
currentSiteName
- The name of the current sitetagName
- the name of the tagprotected Expression getContextExpression(String siteName)
Expression
associated with the given site contextsiteName
- The current site nameExpression
associated with the given site contextprotected Expression getSharedContentsExpression(String currentSiteName)
currentSiteName
- the current site nameprotected Expression getContextLanguagesExpression(String lang)
Expression
associated with the given language contextlang
- The current languageExpression
associated with the given language contextpublic String getPageId()
WebContentFilter.FilterSearchContext
getPageId
in interface WebContentFilter.FilterSearchContext
public void setPageId(String pageId)
WebContentFilter.FilterSearchContext
setPageId
in interface WebContentFilter.FilterSearchContext
pageId
- Id of the parent page (when fetching child of a page).