Class CopyContentClientInteraction

    • Method Detail

      • createContentByCopy

        public Map<String,​ObjectcreateContentByCopy​(String baseContentId,
                                                            String newContentTitle,
                                                            String jsonMap,
                                                            String metadataSetNameToCopy,
                                                            String fallbackMetadataSetNameToCopy,
                                                            String metadataSetTypeToCopy,
                                                            int initActionId,
                                                            int editActionId)
                                                     throws Exception
        Creates a content by copy of another one.
        Also handle the possible inner duplication depending on the duplication mode for each metadata of type "content".
        Parameters:
        baseContentId - The id of content to copy
        newContentTitle - The title of content to create
        jsonMap - The metadata to copy as a JSON string
        metadataSetNameToCopy - The metadata set name to copy. Can be null
        fallbackMetadataSetNameToCopy - The fallback metadata set name to use if 'metadataSetNameToCopy' does not exist. Can be null
        metadataSetTypeToCopy - The metadata set type to copy. Can be null
        initActionId - The init workflow action id for copy
        editActionId - The workflow action for editing content
        Returns:
        the copy result
        Throws:
        Exception - if an error occurred during copy
      • createContentByCopy

        public Map<String,​ObjectcreateContentByCopy​(String baseContentId,
                                                            String newContentTitle,
                                                            String targetContentType,
                                                            String jsonMap,
                                                            String metadataSetNameToCopy,
                                                            String fallbackMetadataSetNameToCopy,
                                                            String metadataSetTypeToCopy,
                                                            int initActionId,
                                                            int editActionId)
                                                     throws Exception
        Creates a content by copy of another one.
        Also handle the possible inner duplication depending on the duplication mode for each metadata of type "content".
        Parameters:
        baseContentId - The id of content to copy
        newContentTitle - The title of content to create
        jsonMap - The metadata to copy as a JSON string
        metadataSetNameToCopy - The metadata set name to copy. Can be null
        fallbackMetadataSetNameToCopy - The fallback metadata set name to use if 'metadataSetNameToCopy' does not exist. Can be null
        metadataSetTypeToCopy - The metadata set type to copy. Can be null
        targetContentType - The type of content to create. If null the type(s) of created content will be those of base content.
        initActionId - The workflow action id for copy to init the new content
        editActionId - The workflow action id for copy to edit the newly created content
        Returns:
        the copy result
        Throws:
        Exception - if an error occurred during copy
      • editContentByCopy

        public Map<String,​ObjecteditContentByCopy​(String baseContentId,
                                                          List<String> targetContentIds,
                                                          String jsonMap,
                                                          String metadataSetNameToCopy,
                                                          String fallbackMetadataSetNameToCopy,
                                                          String metadataSetTypeToCopy)
                                                   throws Exception
        Edits contents by copied of another one.
        Parameters:
        baseContentId - The id of content to copy
        targetContentIds - The ids of content to edit
        jsonMap - The metadata to copy as a JSON string
        metadataSetNameToCopy - The metadata set name to copy. Can be null.
        fallbackMetadataSetNameToCopy - The fallback metadata set name if 'metadataSetName' is not found. Can be null.
        metadataSetTypeToCopy - The metadata set type to copy. Can be null
        Returns:
        the copy result
        Throws:
        Exception - if an error occurred during copy
      • _buildReport

        protected void _buildReport​(CopyReport copyReport,
                                    Map<String,​Object> mainContent,
                                    List<Map<String,​Object>> createdContents,
                                    List<Map<String,​Object>> editedContents,
                                    List<Map<String,​Object>> failedContentCopies,
                                    List<Map<String,​Object>> metadataErrors)
        Helper method used to build the report (rootLevel is false)
        Parameters:
        copyReport - The report of the copy
        mainContent - The map that will receive the copy report informations during a creation at rootLevel.
        createdContents - The list that will receive the copy report informations during a creation at another level.
        editedContents - The list that will receive the copy report informations during something else than a creation
        failedContentCopies - The list that will receive th copy report informations if an error occurred during the copy
        metadataErrors - The list of metadata errors reported
      • _buildReport

        protected void _buildReport​(CopyReport copyReport,
                                    Map<String,​Object> mainContent,
                                    List<Map<String,​Object>> createdContents,
                                    List<Map<String,​Object>> editedContents,
                                    List<Map<String,​Object>> failedContentCopies,
                                    List<Map<String,​Object>> metadataErrors,
                                    boolean rootLevel)
        Helper method used to build the report
        Parameters:
        copyReport - The report of the copy
        mainContent - The map that will receive the copy report informations during a creation at rootLevel.
        createdContents - The list that will receive the copy report informations during a creation at another level.
        editedContents - The list that will receive the copy report informations during something else than a creation
        failedContentCopies - The list that will receive th copy report informations if an error occurred during the copy
        metadataErrors - The list of metadata errors reported
        rootLevel - True indicates the root level of the report.
      • _getCreatedContentIds

        protected List<String_getCreatedContentIds​(CopyReport copyReport)
        Retrieve the identifiers of the created contents through the copy report
        Parameters:
        copyReport - The report of the copy
        Returns:
        list of identifiers
      • _getCreatedContentIds

        protected List<String_getCreatedContentIds​(List<CopyReport> copyReports)
        Retrieve the identifiers of the created contents through the copy reports
        Parameters:
        copyReports - list of copy reports
        Returns:
        list of identifiers
      • _getEditedContentIds

        protected List<String_getEditedContentIds​(List<CopyReport> copyReports)
        Retrieve the identifiers of the edited contents through the copy reports
        Parameters:
        copyReports - list of copy reports
        Returns:
        list of identifiers