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
public class CommentsDAO extends CommentsDAO
Comments DAO for workspaces
-
-
Field Summary
Fields Modifier and Type Field Description protected PopulationContextHelper
_populationContextHelper
The population context helperprotected URIPrefixHandler
_prefixHandler
The URI prefix handlerprotected UserDirectoryHelper
_userDirectoryHelper
The user directory helper-
Fields 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
Constructors Constructor Description CommentsDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_addAdditionalUserProperties(Content userContent, User user, Map<String,Object> comment2json)
Add additional properties for comment's authorprotected void
_addUserImage(User user, String language, Map<String,Object> comment2json)
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 avatarMap<String,Object>
getComment(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 Detail
-
_populationContextHelper
protected PopulationContextHelper _populationContextHelper
The population context helper
-
_userDirectoryHelper
protected UserDirectoryHelper _userDirectoryHelper
The user directory helper
-
_prefixHandler
protected URIPrefixHandler _prefixHandler
The URI prefix handler
-
-
Constructor Detail
-
CommentsDAO
public CommentsDAO()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- 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
protected void _addUserImage(User user, String language, Map<String,Object> comment2json)
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
-
-