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 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, _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
Constructors -
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 theUserIdentityof the comment's authorgetCommentAuthor(Comment comment, Map<String, Object> contextualParameters) Get JSON representation of a comment's authorprotected voidsaxCommentAdditionalProperties(ContentHandler contentHandler, Comment comment, int level, Map<String, Object> contextualParameters) SAX additional comment propertiesvoidservice(ServiceManager smanager) Methods inherited from class org.ametys.web.repository.comment.CommentsDAO
getUserPopulationsContexts, isCaptchaRequired, isValidatedByDefaultMethods 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, saxUserIdentityMethods 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:
servicein interfaceServiceable- Overrides:
servicein classCommentsDAO- Throws:
ServiceException
-
saxCommentAdditionalProperties
protected void saxCommentAdditionalProperties(ContentHandler contentHandler, Comment comment, int level, Map<String, Object> contextualParameters) throws SAXExceptionDescription copied from class:CommentsDAOSAX additional comment properties- Overrides:
saxCommentAdditionalPropertiesin 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:CommentsDAOGet JSON representation of a comment's author- Overrides:
getCommentAuthorin 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 theUserIdentityof the comment's author- Parameters:
comment- the commentcontextualParameters- the contextual parameters- Returns:
- the comment's author identity
-