Class UpdatePublishStatusEntityListener
java.lang.Object
ch.tocco.nice2.dms.impl.entitylistener.status.UpdatePublishStatusEntityListener
- All Implemented Interfaces:
EntityFacadeListener,EventListener
This
EntityFacadeListener sets
the publish status on a given entity.
You have to provide the information which entity should be updated
on which event by contributing UpdateStatusContributions.
The following information is needed:
+ event: The event to listen on ("changing", "creating", "deleting" or "relationChanging")
+ entityName: The name of the entity where the change is captured
+ mainEntityRelationPath: The relation path to the entity which owns the publish status
+ contentService: The ContentService to use for updating the status.
Example for Resource:
+ event: "changing"
+ entityName: "Resource_content"
+ mainEntityRelationPath: "relContent_resource"
+ contentService: "service:ResourceContentService"
This means: We listen on the "changing" event on the entity "Resource_content"
and then follow the relation "relContent_resource" to the "Resource" entity
whose status is set to "changed" by using the "ResourceContentService".-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidentityChanging(EntityChangedEvent event) Fired when any changes are made to an entity.voidentityCreating(EntityFacadeEvent event) Fired when an entity is being created.voidentityDeleting(EntityFacadeEvent event) Fired when an entity is being deleted.voidFired when a relation of an entity has been changed.voidsetUpdateStatusContributions(List<UpdateStatusContribution> updateStatusContributions) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ch.tocco.nice2.persist.core.api.entity.events.EntityFacadeListener
entityReceivedValues, handleSessionOnlyEntity
-
Constructor Details
-
UpdatePublishStatusEntityListener
public UpdatePublishStatusEntityListener(org.slf4j.Logger log)
-
-
Method Details
-
setUpdateStatusContributions
@Autowired public void setUpdateStatusContributions(List<UpdateStatusContribution> updateStatusContributions) -
entityChanging
Description copied from interface:EntityFacadeListenerFired when any changes are made to an entity.- Specified by:
entityChangingin interfaceEntityFacadeListener- Parameters:
event- The event object.
-
entityCreating
Description copied from interface:EntityFacadeListenerFired when an entity is being created.- Specified by:
entityCreatingin interfaceEntityFacadeListener- Parameters:
event- The event object.
-
entityDeleting
Description copied from interface:EntityFacadeListenerFired when an entity is being deleted.- Specified by:
entityDeletingin interfaceEntityFacadeListener- Parameters:
event- The event Object
-
entityRelationChanging
Description copied from interface:EntityFacadeListenerFired when a relation of an entity has been changed.- Specified by:
entityRelationChangingin interfaceEntityFacadeListener- Parameters:
event- The event object.
-