Class ContentPublicationActivityGenerationTransactionObserver

    • Field Detail

      • contentLocaleId

        protected final java.lang.String contentLocaleId
        Identifier of the ContentLocale this observer will generate Activity for.
        Since:
        8.2.0
    • Constructor Detail

      • ContentPublicationActivityGenerationTransactionObserver

        protected ContentPublicationActivityGenerationTransactionObserver​(java.lang.String contentLocaleId)
    • Method Detail

      • attachToTransactionIfNecessary

        public static void attachToTransactionIfNecessary​(ContentLocale contentLocale,
                                                          boolean checkWasNotPublished)
        If necessary, attach to the transaction an observer that will generate the activity if the content locale becomes published.
        Parameters:
        contentLocale - the content locale.
        Since:
        8.2.0
      • attachToTransactionIfNecessary

        protected static void attachToTransactionIfNecessary​(ContentLocale contentLocale,
                                                             boolean checkWasNotPublished,
                                                             boolean checkActivityStreamisEnabled,
                                                             java.lang.String transactionAttributePreffix,
                                                             ContentPublicationActivityGenerationTransactionObserver.IObserverBuilder<ITransactionObserver> observerBuilder)
        If necessary, attach to the transaction an observer that will generate the activity if the content locale becomes published.
        Parameters:
        contentLocale - the content locale.
        checkWasNotPublished - if it is necessary to check if the content locale was not already published. This parameter is false when it is previously known the content locale was not published, for example when it is being added.
        checkActivityStreamisEnabled - if it is necessary to check if this content's service and source have the automatic generation of activities by the activity stream framework enabled with a specific scope. This parameter is false when it is previously known this content's service and source have not the automatic generation of activities by the activity stream framework enabled.
        transactionAttributePreffix - prefix for name of attribute used to mark when an observer need not to be added to a transaction
        observerBuilder - builder for transaction observer being attached.
        Since:
        8.2.0
      • isContentVersionPublished

        protected static boolean isContentVersionPublished​(ContentVersion publishedVersion)
        Checks if a ContentVersion has been published or not.
        Parameters:
        publishedVersion - the ContentVersion to test.
        Returns:
        true if it has been published
        false otherwise
        Since:
        8.2.0