Interface SynchronizableContentsCollection

    • Method Detail

      • getId

        String getId()
        Get the id of synchronizable collection.
        Returns:
        the id
      • getContentType

        String getContentType()
        Get the type of content handled by this collection
        Returns:
        the type of content
      • getLanguages

        List<StringgetLanguages()
        Get the languages handled by this collection
        Returns:
        the list of language
      • removalSync

        boolean removalSync()
        When returns true, a content created by a previous synchro will be removed if it does not exist anymore during the current synchro.
        Returns:
        true if a content created by a previous synchro has to be removed if it does not exist anymore during the current synchro.
      • getWorkflowName

        String getWorkflowName()
        Get the name of the workflow to use for the synchronized contents
        Returns:
        the name of the workflow to use for the synchronized contents
      • getInitialActionId

        int getInitialActionId()
        Get the id of the initial action of the workflow
        Returns:
        The id of the initial action of the workflow
      • getSynchronizeActionId

        int getSynchronizeActionId()
        Get the id of the synchronize action of the workflow
        Returns:
        The id of the synchronize action of the workflow
      • getValidateActionId

        int getValidateActionId()
        Get the id of the validate action of the workflow
        Returns:
        The id of the validate action of the workflow
      • getContentPrefix

        String getContentPrefix()
        Get the prefix to use for the creation of contents
        Returns:
        The prefix to use for the creation of contents
      • validateAfterImport

        boolean validateAfterImport()
        True to validate the contents after import
        Returns:
        True to validate the contents after import
      • getReportMails

        String getReportMails()
        If an exception occurs during synchronization, an error report mail will be sent to those email addresses (separated by new lines)
        Returns:
        The email addresses to send an error report if an exception occurs during synchronization (separated by new lines)
      • getRestrictedField

        String getRestrictedField()
        Get the path of boolean metadata for restricted content. If true, the content will be visible only for connected users.
        Returns:
        the path to the metadata. Can be null.
      • getIdField

        String getIdField()
        Get the path of metadata holding the unique identifier
        Returns:
        the path to the metadata. Can be null.
      • getLocalAndExternalFields

        Set<StringgetLocalAndExternalFields​(Map<String,​Object> additionalParameters)
        Get the path of tri-state fields (with local and external values)
        Parameters:
        additionalParameters - Additional parameters
        Returns:
        the synchronized fields
      • synchronizeExistingContentsOnly

        boolean synchronizeExistingContentsOnly()
        True to synchronize only existing contents
        Returns:
        True to synchronize only existing contents
      • empty

        void empty​(org.slf4j.Logger logger)
        Empty the collection of its synchronized contents
        Parameters:
        logger - The logger
      • populate

        List<ModifiableContentpopulate​(org.slf4j.Logger logger)
        Populates contents
        Parameters:
        logger - The logger
        Returns:
        Return the populated contents (imported or synchronized)
      • importContent

        List<ModifiableContentimportContent​(String idValue,
                                              Map<String,​Object> additionalParameters,
                                              org.slf4j.Logger logger)
                                       throws Exception
        Import a content from remote values.
        Parameters:
        idValue - Id (for import/synchronization) of the content to import
        additionalParameters - Additional parameters
        logger - The logger
        Returns:
        A list of created contents
        Throws:
        Exception - if an error occurs.
      • synchronizeContent

        void synchronizeContent​(ModifiableContent content,
                                org.slf4j.Logger logger)
                         throws Exception
        Synchronize a content with remove values.
        Parameters:
        content - The content to synchronize
        logger - The logger
        Throws:
        Exception - if an error occurs.
      • additionalCommonOperations

        default ContentSynchronizationResult additionalCommonOperations​(ModifiableContent content,
                                                                        Map<String,​Object> additionalParameters,
                                                                        org.slf4j.Logger logger)
        Add specific fields to the content during import or synchronization.
        Parameters:
        content - Content to update
        additionalParameters - Additional parameters
        logger - The logger
        Returns:
        The synchronization result of the additional operations
      • getContent

        ModifiableContent getContent​(String lang,
                                     String idValue)
        Gets the content in the repository
        Parameters:
        lang - the language
        idValue - the content name
        Returns:
        the content in the repository, or null if does not exist
      • search

        Map<String,​Map<String,​Object>> search​(Map<String,​Object> searchParameters,
                                                          int offset,
                                                          int limit,
                                                          List<Object> sort,
                                                          org.slf4j.Logger logger)
        Search the data to import from parameters.
        Parameters:
        searchParameters - Parameters for the search
        offset - Begin of the search
        limit - Number of results
        sort - Sort of results (ignored for LDAP results)
        logger - The logger
        Returns:
        A map of remote values by content
      • updateSyncInformations

        void updateSyncInformations​(ModifiableContent content,
                                    String syncCode,
                                    org.slf4j.Logger logger)
                             throws Exception
        Method to update the synchronisation informations (collection and value of the ID field).
        Parameters:
        content - Content to update
        syncCode - New synchronization code
        logger - The logger
        Throws:
        Exception - if an error occurs.
      • getTotalCount

        int getTotalCount​(Map<String,​Object> searchParameters,
                          org.slf4j.Logger logger)
        Return the total number of results for the search.
        Parameters:
        searchParameters - Parameters for the search
        logger - The logger
        Returns:
        The total count
      • getSynchronizationResult

        Map<String,​IntegergetSynchronizationResult()
        Retrieves the result of the synchronization as a map of key / content count containing
        • The number of created contents
        • The number of synchronized contents
        • The number of unchanged contents
        • The number of deleted contents
        Returns:
        the result of the synchronization