From 2f6fbc0efedf396b050f48eb687a5ecd63bd662d Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 19 Sep 2022 10:10:38 +0300 Subject: [PATCH 1/6] Add scm info --- pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pom.xml b/pom.xml index 4df8163..7af96ab 100644 --- a/pom.xml +++ b/pom.xml @@ -7,6 +7,11 @@ 2.0.5-SNAPSHOT war uoa-admin-tools + + scm:git:gitea@code-repo.d4science.org:MaDgIK/uoa-admin-tools.git + scm:gitea@code-repo.d4science.org:MaDgIK/uoa-admin-tools.git + https://code-repo.d4science.org/MaDgIK/uoa-admin-tools/ + org.springframework.boot From d8ee820a78cf7ab8ffb270569dd63a779ed319db Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 19 Sep 2022 10:12:34 +0300 Subject: [PATCH 2/6] Fix scm info type --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7af96ab..7a85d23 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ uoa-admin-tools scm:git:gitea@code-repo.d4science.org:MaDgIK/uoa-admin-tools.git - scm:gitea@code-repo.d4science.org:MaDgIK/uoa-admin-tools.git + scm:git:gitea@code-repo.d4science.org:MaDgIK/uoa-admin-tools.git https://code-repo.d4science.org/MaDgIK/uoa-admin-tools/ From a1cf5f9a598272e1d1315a6bfac669b90191de27 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 19 Sep 2022 10:15:27 +0300 Subject: [PATCH 3/6] [maven-release-plugin] prepare release uoa-admin-tools-2.0.5 --- pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 7a85d23..5ff84ef 100644 --- a/pom.xml +++ b/pom.xml @@ -1,23 +1,23 @@ - + 4.0.0 eu.dnetlib uoa-admin-tools - 2.0.5-SNAPSHOT + 2.0.5 war uoa-admin-tools scm:git:gitea@code-repo.d4science.org:MaDgIK/uoa-admin-tools.git scm:git:gitea@code-repo.d4science.org:MaDgIK/uoa-admin-tools.git https://code-repo.d4science.org/MaDgIK/uoa-admin-tools/ - + uoa-admin-tools-2.0.5 + org.springframework.boot spring-boot-starter-parent 1.5.8.RELEASE - + UTF-8 From fdb546500b07d03f4b16f3eadf9fc67b42435a17 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 19 Sep 2022 10:15:33 +0300 Subject: [PATCH 4/6] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 5ff84ef..356b8d8 100644 --- a/pom.xml +++ b/pom.xml @@ -3,14 +3,14 @@ 4.0.0 eu.dnetlib uoa-admin-tools - 2.0.5 + 2.0.6-SNAPSHOT war uoa-admin-tools scm:git:gitea@code-repo.d4science.org:MaDgIK/uoa-admin-tools.git scm:git:gitea@code-repo.d4science.org:MaDgIK/uoa-admin-tools.git https://code-repo.d4science.org/MaDgIK/uoa-admin-tools/ - uoa-admin-tools-2.0.5 + HEAD From 5ba5ab458723d642881701671e05c0c4cf402e9d Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 19 Sep 2022 10:16:23 +0300 Subject: [PATCH 5/6] [maven-release-plugin] rollback the release of uoa-admin-tools-2.0.5 --- pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 356b8d8..7a85d23 100644 --- a/pom.xml +++ b/pom.xml @@ -1,23 +1,23 @@ - + 4.0.0 eu.dnetlib uoa-admin-tools - 2.0.6-SNAPSHOT + 2.0.5-SNAPSHOT war uoa-admin-tools scm:git:gitea@code-repo.d4science.org:MaDgIK/uoa-admin-tools.git scm:git:gitea@code-repo.d4science.org:MaDgIK/uoa-admin-tools.git https://code-repo.d4science.org/MaDgIK/uoa-admin-tools/ - HEAD - + org.springframework.boot spring-boot-starter-parent 1.5.8.RELEASE - + UTF-8 From 675ea269cc8ebbba04271956fc8b9b32f8b67d68 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 3 May 2023 13:13:08 +0300 Subject: [PATCH 6/6] Admin Tools | log4j2: pom.xml: Updated version of uoa-admin-tools-library to 1.0.7 (previous 1.0.6) | CommunityController.java & ConnectController.java & ExploreController.java: In methods of update portal, if pid was changed, call also pageService.updatePid() --- pom.xml | 2 +- .../controllers/CommunityController.java | 5 +++++ .../uoaadmintools/controllers/ConnectController.java | 10 ++++++++-- .../uoaadmintools/controllers/ExploreController.java | 11 +++++++++++ 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 141da51..c1030a4 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,7 @@ eu.dnetlib uoa-admin-tools-library - 1.0.6 + 1.0.7 diff --git a/src/main/java/eu/dnetlib/uoaadmintools/controllers/CommunityController.java b/src/main/java/eu/dnetlib/uoaadmintools/controllers/CommunityController.java index 84e9f13..115d580 100644 --- a/src/main/java/eu/dnetlib/uoaadmintools/controllers/CommunityController.java +++ b/src/main/java/eu/dnetlib/uoaadmintools/controllers/CommunityController.java @@ -7,6 +7,7 @@ import eu.dnetlib.uoaadmintoolslibrary.entities.fullEntities.PortalResponse; import eu.dnetlib.uoaadmintoolslibrary.handlers.ContentNotFoundException; import eu.dnetlib.uoaadmintoolslibrary.handlers.MismatchingContentException; import eu.dnetlib.uoaadmintoolslibrary.handlers.utils.RolesUtils; +import eu.dnetlib.uoaadmintoolslibrary.services.PageService; import eu.dnetlib.uoaadmintoolslibrary.services.PortalService; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -43,6 +44,9 @@ public class CommunityController { @Autowired private PortalService portalService; + @Autowired + private PageService pageService; + @RequestMapping(value = {""}, method = RequestMethod.GET) public List getAllCommunities() { return portalService.getAllPortalsByType("community"); @@ -73,6 +77,7 @@ public class CommunityController { layoutService.updatePid(old_pid, new_pid); notificationsService.updatePid(old_pid, new_pid); menuService.updatePid(old_pid, new_pid); + pageService.updatePid(old_pid, new_pid, portal.getType()); } return portalResponse; diff --git a/src/main/java/eu/dnetlib/uoaadmintools/controllers/ConnectController.java b/src/main/java/eu/dnetlib/uoaadmintools/controllers/ConnectController.java index 3da4d68..0edb39a 100644 --- a/src/main/java/eu/dnetlib/uoaadmintools/controllers/ConnectController.java +++ b/src/main/java/eu/dnetlib/uoaadmintools/controllers/ConnectController.java @@ -6,6 +6,7 @@ import eu.dnetlib.uoaadmintoolslibrary.entities.Portal; import eu.dnetlib.uoaadmintoolslibrary.entities.fullEntities.PortalResponse; import eu.dnetlib.uoaadmintoolslibrary.handlers.ContentNotFoundException; import eu.dnetlib.uoaadmintoolslibrary.handlers.MismatchingContentException; +import eu.dnetlib.uoaadmintoolslibrary.services.PageService; import eu.dnetlib.uoaadmintoolslibrary.services.PortalService; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -27,6 +28,9 @@ public class ConnectController { @Autowired private PortalService portalService; + @Autowired + private PageService pageService; + @PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN)") @RequestMapping(value = "/update", method = RequestMethod.POST) public PortalResponse updateConnect(@RequestBody Portal portal) { @@ -35,12 +39,14 @@ public class ConnectController { throw new MismatchingContentException("Update Connect: Portal with id: " + portal.getId() + " has type: " + portal.getType() + " instead of connect"); } + String old_pid = portalService.getPortalById(portal.getId()).getPid(); + String new_pid = portal.getPid(); + PortalResponse portalResponse = portalService.updatePortal(portal); - String old_pid = portalResponse.getPid(); - String new_pid = portal.getPid(); if (!old_pid.equals(new_pid)) { layoutService.updatePid(old_pid, new_pid); + pageService.updatePid(old_pid, new_pid, portal.getType()); } return portalResponse; diff --git a/src/main/java/eu/dnetlib/uoaadmintools/controllers/ExploreController.java b/src/main/java/eu/dnetlib/uoaadmintools/controllers/ExploreController.java index a9b06c0..87edf69 100644 --- a/src/main/java/eu/dnetlib/uoaadmintools/controllers/ExploreController.java +++ b/src/main/java/eu/dnetlib/uoaadmintools/controllers/ExploreController.java @@ -4,6 +4,7 @@ import eu.dnetlib.uoaadmintoolslibrary.entities.Portal; import eu.dnetlib.uoaadmintoolslibrary.entities.fullEntities.PortalResponse; import eu.dnetlib.uoaadmintoolslibrary.handlers.ContentNotFoundException; import eu.dnetlib.uoaadmintoolslibrary.handlers.MismatchingContentException; +import eu.dnetlib.uoaadmintoolslibrary.services.PageService; import eu.dnetlib.uoaadmintoolslibrary.services.PortalService; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -23,13 +24,23 @@ public class ExploreController { @Autowired private PortalService portalService; + @Autowired + private PageService pageService; + @RequestMapping(value = "/update", method = RequestMethod.POST) public PortalResponse updateExplore(@RequestBody Portal portal) { if(!portal.getType().equals("explore")) { // EXCEPTION - MismatchingContent throw new MismatchingContentException("Update Explore: Portal with id: "+portal.getId()+" has type: "+portal.getType()+" instead of explore"); } + String old_pid = portalService.getPortalById(portal.getId()).getPid(); + String new_pid = portal.getPid(); + PortalResponse portalResponse = portalService.updatePortal(portal); + + if (!old_pid.equals(new_pid)) { + pageService.updatePid(old_pid, new_pid, portal.getType()); + } return portalResponse; }