public class ContentPublicationActivityGenerationTransactionObserver extends AbstractTransactionObserver
activities
when a ContentLocale
becomes published.Modifier and Type | Class and Description |
---|---|
protected static interface |
ContentPublicationActivityGenerationTransactionObserver.IObserverBuilder<T extends ITransactionObserver> |
Modifier and Type | Field and Description |
---|---|
protected String |
contentLocaleId
Identifier of the
ContentLocale this observer will generate Activity for. |
Modifier | Constructor and Description |
---|---|
protected |
ContentPublicationActivityGenerationTransactionObserver(String contentLocaleId) |
Modifier and Type | Method and Description |
---|---|
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.
|
protected static void |
attachToTransactionIfNecessary(ContentLocale contentLocale,
boolean checkWasNotPublished,
boolean checkActivityStreamisEnabled,
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.
|
boolean |
beforeCommit()
Called by the observed transaction just before the commit operation.
|
protected Activity |
createActivity(ContentLocale contentLocale)
Creates an activity for the content locale being persisted
|
protected static boolean |
isContentVersionPublished(ContentVersion publishedVersion)
Checks if a
ContentVersion has been published or not. |
afterCommit, afterRollback, beforeRollback
protected final String contentLocaleId
ContentLocale
this observer will generate Activity
for.protected ContentPublicationActivityGenerationTransactionObserver(String contentLocaleId)
public static void attachToTransactionIfNecessary(ContentLocale contentLocale, boolean checkWasNotPublished)
contentLocale
- the content locale.protected static void attachToTransactionIfNecessary(ContentLocale contentLocale, boolean checkWasNotPublished, boolean checkActivityStreamisEnabled, String transactionAttributePreffix, ContentPublicationActivityGenerationTransactionObserver.IObserverBuilder<ITransactionObserver> observerBuilder)
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 transactionobserverBuilder
- builder for transaction observer being attached.public boolean beforeCommit() throws PortalException
ITransactionObserver
beforeCommit
in interface ITransactionObserver
beforeCommit
in class AbstractTransactionObserver
PortalException
protected Activity createActivity(ContentLocale contentLocale) throws ManagerException, PortalException
contentLocale
- the content locale which activity is being created.ManagerException
PortalException
protected static boolean isContentVersionPublished(ContentVersion publishedVersion)
ContentVersion
has been published or not.publishedVersion
- the ContentVersion
to test.LumisXP 12.1.0.191010 - Copyright © 2006–2019 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.