Package org.ametys.cms.workflow
Class EditContentFunction
java.lang.Object
org.ametys.plugins.workflow.AbstractWorkflowComponent
org.ametys.cms.workflow.AbstractContentWorkflowComponent
org.ametys.cms.workflow.EditContentFunction
- All Implemented Interfaces:
com.opensymphony.workflow.FunctionProvider
,EnhancedFunction
,Initializable
,LogEnabled
,Serviceable
- Direct Known Subclasses:
EditSynchronizedContentFunction
public class EditContentFunction
extends AbstractContentWorkflowComponent
implements EnhancedFunction, Initializable
OSWorkflow function to edit a content.
Values are set either programmatically, or parsed from form submission by their
The required transient variables:
- AbstractContentWorkflowComponent.RESULT_MAP_KEY - Map<String, Object> The map containing the results of the function.
- AbstractContentWorkflowComponent.RESULT_MAP_KEY.result - String "true" when everything goes fine. Missing in other case.
- AbstractContentWorkflowComponent.RESULT_MAP_KEY.<MetadataPath> - Errors Each error during edition will be set here. Key will be the metadata path (with '.' separator). Value will be the error message.
- AbstractContentWorkflowComponent.CONTENT_KEY - WorkflowAwareContent The content that will be edited. Should have the lock token.
- AbstractWorkflowComponent.CONTEXT_PARAMETERS_KEY - Map<String, Object> Contains the following parameters:
- AbstractWorkflowComponent.CONTEXT_PARAMETERS_KEY.QUIT - boolean True to specify edition mode will be quit, this imply to unlock the content.
- AbstractWorkflowComponent.CONTEXT_PARAMETERS_KEY.VIEW_PARAM The name of the view to use and to check attributes. If missing a view will be created from values.
- AbstractWorkflowComponent.CONTEXT_PARAMETERS_KEY.FALLBACK_VIEW_PARAM The name of the view to use if the initial view does not exist on the Content's model.
- AbstractWorkflowComponent.CONTEXT_PARAMETERS_KEY.VALUES_KEY - Map<String, Object> The typed values. If present, raw values must not be present.
- AbstractWorkflowComponent.CONTEXT_PARAMETERS_KEY.FORM_RAW_VALUES - Map<String, Object> The values of the submitted form. If present, types values must not be present.
- AbstractWorkflowComponent.CONTEXT_PARAMETERS_KEY.FORM_RAW_VALUES.<MetadataPath> Object Key is the path of the metadata ('.' separated) prefixed by FORM_ELEMENTS_PREFIX. Value is a depending on the type of metadata. Sometimes types require additional information. In that case : Key is a metadata path ('.' separated) prefixed by INTERNAL_FORM_ELEMENTS_PREFIX and suffixed by '.' + an additional information name.
- AbstractWorkflowComponent.CONTEXT_PARAMETERS_KEY.FORM_RAW_COMMENTS - Map<String, List<Map<String, String>>> The comments of the metadata of the submitted form :
- AbstractContentWorkflowComponent.RESULT_MAP_KEY.<MetadataPath> - List<Map<String, String>> Key is the path of the metadata ('.' separated) prefixed by FORM_ELEMENTS_PREFIX. Value is the list of comments.
- AbstractContentWorkflowComponent.RESULT_MAP_KEY.<MetadataPath>.<X> - <Map<String, String> A comment with the following parameters
- AbstractContentWorkflowComponent.RESULT_MAP_KEY.<MetadataPath>.<X>.author String The login of the author of the comment
- AbstractContentWorkflowComponent.RESULT_MAP_KEY.<MetadataPath>.<X>.text String The text of the comment
- AbstractContentWorkflowComponent.RESULT_MAP_KEY.<MetadataPath>.<X>.date String The date of the comment using the ISODateTimeFormat (See DateUtils.parse)
Where <MetadataPath> is the path of a metadata (using a '.' separator). In some cases it is prefixed by FORM_ELEMENTS_PREFIX. A metadata path with in a repeater include the number of the repeated instance (1 based).
Where <X> Is an element of the parent list.
Values are set either programmatically, or parsed from form submission by their
ElementType
s according to the Content
model.The required transient variables:
- AbstractContentWorkflowComponent.RESULT_MAP_KEY - Map<String, Object> The map containing the results of the function.
- AbstractContentWorkflowComponent.RESULT_MAP_KEY.result - String "true" when everything goes fine. Missing in other case.
- AbstractContentWorkflowComponent.RESULT_MAP_KEY.<MetadataPath> - Errors Each error during edition will be set here. Key will be the metadata path (with '.' separator). Value will be the error message.
- AbstractContentWorkflowComponent.CONTENT_KEY - WorkflowAwareContent The content that will be edited. Should have the lock token.
- AbstractWorkflowComponent.CONTEXT_PARAMETERS_KEY - Map<String, Object> Contains the following parameters:
- AbstractWorkflowComponent.CONTEXT_PARAMETERS_KEY.QUIT - boolean True to specify edition mode will be quit, this imply to unlock the content.
- AbstractWorkflowComponent.CONTEXT_PARAMETERS_KEY.VIEW_PARAM The name of the view to use and to check attributes. If missing a view will be created from values.
- AbstractWorkflowComponent.CONTEXT_PARAMETERS_KEY.FALLBACK_VIEW_PARAM The name of the view to use if the initial view does not exist on the Content's model.
- AbstractWorkflowComponent.CONTEXT_PARAMETERS_KEY.VALUES_KEY - Map<String, Object> The typed values. If present, raw values must not be present.
- AbstractWorkflowComponent.CONTEXT_PARAMETERS_KEY.FORM_RAW_VALUES - Map<String, Object> The values of the submitted form. If present, types values must not be present.
- AbstractWorkflowComponent.CONTEXT_PARAMETERS_KEY.FORM_RAW_VALUES.<MetadataPath> Object Key is the path of the metadata ('.' separated) prefixed by FORM_ELEMENTS_PREFIX. Value is a depending on the type of metadata. Sometimes types require additional information. In that case : Key is a metadata path ('.' separated) prefixed by INTERNAL_FORM_ELEMENTS_PREFIX and suffixed by '.' + an additional information name.
- AbstractWorkflowComponent.CONTEXT_PARAMETERS_KEY.FORM_RAW_COMMENTS - Map<String, List<Map<String, String>>> The comments of the metadata of the submitted form :
- AbstractContentWorkflowComponent.RESULT_MAP_KEY.<MetadataPath> - List<Map<String, String>> Key is the path of the metadata ('.' separated) prefixed by FORM_ELEMENTS_PREFIX. Value is the list of comments.
- AbstractContentWorkflowComponent.RESULT_MAP_KEY.<MetadataPath>.<X> - <Map<String, String> A comment with the following parameters
- AbstractContentWorkflowComponent.RESULT_MAP_KEY.<MetadataPath>.<X>.author String The login of the author of the comment
- AbstractContentWorkflowComponent.RESULT_MAP_KEY.<MetadataPath>.<X>.text String The text of the comment
- AbstractContentWorkflowComponent.RESULT_MAP_KEY.<MetadataPath>.<X>.date String The date of the comment using the ISODateTimeFormat (See DateUtils.parse)
Where <MetadataPath> is the path of a metadata (using a '.' separator). In some cases it is prefixed by FORM_ELEMENTS_PREFIX. A metadata path with in a repeater include the number of the repeated instance (1 based).
Where <X> Is an element of the parent list.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
AbstractWorkflowComponent.ConditionFailure
Nested classes/interfaces inherited from interface org.ametys.plugins.workflow.EnhancedFunction
EnhancedFunction.FunctionType
-
Field Summary
Modifier and TypeFieldDescriptionprotected ContentDataHelper
Helper for collecting content referencesprotected ContentTypeExtensionPoint
Content type extension point.protected ContentTypesHelper
Helper for content typesprotected DisableConditionsEvaluator<ModelAwareDataHolder>
TheDisableConditions
evaluatorprotected ExternalizableDataProviderExtensionPoint
Provider for externalizable dataprotected I18nUtils
The i18n utilsprotected ObservationManager
Observation manager available to subclasses.protected OutgoingReferencesExtractor
The outgoing references extractorprotected UserManager
The user managerprotected ContentWorkflowHelper
The content workflow helper.static final String
Fallback view name parameter.static final String
Prefix for HTML form elements.static final String
Request parameter key for the field comments.static final String
Request parameter key for the field values.static final String
Request parameter key for the field with version.static final String
Set tofalse
to deactivate global validation, default value istrue
static final String
The key for global errorsstatic final String
Set totrue
to ignore warnings and continue edition, default value istrue
static final String
Prefix for internal HTML form elements.static final int
Default action id of editing revert relations.static final String
Constant for storing the action id for editing revert relations.static final String
Key for notify argumentstatic final String
Local only parameter.static final String
Quit edition mode parameter.static final String
Constant for storing the result's state (ok / warnings / errors) into the transient variables map.static final String
Constant for the OK result's statestatic final String
Optional previous synchronization resultstatic final String
Constant for storing the field's labelstatic final String
Constant for storing the field's pathstatic final String
Constant for storing the field validation's resultstatic final String
Inputs key for typed values.static final String
View parameter.static final String
View items parameter.static final String
View name parameter.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_VALIDATION_KEY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
_canWriteModelItem
(ModelItem modelItem, Content content, Map transientVars) Returnstrue
if the current model item is writable for this content in the current context._convertValues
(ModifiableContent content, View view, Map<String, Object> values, Map transientVars) Converts the given values according to the definitions in the givenViewItemAccessor
protected ContentSynchronizationResult
additionalOperations
(ModifiableContent content, Map transientVars) Allow to do some other modifications on the given content before saving changesvoid
protected void
extractOutgoingReferences
(ModifiableContent content, SynchronizationResult synchronizationResult) Analyze the content to extract outgoing references and store themReturn the type for the functionprotected int
getInvertEditActionId
(Map transientVars, Content referencedContent) Get the identifier of the invert edit actiongetLabel()
Get the label for this functionprotected ContentSynchronizationContext
getSynchronizationContext
(Map transientVars) Retrieves the synchronization contextgetValues
(View view, ModifiableContent content, Map<String, Object> typedValues, Map<String, Object> rawValues, Map<String, List<Map<String, String>>> rawComments, boolean localOnly, Map transientVars) Computes the actual typed values from the input.protected View
getView
(Map<String, Object> parameters, Map<String, Object> values, Map<String, Object> rawValues, Content content, Map transientVars) Get the view for the contentprotected ValidationResult
Performs a global validation of the Content, based on declaredContentValidator
s.void
protected boolean
Template method to indicates if invert relation should be taken into account during the whole edition.protected void
Notify observers that the content is being modifiedprotected void
prepareOrNotifyContentModified
(Content content, Map transientVars, Map args, SynchronizationResult synchronizationResult) Prepare or notify observers that the content has been modifiedprotected Collection<ReferencedContents>
prepareSynchronize
(ModifiableContent content, View view, Map<String, Object> values, UserIdentity user, ValidationResults validationResults, Map transientVars) Prepares the write process by checking remote contents concerned by invert relations.processDisableConditions
(View view, ModifiableContent content, Map<String, Object> values, Map<String, Object> contextualParameters) Processes disable conditions on given valuesprocessDisableConditionsOnComposite
(ModelViewItemGroup group, CompositeDefinition definition, String prefix, Optional<String> oldPrefix, ModifiableContent content, Map<String, Object> currentValues, Map<String, Object> allValues, Map<String, Object> contextualParameters) Processes disable conditions on given compositeprocessDisableConditionsOnElement
(ElementDefinition definition, String prefix, Optional<String> oldPrefix, ModifiableContent content, Map<String, Object> currentValues, Map<String, Object> allValues, Map<String, Object> contextualParameters) Processes disable conditions on given elementprocessDisableConditionsOnRepeater
(ModelViewItemGroup group, RepeaterDefinition definition, String prefix, Optional<String> oldPrefix, ModifiableContent content, Map<String, Object> currentValues, Map<String, Object> allValues, Map<String, Object> contextualParameters) Processes disable conditions on given repeaterprotected SynchronizationResult
synchronize
(ModifiableContent content, View view, Map<String, Object> values, Collection<ReferencedContents> referencedContents, Map transientVars) Synchronize the values of the given contentprotected void
triggerInvertWorkflowAction
(Content content, int actionId) Trigger a 'edit content' workflow action (if the content is workflow-aware).protected void
updateCommonMetadata
(ModifiableContent content, UserIdentity user, SynchronizationResult synchronizationResult) Updates common metadata (last contributor, last modification date, ...).protected ValidationResults
validateRepeaterValue
(ModelViewItemGroup viewItem, RepeaterDefinition definition, String dataPath, Optional<String> oldDataPath, ModifiableContent content, Object value, Map transientVars) Validate repeater values.protected ValidationResult
validateValue
(ElementDefinition definition, String dataPath, Optional<String> oldDataPath, ModifiableContent content, Object value, Map transientVars) Validate an attribute value.protected ValidationResults
validateValues
(View view, ModifiableContent content, Map<String, Object> values, Map transientVars) Validates all input values.Methods inherited from class org.ametys.cms.workflow.AbstractContentWorkflowComponent
getContent, service
Methods inherited from class org.ametys.plugins.workflow.AbstractWorkflowComponent
addWorkflowError, addWorkflowWarning, enableLogging, getConditionFailures, getContextParameters, getResultsMap, getUser
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.plugins.workflow.EnhancedFunction
getArguments, getFullLabel, getVisibilities
-
Field Details
-
INVERT_RELATION_EDIT_WORKFLOW_ACTION_ID
Constant for storing the action id for editing revert relations. -
FORM_ELEMENTS_PREFIX
Prefix for HTML form elements.- See Also:
-
GLOBAL_VALIDATION_RESULT_KEY
The key for global errors- See Also:
-
INTERNAL_FORM_ELEMENTS_PREFIX
Prefix for internal HTML form elements.- See Also:
-
VALUES_KEY
Inputs key for typed values.- See Also:
-
FORM_RAW_VALUES
Request parameter key for the field values.- See Also:
-
FORM_RAW_COMMENTS
Request parameter key for the field comments.- See Also:
-
FORM_RAW_VERSION
Request parameter key for the field with version.- See Also:
-
VIEW
View parameter.- See Also:
-
VIEW_ITEMS
View items parameter.- See Also:
-
VIEW_NAME
View name parameter.- See Also:
-
FALLBACK_VIEW_NAME
Fallback view name parameter.- See Also:
-
GLOBAL_VALIDATION
Set tofalse
to deactivate global validation, default value istrue
- See Also:
-
IGNORE_WARNINGS
Set totrue
to ignore warnings and continue edition, default value istrue
- See Also:
-
QUIT
Quit edition mode parameter.- See Also:
-
LOCAL_ONLY
Local only parameter.- See Also:
-
SYNCHRONIZATION_RESULT
Optional previous synchronization result- See Also:
-
INVERT_EDIT_ACTION_ID
Default action id of editing revert relations.- See Also:
-
KEY_NOTIFY_ARGUMENTS
Key for notify argument- See Also:
-
RESULT_STATE_KEY
Constant for storing the result's state (ok / warnings / errors) into the transient variables map.- See Also:
-
RESULT_STATE_OK
Constant for the OK result's state- See Also:
-
VALIDATION_RESULTS_FIELD_RESULT_KEY
Constant for storing the field validation's result- See Also:
-
VALIDATION_RESULTS_FIELD_LABEL_KEY
Constant for storing the field's label- See Also:
-
VALIDATION_RESULTS_FIELD_PATH_KEY
Constant for storing the field's path- See Also:
-
_contentTypeExtensionPoint
Content type extension point. -
_contentTypesHelper
Helper for content types -
_observationManager
Observation manager available to subclasses. -
_workflowHelper
The content workflow helper. -
_outgoingReferencesExtractor
The outgoing references extractor -
_userManager
The user manager -
_externalizableDataProviderEP
Provider for externalizable data -
_contentDataHelper
Helper for collecting content references -
_disableConditionsEvaluator
TheDisableConditions
evaluator -
_i18nUtils
The i18n utils
-
-
Constructor Details
-
EditContentFunction
public EditContentFunction()
-
-
Method Details
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
execute
public void execute(Map transientVars, Map args, com.opensymphony.module.propertyset.PropertySet ps) throws com.opensymphony.workflow.WorkflowException - Specified by:
execute
in interfacecom.opensymphony.workflow.FunctionProvider
- Throws:
com.opensymphony.workflow.WorkflowException
-
getInvertEditActionId
Get the identifier of the invert edit action- Parameters:
transientVars
- The workflow varsreferencedContent
- the content concerned by the invert relation- Returns:
- the identifier of the invert edit action
-
notifyContentModifying
protected void notifyContentModifying(Content content, Map<String, Object> values, Map transientVars) throws com.opensymphony.workflow.WorkflowExceptionNotify observers that the content is being modified- Parameters:
content
- The content being modifiedvalues
- the new values being set to the contenttransientVars
- The workflow vars- Throws:
com.opensymphony.workflow.WorkflowException
- If an error occurred
-
prepareOrNotifyContentModified
protected void prepareOrNotifyContentModified(Content content, Map transientVars, Map args, SynchronizationResult synchronizationResult) throws com.opensymphony.workflow.WorkflowException Prepare or notify observers that the content has been modified- Parameters:
content
- The content modifiedtransientVars
- The workflow varsargs
- the workflow argssynchronizationResult
- The result of the content values synchronization- Throws:
com.opensymphony.workflow.WorkflowException
- If an error occurred
-
getView
protected View getView(Map<String, Object> parameters, Map<String, throws com.opensymphony.workflow.WorkflowExceptionObject> values, Map<String, Object> rawValues, Content content, Map transientVars) Get the view for the content- Parameters:
parameters
- The parametersvalues
- Typed values from inputsrawValues
- The raw values of the formcontent
- The contenttransientVars
- the parameters from the call- Returns:
- The view asked in the request or a built-in view
- Throws:
com.opensymphony.workflow.WorkflowException
- If an error occurred while getting the view
-
getValues
protected Map<String,Object> getValues(View view, ModifiableContent content, Map<String, Object> typedValues, Map<String, throws com.opensymphony.workflow.WorkflowExceptionObject> rawValues, Map<String, List<Map<String, String>>> rawComments, boolean localOnly, Map transientVars) Computes the actual typed values from the input.- Parameters:
view
- the currentView
content
- the current ContenttypedValues
- typed values, if anyrawValues
- raw values from form, if anyrawComments
- the form comments, if anylocalOnly
- if the form values are local only or may include external valuestransientVars
- the parameters from the call.- Returns:
- the actual values to be set
- Throws:
com.opensymphony.workflow.WorkflowException
- If an error occurred
-
_convertValues
protected Map<String,Object> _convertValues(ModifiableContent content, View view, Map<String, Object> values, Map transientVars) Converts the given values according to the definitions in the givenViewItemAccessor
- Parameters:
content
- the current contentview
- the current viewvalues
- the values to converttransientVars
- the parameters from the call- Returns:
- the converted values
-
processDisableConditions
protected Map<String,Object> processDisableConditions(View view, ModifiableContent content, Map<String, Object> values, Map<String, Object> contextualParameters) Processes disable conditions on given values- Parameters:
view
- the current viewcontent
- the current contentvalues
- the values to processcontextualParameters
- the contextual parameters- Returns:
- the values with
UntouchedValue
s for instead of disabled ones
-
processDisableConditionsOnElement
protected Optional<Object> processDisableConditionsOnElement(ElementDefinition definition, String prefix, Optional<String> oldPrefix, ModifiableContent content, Map<String, Object> currentValues, Map<String, Object> allValues, Map<String, Object> contextualParameters) Processes disable conditions on given element- Parameters:
definition
- the element's definitionprefix
- the prefix for computing current data patholdPrefix
- the prefix for computing old data pathcontent
- the current contentcurrentValues
- the values to processallValues
- all values of the current editioncontextualParameters
- the contextual parameters- Returns:
- the values of the element, or
UntouchedValue
if disabled
-
processDisableConditionsOnComposite
protected Optional<Object> processDisableConditionsOnComposite(ModelViewItemGroup group, CompositeDefinition definition, String prefix, Optional<String> oldPrefix, ModifiableContent content, Map<String, Object> currentValues, Map<String, Object> allValues, Map<String, Object> contextualParameters) Processes disable conditions on given composite- Parameters:
group
- the composite's view itemdefinition
- the composite's definitionprefix
- the prefix for computing current data patholdPrefix
- the prefix for computing old data pathcontent
- the current contentcurrentValues
- the values to processallValues
- all values of the current editioncontextualParameters
- the contextual parameters- Returns:
- the values of the composite, or
UntouchedValue
if disabled
-
processDisableConditionsOnRepeater
protected Optional<Object> processDisableConditionsOnRepeater(ModelViewItemGroup group, RepeaterDefinition definition, String prefix, Optional<String> oldPrefix, ModifiableContent content, Map<String, Object> currentValues, Map<String, Object> allValues, Map<String, Object> contextualParameters) Processes disable conditions on given repeater- Parameters:
group
- the repeater's view itemdefinition
- the repeater's definitionprefix
- the prefix for computing current data patholdPrefix
- the prefix for computing old data pathcontent
- the current contentcurrentValues
- the values to processallValues
- all values of the current editioncontextualParameters
- the contextual parameters- Returns:
- the values of the repeater, or
UntouchedValue
if disabled
-
validateValues
protected ValidationResults validateValues(View view, ModifiableContent content, Map<String, Object> values, Map transientVars) throws com.opensymphony.workflow.WorkflowExceptionValidates all input values.- Parameters:
view
- the model's view corresponding to the valuescontent
- the current contentvalues
- the actual input valuestransientVars
- the parameters from the call- Returns:
- the validation results
- Throws:
com.opensymphony.workflow.WorkflowException
- If an error occurred
-
validateValue
protected ValidationResult validateValue(ElementDefinition definition, String dataPath, Optional<String> oldDataPath, ModifiableContent content, Object value, Map transientVars) Validate an attribute value.- Parameters:
definition
- the attribute definition.dataPath
- the attribute path.oldDataPath
- the old data path, i.e. with the repeater entries previous positions. Used to know the current status for externalizable datacontent
- the Content being edited.value
- the value.transientVars
- the parameters from the call.- Returns:
- the validation result
-
validateRepeaterValue
protected ValidationResults validateRepeaterValue(ModelViewItemGroup viewItem, RepeaterDefinition definition, String dataPath, Optional<String> oldDataPath, ModifiableContent content, Object value, Map transientVars) Validate repeater values.- Parameters:
viewItem
- the view item referencing the repeaterdefinition
- the repeater definition.dataPath
- the repeater path.oldDataPath
- the old repeater data path, i.e. with the repeater entries previous positions. Used to know the current status for externalizable datacontent
- the Content being edited.value
- the value.transientVars
- the parameters from the call.- Returns:
- the validation results
-
globalValidate
Performs a global validation of the Content, based on declaredContentValidator
s. -
prepareSynchronize
protected Collection<ReferencedContents> prepareSynchronize(ModifiableContent content, View view, Map<String, Object> values, UserIdentity user, ValidationResults validationResults, Map transientVars) Prepares the write process by checking remote contents concerned by invert relations.- Parameters:
content
- the current content.view
- the current View.values
- the new values.user
- the current uservalidationResults
- the collected errorstransientVars
- the parameters from the call.- Returns:
- the
ReferencedContents
-
synchronize
protected SynchronizationResult synchronize(ModifiableContent content, View view, Map<String, Object> values, Collection<ReferencedContents> referencedContents, Map transientVars) throws com.opensymphony.workflow.WorkflowExceptionSynchronize the values of the given content- Parameters:
content
- the content to synchronizeview
- the content's view to use for synchronizationvalues
- the values to synchronizereferencedContents
- the contents referenced by invert relationstransientVars
- the parameters from the call.- Returns:
- The result of the synchronization
- Throws:
com.opensymphony.workflow.WorkflowException
- if an error occurs while triggering the edition workflow action for related contents
-
getSynchronizationContext
Retrieves the synchronization context- Parameters:
transientVars
- the parameters from the call- Returns:
- the synchronization context
-
additionalOperations
protected ContentSynchronizationResult additionalOperations(ModifiableContent content, Map transientVars) throws com.opensymphony.workflow.WorkflowException Allow to do some other modifications on the given content before saving changes- Parameters:
content
- the contenttransientVars
- the parameters from the call- Returns:
- The synchronization result of additional operations
- Throws:
com.opensymphony.workflow.WorkflowException
- If an error occurred
-
updateCommonMetadata
protected void updateCommonMetadata(ModifiableContent content, UserIdentity user, SynchronizationResult synchronizationResult) throws com.opensymphony.workflow.WorkflowException Updates common metadata (last contributor, last modification date, ...).- Parameters:
content
- the content.user
- the user.synchronizationResult
- The result of the content values synchronization- Throws:
com.opensymphony.workflow.WorkflowException
- if an error occurs.
-
extractOutgoingReferences
protected void extractOutgoingReferences(ModifiableContent content, SynchronizationResult synchronizationResult) Analyze the content to extract outgoing references and store them- Parameters:
content
- The content to analyzesynchronizationResult
- The result of the content values synchronization
-
invertRelationEnabled
Template method to indicates if invert relation should be taken into account during the whole edition. Override and return false to disabled invert relation management.- Returns:
- true if invert relation are enabled
-
triggerInvertWorkflowAction
protected void triggerInvertWorkflowAction(Content content, int actionId) throws com.opensymphony.workflow.WorkflowException Trigger a 'edit content' workflow action (if the content is workflow-aware).- Parameters:
content
- The content.actionId
- The current 'edit content' action ID.- Throws:
com.opensymphony.workflow.WorkflowException
- if an error occurs.
-
_canWriteModelItem
Returnstrue
if the current model item is writable for this content in the current context.- Parameters:
modelItem
- The model item to checkcontent
- The contenttransientVars
- The parameters from the call- Returns:
true
if the current model item is writable
-
getFunctionExecType
Description copied from interface:EnhancedFunction
Return the type for the function- Specified by:
getFunctionExecType
in interfaceEnhancedFunction
- Returns:
- the type 's code
-
getLabel
Description copied from interface:EnhancedFunction
Get the label for this function- Specified by:
getLabel
in interfaceEnhancedFunction
- Returns:
- the label
-