Package org.ametys.odf.workflow.copy
Class CopyODFContentClientSideElement
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.odf.workflow.copy.CopyODFContentClientSideElement
- All Implemented Interfaces:
- ClientSideElement,- LogEnabled,- PluginAware,- Configurable,- Serviceable
- Direct Known Subclasses:
- CopyODFPilotageContentClientSideElement
Client side element for ODF content copy
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumEnumeration for the mode of duplicationNested classes/interfaces inherited from interface org.ametys.core.ui.ClientSideElementClientSideElement.Script, ClientSideElement.ScriptFile
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected ContentWorkflowHelperThe content workflow helperprotected CopyContentClientInteractionThe client side element for copyprotected JSONUtilsJSON utilsprotected ObservationManagerThe observation managerprotected ODFHelperThe ODF helperprotected ShareableCourseHelperThe shareable course helperprotected SolrIndexHelperThe Solr index helperstatic final StringThe key to get the duplication modestatic final StringThe key to tell if we keep the creation titlestatic final StringThe key to get the parent ProgramPart's idFields 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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescription_getCourse(ProgramItem programItem) Get all first courses in sub item of the program itemprotected void_initializeShareableFields(String copiedContentId, String parentContentId, List<String> createdContentIds) Initialize shareable fields for the copied contentDetermines if a ODF content can be copied and linked to a target contentprotected booleancheckBeforeDuplication(String contentId, String parentContentId, CopyODFContentClientSideElement.DuplicationMode duplicationMode, Map<String, Object> results) Check that duplication can be performed without blocking errorscreateContentByCopy(String baseContentId, String newContentTitle, String viewNameToCopy, String fallbackViewNameToCopy, String viewMode, int initActionId, int editActionId, String duplicationModeAsString, String parentContentId) Creates a content by copy of another one.
 Also handle the possible inner duplication depending on the duplication mode for each attribute of type "content".voidservice(ServiceManager sManager) Methods inherited from class org.ametys.cms.clientsideelement.SmartContentClientSideElement_getAllRightDescription, _getIncorrectWorkflowStepDescription, _getLockedDescription, _getNoModifiableDescription, _getNoRightDescription, _getWorkflowActionUnvailableDescription, _hasRight, _isAllRight, _isLocked, _isModifiable, _isWorkflowStepCorrect, _workflowAction, getContentDefaultParameters, getStatusMethods 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.AbstractLogEnabledgetLogger, setLogger
- 
Field Details- 
DUPLICATION_MODE_KEYThe key to get the duplication mode- See Also:
 
- 
PARENT_KEYThe key to get the parent ProgramPart's id- See Also:
 
- 
KEEP_CREATION_TITLE_KEYThe key to tell if we keep the creation title- See Also:
 
- 
_contentWorkflowHelperThe content workflow helper
- 
_observationManagerThe observation manager
- 
_odfHelperThe ODF helper
- 
_copyClientSideInteractionThe client side element for copy
- 
_jsonUtilsJSON utils
- 
_solrIndexHelperThe Solr index helper
 
- 
- 
Constructor Details- 
CopyODFContentClientSideElementpublic CopyODFContentClientSideElement()
 
- 
- 
Method Details- 
service- Specified by:
- servicein interface- Serviceable
- Overrides:
- servicein class- SmartContentClientSideElement
- Throws:
- ServiceException
 
- 
canCopyTopublic Map<String,Object> canCopyTo(String copiedContentId, String targetContentId, Map<String, Object> contextualParameters) Determines if a ODF content can be copied and linked to a target content- Parameters:
- copiedContentId- The id of copied content
- targetContentId- The id of target content
- contextualParameters- the contextual parameters
- Returns:
- the result with success to true if copy is available
 
- 
createContentByCopypublic Map<String,Object> createContentByCopy(String baseContentId, String newContentTitle, String viewNameToCopy, String fallbackViewNameToCopy, String viewMode, int initActionId, int editActionId, String duplicationModeAsString, String parentContentId) throws Exception Creates a content by copy of another one.
 Also handle the possible inner duplication depending on the duplication mode for each attribute of type "content".- Parameters:
- baseContentId- The id of content to copy
- newContentTitle- The title of content to create
- viewNameToCopy- The view name to copy. Can be null
- fallbackViewNameToCopy- The fallback view name to use if 'viewNameToCopy' does not exist. Can be null
- viewMode- The view type to copy. Can be null
- initActionId- The init workflow action id for copy
- editActionId- The workflow action for editing content
- duplicationModeAsString- the duplication mode
- parentContentId- the parent id under which the duplicated content will be created. Can be null
- Returns:
- the copy result
- Throws:
- Exception- if an error occurred during copy
 
- 
checkBeforeDuplicationprotected boolean checkBeforeDuplication(String contentId, String parentContentId, CopyODFContentClientSideElement.DuplicationMode duplicationMode, Map<String, Object> results) Check that duplication can be performed without blocking errors- Parameters:
- contentId- The content id to copy
- parentContentId- The parent content id
- duplicationMode- The duplication mode
- results- the results map
- Returns:
- true if the duplication can be performed
 
- 
_getCourseGet all first courses in sub item of the program item- Parameters:
- programItem- the program item
- Returns:
- a set of courses
 
 
-