Package org.ametys.odf.workflow.copy
Class AbstractCreateODFContentByCopyFunction
java.lang.Object
org.ametys.plugins.workflow.AbstractWorkflowComponent
org.ametys.cms.workflow.AbstractContentWorkflowComponent
org.ametys.cms.workflow.CreateContentFunction
org.ametys.cms.workflow.copy.CreateContentByCopyFunction
org.ametys.odf.workflow.copy.AbstractCreateODFContentByCopyFunction
- All Implemented Interfaces:
com.opensymphony.workflow.FunctionProvider
,EnhancedFunction
,LogEnabled
,Serviceable
- Direct Known Subclasses:
AbstractCreateProgramItemByCopyFunction
,CreateCoursePartByCopyFunction
,CreateOrgUnitByCopyFunction
,CreatePersonByCopyFunction
OSWorkflow function to create a odf content by copy of another
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.plugins.workflow.EnhancedFunction
EnhancedFunction.FunctionArgument
-
Field Summary
Modifier and TypeFieldDescriptionprotected ODFHelper
ODF helperstatic final String
Key for the parent of the target contentFields inherited from class org.ametys.cms.workflow.copy.CreateContentByCopyFunction
_copyContentComponent, _cTypesHelper, _i18nUtils, BASE_CONTENT_ID, BASE_CONTENT_KEY, COPY_FALLBACK_VIEW_NAME, COPY_MAP_KEY, COPY_REPORT_KEY, COPY_VIEW_NAME
Fields inherited from class org.ametys.cms.workflow.CreateContentFunction
_contentTypeEP, _contentTypeHelper, _observationManager, _resolver, CONTENT_LANGUAGE_KEY, CONTENT_MIXINS_KEY, CONTENT_NAME_KEY, CONTENT_TITLE_KEY, CONTENT_TITLE_VARIANTS_KEY, CONTENT_TYPES_KEY, INITIAL_VALUE_SUPPLIER, PARENT_CONTENT_ID_KEY, PARENT_CONTENT_METADATA_PATH_KEY, PARENT_CONTEXT_VALUE
Fields inherited from class org.ametys.cms.workflow.AbstractContentWorkflowComponent
_contentHelper, CONTENT_KEY, HAS_CHANGED_KEY
Fields inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
_logger, _manager, CONTEXT_PARAMETERS_KEY, FAIL_CONDITIONS_KEY, RESULT_MAP_KEY, WORKFLOW_ERRORS_KEY, WORKFLOW_WARNS_KEY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract SynchronizableValue
Get the parent attribute synchronizable value.protected ModifiableWorkflowAwareContent
_createContent
(Map transientVars, Map args, String desiredContentName, ModifiableTraversableAmetysObject contentsNode) Create the content object.protected abstract String
Get the prefix for content nameprotected AmetysObjectCollection<?,
ModifiableWorkflowAwareContent> _getContentRoot
(Map transientVars) Retrieve the content root.protected Content
_getParent
(Map transientVars) Get the parent content if exists.protected abstract String
_getParentAttributeName
(Content parent) Get the parent attribute name.protected abstract boolean
_isCompatibleParent
(Content parent) Check if the parent is compatibleprotected void
processValues
(Map transientVars, ModifiableContent targetContent, Map<String, Object> values) Called after creation and before execution of theEditContentFunction
to allow subclasses to add/remove/modify the values.void
service
(ServiceManager manager) Methods inherited from class org.ametys.cms.workflow.copy.CreateContentByCopyFunction
execute, getAdditionalCopyMap, getBaseContentForCopy
Methods inherited from class org.ametys.cms.workflow.CreateContentFunction
_eventParamsForContentAdded, _getDefaultNameComputationMode, _getNameComputationMode, _getNonNullVar, _getObjectType, _getSubContentRoot, _initWorkflow, _isMultilingual, _notifyContentAdded, _populateAdditionalData, _populateContent, _setTitle, getArguments, getDescription, getSystemUser
Methods inherited from class org.ametys.cms.workflow.AbstractContentWorkflowComponent
getContent
Methods inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
addWorkflowError, addWorkflowWarning, enableLogging, getConditionFailures, getContextParameters, getResultsMap, getUser
-
Field Details
-
PARENT_KEY
Key for the parent of the target content -
_odfHelper
ODF helper
-
-
Constructor Details
-
AbstractCreateODFContentByCopyFunction
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classCreateContentByCopyFunction
- Throws:
ServiceException
-
_getContentRoot
protected AmetysObjectCollection<?,ModifiableWorkflowAwareContent> _getContentRoot(Map transientVars) throws com.opensymphony.workflow.WorkflowException Description copied from class:CreateContentFunction
Retrieve the content root.- Overrides:
_getContentRoot
in classCreateContentFunction
- Parameters:
transientVars
- the workflow parameters.- Returns:
- the content root node.
- Throws:
com.opensymphony.workflow.WorkflowException
- if an error occurs
-
_createContent
protected ModifiableWorkflowAwareContent _createContent(Map transientVars, Map args, String desiredContentName, ModifiableTraversableAmetysObject contentsNode) Description copied from class:CreateContentFunction
Create the content object.- Overrides:
_createContent
in classCreateContentFunction
- Parameters:
transientVars
- the workflow parameters.args
- The workflow function argumentsdesiredContentName
- the desired content name.contentsNode
- the content root node in the repository.- Returns:
- the created Content.
-
processValues
protected void processValues(Map transientVars, ModifiableContent targetContent, Map<String, Object> values) throws com.opensymphony.workflow.WorkflowExceptionDescription copied from class:CreateContentByCopyFunction
Called after creation and before execution of theEditContentFunction
to allow subclasses to add/remove/modify the values.- Overrides:
processValues
in classCreateContentByCopyFunction
- Parameters:
transientVars
- The workflow transient varstargetContent
- The newly created contentvalues
- the values computed from the copyMap and to be given to the EditContentFunction.- Throws:
com.opensymphony.workflow.WorkflowException
- if an error occurs
-
_getParent
Get the parent content if exists.- Parameters:
transientVars
- The transient vars- Returns:
- the parent content (may be not compatible at this stage)
-
_isCompatibleParent
Check if the parent is compatible- Parameters:
parent
- The parent- Returns:
true
if the parent is compatible
-
_getParentAttributeName
Get the parent attribute name.- Parameters:
parent
- The parent- Returns:
- the parent attribute name
-
_buildParentSynchronizableValue
Get the parent attribute synchronizable value.- Parameters:
parent
- The parent- Returns:
- a synchronizable value
-
_getContentNamePrefix
Get the prefix for content name- Returns:
- the prefix
-