public class ContentFilterHelper extends Object implements Component, Serviceable
ContentFilter
Modifier and Type | Field and Description |
---|---|
protected static Logger |
__LOGGER
Logger
|
protected ContentAccessManager |
_contentAccessManager
The content access manager.
|
protected CurrentUserProvider |
_currentUserProvider
The current user provider
|
protected RenderingContextHandler |
_renderingContentHandler
The rendering context handler.
|
private SourceResolver |
_resolver |
static String |
ROLE
The Avalon Role
|
Constructor and Description |
---|
ContentFilterHelper() |
Modifier and Type | Method and Description |
---|---|
List<String> |
getMatchingContentIds(WebContentFilter filter,
String siteName,
String lang,
Page page)
Get the ID of all contents matching the given filter.
|
protected boolean |
isAccessible(Content content,
Page currentPage,
WebContentFilter filter)
Test if the content is accessible in accordance with the filter's access limitation policy.
|
boolean |
isContentValid(Content content,
Page currentPage,
ContentFilter filter)
Test if the content is accessible in accordance with the filter options (mask orphans, access limitation policy, ...)
|
protected boolean |
isOrphan(Content content)
Determines if a content is orphan
|
void |
saxContent(ContentHandler handler,
Content content,
String metadataSetName,
boolean checkUserAccess)
SAX a content in its specific view
|
void |
saxMatchingContents(ContentHandler handler,
ContentFilter filter)
SAX all contents matching the given filter
|
void |
saxMatchingContents(ContentHandler handler,
WebContentFilter filter,
String siteName,
String lang,
Page page)
SAX all contents matching the given filter
|
void |
service(ServiceManager manager) |
protected ContentAccessManager _contentAccessManager
protected RenderingContextHandler _renderingContentHandler
protected CurrentUserProvider _currentUserProvider
private SourceResolver _resolver
public ContentFilterHelper()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void saxMatchingContents(ContentHandler handler, ContentFilter filter) throws SAXException, IOException
handler
- The content handler to SAX intofilter
- The filterSAXException
- If an error occurs while SAXingIOException
- If an error occurs while retrieving content.public void saxMatchingContents(ContentHandler handler, WebContentFilter filter, String siteName, String lang, Page page) throws SAXException, IOException
handler
- The content handler to SAX intofilter
- The filtersiteName
- The current site name. Can be null.lang
- The current language. Can be null.page
- The current page. Can be null.SAXException
- If an error occurs while SAXingIOException
- If an error occurs while retrieving content.public List<String> getMatchingContentIds(WebContentFilter filter, String siteName, String lang, Page page)
filter
- The filtersiteName
- The current site name. Can be null.lang
- The current language. Can be null.page
- The current page. Can be null.public void saxContent(ContentHandler handler, Content content, String metadataSetName, boolean checkUserAccess) throws SAXException, IOException
handler
- The content handler to SAX intocontent
- The content to SAXmetadataSetName
- The metadata set to usecheckUserAccess
- Set to true to check FO user access when rendering contentSAXException
- If an error occurs while SAXingIOException
- If an error occurs while retrieving content.public boolean isContentValid(Content content, Page currentPage, ContentFilter filter)
content
- the content to test.currentPage
- the current page.filter
- the content filter.protected boolean isAccessible(Content content, Page currentPage, WebContentFilter filter)
content
- the content to test.currentPage
- the current page.filter
- the web content filter.