public class PageSaxer extends Object implements ReturnableSaxer
Modifier and Type | Field and Description |
---|---|
protected PageReturnable |
_pageReturnable
The associated returnable on pages
|
Constructor and Description |
---|
PageSaxer(PageReturnable pageReturnable)
Constructor
|
Modifier and Type | Method and Description |
---|---|
private static Stream<Content> |
_pageContents(Page page) |
private void |
_saxLastDate(Page page,
Function<Content,Date> dateRetriever,
ContentHandler handler,
String tagName) |
private void |
_saxLastModifiedDate(Page page,
ContentHandler handler) |
private void |
_saxLastValidationDate(Page page,
ContentHandler handler) |
private void |
_saxPageContents(Page page,
ContentHandler handler,
Logger logger) |
boolean |
canSax(AmetysObject hit,
Logger logger,
SearchComponentArguments args)
Returns
true if this saxer is able to SAX the given search hit |
void |
sax(ContentHandler contentHandler,
AmetysObject hit,
Logger logger,
SearchComponentArguments args)
SAX the given search hit
|
protected void |
saxContent(Content content,
String metadataSetName,
Locale defaultLocale,
ContentHandler contentHandler,
Logger logger)
SAX the metadata set of a content if exists
|
protected void |
saxRichTextExcerpt(String metadataPath,
String contentId,
Object richText,
ContentHandler contentHandler,
Logger logger)
SAX excerpt for rich text
|
protected PageReturnable _pageReturnable
public PageSaxer(PageReturnable pageReturnable)
pageReturnable
- The associated returnable on pagespublic boolean canSax(AmetysObject hit, Logger logger, SearchComponentArguments args)
ReturnableSaxer
true
if this saxer is able to SAX the given search hitcanSax
in interface ReturnableSaxer
hit
- The search hitlogger
- A loggerargs
- The other argumentstrue
if this saxer is able to SAX the given search hitpublic void sax(ContentHandler contentHandler, AmetysObject hit, Logger logger, SearchComponentArguments args) throws SAXException
ReturnableSaxer
sax
in interface ReturnableSaxer
contentHandler
- The content handlerhit
- The search hitlogger
- A loggerargs
- The other argumentsSAXException
- if a SAX error occuredprivate void _saxPageContents(Page page, ContentHandler handler, Logger logger)
private void _saxLastModifiedDate(Page page, ContentHandler handler) throws SAXException
SAXException
private void _saxLastValidationDate(Page page, ContentHandler handler) throws SAXException
SAXException
private void _saxLastDate(Page page, Function<Content,Date> dateRetriever, ContentHandler handler, String tagName) throws SAXException
SAXException
private static Stream<Content> _pageContents(Page page)
protected void saxContent(Content content, String metadataSetName, Locale defaultLocale, ContentHandler contentHandler, Logger logger) throws SAXException
content
- the contentmetadataSetName
- The name of metadata set to saxdefaultLocale
- The locale to use to sax localized values such as multilingual content or multilingual string. Only use if initial content's language is not null.contentHandler
- The content handlerlogger
- The loggerSAXException
- if an exception occurs while saxingprotected void saxRichTextExcerpt(String metadataPath, String contentId, Object richText, ContentHandler contentHandler, Logger logger)
metadataPath
- The path of metadatacontentId
- The content idrichText
- The rich textcontentHandler
- The content handlerlogger
- The logger