Commit Graph

8 Commits

Author SHA1 Message Date
argirok 4eaac0ee19 add plugin controller and service and related changes 2024-04-03 11:20:09 +03:00
Konstantina Galouni 806a2365c3 Updated parent in pom.xml and moved to log4j2 2022-10-07 13:35:48 +03:00
Konstantina Galouni 9c57010ca3 [Trunk | Admin Tools Library]: AdminPortalRelationsController.java:
a. Uncomment method "getDivHelpContent()" ({portalType}/{pid}/divhelpcontent/{id}) (used by portal).
b. Update method "List<DivHelpContent> getDivHelpContentsByPageId()" to "List<DivHelpContentResponse> getDivHelpContentsByPageId()" to return full objects for DivHelpContents.
2021-03-31 15:45:53 +00:00
Konstantina Galouni 2a3f6c6a58 [Trunk | Admin Tools Library]:
1. DivHelpContentDAO.java & MongoDBDivHelpContentDAO.java: [Bug fix] Remove method "findByPortalAndPage()" as there is no "page" field in "DivHelpContent" class.
2. DivHelpContentService.java: [Bug fix] In method "getDivHelpContentsBasic()" change the way parameter "pageId" is used to filter results - find page in "DivId" not "DivHelpContent".
3. AdminPortalRelationsController.java: In method "getPagesForPortalByType()" add again optional parameter "page_route".
2021-03-04 16:20:19 +00:00
Konstantina Galouni a265d414a4 [Trunk | Admin Tools Library]:
1. PageHelpContentDAO.java & MongoDBPageHelpContentDAO.java: Added method "findByPortalAndPageOrderByPlacementAscOrderAsc()" to get page help contents for a specific portal and page.
2. PageHelpContentService.java: Added method "getPageHelpContentsBasic()".
3. DivHelpContentDAO.java & MongoDBDivHelpContentDAO.java: Added method "findByPortalAndPage()" to get div help contents for a specific portal and page.
4. DivHelpContentService.java: Added method "getDivHelpContentsBasic()".
5. AdminPortalRelationsController.java: 
        a. Added methods
                "public List<PageHelpContent> getPageHelpContentsByPageId()" (/{portalType}/{pid}/{pageId}/pagehelpcontent),
                "public Map<String, Integer> countPageHelpContentsForPages()" (/{portalType}/{pid}/pagehelpcontent/page/count),
                "public List<DivHelpContent> getDivHelpContentsByPageId()" (/{portalType}/{pid}/{pageId}/divhelpcontent),
                "public Map<String, Integer> countDivHelpContentsForPages()" (/{portalType}/{pid}/divhelpcontent/page/count) 
        b. Added @PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN)") in methods: 
                "public List<PageHelpContentResponse> getPageHelpContents()" and "public List<DivHelpContentResponse> getDivHelpContents()".
6. RolesUtils.java: [Bug fix] In method "getEmail()" call authorizationService.getEmail().
2021-02-26 12:44:44 +00:00
Konstantina Galouni 3b563eb5c2 [Trunk | Admin Tools Library]:
1. pom.xml: Added in dependency for spring security and and for uoa-authorization-library.
2. UoaAdminToolsLibraryApplication.java: import "AuthorizationConfiguration.class".
3. RolesUtils.java: Added folder handlers/utils and file handlers/utils/RolesUtils.java to get roles and info of user from authorization library.
4. AdminToolsLibraryExceptionsHandler.java: call setStatus of ExceptionResponse in handlers that status was not set | Use log.error instead of log.debug.
5. DivHelpContentService.java: Added checks and throw Exceptions in methods "deleteDivHelpContents()" and "toggleDivHelpContent()".
6. PageHelpContentService.java: Added checks and throw Exceptions in methods "deletePageHelpContents()" and "togglePageHelpContent()".
7. PortalService.java: Added checks and throw Exceptions in method "togglePage()".
8. EntityController.java: Added @PreAuthorize
	Portal Admins: methods "insertEntity()" (/entity/save), "updateEntity()" (/entity/update), "deleteEntities()" (/entity/delete).
9. DivIdController.java: Added @PreAuthorize
	Portal Admins: methods "insertDivId()" (/div/save), "updateDivId()" (/div/update), "deleteDivIds()" (/div/delete).
10. PageController.java: Added @PreAuthorize
        Portal Admins: methods "insertPage()" (/page/save), "updatePage()" (/page/update), "deletePages()" (/page/delete).
11. AdminPortalRelationsController.java:  
	a. Added checks and throw Exceptions in methods "getEntitiesForCommunity()", 
							"getDivHelpContent()", "saveDivHelpContent()", "updateDivHelpContent()", "deleteDivHelpContents()", "toggleDivHelpContent()",
							"togglePage()",
							"getPageHelpContent()", "savePageHelpContent()", "updatePageHelpContent()", "deletePageHelpContents()", "togglePageHelpContent()"
	b. Added @PreAuthorize
		Portals Admin - Curators - Managers: "toggleEntity()" (/{portalType}/{pid}/entity/toggle), 
						     "saveDivHelpContent()" (/{portalType}/{pid}/divhelpcontent/save), "updateDivHelpContent()" (/{portalType}/{pid}/divhelpcontent/update),
						     "deleteDivHelpContents()" (/{portalType}/{pid|/divhelpcontent/delete), "toggleDivHelpContent()"  (/{portalType}/{pid|/divhelpcontent/toggle),
						     "togglePage()" (/{portalType}/{pid}/page/toggle),
						     "savePageHelpContent()" (/{portalType}/{pid}/pagehelpcontent/save), "updatePageHelpContent()" (/{portalType}/{pid}/pagehelpcontent/update),
                                                     "deletePageHelpContents()" (/{portalType}/{pid|/pagehelpcontent/delete), "togglePageHelpContent()"  (/{portalType}/{pid|/pagehelpcontent/toggle)
2021-02-25 10:03:23 +00:00
Konstantina Galouni 7d14e75334 [Trunk | Admin Tools Library]:
1. AdminPortalRelationsController.java: In "getDivIdsFull()" (/{pid}/div/full) set RequestParam page as NOT required (bug fix in admin portal).
2. EntityService.java: [Bug fix] 
	a. In "deleteEntities()", delete entity, after all relations with it have been deleted.
	b. Check equality of page entity with id with "equals" not "==".
3. PageService.java: [Bug fix]
	a. Delete page, after all related divIds, related div help contents, related page help contents have been deleted.
	b. Delete divId, after all related div help contents have been deleted.
	c. In "getDivHelpContents()" and "getPageHelpContents()" param is "page.getRoute()" (not its id).
2020-09-22 14:14:35 +00:00
Konstantina Galouni 1f0fb6df28 [Trunk | Admin Tools Library]:
1. DivHelpContentController.java & PageHelpContentController.java: Comment every method (not used anymore by portals) (changed and moved to AdminPortalRelationsController.java - portal specific).
2. DivIdController.java & EntityController.java & PageController.java: Comment methods not used by portals (some of them changed and moved to AdminPortalRelationsController.java - portal specific).
3. PortalController.java: 
	a. Comment methods not used by portals (some of them changed and moved to AdminPortalRelationsController.java - entities portal specific).
	b. Methods to get portal (basic and full response) by pid.
	c. In path of methods "getPageHelpContentsByPosition()" and "getDivHelpContentsByPosition()" add "/grouped" (without it, methods in AdminPortalRelationsController.java return simple lists).
4. DivId.java & DivIdResponse.java & Page.java & PageResponse.java & Portal.java & PortalResponse.java: Change type of field "portalType" (type for Portal.java) from "String" to "PortalType" (enum).
5. VerifyRecaptcha.java: log error before throwing exception.
6. PageHelpContentService.java: 
	a. Replace methods "insertPageHelpContent()" and "updatePageHelpContent()" with "insertOrUpdatePageHelpContent()".
	b. In "addPageHelpContentsInPortal()" call DAO instead of insert.
7. PageService.java: Use method "getAllPortalsByType()" with portalType parameter, instead of "getAllPortals()".
8. PortalService.java: 
	a. Add methods "getAllPortalsByType()" and "getAllPortalsFullByType()".
	b. In method "getPagesForPortalByType()" add parameter "with_positions".
	c. Add method "checkPortalInfo()", which checks if pid and portalType matches, otherwise throws exception.
9. AdminPortalRelationsController.java: [NEW] controller to handle actions (get, delete, save, update, toggle) for portal specific entities.
10. PortalType.java: [NEW] Enumeration for acceptable portal types.
11. AdminToolsLibraryExceptionsHandler.java & ContentNotFoundException.java & MismatchingContentException.java & ExceptionResponse.java: [NEW] Exception handling for specific error cases.
2020-09-15 10:04:52 +00:00