Class CopyContentMetadataComponent

  • All Implemented Interfaces:
    LogEnabled, Component, Serviceable
    Direct Known Subclasses:
    CopyContentMetadataComponent, CopyContentMetadataComponent

    public class CopyContentMetadataComponent
    extends AbstractLogEnabled
    implements Serviceable, Component

    This component is used to copy a content (either totally or partially).

    In this whole file a Map named copyMap is regularly used. This map provide the name of the metadata to copy as well as some optional parameters. It has the following form (JSON) :

     {
       "$param1": value,
       "metadataA": null,
       "metadataB": {
         "subMetadataB1": null,
         "subMetadataB2": {
           "$param1": value,
           "$param2": value,
           "subSubMetadataB21": {...}
         },
         ...
       }
     }
     

    Each metadata that should be copied must be present as a key in the map. Composite metadata can contains child metadata but as seen on the example the map must be well structured, it is not a flat map. Parameters in the map must always start with the reserved character '$', in order to be differentiated from metadata name.

    There are two main entry points for this helper component:

    • copyContent and editContent are methods that run a dedicated workflow function (createByCopy or editByCopy) that will later call the copyMetadataMap function (see below).
    • copyMetadataMap is the method that is responsible for the recursive copy of the metadata (by following the copyMap structure). During this process, underlying content creation can be requested in which case the copyContent method will be called.
    • Method Detail

      • copyContent

        public CopyReport copyContent​(String baseContentId,
                                      Map<String,​Object> copyMap,
                                      String metadataSetName,
                                      String fallbackMetadataSetName,
                                      String metadataSetType,
                                      int initActionId,
                                      int editActionId)
        Copy a content by creating a new content and copying the value of the metadata of a source content into the new one. The title of the new content will the one from the base content.
        Parameters:
        baseContentId - The identifier of the base content
        copyMap - The map of properties as described in CopyContentMetadataComponent. Can be null in which case the map will be constructed from a metadataSet.
        metadataSetName - The name of the metadata set to be used to construct to copyMap if not provided. This will also be the default name for possible inner copies (if not provided as a copyMap parameter).
        fallbackMetadataSetName - The fallback of metadata set to copy. Use for legacy purpose if 'metadataSetName' does not exist.
        metadataSetType - The type of the metadata set to be used to construct to copyMap if not provided. This will also be the default type for possible inner copies.
        initActionId - The workflow action id to use to create the new content
        editActionId - The workflow action id to use to edit the newly created content
        Returns:
        The copy report containing valuable information about the copy and the possible encountered errors.
      • copyContent

        public CopyReport copyContent​(String baseContentId,
                                      String title,
                                      Map<String,​Object> copyMap,
                                      String metadataSetName,
                                      String fallbackMetadataSetName,
                                      String metadataSetType,
                                      int initActionId,
                                      int editActionId)
        Copy a content by creating a new content and copying the value of the metadata of a source content into the new one.
        Parameters:
        baseContentId - The identifier of the base content
        title - Desired title for the new content.
        copyMap - The map of properties as described in CopyContentMetadataComponent. Can be null in which case the map will be constructed from a metadataSet.
        metadataSetName - The name of the metadata set to be used to construct to copyMap if not provided. This will also be the default name for possible inner copies (if not provided as a copyMap parameter).
        fallbackMetadataSetName - The fallback of metadata set to copy. Use for legacy purpose if 'metadataSetName' does not exist.
        metadataSetType - The type of the metadata set to be used to construct to copyMap if not provided. This will also be the default type for possible inner copies.
        initActionId - The init workflow action id for main content only
        editActionId - The workflow action for editing main content only
        Returns:
        The copy report containing valuable information about the copy and the possible encountered errors.
      • copyContent

        public CopyReport copyContent​(String baseContentId,
                                      String title,
                                      Map<String,​Object> copyMap,
                                      String metadataSetName,
                                      String fallbackMetadataSetName,
                                      String metadataSetType,
                                      String targetContentType,
                                      int initActionId,
                                      int editActionId)
        Create a new content by copy of another. The type of created content can be different of the source content. The source and target contents must have a common content type ancestor.
        Parameters:
        baseContentId - The id of content to copy
        title - The title of the new created content
        copyMap - The map of metadata to copy. Can be null to copy the whole metadata set.
        metadataSetName - The name of metadata set to copy
        fallbackMetadataSetName - The fallback of metadata set to copy. Use for legacy purpose if 'metadataSetName' does not exist.
        metadataSetType - The type of metadata set to copy
        targetContentType - The type of content to create. If null the type(s) of created content will be those of base content.
        initActionId - The init workflow action id for main content only
        editActionId - The workflow action for editing main content only
        Returns:
        The copy report
      • copyContent

        public CopyReport copyContent​(Content baseContent,
                                      Map<String,​Object> copyMap,
                                      String metadataSetName,
                                      String fallbackMetadataSetName,
                                      String metadataSetType)
        Copy a content by creating a new content and copying the value of the metadata of a source content into the new one.
        Parameters:
        baseContent - The base content.
        copyMap - The map of properties as described in CopyContentMetadataComponent. Can be null in which case the map will be constructed from a metadataSet.
        metadataSetName - The name of the metadata set to be used to construct to copyMap if not provided. This will also be the default name for possible inner copies (if not provided as a copyMap parameter).
        fallbackMetadataSetName - The fallback of metadata set to copy. Use for legacy purpose if 'metadataSetName' does not exist.
        metadataSetType - The type of the metadata set to be used to construct to copyMap if not provided. This will also be the default type for possible inner copies.
        Returns:
        The copy report containing valuable information about the copy and the possible encountered errors.
      • copyContent

        public CopyReport copyContent​(Content baseContent,
                                      Map<String,​Object> copyMap,
                                      String metadataSetName,
                                      String fallbackMetadataSetName,
                                      String metadataSetType,
                                      int initActionId,
                                      int editRefActionId)
        Copy a content by creating a new content and copying the value of the metadata of a source content into the new one.
        Parameters:
        baseContent - The base content.
        copyMap - The map of properties as described in CopyContentMetadataComponent. Can be null in which case the map will be constructed from a metadataSet.
        metadataSetName - The name of the metadata set to be used to construct to copyMap if not provided. This will also be the default name for possible inner copies (if not provided as a copyMap parameter).
        fallbackMetadataSetName - The fallback of metadata set to copy. Use for legacy purpose if 'metadataSetName' does not exist.
        metadataSetType - The type of the metadata set to be used to construct to copyMap if not provided. This will also be the default type for possible inner copies.
        initActionId - The init workflow action id for main content only
        editRefActionId - The workflow action for editing references
        Returns:
        The copy report containing valuable information about the copy and the possible encountered errors.
      • copyContent

        public CopyReport copyContent​(Content baseContent,
                                      String title,
                                      Map<String,​Object> copyMap,
                                      String metadataSetName,
                                      String fallbackMetadataSetName,
                                      String metadataSetType,
                                      int initActionId,
                                      int editRefActionId)
        Copy a content by creating a new content and copying the value of the metadata of a source content into the new one.
        Parameters:
        baseContent - The base content.
        title - Desired title for the new content.
        copyMap - The map of properties as described in CopyContentMetadataComponent. Can be null in which case the map will be constructed from a metadataSet.
        metadataSetName - The name of the metadata set to be used to construct to copyMap if not provided. This will also be the default name for possible inner copies (if not provided as a copyMap parameter).
        fallbackMetadataSetName - The fallback of metadata set to copy. Use for legacy purpose if 'metadataSetName' does not exist.
        metadataSetType - The type of the metadata set to be used to construct to copyMap if not provided. This will also be the default type for possible inner copies.
        initActionId - The init workflow action id for main content only
        editRefActionId - The workflow action for editing references
        Returns:
        The copy report containing valuable information about the copy and the possible encountered errors.
      • copyContent

        public CopyReport copyContent​(Content baseContent,
                                      String title,
                                      Map<String,​Object> copyMap,
                                      String metadataSetName,
                                      String fallbackMetadataSetName,
                                      String metadataSetType,
                                      String targetContentType,
                                      int initActionId,
                                      int editRefActionId)
        Copy a content by creating a new content and copying the value of the metadata of a source content into the new one.
        Parameters:
        baseContent - The base content.
        title - Desired title for the new content.
        copyMap - The map of properties as described in CopyContentMetadataComponent. Can be null in which case the map will be constructed from a metadataSet.
        metadataSetName - The name of the metadata set to be used to construct to copyMap if not provided. This will also be the default name for possible inner copies (if not provided as a copyMap parameter).
        fallbackMetadataSetName - The fallback of metadata set to copy. Use for legacy purpose if 'metadataSetName' does not exist.
        metadataSetType - The type of the metadata set to be used to construct to copyMap if not provided. This will also be the default type for possible inner copies.
        targetContentType - The type of content to create. If null the type(s) of created content will be those of base content.
        initActionId - The init workflow action id for main content only
        editRefActionId - The workflow action for editing references
        Returns:
        The copy report containing valuable information about the copy and the possible encountered errors.
      • copyContent

        public CopyReport copyContent​(Content baseContent,
                                      String title,
                                      Map<String,​Object> copyMap,
                                      String metadataSetName,
                                      String fallbackMetadataSetName,
                                      String metadataSetType,
                                      String parentContentId,
                                      String parentMetadataPath,
                                      int initActionId,
                                      int editActionId)
        Copy a content by creating a new content and copying the value of the metadata of a source content into the new one.
        Parameters:
        baseContent - The base content.
        title - Desired title for the new content.
        copyMap - The map of properties as described in CopyContentMetadataComponent. Can be null in which case the map will be constructed from a metadataSet.
        metadataSetName - The name of the metadata set to be used to construct to copyMap if not provided. This will also be the default name for possible inner copies (if not provided as a copyMap parameter).
        fallbackMetadataSetName - The fallback of metadata set to copy. Use for legacy purpose if 'metadataSetName' does not exist.
        metadataSetType - The type of the metadata set to be used to construct to copyMap if not provided. This will also be the default type for possible inner copies.
        parentContentId - The target content ID.
        parentMetadataPath - the parent metadata path, if a sub-content is being created.
        initActionId - The init workflow action id for main content only
        editActionId - The workflow action for editing main content only
        Returns:
        The copy report containing valuable information about the copy and the possible encountered errors.
      • copyContent

        public CopyReport copyContent​(Content baseContent,
                                      String title,
                                      Map<String,​Object> copyMap,
                                      String metadataSetName,
                                      String fallbackMetadataSetName,
                                      String metadataSetType,
                                      String targetContentType,
                                      String parentContentId,
                                      String parentMetadataPath,
                                      int initActionId,
                                      int editRefActionId)
        Copy a content by creating a new content and copying the value of the metadata of a source content into the new one.
        Parameters:
        baseContent - The base content.
        title - Desired title for the new content.
        copyMap - The map of properties as described in CopyContentMetadataComponent. Can be null in which case the map will be constructed from a metadataSet.
        metadataSetName - The name of the metadata set to be used to construct to copyMap if not provided. This will also be the default name for possible inner copies (if not provided as a copyMap parameter).
        fallbackMetadataSetName - The fallback of metadata set to copy. Use for legacy purpose if 'metadataSetName' does not exist.
        metadataSetType - The type of the metadata set to be used to construct to copyMap if not provided. This will also be the default type for possible inner copies.
        targetContentType - The type of content to create. If null the type(s) of created content will be those of base content.
        parentContentId - The target content ID.
        parentMetadataPath - the parent metadata path, if a sub-content is being created.
        initActionId - The init workflow action id for main content only
        editRefActionId - The workflow action for editing references
        Returns:
        The copy report containing valuable information about the copy and the possible encountered errors.
      • _getInputsForCopy

        protected Map<String,​Object_getInputsForCopy​(Content baseContent,
                                                             String title,
                                                             Map<String,​Object> copyMap,
                                                             String targetContentType,
                                                             String parentContentId,
                                                             String parentMetadataPath,
                                                             CopyReport copyReport)
        Retrieve the inputs for the copy workflow function.
        Parameters:
        baseContent - The content to copy
        title - The title to set
        copyMap - The map with properties to copy
        targetContentType - The type of content to create. If null the type(s) of created content will be those of base content.
        parentContentId - The parent content ID, when copying a sub-content.
        parentMetadataPath - The parent metadata path, when copying a sub-content.
        copyReport - The report of the copy
        Returns:
        The map of inputs.
      • buildCopyMap

        public Map<String,​ObjectbuildCopyMap​(Content baseContent,
                                                     String metadataSetName,
                                                     String fallbackMetadataSetName,
                                                     String metadataSetType)
        Build the copy map from given content and metadata set.
        Parameters:
        baseContent - the content to copy
        metadataSetName - Name of the metadata set.
        fallbackMetadataSetName - The fallback metadata set name if 'metadataSetName' is not found
        metadataSetType - Type of the metadata set.
        Returns:
        A map with properties to copy.
      • _buildCopyMap

        protected Map<String,​Object_buildCopyMap​(Content baseContent,
                                                         String metadataSetName,
                                                         String fallbackMetadataSetName,
                                                         String metadataSetType,
                                                         Map<String,​Object> baseCopyMap)
        Build the copy map from a metadata set.
        Parameters:
        baseContent - the content to copy
        metadataSetName - Name of the metadata set.
        fallbackMetadataSetName - The fallback metadata set name if 'metadataSetName' is not found
        metadataSetType - Type of the metadata set.
        baseCopyMap - The copy map being constructed
        Returns:
        The copy map.
      • _buildCopyMap

        protected Map<String,​Object_buildCopyMap​(Content baseContent,
                                                         String metadataSetName,
                                                         String fallbackMetadataSetName,
                                                         String metadataSetType,
                                                         String targetContentType,
                                                         Map<String,​Object> baseCopyMap)
        Build the copy map from a metadata set.
        Parameters:
        baseContent - The content to be copied
        metadataSetName - Name of the metadata set to be copied.
        fallbackMetadataSetName - The fallback metadata set name if 'metadataSetName' is not found
        metadataSetType - Type of the metadata set to be copied (view or edition).
        targetContentType - The content type of content to create. Can be null.
        baseCopyMap - The copy map being constructed
        Returns:
        The copy map.
      • _buildCopyMap

        protected Map<String,​Object_buildCopyMap​(AbstractMetadataSetElement metadataSetElement,
                                                         Map<String,​Object> copyMap)
        Recursive auxiliary function used to build the copy map.
        Parameters:
        metadataSetElement - The current metadata set element
        copyMap - The copy map being constructed or null
        Returns:
        The copy map corresponding to this metadata set element.
      • editContent

        public CopyReport editContent​(String baseContentId,
                                      String targetContentId,
                                      Map<String,​Object> copyMap,
                                      String metadataSetName,
                                      String fallbackMetadataSetName,
                                      String metadataSetType)
        Edit a content by copying the value of the metadata of a source content into a target content.
        Parameters:
        baseContentId - The identifier of the base content
        targetContentId - The identifier of the target content
        copyMap - The map of properties as described in CopyContentMetadataComponent. Can be null in which case the map will be constructed from a metadataSet.
        metadataSetName - The name of the metadata set to be used to construct to copyMap if not provided. This will also be the default name for possible inner copies (if not provided as a copyMap parameter).
        fallbackMetadataSetName - The fallback metadata set name if 'metadataSetName' is not found
        metadataSetType - The type of the metadata set to be used to construct to copyMap if not provided. This will also be the default type for possible inner copies.
        Returns:
        The copy report containing valuable information about the copy and the possible encountered errors.
      • editContent

        public CopyReport editContent​(String baseContentId,
                                      String targetContentId,
                                      Map<String,​Object> copyMap,
                                      String metadataSetName,
                                      String fallbackMetadataSetName,
                                      String metadataSetType,
                                      int actionId,
                                      int editRefActionId)
        Edit a content by copying the value of the metadata of a source content into a target content.
        Parameters:
        baseContentId - The identifier of the base content
        targetContentId - The identifier of the target content
        copyMap - The map of properties as described in CopyContentMetadataComponent. Can be null in which case the map will be constructed from a metadataSet.
        metadataSetName - The name of the metadata set to be used to construct to copyMap if not provided. This will also be the default name for possible inner copies (if not provided as a copyMap parameter).
        fallbackMetadataSetName - The fallback metadata set name if 'metadataSetName' is not found
        metadataSetType - The type of the metadata set to be used to construct to copyMap if not provided. This will also be the default type for possible inner copies.
        actionId - the edit workflow action id
        editRefActionId - the workflow action id for editing references
        Returns:
        The copy report containing valuable information about the copy and the possible encountered errors.
      • copyMetadataMap

        public void copyMetadataMap​(Content baseContent,
                                    ModifiableContent targetContent,
                                    Map<String,​Object> copyMap,
                                    CopyReport copyReport)
        Copy the specified set of metadata from a base content to a target content by iterating over the copyMap.
        Parameters:
        baseContent - The original content
        targetContent - The copy content
        copyMap - The properties to copy
        copyReport - The copy report being populated during the copy.
      • _copyMetadataMap

        protected void _copyMetadataMap​(Content baseContent,
                                        CompositeMetadata baseMetaHolder,
                                        ModifiableCompositeMetadata targetMetaHolder,
                                        String metaPrefix,
                                        MetadataDefinition parentMetadataDefinition,
                                        Map<String,​Object> copyMap,
                                        Map<String,​Object> innerCopyMapInputs,
                                        CopyReport copyReport)
        Copy the specified set of metadata from a base composite metadata to a target composite metadata by iterating over the copyMap.
        Parameters:
        baseContent - The original content
        baseMetaHolder - The metadata holder of the baseContent
        targetMetaHolder - The metadata holder of the target content
        metaPrefix - The metadata prefix.
        parentMetadataDefinition - The parent metadata definition. Can be null
        copyMap - The properties to copy
        innerCopyMapInputs - The properties to copy for sub objects
        copyReport - The copy report being populated during the copy.
      • _getMetadataDefinition

        protected MetadataDefinition _getMetadataDefinition​(Content content,
                                                            MetadataDefinition metadataDefinition,
                                                            String metadataName)
        Retrieves a MetadataDefinition through its parent definition or the ContentType of the current content if at the root level of the metadataset.
        Parameters:
        content - The content
        metadataDefinition - The parent metadata definition. Can be null.
        metadataName - The metadata name
        Returns:
        The retrieved metadata defintion or null if not found
      • copyMetadata

        public void copyMetadata​(Content baseContent,
                                 CompositeMetadata baseMetaHolder,
                                 ModifiableCompositeMetadata targetMetaHolder,
                                 MetadataDefinition metadataDefinition,
                                 String metaPrefix,
                                 Map<String,​Object> copyMap,
                                 Map<String,​Object> innerCopyMapInputs,
                                 CopyReport copyReport)
        Copy the specified metadata from a base composite metadata to a target composite metadata.
        Parameters:
        baseContent - The original content
        baseMetaHolder - The metadata holder to copy
        targetMetaHolder - The metadata holder where to copy
        metadataDefinition - The associated definition
        metaPrefix - The metadata prefix.
        copyMap - The properties to copy
        innerCopyMapInputs - The properties to copy for sub objects
        copyReport - The report of the copy
      • _setStringMetadata

        protected void _setStringMetadata​(CompositeMetadata baseMetaHolder,
                                          ModifiableCompositeMetadata targetMetaHolder,
                                          String metadataName,
                                          Boolean isMultiple)
        Set a metadata of type string from a base composite metadata to a target composite metadata.
        Parameters:
        baseMetaHolder - The metadata holder to copy
        targetMetaHolder - The metadata holder where to copy
        metadataName - The metadata to consider
        isMultiple - Is the metadata multiple
      • _setDateMetadata

        protected void _setDateMetadata​(CompositeMetadata baseMetaHolder,
                                        ModifiableCompositeMetadata targetMetaHolder,
                                        String metadataName,
                                        Boolean isMultiple)
        Set a metadata of type date/datetime from a base composite metadata to a target composite metadata.
        Parameters:
        baseMetaHolder - The metadata holder to copy
        targetMetaHolder - The metadata holder where to copy
        metadataName - The metadata to consider
        isMultiple - Is the metadata multiple
      • _setDoubleMetadata

        protected void _setDoubleMetadata​(CompositeMetadata baseMetaHolder,
                                          ModifiableCompositeMetadata targetMetaHolder,
                                          String metadataName,
                                          Boolean isMultiple)
        Set a metadata of type double from a base composite metadata to a target composite metadata.
        Parameters:
        baseMetaHolder - The metadata holder to copy
        targetMetaHolder - The metadata holder where to copy
        metadataName - The metadata to consider
        isMultiple - Is the metadata multiple
      • _setLongMetadata

        protected void _setLongMetadata​(CompositeMetadata baseMetaHolder,
                                        ModifiableCompositeMetadata targetMetaHolder,
                                        String metadataName,
                                        Boolean isMultiple)
        Set a metadata of type long from a base composite metadata to a target composite metadata.
        Parameters:
        baseMetaHolder - The metadata holder to copy
        targetMetaHolder - The metadata holder where to copy
        metadataName - The metadata to consider
        isMultiple - Is the metadata multiple
      • _setBooleanMetadata

        protected void _setBooleanMetadata​(CompositeMetadata baseMetaHolder,
                                           ModifiableCompositeMetadata targetMetaHolder,
                                           String metadataName,
                                           Boolean isMultiple)
        Set a metadata of type boolean from a base composite metadata to a target composite metadata.
        Parameters:
        baseMetaHolder - The metadata holder to copy
        targetMetaHolder - The metadata holder where to copy
        metadataName - The metadata to consider
        isMultiple - Is the metadata multiple
      • _copyFolder

        protected void _copyFolder​(Folder baseFolder,
                                   ModifiableFolder targetFolder)
        Folder copy during the copy of a rich text metadata.
        Parameters:
        baseFolder - The folder to copy
        targetFolder - The folder where to copy
      • _copyFile

        protected void _copyFile​(File baseFile,
                                 ModifiableFolder targetFolder)
        File copy during the copy of a folder.
        Parameters:
        baseFile - The file to copy
        targetFolder - The folder where to copy
      • _copyReferencedContents

        protected String[] _copyReferencedContents​(String[] baseContentIds,
                                                   Map<String,​Object> copyMap,
                                                   Map<String,​Object> innerCopyMapInputs,
                                                   CopyReport copyReport)
        Duplicate base contents by creating new contents. If a specific metadata set must be used, a '$metadataSetName' parameter must be specified. If the copyMap for each inner duplication is already present in the current copyMap, a '$loaded' parameter must be set to true, if not the copyMap will be constructed from the requested metadata set.
        Parameters:
        baseContentIds - The ids of contents to copy
        copyMap - The properties to copy
        innerCopyMapInputs - The properties of sub objects
        copyReport - The report of the copy
        Returns:
        The array of identifiers of the new contents.
      • _handleInnerCopyMap

        protected Map<String,​Object_handleInnerCopyMap​(Map<String,​Object> copyMap,
                                                               Map<String,​Object> innerCopyMapInputs)
        Handle the creation of the inner copy map given the current context. The inner copy map will act as the copy map for underlying content copies.
        Parameters:
        copyMap - The properties to copy
        innerCopyMapInputs - The properties of sub objects
        Returns:
        The inner copy map
      • copySubContentMetadata

        public void copySubContentMetadata​(CompositeMetadata baseMetaHolder,
                                           ModifiableCompositeMetadata targetMetaHolder,
                                           String metadataName,
                                           String metadataPath,
                                           Map<String,​Object> copyMap,
                                           Map<String,​Object> innerCopyMapInputs,
                                           CopyReport copyReport)
        Duplicate a metadata of type MetadataType.SUB_CONTENT. If the copy map has a '$mode' parameter set to 'create', a new content will be created for each referenced content in the base metadata.
        Parameters:
        baseMetaHolder - The metadata holder of the content to copy
        targetMetaHolder - The metadata holder of the target content
        metadataName - The name of the metadata
        metadataPath - The content metadata path.
        copyMap - The properties to copy
        innerCopyMapInputs - The properties of sub objects
        copyReport - The report of the copy
      • _copyRepeater

        protected void _copyRepeater​(Content baseContent,
                                     CompositeMetadata baseMetaHolder,
                                     ModifiableCompositeMetadata targetMetaHolder,
                                     String metadataPath,
                                     MetadataDefinition metadataDefinition,
                                     Map<String,​Object> copyMap,
                                     Map<String,​Object> innerCopyMapInputs,
                                     CopyReport copyReport)
        Copy a repeater
        Parameters:
        baseContent - The copied content
        baseMetaHolder - The original composite metadata
        targetMetaHolder - The target composite metadata
        metadataPath - The metadata path
        metadataDefinition - The metadata definition
        copyMap - The map for copy
        innerCopyMapInputs - The properties of sub objects
        copyReport - The copy report
      • _updateRichTextMetadata

        protected void _updateRichTextMetadata​(Content baseContent,
                                               ModifiableContent targetContent,
                                               CopyReport copyReport)
        This method analyzes content rich texts and update their content to ensure consistency. (link to image, attachments...)
        Parameters:
        baseContent - The copied content
        targetContent - The target content
        copyReport - The copy report
      • _runContentReferencesEdition

        protected void _runContentReferencesEdition​(Content baseContent,
                                                    WorkflowProvider.AmetysObjectWorkflow targetContentWorkflow,
                                                    int editActionId,
                                                    boolean forceEdition,
                                                    CopyReport copyReport)
                                             throws Exception
        Run the edition of the content references that has been stored during the copy of the metadata. It is done via the EditContentFunction at the end of the process for technical purposes.
        Parameters:
        baseContent - The base content to copy
        targetContentWorkflow - the target content local workflow
        editActionId - The edit action id to edit references
        forceEdition - true to force edition regardless user's rights
        copyReport - the copy report
        Throws:
        Exception - If an error occured
      • _getInputsForContentReferencesEdition

        protected Map<String,​Object_getInputsForContentReferencesEdition​(Content baseContent,
                                                                                 WorkflowAwareContent targetContent,
                                                                                 Map<String,​Object> editionValues,
                                                                                 CopyReport copyReport)
        Retrieve the inputs for the content references edition workflow function.
        Parameters:
        baseContent - The content to copy
        targetContent - The content where to copy
        editionValues - The values representing the content references to be edited (also contains special repeater size values)
        copyReport - The report of the copy
        Returns:
        The map of inputs.
      • getDefaultInitActionId

        public int getDefaultInitActionId()
        Get the default workflow action id for initialization of main content
        Returns:
        the default action id
      • getDefaultActionIdForContentEdition

        public int getDefaultActionIdForContentEdition()
        Get the default workflow action id for editing content by copy
        Returns:
        the default action id
      • getActionIdForCopy2

        public int getActionIdForCopy2()
        Retrieve the action id to execute for the content copy.
        Returns:
        The action id