Class CommentsDAO
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.cms.repository.comment.CommentsDAO
org.ametys.web.repository.comment.CommentsDAO
org.ametys.plugins.workspaces.comments.CommentsDAO
- All Implemented Interfaces:
LogEnabled
,Component
,Contextualizable
,Serviceable
Comments DAO for workspaces
-
Field Summary
Modifier and TypeFieldDescriptionprotected URIPrefixHandler
The URI prefix handlerprotected UserDirectoryHelper
The user directory helperFields inherited from class org.ametys.web.repository.comment.CommentsDAO
_pageHelper
Fields inherited from class org.ametys.cms.repository.comment.CommentsDAO
_context, _observationManager, _populationContextHelper, _reactionableHelper, _resolver, _rightManager, _userHelper, _userManager, _userPopulationDAO, _userProvider, FORM_AUTHOR_EMAIL, FORM_AUTHOR_HIDEEMAIL, FORM_AUTHOR_NAME, FORM_AUTHOR_URL, FORM_CAPTCHA_KEY, FORM_CAPTCHA_VALUE, FORM_CONTENTTEXT, ROLE, URL_VALIDATOR
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
_saxAdditionalUserProperties
(ContentHandler contentHandler, Content userContent) Add additional properties for comment's authorprotected void
_saxUserImage
(ContentHandler contentHandler, UserIdentity userIdentity, String language) Sax the user avatarprotected Optional<UserIdentity>
getAuthorIdentity
(Comment comment, Map<String, Object> contextualParameters) Retrieves theUserIdentity
of the comment's authorgetCommentAuthor
(Comment comment, Map<String, Object> contextualParameters) Get JSON representation of a comment's authorprotected void
saxCommentAdditionalProperties
(ContentHandler contentHandler, Comment comment, int level, Map<String, Object> contextualParameters) SAX additional comment propertiesvoid
service
(ServiceManager smanager) Methods inherited from class org.ametys.web.repository.comment.CommentsDAO
getUserPopulationsContexts, isCaptchaRequired, isValidatedByDefault
Methods inherited from class org.ametys.cms.repository.comment.CommentsDAO
_setCommentAttributes, addComment, canDeleteComment, canDeleteComment, contextualize, deleteComment, getComment, getComments, getContent, getContributorComments, getCurrentUser, getErrors, getUserByEmail, getUserIdentityProperties, getUserProperties, getUserPropertiesFromIdentity, likeOrUnlikeComment, likeOrUnlikeComment, reportComment, saxComment, saxUserIdentity
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_userDirectoryHelper
The user directory helper -
_prefixHandler
The URI prefix handler
-
-
Constructor Details
-
CommentsDAO
public CommentsDAO()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classCommentsDAO
- Throws:
ServiceException
-
saxCommentAdditionalProperties
protected void saxCommentAdditionalProperties(ContentHandler contentHandler, Comment comment, int level, Map<String, Object> contextualParameters) throws SAXExceptionDescription copied from class:CommentsDAO
SAX additional comment properties- Overrides:
saxCommentAdditionalProperties
in classCommentsDAO
- Parameters:
contentHandler
- the content handlercomment
- the commentlevel
- the level of commentcontextualParameters
- the contextual parameters- Throws:
SAXException
- if an error occurred while saxing
-
getCommentAuthor
protected Map<String,Object> getCommentAuthor(Comment comment, Map<String, Object> contextualParameters) Description copied from class:CommentsDAO
Get JSON representation of a comment's author- Overrides:
getCommentAuthor
in classCommentsDAO
- Parameters:
comment
- the commentcontextualParameters
- the contextual parameters- Returns:
- the comment's author as JSON
-
_saxUserImage
protected void _saxUserImage(ContentHandler contentHandler, UserIdentity userIdentity, String language) throws SAXException Sax the user avatar- Parameters:
contentHandler
- the content handleruserIdentity
- the user identitylanguage
- the language code (if image will be taken from user content)- Throws:
SAXException
- if an error occurred while saxing
-
_saxAdditionalUserProperties
protected void _saxAdditionalUserProperties(ContentHandler contentHandler, Content userContent) throws SAXException Add additional properties for comment's author- Parameters:
contentHandler
- the content handleruserContent
- the user content- Throws:
SAXException
- if an error occurred while saxing
-
getAuthorIdentity
protected Optional<UserIdentity> getAuthorIdentity(Comment comment, Map<String, Object> contextualParameters) Retrieves theUserIdentity
of the comment's author- Parameters:
comment
- the commentcontextualParameters
- the contextual parameters- Returns:
- the comment's author identity
-