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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
entityChanging
(EntityChangedEvent event) Fired when any changes are made to an entity.void
entityCreating
(EntityFacadeEvent event) Fired when an entity is being created.void
entityDeleting
(EntityFacadeEvent event) Fired when an entity is being deleted.void
Fired when a relation of an entity has been changed.void
setUpdateStatusContributions
(List<UpdateStatusContribution> updateStatusContributions) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:EntityFacadeListener
Fired when any changes are made to an entity.- Specified by:
entityChanging
in interfaceEntityFacadeListener
- Parameters:
event
- The event object.
-
entityCreating
Description copied from interface:EntityFacadeListener
Fired when an entity is being created.- Specified by:
entityCreating
in interfaceEntityFacadeListener
- Parameters:
event
- The event object.
-
entityDeleting
Description copied from interface:EntityFacadeListener
Fired when an entity is being deleted.- Specified by:
entityDeleting
in interfaceEntityFacadeListener
- Parameters:
event
- The event Object
-
entityRelationChanging
Description copied from interface:EntityFacadeListener
Fired when a relation of an entity has been changed.- Specified by:
entityRelationChanging
in interfaceEntityFacadeListener
- Parameters:
event
- The event object.
-