Class ClearGeoLocationListener
java.lang.Object
ch.tocco.nice2.persist.core.api.util.CollectingEntityListener
ch.tocco.nice2.optional.geolocation.impl.entitylistener.ClearGeoLocationListener
- All Implemented Interfaces:
ContextListener,EntityFacadeListener,CommitListener,EventListener
Listener to initiate geographic coordinates determination. Every time a field
which is part of the address is changed, the geographic coordinates are cleared.
The geographic coordinates are also cleared, when the flag is deselected.
Entities of the contribution
GeoLocationEntities are taken into account.
Example:
@Bean
public GeoLocationEntityContribution eventGeoLocationEntityContribution() {
GeoLocationEntityContribution bean = new GeoLocationEntityContribution();
bean.setEntityName("Event");
bean.setAddressField("geoloc_address");
bean.setZipField("geoloc_zip");
bean.setCityField("geoloc_city");
bean.setCountryRelation("relGeoloc_country");
return bean;
}
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.tocco.nice2.persist.core.api.util.CollectingEntityListener
CollectingEntityListener.EntityModelNamePredicate, CollectingEntityListener.FieldChangedPredicate, CollectingEntityListener.RelationTouchedPredicate -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionClearGeoLocationListener(GeolocListenerService geolocListenerService, SecurityManager securityManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidsetGeoLocationEntities(List<GeoLocationEntityContribution> geoLocationEntities) Methods inherited from class ch.tocco.nice2.persist.core.api.util.CollectingEntityListener
afterCommit, beforeCommit, contextDestroying, entityChanging, entityCreating, entityDeleting, entityModel, entityRelationChanging, fieldChanged, fieldChanged, getAddedRelationChanges, getAddedRelationChangesFor, getAffectedEntities, getAffectedEntities, getAllAffectedEntities, getAllAffectedEntities, getAllRelationChanges, getCreatedEntities, getCreatedEntities, getDeletedEntities, getDeletedEntities, getKey, getOldValues, getRelationChanges, getRelationChangesFor, getRelationChangesFor, getRemovedRelationChanges, getRemovedRelationChangesFor, getUpdatedEntities, getUpdatedEntities, isValidTx, onEntityChanging, onEntityCreating, onEntityDeleting, onEntityRelationChanging, relationTouched, relationTouched, transactionStarted, withAffectedEntities, withAffectedEntities, withAllAffectedEntities, withAllAffectedEntities, withCreatedEntities, withCreatedEntities, withDeletedEntities, withDeletedEntities, withUpdatedEntities, withUpdatedEntitiesMethods 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.util.CommitListener
afterFlush, priorityMethods inherited from interface ch.tocco.nice2.persist.core.api.entity.events.EntityFacadeListener
entityReceivedValues, handleSessionOnlyEntity
-
Field Details
-
SHOULD_DETERMINE_FLAG_NAME
- See Also:
-
-
Constructor Details
-
ClearGeoLocationListener
public ClearGeoLocationListener(GeolocListenerService geolocListenerService, SecurityManager securityManager)
-
-
Method Details
-
setGeoLocationEntities
@Autowired(required=false) public void setGeoLocationEntities(List<GeoLocationEntityContribution> geoLocationEntities) -
onBeforeCommit
- Specified by:
onBeforeCommitin classCollectingEntityListener
-