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 PopulationContextHelper
The population context helperprotected 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, _reactionableHelper, _resolver, _rightManager, _userHelper, _userManager, _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
Add additional properties for comment's authorprotected void
Add image for comment's authorprotected void
_saxAdditionalUserProperties
(ContentHandler contentHandler, Content userContent, User user) Add additional properties for comment's authorprotected void
_saxUserImage
(ContentHandler contentHandler, User user, String language) Sax the user avatargetComment
(Comment comment, int level, Map<String, Object> contextualParameters) Get JSON representation of a commentprotected void
saxCommentAdditionalProperties
(ContentHandler contentHandler, Comment comment, int level) SAX additional comment propertiesvoid
service
(ServiceManager smanager) Methods inherited from class org.ametys.web.repository.comment.CommentsDAO
isCaptchaRequired, isValidatedByDefault
Methods inherited from class org.ametys.cms.repository.comment.CommentsDAO
_setCommentAttributes, addComment, canDeleteComment, contextualize, deleteComment, getComments, getContent, getCurrentUser, getErrors, likeOrUnlikeComment, likeOrUnlikeComment, reportComment, saxComment
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_populationContextHelper
The population context helper -
_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
-
getComment
public Map<String,Object> getComment(Comment comment, int level, Map<String, Object> contextualParameters) Description copied from class:CommentsDAO
Get JSON representation of a comment- Overrides:
getComment
in classCommentsDAO
- Parameters:
comment
- the commentlevel
- the level of comment (0 for parent comment, 1 for sub-comment, etc ....)contextualParameters
- the contextual parameters- Returns:
- the comment as JSON
-
saxCommentAdditionalProperties
protected void saxCommentAdditionalProperties(ContentHandler contentHandler, Comment comment, int level) throws SAXException Description copied from class:CommentsDAO
SAX additional comment properties- Overrides:
saxCommentAdditionalProperties
in classCommentsDAO
- Parameters:
contentHandler
- the content handlercomment
- the commentlevel
- the level of comment- Throws:
SAXException
- if an error occurred hile saxing
-
_saxUserImage
protected void _saxUserImage(ContentHandler contentHandler, User user, String language) throws SAXException Sax the user avatar- Parameters:
contentHandler
- the content handleruser
- the userlanguage
- 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, User user) throws SAXException Add additional properties for comment's author- Parameters:
contentHandler
- the content handleruserContent
- the user contentuser
- the user- Throws:
SAXException
- if an error occurred while saxing
-
_addUserImage
Add image for comment's author- Parameters:
user
- the userlanguage
- the language code (if image will be taken from user content)comment2json
- the comment properties
-
_addAdditionalUserProperties
protected void _addAdditionalUserProperties(Content userContent, User user, Map<String, Object> comment2json) Add additional properties for comment's author- Parameters:
userContent
- the user contentuser
- the usercomment2json
- the comment properties
-