Class CommentClientSideElement
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.ui.StaticFileImportsClientSideElement
org.ametys.core.ui.StaticClientSideElement
org.ametys.cms.repository.comment.ui.CommentClientSideElement
- All Implemented Interfaces:
- ClientSideElement,- LogEnabled,- PluginAware,- Configurable,- Serviceable
This client site elements creates a button representing the validation state of a content's comment
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.ametys.core.ui.ClientSideElementClientSideElement.Script, ClientSideElement.ScriptFile
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected ObservationManagerThe observation managerprotected AmetysObjectResolverThe Ametys object resolverstatic final StringThe constant for the email of the author from parametersstatic final StringThe constant for the hidden status of the email of the author from parametersstatic final StringThe constant for the name of the author from parametersstatic final StringThe constant for the url of the author from parametersstatic final StringThe constant for the comment id from parametersstatic final StringThe constant for the content id from parametersstatic final StringThe constant for the text from parametersFields inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected boolean_isParentCommentAlreadyDelete(List<String> deleteCommentIds, String commentId) True if the a parent comment of the comment id is already deleted_jsonifyComment(Comment comment, Content content) Jsonify the comment._jsonifyContent(Content content) Jsonify the content.deleteComments(Map<String, List<String>> contents) Removes commentseditComment(Map<String, Object> parameters) Edit a comment if connected user has sufficient rightsgetComment(String contentId, String commentId) Get a comment propertiesgetCommentParameters(Content content, Comment comment) Get the parameters for a commentgetComments(Map<String, Object> parameters) Return the list of comments with its validation stategetContentDefaultParameters(Content content) Get the default content's parametersprotected UserIdentityGet the current userprotected booleanDetermines if connected user has right on contentinvalidateComments(Map<String, List<String>> contents) Invalidates comments when it is possible.voidservice(ServiceManager smanager) validateComments(Map<String, List<String>> contents) Validates comments when it is possible.Methods inherited from class org.ametys.core.ui.StaticClientSideElement_configureClass, _configureParameters, _configureScript, configureInitialParametersMethods inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement_configureDependencies, _configureImports, _configureRights, _configureRightsMode, configure, getDependencies, getId, getPluginName, getRights, getScripts, getScripts, hasRight, setPluginInfo, toStringMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabledgetLogger, setLogger
- 
Field Details- 
PARAMETER_AUTHOR_NAMEThe constant for the name of the author from parameters- See Also:
 
- 
PARAMETER_AUTHOR_EMAILThe constant for the email of the author from parameters- See Also:
 
- 
PARAMETER_AUTHOR_EMAILHIDDENThe constant for the hidden status of the email of the author from parameters- See Also:
 
- 
PARAMETER_AUTHOR_URLThe constant for the url of the author from parameters- See Also:
 
- 
PARAMETER_TEXTThe constant for the text from parameters- See Also:
 
- 
PARAMETER_CONTENT_IDThe constant for the content id from parameters- See Also:
 
- 
PARAMETER_COMMENT_IDThe constant for the comment id from parameters- See Also:
 
- 
_resolverThe Ametys object resolver
- 
_observationManagerThe observation manager
 
- 
- 
Constructor Details- 
CommentClientSideElementpublic CommentClientSideElement()
 
- 
- 
Method Details- 
service- Specified by:
- servicein interface- Serviceable
- Overrides:
- servicein class- StaticFileImportsClientSideElement
- Throws:
- ServiceException
 
- 
getCommentsReturn the list of comments with its validation state- Parameters:
- parameters- The contents and their comments
- Returns:
- The comments and their validated status
 
- 
getCommentpublic Map<String,Object> getComment(String contentId, String commentId) throws IOException, ProcessingException Get a comment properties- Parameters:
- contentId- the id of the content
- commentId- the id of the comment. Can be null
- Returns:
- results the server's response in JSON.
- Throws:
- IOException- If an error occurred
- ProcessingException- If an error occurred
 
- 
getContentDefaultParametersGet the default content's parameters- Parameters:
- content- The content
- Returns:
- The default parameters
 
- 
editCommentEdit a comment if connected user has sufficient rights- Parameters:
- parameters- the JS parameters. Necessarily contains the content and comment id, and the values to edit
- Returns:
- An empty map
 
- 
deleteCommentsRemoves comments- Parameters:
- contents- the contents with comments to remove
- Returns:
- the JSON result with deleted comments or not
 
- 
_isParentCommentAlreadyDeleteTrue if the a parent comment of the comment id is already deleted- Parameters:
- deleteCommentIds- the delete comment ids
- commentId- the comment id
- Returns:
- true if the a parent comment of the comment id is already deleted
 
- 
validateCommentsValidates comments when it is possible.- Parameters:
- contents- the contents with comments to validate
- Returns:
- the JSON result with validated comments or not
 
- 
invalidateCommentsInvalidates comments when it is possible.- Parameters:
- contents- the contents with comments to invalidate
- Returns:
- the JSON result with invalidated comments or not
 
- 
_jsonifyCommentJsonify the comment.- Parameters:
- comment- The comment
- content- The content
- Returns:
- commentMap the comment map
 
- 
_jsonifyContentJsonify the content.- Parameters:
- content- The content
- Returns:
- contentMap the content map
 
- 
getCommentParametersGet the parameters for a comment- Parameters:
- content- The content
- comment- The comment
- Returns:
- The parameters
 
- 
getCurrentUserGet the current user- Returns:
- The current user
 
- 
hasRightDetermines if connected user has right on content- Parameters:
- rightId- The right id
- content- The content
- Returns:
- true if user has right
 
 
-