PageService.java: Added method "updatePid()" to set new portal pid to all pages related to this specific portal.

This commit is contained in:
Konstantina Galouni 2023-04-28 17:50:02 +03:00
parent f50d434e1d
commit a1fddbd2a8
1 changed files with 12 additions and 0 deletions

View File

@ -333,4 +333,16 @@ public class PageService {
page.setEntities(entities);
return pageDAO.save(page);
}
public void updatePid(String old_pid, String new_pid, String portalType) {
log.debug("page service: updatePid");
List<Page> pages = pageDAO.findByPortalTypeAndPortalPidOrNull(portalType, old_pid);
for(Page page : pages) {
if (page != null) {
page.setPortalPid(new_pid);
pageDAO.save(page);
log.debug("page "+page.getId()+" saved!");
}
}
}
}