Class UserReturnable.UserSaxer
- java.lang.Object
-
- org.ametys.web.frontoffice.search.metamodel.impl.PageSaxer
-
- org.ametys.plugins.userdirectory.service.search.UserReturnable.UserSaxer
-
- All Implemented Interfaces:
ReturnableSaxer
- Enclosing class:
- UserReturnable
public class UserReturnable.UserSaxer extends PageSaxer
TheReturnableSaxer
for user contents.
Their pages are SAXed.
-
-
Field Summary
Fields Modifier and Type Field Description protected Collection<String>
_allContentTypes
The user content types selected in the additional parameter of the current servicee instance (and their descendants)-
Fields inherited from class org.ametys.web.frontoffice.search.metamodel.impl.PageSaxer
_pageReturnable
-
-
Constructor Summary
Constructors Constructor Description UserSaxer(AdditionalParameterValueMap additionalParameterValues)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private Collection<String>
_allContentTypeIds(AdditionalParameterValueMap additionalParameterValues)
private Collection<String>
_currentServiceInstanceContentTypes(AdditionalParameterValueMap additionalParameterValues)
protected SearchContext
_getSearchContext(SearchComponentArguments args)
Gets the search context to use to determine site and sitemap as to resolve user pages from user contentsprotected String
_getSitemapName(SearchComponentArguments args, SearchContext searchContext, Content userContent)
Gets the sitemap nameprotected String
_getSiteName(SearchComponentArguments args, SearchContext searchContext)
Gets the site nameprotected UserPage
_resolveUserPage(Content userContent, String siteName, String sitemapName)
Resolves the use page corresponding to the user contentprotected void
_saxUserPage(ContentHandler contentHandler, UserPage userPage, org.slf4j.Logger logger, SearchComponentArguments args)
Sax the user pageprivate Set<String>
_selfAndDescendantContentTypes(String cType)
boolean
canSax(AmetysObject hit, org.slf4j.Logger logger, SearchComponentArguments args)
Returnstrue
if this saxer is able to SAX the given search hitString
getIdentifier()
Gets this Saxer identifier.void
sax(ContentHandler contentHandler, AmetysObject hit, org.slf4j.Logger logger, SearchComponentArguments args)
SAX the given search hit-
Methods inherited from class org.ametys.web.frontoffice.search.metamodel.impl.PageSaxer
saxContent, saxRichTextExcerpt
-
-
-
-
Field Detail
-
_allContentTypes
protected Collection<String> _allContentTypes
The user content types selected in the additional parameter of the current servicee instance (and their descendants)
-
-
Constructor Detail
-
UserSaxer
public UserSaxer(AdditionalParameterValueMap additionalParameterValues)
Constructor- Parameters:
additionalParameterValues
- The additional parameter values
-
-
Method Detail
-
_currentServiceInstanceContentTypes
private Collection<String> _currentServiceInstanceContentTypes(AdditionalParameterValueMap additionalParameterValues)
-
_allContentTypeIds
private Collection<String> _allContentTypeIds(AdditionalParameterValueMap additionalParameterValues)
-
_selfAndDescendantContentTypes
private Set<String> _selfAndDescendantContentTypes(String cType)
-
getIdentifier
public String getIdentifier()
Description copied from interface:ReturnableSaxer
Gets this Saxer identifier.
Most of the time you don't need to override this method and keep the default implementation which takes the runtime class name.
This identifier is used to match some XSL templates.
Thus, it does not have to be a unique identifier; for instance aReturnableSaxer
implementation can extend another Saxer and overrideReturnableSaxer.getIdentifier()
by returning its superclass name, in order to match the same XSL templates.- Returns:
- this Saxer identifier
-
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
- Overrides:
canSax
in classPageSaxer
- 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
- Overrides:
sax
in classPageSaxer
- Parameters:
contentHandler
- The content handlerhit
- The search hitlogger
- A loggerargs
- The other arguments- Throws:
SAXException
- if a SAX error occured
-
_getSearchContext
protected SearchContext _getSearchContext(SearchComponentArguments args)
Gets the search context to use to determine site and sitemap as to resolve user pages from user contents- Parameters:
args
- The search arguments- Returns:
- The search context
-
_getSiteName
protected String _getSiteName(SearchComponentArguments args, SearchContext searchContext)
Gets the site name- Parameters:
args
- The search argumentssearchContext
- The search context- Returns:
- the site name
-
_getSitemapName
protected String _getSitemapName(SearchComponentArguments args, SearchContext searchContext, Content userContent)
Gets the sitemap name- Parameters:
args
- The search argumentssearchContext
- The search contextuserContent
- The user content (current hit)- Returns:
- the sitemap name
-
_resolveUserPage
protected UserPage _resolveUserPage(Content userContent, String siteName, String sitemapName)
Resolves the use page corresponding to the user content- Parameters:
userContent
- The user contentsiteName
- The site namesitemapName
- The sitemap name- Returns:
- The user page
-
_saxUserPage
protected void _saxUserPage(ContentHandler contentHandler, UserPage userPage, org.slf4j.Logger logger, SearchComponentArguments args) throws SAXException
Sax the user page- Parameters:
contentHandler
- The content handleruserPage
- The user pagelogger
- The loggerargs
- The search arguments- Throws:
SAXException
- if a SAX error occured
-
-