From d8e38bc0ff45565f0ee1db305c0db2adb8d579ce Mon Sep 17 00:00:00 2001 From: hilpitome Date: Wed, 24 Jan 2024 17:26:51 +0300 Subject: [PATCH] update server version --- pom.xml | 4 ++-- .../StructureRepositoryEventListener.java | 23 +++++++++++++++++++ .../resources/spring/listener-context.xml | 3 +++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 src/main/java/org/opensrp/web/listener/StructureRepositoryEventListener.java diff --git a/pom.xml b/pom.xml index 51b4dcb17..ecdd229b2 100755 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ opensrp-server-web war - 2.10.12-ALPHA-SNAPSHOT + 2.10.12-ALPHA1-SNAPSHOT opensrp-server-web OpenSRP Server Web Application https://github.com/OpenSRP/opensrp-server-web @@ -24,7 +24,7 @@ 3.8.0 always 1.5.1 - 2.14.9-DEV3-SNAPSHOT + 2.14.9-ALPHA-SNAPSHOT 2.4.1-SNAPSHOT 2.0.1-SNAPSHOT 2.0.5 diff --git a/src/main/java/org/opensrp/web/listener/StructureRepositoryEventListener.java b/src/main/java/org/opensrp/web/listener/StructureRepositoryEventListener.java new file mode 100644 index 000000000..2054f4dde --- /dev/null +++ b/src/main/java/org/opensrp/web/listener/StructureRepositoryEventListener.java @@ -0,0 +1,23 @@ +package org.opensrp.web.listener; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.opensrp.domain.postgres.Structure; +import org.opensrp.repository.StructureCreateOrUpdateEvent; +import org.opensrp.service.PhysicalLocationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationListener; +import org.springframework.stereotype.Component; + +@Component +public class StructureRepositoryEventListener implements ApplicationListener { + private static final Logger logger = LogManager.getLogger(StructureRepositoryEventListener.class.toString()); + @Autowired + private PhysicalLocationService physicalLocationService; + @Override + public void onApplicationEvent(StructureCreateOrUpdateEvent structureCreateOrUpdateEvent) { + Structure structure = (Structure) structureCreateOrUpdateEvent.getSource(); + logger.info("updating structure qw "+structure.getJson()); + physicalLocationService.regenerateTasksForOperationalArea(structure); + } +} diff --git a/src/main/resources/spring/listener-context.xml b/src/main/resources/spring/listener-context.xml index f5537b86a..f53498a53 100644 --- a/src/main/resources/spring/listener-context.xml +++ b/src/main/resources/spring/listener-context.xml @@ -16,6 +16,9 @@ + +