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
public class ReportsClientSideElement extends StaticClientSideElement
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
Fields Modifier and Type Field Description private ContentHelper
_contentHelper
The content helperprotected ObservationManager
_observationManager
The observation managerprotected AmetysObjectResolver
_resolver
The Ametys object resolverprotected CurrentUserProvider
_userProvider
The current user provider-
Fields inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script
-
-
Constructor Summary
Constructors Constructor Description ReportsClientSideElement()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,Object>
_getCommentParameters(String commentId, Content content)
Retrieves the given comment's parametersprotected Map<String,Object>
_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 contentMap<String,Object>
ignoreReports(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 Detail
-
_resolver
protected AmetysObjectResolver _resolver
The Ametys object resolver
-
_userProvider
protected CurrentUserProvider _userProvider
The current user provider
-
_observationManager
protected ObservationManager _observationManager
The observation manager
-
_contentHelper
private ContentHelper _contentHelper
The content helper
-
-
Constructor Detail
-
ReportsClientSideElement
public ReportsClientSideElement()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classStaticFileImportsClientSideElement
- Throws:
ServiceException
-
ignoreReports
public Map<String,Object> ignoreReports(List<Map<String,String>> reportedObjects)
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
protected Map<String,Object> _getContentParameters(Content content)
Retrieves the given content's parameters- Parameters:
content
- the content- Returns:
- the content's parameters
-
_ignoreReportsOnContent
protected boolean _ignoreReportsOnContent(ReportableObject content, UserIdentity currentUser)
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
protected Map<String,Object> _getCommentParameters(String commentId, Content content)
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
-
-