Class ReportsClientSideElement
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.ui.StaticFileImportsClientSideElement
org.ametys.core.ui.StaticClientSideElement
org.ametys.cms.repository.reports.ui.ReportsClientSideElement
- 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 Summary
Nested classes/interfaces inherited from interface org.ametys.core.ui.ClientSideElement
ClientSideElement.Script, ClientSideElement.ScriptFile
-
Field Summary
Modifier and TypeFieldDescriptionprotected ObservationManager
The observation managerprotected AmetysObjectResolver
The Ametys object resolverprotected CurrentUserProvider
The current user providerFields inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription_getCommentParameters
(String commentId, Content content) Retrieves the given comment's parameters_getContentParameters
(Content content) Retrieves the given content's parametersprotected boolean
_ignoreReportsOnComment
(String commentId, CommentableContent content, UserIdentity currentUser) Ignores the reports on the given commentprotected boolean
_ignoreReportsOnContent
(ReportableObject content, UserIdentity currentUser) Ignores the reports on the given contentignoreReports
(List<Map<String, String>> reportedObjects) Ignore reports on objects (contents or comments) when it is possible.void
service
(ServiceManager smanager) Methods inherited from class org.ametys.core.ui.StaticClientSideElement
_configureClass, _configureParameters, _configureScript, configureInitialParameters
Methods inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_configureDependencies, _configureImports, _configureRights, _configureRightsMode, configure, getDependencies, getId, getPluginName, getRights, getScripts, getScripts, hasRight, setPluginInfo, toString
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_resolver
The Ametys object resolver -
_userProvider
The current user provider -
_observationManager
The observation manager
-
-
Constructor Details
-
ReportsClientSideElement
public ReportsClientSideElement()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classStaticFileImportsClientSideElement
- Throws:
ServiceException
-
ignoreReports
Ignore reports on objects (contents or comments) when it is possible.- Parameters:
reportedObjects
- the objects where to ignore reports- Returns:
- the JSON result with contents and comments with ignored reports or not
-
_getContentParameters
Retrieves the given content's parameters- Parameters:
content
- the content- Returns:
- the content's parameters
-
_ignoreReportsOnContent
Ignores the reports on the given content- Parameters:
content
- the contentcurrentUser
- the current user- Returns:
true
if there are reports that have been ignored,false
otherwise
-
_getCommentParameters
Retrieves the given comment's parameters- Parameters:
commentId
- the comment identifiercontent
- the content of the comment- Returns:
- the comment's parameters
-
_ignoreReportsOnComment
protected boolean _ignoreReportsOnComment(String commentId, CommentableContent content, UserIdentity currentUser) Ignores the reports on the given comment- Parameters:
commentId
- the identifier of the commentcontent
- the content of the commentcurrentUser
- the current user- Returns:
true
if there are reports that have been ignored,false
otherwise
-