Commit Graph

39 Commits

Author SHA1 Message Date
argirok 4eaac0ee19 add plugin controller and service and related changes 2024-04-03 11:20:09 +03:00
Konstantinos Triantafyllou 0a575fbcd2 Import IgnoreSecurityConfiguration instead of AuthorizationConfiguration and update authorization-library. 2023-12-14 15:36:35 +02:00
Konstantinos Triantafyllou 22629313d7 Add country, researcher and datasource in PortalType. 2023-11-14 13:19:28 +02:00
Konstantinos Triantafyllou 9a9209f9a2 Fix RoleUtils methods 2023-06-30 13:51:55 +03:00
Konstantina Galouni 02169daeb7 PageService.java: In method "insertPage()", put new page in portal pages map as disabled (false) by default. 2023-06-28 15:39:02 +03:00
Konstantina Galouni a1fddbd2a8 PageService.java: Added method "updatePid()" to set new portal pid to all pages related to this specific portal. 2023-04-28 17:50:02 +03:00
Konstantina Galouni 806a2365c3 Updated parent in pom.xml and moved to log4j2 2022-10-07 13:35:48 +03:00
Konstantina Galouni 8af24273e5 [Trunk | Admin Tools Library]: PortalType.java: Added "eosc" in PortalType enum | DivHelpContentService.java: Updated footer contents (font-size:12px instead of 8pt). 2022-07-27 11:37:53 +00:00
Konstantina Galouni 0de1d1d662 [Trunk | Admin tools library]: Added portal specific pages.
1. Page.java & PortalPage.java: Added new field "String portalPid" - pages will be either portalPid and portalType specific either only portalType specific.
2. MongoDBDAOs/MongoDBPageDAO.java & PageDAO.java: Updated find methods to search for pages related to portalType and pages related to both portalPid and portalType.
		a. Replaced findByPortalType with: @Query("{'portalType': ?0, 'portalPid': {$in: [?1, null] }}") List<Page> findByPortalTypeAndPortalPidOrNull(String portalType, String portalPid);
		b. Replaced findByPortalTypeAndRoute with: @Query("{'portalType': ?0, 'route': ?1, 'portalPid': {$in: [?2, null] }}") Page findByPortalTypeAndRouteAndPortalPidOrNull(String portalType, String route, String portalPid);
3. PageController.java & PageService.java & PortalService.java & PageHelpContentService.java: Updated methods to handle pages with portalPid and added more checks for null values and permissions.
2022-02-09 12:14:23 +00:00
Konstantinos Triantafyllou 1da1d75771 Add component scan to configuration file 2021-12-06 15:20:43 +00:00
Konstantinos Triantafyllou 121a72611d Update authorization library 2021-11-30 11:52:19 +00:00
Konstantinos Triantafyllou c4134a9f41 Add version to global vars. Update authorization library 2021-11-16 14:48:05 +00:00
Konstantina Galouni f9f542291e [Trunk | Admin Tools Library]:
1. MailConfig.java: Added field "sslProtocols".
2. AdminToolsLibraryCheckDeployController.java: Expose property "admintoolslibrary.mail.sslProtocols".
3. EmailSender.java: Set "mail.smtp.ssl.protocols" with value from property "admintoolslibrary.mail.sslProtocols", if it is not null.
2021-11-15 13:19:56 +00:00
Konstantina Galouni a262fe2c45 [Trunk | Admin Tools Library]:
1. AdminToolsLibraryCheckDeployController.java: [Bug fix] In health-check/advanced method, show "admintoolslibrary.mail.from" property correctly (it showed "auth" property).
2. EmailSender.java: Spelling error fix "Email could not be sent.".
2021-11-15 11:07:42 +00:00
Konstantina Galouni e1f8b4308f [Trunk | Admin Tools Library]: Portal.java & PortalResponse.java & PortalService.java: Added new field in Portal (and PortalResponse) "twitterAccount". 2021-10-25 09:17:37 +00:00
Konstantina Galouni a7b07ad7e0 [Trunk | Admin Tools Library]:
1. pom.xml: 
        a. Added timestamp in properties.
        b. In <build> added <resources> with filtering set to true.
2. GlobalVars.java: Added GlobalVars class for date of deploy & date of build.
3. UoaAdminToolsLibraryApplication.java: In @EnableConfigurationProperties added GlobalVars.class.
4. AdminToolsLibraryCheckDeployController.java: Added exposing date of deploy and date of build.
5. admintoolslibrary.properties: Added property admintoolslibrary.globalVars.buildDate=@timestamp@.
2021-09-15 21:58:27 +00:00
Konstantina Galouni ca3a327172 [Trunk | Admin Tools Library]: Added properties.put("mail.smtp.ssl.protocols", "TLSv1.2"); if(mailConfig.getHost().equals("smtp.gmail.com")) (only for dev). 2021-06-24 12:29:18 +00:00
Konstantina Galouni bcf37d165c [Trunk | Admin Tools Library]: DivHelpContentService.java: Updated default footer div helptext for new communities and added default footer div helptext for new monitor dashboards and other portals. 2021-06-04 10:07:17 +00:00
Konstantina Galouni e3d5e5679b [Trunk | Admin Tools Library]: DivHelpContentService.java: In method "addDivHelpContentsInPortal()" (when creating a new portal), added default footer div help content for divId with name "footer". 2021-06-04 09:25:55 +00:00
Konstantina Galouni 62cb461196 [Trunk | Admin Tools Library]:
1. AdminToolsLibraryCheckDeployController.java: 
	a. In "hello()" method added @RequestMapping (except for existing ""), "/health_check".
	b. Added method "checkEverything()" (/health_chech/advanced) only accessible by PORTAL ADMINS which checks connection with db and prints properties.
2. PortalPage.java: Added default value "false" for position fields (top, bottom, left, right).
2021-04-22 09:09:16 +00: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 93efd1f7d3 [Trunk | Admin Tools Library]: AdminToolsLibraryCheckDeployController.java: [NEW] Controller added with @RequestMapping("/admin-tools-library") and
"hello()" method (@RequestMapping(value = "", method = RequestMethod.GET)) which just prints and returns a greeting message.
2021-03-24 10:26:35 +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 e98cf88a13 [Trunk | Admin Tools Library]:
1. GenericPortalController.java: Added Generic portal controller for handling all portals without type limitation.
2. SimpleErrorController.java: Added /error request mapping, to format all error that are not explicitly handled.
3. AdminToolsLibraryExceptionsHandler.java: Added methods 
	"notFoundException()" (ChangeSetPersister.NotFoundException), 
	"forbiddenException()" (ForbiddenException), 
	"duplicateKeyException()" (DuplicateKeyException).
4. ForbiddenException.java: [NEW] Added class ForbiddenException extends RuntimeException.
5. ExceptionResponse.java: Added field HttpStatus status.
6. SingleValueWrapperResponse.java: [Moved from Admin Tools Service to Admin Tools Library] 
	Generic class SingleValueWrapperResponse created, with field "value" of type defined when instance is created (used for returning single value from API methods).
2020-12-09 13:46:32 +00:00
Konstantina Galouni 613af8fc70 [Trunk | Admin tools Library]: PortalType.java: In enum PortalType add "aggregator". 2020-12-04 09:35:13 +00:00
Konstantina Galouni 4e770197e1 [Trunk | Admin tools Library]:
1. Portal.java & PortalResponse.java & PortalService.java: New field "piwik".
2. PortalType.java: Added "funder", "ri", "project", "organization" values in PortalType enum for monitor Stakeholder types.
2020-11-20 14:46:28 +00:00
Konstantina Galouni 2cf8fd5b8b [use-UoaAdminToolsLibrary | Admin Tools Library]: pom.xml & UoaAdminToolsApplication.java: Commit commented configuration for spring secutiry and "uoa-authorization-library". 2020-09-24 09:57:20 +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
Konstantina Galouni b12d839964 [Trunk | Admin Tools Library Service]: [Bug fix] PageService.java: Error (by accident) in name of "getPageByPortalTypeAndRoute()" method. 2020-04-03 20:35:19 +00:00
Konstantina Galouni 011628562d [Trunk | Admin Tools Library Service]:
1. DivHelpContentController.java: In "getDivHelpContents()" (/divhelpcontent) method rename parameter "div" to "divId" | Delete unnecessary method "addDivHelpContentsInPortal()".
2. PageHelpContentController.java: In "getPageHelpContents()" (/pagehelpconent) method add request parameter "portalType".
3. PortalController.java: Controller added for common methods of "ExploreController", "ConnectController" and "CommunityController" in "Admin Tools Service" - @RequestMapping with multiple paths.
4. DivIdDAO.java & MongoDBDivIdDAO.java: 
        a. Method "findByName()" returns List with new schema.
        b. Added methods: "List<DivId> findByPagesContainingAndPortalType()", "DivId findByPagesContainingAndNameAndPortalType()", "DivId findByNameAndPortalType()".
5. PortalDAO.java & MongoDBPortalDAO.java: Added method "findByType()".
6. Portal.java & PortalResponse.java: Removed "layout" field and its methods.
7. DivHelpContentService.java:
        a. In "getDivHelpContents()" (/divhelpcontent) method rename parameter "div" to "divId"
        b. public void addDivHelpContentsInPortal(String pid, String portalId, String divIdName) --> public void addDivHelpContentsInPortal(String portalId, String portalType)
8. DivIdService.java:
        a. [Bug fix] "getDivIds()", "getDivIdsFull()", "deleteDivIds()", "getDivIdsPages()"  methods
        b. Added method "getDivIdsByPortalType()"
        c. Commented "getDivIdByName()" method.
9. PageHelpContentService.java:
        a. In "getPageHelpContents()" method add parameter "portalType" and do bug fixes.
        b. public void addPageHelpContentsInPortal(String pid, String portalId) --> public void addPageHelpContentsInPortal(String portalId, String portalType).
10. PageService.java:
        a. [Bug fix] "getPagesFull()", "getAllPages()", "deletePageHelpContentsForPositionsIfDisabled()" methods.
        b. Added methods "getPagesByPortalType()" and "getPageByPortalTypeAndRoute()".
11. PortalService.java: 
        a. [Bug fix] "getPortalFull()".                   
        b. Method "deletePortal()" renamed to "deletePortalId()" and added NEW "deletePortal()" which deletes related page and div contents (and if no portal with the same type, also pages and divIds).
2020-04-03 20:32:32 +00:00
Konstantina Galouni 1872dbc4ab [Trunk - Admin tools library Service]: Commit r58031 was not completed.
DivIdService.java, PageService.java: In all controllers/services use methods only from services (except for entity's DAO).
2020-01-30 12:22:02 +00:00
Konstantina Galouni 9f65227b39 [Trunk - Admin tools library Service]: Rename Porrtal > "alias" to "type" and Page/ DivId > "dashboardAlias" to "portalType". 2020-01-30 09:37:32 +00:00
Konstantina Galouni 41bf82277f [Trunk - Admin tools library Service]:
1. Created services for all entities: PortalService.java, PageService.java, EntityService.java, DivIdService.java, PageHelpContentService.java, DivHelpContentService.java.
2. PortalController.java: Deleted from library. Each service will have its own portal controllers, that will use methods from PortalService.java.
3. In all controllers use methods only from services.
2020-01-29 23:53:07 +00:00
Konstantina Galouni cf47b7b4bf [Trunk | Admin tools library Service]: Rename "Community" to "Portal".
1. Entity "Community" renamed to "Portal" - Files renamed accordingly.
2. PageHelpContent.java & DivHelpContent.java & PageHelpContentResponse.java & DivHelpContentResponse.java: Rename "community" field to "portal".
3. PageHelpContentDAO.java & DivHelpContentDAO.java & MongoDBPageHelpContentDAO.java & MongoDBDivHelpContentDAO.java: Methods changed to use "portal" field instead of "community".
4. PageHelpContentController.java: In "getPageHelpContents()" method rename "community" parameter to "portal".
5. DivIdController.java: In "getDivIds()", "getDivIdsFull()", "getDivIdsPages()"  methods rename "communityId" or "community" parameter to "portal".
6. DivHelpContentController.java: In "getDivHelpContents()" method rename "community" parameter to "portal".
2020-01-27 14:48:00 +00:00
Konstantina Galouni 30e8d91991 [Trunk | Admin tools library service]:
1. Community.java: Add field "alias" (now it will be: openaire/explore (to be decided), connect, community, monitor) - it may be renamed again to: type.
2. Page.java & DivId.java & CommunityPage.java & DivIdResponse.java: Remove fields: "connect", "communities", "openaire" and add field: "dashboardAlias".
3. PageDAO.java & MongoDBPageDAO.java & DivIdDAO.java & MongoDBDivIdDAO.java: Methods use new field "dashboardAlias" instead of old fields: "connect", "communities", "openaire".
4. CommunityController.java & PageController.java & DivIdController.java & DivHelpContentController.java: Use methods for new field "dashboardAlias" instead of old fields: "connect", "communities", "openaire".
2020-01-23 16:48:43 +00:00
Konstantina Galouni caaa5921ca [Trunk | Admin tools library Service]: Initial commit of project - Common files & methods copied from admin tools service.
1. Entities: common entities are Community, Entity, Page, DivId, PageHelpContent, DivHelpContent (+ fullEntities), email: Email, EmailRecaptcha, GoogleResponse.
2. DAOs: DAOs for common entities are CommunityDAO, EntityDAO, PageDAO, DivIdDAO, PageHelpContentDAO, DivHelpContentDAO (+MongoDBDAOs).
3. Controllers: controllers for common entities are CommunityController, EntityController, PageController, DivIdController, PageHelpContentController, DivHelpContentController 
	(comment references to community specific entities e.g. Statistics, Subscribers, Layout).
4. Configuration: common configuration files are GoogleConfig, MailConfig.
5. For email: emailSender/EmailSender.java & handlers/InvalidReCaptchaException.java & recaptcha/VerifyRecaptcha.java.
6. Resources: log4j.properties.
2020-01-23 16:05:17 +00:00