Compare commits

...

12 Commits

Author SHA1 Message Date
Konstantinos Triantafyllou 61096bf7ea Update admin tools library 2024-04-03 14:55:30 +03:00
Konstantinos Triantafyllou 87d4ffa8b3 Fix RoleUtils 2023-06-30 13:53:26 +03:00
Konstantinos Triantafyllou f51095c183 Merge remote-tracking branch 'origin/log4j2' 2023-05-19 16:50:59 +03:00
Konstantinos Triantafyllou 0116120843 Pom: Add spring-boot-version in maven-plugin 2023-05-19 16:50:33 +03:00
Konstantina Galouni 61cba891a1 Merge pull request 'log4j2' (#1) from log4j2 into master
Reviewed-on: #1
2023-05-03 12:14:50 +02:00
Konstantina Galouni 675ea269cc 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() 2023-05-03 13:13:08 +03:00
Konstantina Galouni 0586a82e86 Merge log4j2 branch into master 2022-12-12 10:45:22 +02:00
Konstantinos Triantafyllou 5ba5ab4587 [maven-release-plugin] rollback the release of uoa-admin-tools-2.0.5 2022-09-19 10:16:23 +03:00
Konstantinos Triantafyllou fdb546500b [maven-release-plugin] prepare for next development iteration 2022-09-19 10:15:33 +03:00
Konstantinos Triantafyllou a1cf5f9a59 [maven-release-plugin] prepare release uoa-admin-tools-2.0.5 2022-09-19 10:15:27 +03:00
Konstantinos Triantafyllou d8ee820a78 Fix scm info type 2022-09-19 10:12:34 +03:00
Konstantinos Triantafyllou 2f6fbc0efe Add scm info 2022-09-19 10:10:38 +03:00
4 changed files with 26 additions and 5 deletions

View File

@ -38,7 +38,7 @@
<dependency> <!-- this dependency includes dependency to uoa-authorization-library -->
<groupId>eu.dnetlib</groupId>
<artifactId>uoa-admin-tools-library</artifactId>
<version>1.0.6</version>
<version>1.0.11</version>
</dependency>
<!--swagger-->
<dependency>
@ -58,6 +58,7 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot-version}</version>
<configuration>
<mainClass>eu.dnetlib.uoaadmintools.UoaAdminToolsApplication</mainClass>
<executable>true</executable>

View File

@ -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<Portal> 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;
@ -97,8 +102,6 @@ public class CommunityController {
@PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN)")
@RequestMapping(value = "/delete", method = RequestMethod.POST)
public Boolean deleteCommunities(@RequestBody List<String> portals) throws Exception {
List<String> roles = rolesUtils.getRoles();
for (String id: portals) {
Portal portal = portalService.getPortalById(id);
if(portal == null) {

View File

@ -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;

View File

@ -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;
}