Package org.ametys.cms.clientsideelement
Class ScheduleContentPublicationClientSideElement
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.ui.StaticFileImportsClientSideElement
org.ametys.core.ui.StaticClientSideElement
org.ametys.cms.clientsideelement.SmartContentClientSideElement
org.ametys.cms.clientsideelement.ScheduleContentPublicationClientSideElement
- All Implemented Interfaces:
ClientSideElement,LogEnabled,PluginAware,Configurable,Contextualizable,Serviceable
public class ScheduleContentPublicationClientSideElement
extends SmartContentClientSideElement
implements Contextualizable
Client side element to schedule a workflow action on a selected content
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.core.ui.ClientSideElement
ClientSideElement.Script, ClientSideElement.ScriptFile -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContextThe avalon contextprotected SchedulerThe schedulerstatic final Stringname of the publish scheduled action id in the content unversioned data holderstatic final Stringname of the publish scheduled date data in the content unversioned data holderstatic final Stringname of the unpublish scheduled action id in the content unversioned data holderstatic final Stringname of the unpublish scheduled date data in the content unversioned data holderFields inherited from class org.ametys.cms.clientsideelement.SmartContentClientSideElement
_contentHelper, _resolver, _smartHelperFields inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ClientSideElement.Script_configureScript(Configuration configuration) Configure the scriptprotected int_workflowAction(Content content) Determines if the workflow action is correctvoidcontextualize(Context context) getScheduleInfo(String contentId) Get the schedule info of the contentGet informations on contents' state This method should only be used if you need additional information than the default one.scheduleAction(String contentId, String startDateAsStr, String endDateAsStr) Schedule the execution of a workflow action at a given datevoidservice(ServiceManager manager) Methods inherited from class org.ametys.cms.clientsideelement.SmartContentClientSideElement
_getAllRightDescription, _getIncorrectWorkflowStepDescription, _getLockedDescription, _getNoModifiableDescription, _getNoRightDescription, _getWorkflowActionUnvailableDescription, _hasReadAccess, _hasRight, _isAllRight, _isLocked, _isModifiable, _isWorkflowStepCorrect, getContentDefaultParametersMethods inherited from class org.ametys.core.ui.StaticClientSideElement
_configureClass, _configureParameters, 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
-
PUBLISH_DATE
name of the publish scheduled date data in the content unversioned data holder- See Also:
-
PUBLISH_ACTION_ID
name of the publish scheduled action id in the content unversioned data holder- See Also:
-
UNPUBLISH_DATE
name of the unpublish scheduled date data in the content unversioned data holder- See Also:
-
UNPUBLISH_ACTION_ID
name of the unpublish scheduled action id in the content unversioned data holder- See Also:
-
_context
The avalon context -
_scheduler
The scheduler
-
-
Constructor Details
-
ScheduleContentPublicationClientSideElement
-
-
Method Details
-
contextualize
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classSmartContentClientSideElement- Throws:
ServiceException
-
_configureScript
protected ClientSideElement.Script _configureScript(Configuration configuration) throws ConfigurationException Description copied from class:StaticFileImportsClientSideElementConfigure the script- Overrides:
_configureScriptin classStaticClientSideElement- Parameters:
configuration- the global configuration- Returns:
- The script created
- Throws:
ConfigurationException- The configuration is incorrect
-
getScheduleInfo
Get the schedule info of the content- Parameters:
contentId- the content identifier- Returns:
- the scheduled date if any
-
scheduleAction
public Map<String,Object> scheduleAction(String contentId, String startDateAsStr, String endDateAsStr) Schedule the execution of a workflow action at a given date- Parameters:
contentId- the identifier of the content to act onstartDateAsStr- the date of publication as an ISO date-time stringendDateAsStr- the date of unpublication as an ISO date-time string- Returns:
- true if the action is a success
-
getStatus
Description copied from class:SmartContentClientSideElementGet informations on contents' state This method should only be used if you need additional information than the default one. Otherwise use the JS implementation provided bySmartContentController._calculateStatusWhen called inside aCallable, you can consider that this method will do the right check as long as you only do additional processing on the "allright-contents".- Overrides:
getStatusin classSmartContentClientSideElement- Parameters:
contentsId- the ids of contents- Returns:
- informations on contents' state
-
_workflowAction
Description copied from class:SmartContentClientSideElementDetermines if the workflow action is correct- Overrides:
_workflowActionin classSmartContentClientSideElement- Parameters:
content- the content- Returns:
- true if the workflow action is incorrect
-