Class CopyReport


  • public final class CopyReport
    extends Object
    The report object, used internally to provide useful informations once the whole duplication process has ended.
    • Constructor Detail

      • CopyReport

        public CopyReport​(String baseContentId,
                          Boolean baseContentIsRefTable,
                          String metadataSetName,
                          String fallbackMetadataSetName,
                          String metadataSetType,
                          CopyReport.CopyMode copyMode)
        Constructor. If the title of the base content if available, should be used.
        Parameters:
        baseContentId - The content id of the base content
        baseContentIsRefTable - Indicates if the base content is a reference table's entry (can be null if unavailable)
        metadataSetName - The metadata set name
        fallbackMetadataSetName - The fallback metadata set name. Use for legacy purpose.
        metadataSetType - The metadata set type (edit or view)
        copyMode - The mode of copy
      • CopyReport

        public CopyReport​(String baseContentId,
                          String baseContentTitle,
                          Boolean baseContentIsRefTable,
                          String metadataSetName,
                          String fallbackMetadataSetName,
                          String metadataSetType,
                          CopyReport.CopyMode copyMode)
        Constructor.
        Parameters:
        baseContentId - The content id of the base content
        baseContentTitle - The title of the base content
        baseContentIsRefTable - Indicates if the base content is a reference table's entry
        metadataSetName - The metadata set name
        fallbackMetadataSetName - The fallback metadata set name. Use for legacy purpose.
        metadataSetType - The metadata set type (edit or view)
        copyMode - The mode of copy
    • Method Detail

      • setReferenceTable

        public void setReferenceTable​(boolean isRefTable)
        Set whether the base content is a reference table's entry.
        Parameters:
        isRefTable - true for reference table's entry.
      • setTargetContentTitle

        public void setTargetContentTitle​(String title)
        Set the target content title.
        Parameters:
        title - The target content title.
      • notifyContentCreation

        public void notifyContentCreation​(String id,
                                          String title,
                                          boolean isRefTable)
        Notify information about the target content to the report.
        Parameters:
        id - The content id
        title - The content title
        isRefTable - Indicates if the target content is a reference table's entry.
      • addAttachment

        public void addAttachment​(String relPath)
        Add an attachments to the copied attachments report list
        Parameters:
        relPath - The relative path where to copy
      • addContentReferenceValues

        public void addContentReferenceValues​(String metadataPath,
                                              Object values)
        Should be used to store the values of a content metadata. These values will be used later in the copy process to properly edit content metadata
        Parameters:
        metadataPath - The path of the metadata to copy
        values - The values
      • addRepeaterInfo

        public void addRepeaterInfo​(String metadataPath,
                                    int entryCount)
        Add repeater info to be able to perform an edition at the of the copy for content metadata
        Parameters:
        metadataPath - The path of the metadata concerned
        entryCount - the entry count
      • getRepeatersInfo

        public Map<String,​IntegergetRepeatersInfo()
        Get the map of info about copied repeaters
        Returns:
        Map holding repeaters info. Each values is the size of a repeater
      • getMetadataSetName

        public String getMetadataSetName()
        Get the name of the metadataset used for the copy.
        Returns:
        the metadataset name
      • getFallbackMetadataSetName

        public String getFallbackMetadataSetName()
        Get the name of the fallback metadataset used for the copy.
        Returns:
        the fallback metadataset name
      • getMetadataSetType

        public String getMetadataSetType()
        Get the type of the metadataset used for the copy.
        Returns:
        the metadataset name
      • getBaseContentTitle

        public String getBaseContentTitle()
        Get the base content title.
        Returns:
        The title or null (if unavailable)
      • getChildReports

        public List<CopyReportgetChildReports()
        Get the list of child copy reports. Each child report denotes an inner copy
        Returns:
        The list of copy reports.
      • getCopiedAttachments

        public List<StringgetCopiedAttachments()
        Get the list of the copied attachments.
        Returns:
        List of paths (relative to the root attachment node of the target content)
      • addReport

        public void addReport​(CopyReport report)
        Add a child report to the report. This must be done when an copy is requested
        Parameters:
        report - The report of the copy to add