[Admin Tools | log4j2]: CommunityController.java: In method "updateCommunity()", update also portalPid in the related menu | MenuService.java: Added method "updatePid()".
This commit is contained in:
parent
4f62befa74
commit
43a4c1a5a4
|
@ -72,6 +72,7 @@ public class CommunityController {
|
|||
subscriberService.updatePid(old_pid, new_pid);
|
||||
layoutService.updatePid(old_pid, new_pid);
|
||||
notificationsService.updatePid(old_pid, new_pid);
|
||||
menuService.updatePid(old_pid, new_pid);
|
||||
}
|
||||
|
||||
return portalResponse;
|
||||
|
|
|
@ -2,6 +2,7 @@ package eu.dnetlib.uoaadmintools.services;
|
|||
|
||||
import eu.dnetlib.uoaadmintools.dao.MenuDAO;
|
||||
import eu.dnetlib.uoaadmintools.dao.MenuItemDAO;
|
||||
import eu.dnetlib.uoaadmintools.entities.Notifications;
|
||||
import eu.dnetlib.uoaadmintools.entities.menu.*;
|
||||
import eu.dnetlib.uoaadmintoolslibrary.handlers.ContentNotFoundException;
|
||||
import eu.dnetlib.uoaadmintoolslibrary.handlers.MismatchingContentException;
|
||||
|
@ -372,4 +373,14 @@ public class MenuService {
|
|||
|
||||
return menuDAO.save(menu);
|
||||
}
|
||||
|
||||
public void updatePid(String old_pid, String new_pid) {
|
||||
log.debug("menu service: updatePid");
|
||||
Menu menu = menuDAO.findByPortalPid(old_pid);
|
||||
if(menu != null) {
|
||||
menu.setPortalPid(new_pid);
|
||||
menuDAO.save(menu);
|
||||
log.debug("menu saved!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue