From e22de504a245be0c284bc250c5aac53523f3b048 Mon Sep 17 00:00:00 2001 From: hilpitome Date: Wed, 17 Jan 2024 16:28:32 +0300 Subject: [PATCH 1/5] update to relevant opensrp-server-core version --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 4a8425ad7..51b4dcb17 100755 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ opensrp-server-web war - 2.10.10-SNAPSHOT + 2.10.12-ALPHA-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.5-SNAPSHOT + 2.14.9-DEV3-SNAPSHOT 2.4.1-SNAPSHOT 2.0.1-SNAPSHOT 2.0.5 From d8e38bc0ff45565f0ee1db305c0db2adb8d579ce Mon Sep 17 00:00:00 2001 From: hilpitome Date: Wed, 24 Jan 2024 17:26:51 +0300 Subject: [PATCH 2/5] 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 @@ + + From c17b1a2c41a0673af3fbe475749215ff8d13f5ce Mon Sep 17 00:00:00 2001 From: hilpitome Date: Wed, 24 Jan 2024 17:33:08 +0300 Subject: [PATCH 3/5] change listener logger message --- .../opensrp/web/listener/StructureRepositoryEventListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/opensrp/web/listener/StructureRepositoryEventListener.java b/src/main/java/org/opensrp/web/listener/StructureRepositoryEventListener.java index 2054f4dde..800c88f16 100644 --- a/src/main/java/org/opensrp/web/listener/StructureRepositoryEventListener.java +++ b/src/main/java/org/opensrp/web/listener/StructureRepositoryEventListener.java @@ -17,7 +17,7 @@ public class StructureRepositoryEventListener implements ApplicationListener Date: Wed, 24 Jan 2024 17:35:59 +0300 Subject: [PATCH 4/5] change listener logger message --- .../opensrp/web/listener/StructureRepositoryEventListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/opensrp/web/listener/StructureRepositoryEventListener.java b/src/main/java/org/opensrp/web/listener/StructureRepositoryEventListener.java index 800c88f16..50515bf23 100644 --- a/src/main/java/org/opensrp/web/listener/StructureRepositoryEventListener.java +++ b/src/main/java/org/opensrp/web/listener/StructureRepositoryEventListener.java @@ -17,7 +17,7 @@ public class StructureRepositoryEventListener implements ApplicationListener Date: Wed, 31 Jan 2024 17:44:51 +0300 Subject: [PATCH 5/5] update server version --- configs | 2 +- pom.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configs b/configs index 3ad596261..c9552e1cf 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit 3ad596261a3471198c870a39038076a5a61a12ff +Subproject commit c9552e1cfbc9438f7ee90416b8fd2e2e57989ed5 diff --git a/pom.xml b/pom.xml index da65a1bfc..7cee447f2 100755 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ opensrp-server-web war - 2.10.12-ALPHA1-SNAPSHOT + 2.10.12-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-ALPHA-SNAPSHOT + 2.14.9-SNAPSHOT 2.4.1-SNAPSHOT 2.0.1-SNAPSHOT 2.0.5