Class PageSaxer
- java.lang.Object
-
- org.ametys.web.frontoffice.search.metamodel.impl.PageSaxer
-
- All Implemented Interfaces:
ReturnableSaxer
- Direct Known Subclasses:
CourseSaxer
,ProgramSaxer
,UserReturnable.UserSaxer
public class PageSaxer extends Object implements ReturnableSaxer
-
-
Field Summary
Fields Modifier and Type Field Description protected PageReturnable
_pageReturnable
The associated returnable on pages
-
Constructor Summary
Constructors Constructor Description PageSaxer(PageReturnable pageReturnable)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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, org.slf4j.Logger logger)
boolean
canSax(AmetysObject hit, org.slf4j.Logger logger, SearchComponentArguments args)
Returnstrue
if this saxer is able to SAX the given search hitvoid
sax(ContentHandler contentHandler, AmetysObject hit, org.slf4j.Logger logger, SearchComponentArguments args)
SAX the given search hitprotected void
saxContent(Content content, String metadataSetName, Locale defaultLocale, ContentHandler contentHandler, org.slf4j.Logger logger)
SAX the metadata set of a content if existsprotected void
saxRichTextExcerpt(String metadataPath, String contentId, Object richText, ContentHandler contentHandler, org.slf4j.Logger logger)
SAX excerpt for rich text-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.web.frontoffice.search.metamodel.ReturnableSaxer
getIdentifier
-
-
-
-
Field Detail
-
_pageReturnable
protected PageReturnable _pageReturnable
The associated returnable on pages
-
-
Constructor Detail
-
PageSaxer
public PageSaxer(PageReturnable pageReturnable)
Constructor- Parameters:
pageReturnable
- The associated returnable on pages
-
-
Method Detail
-
canSax
public boolean canSax(AmetysObject hit, org.slf4j.Logger logger, SearchComponentArguments args)
Description copied from interface:ReturnableSaxer
Returnstrue
if this saxer is able to SAX the given search hit- Specified by:
canSax
in interfaceReturnableSaxer
- Parameters:
hit
- The search hitlogger
- A loggerargs
- The other arguments- Returns:
true
if this saxer is able to SAX the given search hit
-
sax
public void sax(ContentHandler contentHandler, AmetysObject hit, org.slf4j.Logger logger, SearchComponentArguments args) throws SAXException
Description copied from interface:ReturnableSaxer
SAX the given search hit- Specified by:
sax
in interfaceReturnableSaxer
- Parameters:
contentHandler
- The content handlerhit
- The search hitlogger
- A loggerargs
- The other arguments- Throws:
SAXException
- if a SAX error occured
-
_saxPageContents
private void _saxPageContents(Page page, ContentHandler handler, org.slf4j.Logger logger)
-
_saxLastModifiedDate
private void _saxLastModifiedDate(Page page, ContentHandler handler) throws SAXException
- Throws:
SAXException
-
_saxLastValidationDate
private void _saxLastValidationDate(Page page, ContentHandler handler) throws SAXException
- Throws:
SAXException
-
_saxLastDate
private void _saxLastDate(Page page, Function<Content,Date> dateRetriever, ContentHandler handler, String tagName) throws SAXException
- Throws:
SAXException
-
_pageContents
private static Stream<Content> _pageContents(Page page)
-
saxContent
protected void saxContent(Content content, String metadataSetName, Locale defaultLocale, ContentHandler contentHandler, org.slf4j.Logger logger) throws SAXException
SAX the metadata set of a content if exists- Parameters:
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 logger- Throws:
SAXException
- if an exception occurs while saxing
-
saxRichTextExcerpt
protected void saxRichTextExcerpt(String metadataPath, String contentId, Object richText, ContentHandler contentHandler, org.slf4j.Logger logger)
SAX excerpt for rich text- Parameters:
metadataPath
- The path of metadatacontentId
- The content idrichText
- The rich textcontentHandler
- The content handlerlogger
- The logger
-
-