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
FieldsModifier and TypeFieldDescriptionprotected PopulationContextHelperThe population context helperprotected URIPrefixHandlerThe URI prefix handlerprotected UserDirectoryHelperThe user directory helperFields inherited from class org.ametys.web.repository.comment.CommentsDAO
_pageHelperFields 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 - 
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdd additional properties for comment's authorprotected voidAdd 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 voidsaxCommentAdditionalProperties(ContentHandler contentHandler, Comment comment, int level) SAX additional comment propertiesvoidservice(ServiceManager smanager) Methods inherited from class org.ametys.web.repository.comment.CommentsDAO
isCaptchaRequired, isValidatedByDefaultMethods inherited from class org.ametys.cms.repository.comment.CommentsDAO
_setCommentAttributes, addComment, canDeleteComment, contextualize, deleteComment, getComments, getContent, getCurrentUser, getErrors, likeOrUnlikeComment, likeOrUnlikeComment, reportComment, saxCommentMethods 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:
 servicein interfaceServiceable- Overrides:
 servicein classCommentsDAO- Throws:
 ServiceException
 - 
getComment
public Map<String,Object> getComment(Comment comment, int level, Map<String, Object> contextualParameters) Description copied from class:CommentsDAOGet JSON representation of a comment- Overrides:
 getCommentin 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:CommentsDAOSAX additional comment properties- Overrides:
 saxCommentAdditionalPropertiesin 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
 
 -