Commit Graph

72 Commits

Author SHA1 Message Date
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
Konstantina Galouni d9b327a845 Creating "trunk" and "branches" folders. 2020-01-21 14:18:39 +00:00