Class UGCContentModerationClientSideElement
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.ui.StaticFileImportsClientSideElement
-
- org.ametys.core.ui.StaticClientSideElement
-
- org.ametys.plugins.ugc.clientsideelement.UGCContentModerationClientSideElement
-
- All Implemented Interfaces:
ClientSideElement
,LogEnabled
,PluginAware
,Configurable
,Serviceable
public class UGCContentModerationClientSideElement extends StaticClientSideElement
Client side element for UGC content moderation
-
-
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 protected ContentWorkflowHelper
_contentWorkflowHelper
The content workflow helperprotected ObservationManager
_observationManager
The observation managerprotected PageDAO
_pageDAO
The page DAOprotected AmetysObjectResolver
_resolver
The Ametys resolverprotected SiteManager
_siteManager
The site managerprotected SkinsManager
_skinsManager
The skins manager-
Fields inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script
-
-
Constructor Summary
Constructors Constructor Description UGCContentModerationClientSideElement()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>
acceptUGCContent(List<String> contentIds, String targetContentType, String targetWorkflowName, int initActionId, String mode, String pageId)
Accept a UGC contentprotected Content
createContent(Content initialContent, String workflowName, int actionId, String cTypeId)
Create the content from the proposed contentprotected ModifiablePage
createPage(String parentId, DefaultWebContent content)
Create page under a parent pageprotected void
deleteContent(Content content)
Delete the contentprotected String
getZoneName(Page page)
Get the name of zone where to insert contentMap<String,Object>
refuseUGCContent(List<String> contentIds, String comment, boolean withNotification)
Refuse UGC contentvoid
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 resolver
-
_siteManager
protected SiteManager _siteManager
The site manager
-
_skinsManager
protected SkinsManager _skinsManager
The skins manager
-
_observationManager
protected ObservationManager _observationManager
The observation manager
-
_contentWorkflowHelper
protected ContentWorkflowHelper _contentWorkflowHelper
The content workflow helper
-
-
Constructor Detail
-
UGCContentModerationClientSideElement
public UGCContentModerationClientSideElement()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classStaticFileImportsClientSideElement
- Throws:
ServiceException
-
acceptUGCContent
public Map<String,Object> acceptUGCContent(List<String> contentIds, String targetContentType, String targetWorkflowName, int initActionId, String mode, String pageId) throws ProcessingException
Accept a UGC content- Parameters:
contentIds
- The id of UGC contentstargetContentType
- The id of target content type. Can be null or empty to not change content typetargetWorkflowName
- The workflow name for contents to createinitActionId
- The id of workflow init actionmode
- The insertion mode ('new' to insert contents in a new page, 'affect' to insert contents on a existing page or 'none' to keep content as orphan).pageId
- The page id. Can be null for mode 'none'- Returns:
- the result
- Throws:
ProcessingException
- if failed to transform UGC contents
-
refuseUGCContent
public Map<String,Object> refuseUGCContent(List<String> contentIds, String comment, boolean withNotification) throws ProcessingException
Refuse UGC content- Parameters:
contentIds
- The id of UGC contents to refusecomment
- The reject's commentwithNotification
- True to notify UGC author of the refuse- Returns:
- the result
- Throws:
ProcessingException
- if failed to transform UGC contents
-
createPage
protected ModifiablePage createPage(String parentId, DefaultWebContent content)
Create page under a parent page- Parameters:
parentId
- the parent page id or empty for the sitemap rootcontent
- the UGC content- Returns:
- the new created page
-
getZoneName
protected String getZoneName(Page page)
Get the name of zone where to insert content- Parameters:
page
- The page- Returns:
- the zone's name
-
createContent
protected Content createContent(Content initialContent, String workflowName, int actionId, String cTypeId) throws com.opensymphony.workflow.WorkflowException
Create the content from the proposed content- Parameters:
initialContent
- The initial contentworkflowName
- the workflow nameactionId
- The init action idcTypeId
- the content type- Returns:
- the created content
- Throws:
com.opensymphony.workflow.WorkflowException
- if failed to create content
-
deleteContent
protected void deleteContent(Content content)
Delete the content- Parameters:
content
- the content to delete
-
-