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
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
FieldsModifier and TypeFieldDescriptionprotected ContentWorkflowHelperThe content workflow helperprotected ObservationManagerThe observation managerprotected PageDAOThe page DAOprotected AmetysObjectResolverThe Ametys resolverprotected SiteManagerThe site managerprotected SkinsManagerThe skins managerFields inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionacceptUGCContent(List<String> contentIds, String targetContentType, String targetWorkflowName, int initActionId, String mode, String pageId) Accept a UGC contentprotected ContentcreateContent(Content initialContent, String workflowName, int actionId, String cTypeId) Create the content from the proposed contentprotected ModifiablePagecreatePage(String parentId, DefaultWebContent content) Create page under a parent pageprotected voiddeleteContent(Content content) Delete the contentprotected StringgetZoneName(Page page) Get the name of zone where to insert contentrefuseUGCContent(List<String> contentIds, String comment, boolean withNotification) Refuse UGC contentvoidservice(ServiceManager smanager) 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.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_resolver
The Ametys resolver -
_pageDAO
The page DAO -
_siteManager
The site manager -
_skinsManager
The skins manager -
_observationManager
The observation manager -
_contentWorkflowHelper
The content workflow helper
-
-
Constructor Details
-
UGCContentModerationClientSideElement
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein 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
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
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
Delete the content- Parameters:
content- the content to delete
-