Commit Graph

17 Commits

Author SHA1 Message Date
Konstantinos Triantafyllou cf505bd214 Fix delete and change visibility methods for all entities. 2024-03-14 19:01:28 +02:00
Konstantinos Triantafyllou e345f5b689 [new-model | WIP]: Refactoring the code in order to improve performance and code. 2024-03-08 20:55:51 +02:00
Konstantinos Triantafyllou 8918826766 Remove comments. Add getAliases method in stakeholderService. Remove parametersMapping 2024-03-05 18:51:14 +02:00
Konstantinos Triantafyllou 7b4f0a9eec Fix role utils methods 2023-07-04 16:02:34 +03:00
Konstantina Galouni adf8cb5e70 pom.xml: Updated parent and versions of libraries | Moved to log4j2 & set spring log file as default | Added swagger 2022-10-10 15:27:17 +03:00
Konstantina Galouni 82a8f8ad56 [Trunk | Monitor Service]: StakeholderController.java & TopicController.java & CategoryController.java & SubCategoryController.java & SectionController.java & IndicatorController.java: Updated /change-visibility methods and added @RequestParam(required = false) Boolean propagate, to allow changing visibility of all contents of the updated entity too & updated return type to return the entity instead its visibility & added everywhere method "changeVisibilityTree()". 2022-09-14 18:02:47 +03:00
Konstantina Galouni a284d8449a [Trunk | Monitor Service]:
1. RolesUtils.java: Comment all contents of this file (should be removed in next commit). This file is added in uoa-admin-tools-library.
2. StakeholderController.java & TopicController.java & CategoryController.java & SubCategoryController.java & SectionController.java & IndicatorController.java: Import RolesUtils from uoa-admin-tools-library.
3. StakeholderController.java: In "getAllRealStakeholders()" method, add optional parameter "defaultId", to get Stakeholders based on a default profile.
2021-02-24 19:22:19 +00:00
Konstantina Galouni 38a5a09d8a [Trunk | Monitor Service]:
1. StakeholderController.java & TopicController.java & CategoryController.java & SubCategoryController.java && SectionController.java && IndicatorController.java:
	a. Comment logs for get requests.
	b. Use "ForbiddenException" instead of "AccessDeniedException"
	c. On /save, if full entity has id (already in DB), if not found in DB throw EntityNotFoundException.
	d. Get children (e.g. when saving a Topic, get its categories) from DB.
2. TopicController.java & CategoryController.java & SubCategoryController.java & SectionController.java:
	In /reorder, if there are in DB, ids that are missing from reordered list, do reordering and add in the end of list the missing ids.
3. ReorderEvent.java: [NEW] Added class ReorderEvent with fields "action" (String), "target" (String), "ids" (List<String>) (used in IndicatorController.java).
4. IndicatorController.java: 
	a. In /reorder, @RequestBody changed from List<String> indicators to  ReorderEvent reorderEvent.
	b. If there are in DB, ids that are missing from reordered list AND missing id is not moved to other section (action = removed and target = missing id), do reordering and add in the end of list the missing ids.
5. ExceptionsHandler.java: exception handler methods "invalidInput()", "nullPointerException()", "notFoundException()" moved to "Admin Tools Library" - "accessDeniedException()" is removed.
6. responses/ExceptionResponse.java: File and folder deleted (moved to "Admin Tools Library").
7. RolesUtils.java: Added method "isLoggedIn()" (checks if no roles for user, or user has role "ROLE_ANONYMOUS").
2020-12-09 14:24:27 +00:00
Konstantina Galouni 1a784f29bd [Trunk | Monitor Service]:
1. RolesUtils.java: New class connected to "AuthorizationService" and returns helper methods for roles and authorities.
2. StakeholderController.java & TopicController.java & CategoryController.java & SubCategoryController.java & SectionController.java & IndicatorController.java:
	a. Add authorization checks according to user roles (authorization library).
	b. Handle new fields "createDate" and "updateDate" (StakeholderController.java already had these fields).
	c. [Bug fix] On save method, if it is default entity, add it before "onSaveDefault...()" or after "onUpdateDefault...()".
	d. (not in SectionController) Comment methods for toggling status and access and add method for changing visibility.
		e.g. "changeIndicatorVisibility()" (/{stakeholderId}/{topicId}/{categoryId}/{subcategoryId}/{sectionId}/{indicatorId}/change-visibility).
3. StakeholderController.java: Method "getAllRealStakeholders()" (/stakeholder) returns now basic Stakeholder info (topicIds, not full entities).
4. IndicatorController.java:
	a. [Bug fix] On "onUpdateDefaultIndicator()", "changed" is set to false for each indicatorBasedOnDefault.
	b. On "onUpdateDefaultIndicator()" handle update policy for "description" and "additionalDescription".
	c. [Bug fix] On "onUpdateDefaultIndicator()", bug fixes when updating "jsonPath".
2020-11-11 12:45:59 +00:00
Konstantina Galouni 30a58da9b1 [Trunk | Monitor Service]:
CategoryController.java & SubCategoryController.java & TopicController.java: In "onUpdateDefaultTopic()" method, when "name" is changed, update also "alias" according to default profile.
2020-09-28 11:59:00 +00:00
Konstantina Galouni 78913b0140 [Trunk | Monitor Service]:
1. TopicController.java & CategoryController.java & SubCategoryController.java: New methods for reorder added.
2. CategoryController.java: Method "checkForExceptions()" added.
3. IndicatorController.java: [Bug Fix] When updating a default indicator and all indicators based on that are updated too, set description field when needed (not name again).
2020-06-25 09:55:46 +00:00
Konstantina Galouni 0f929b581d [Trunk | Monitor Service]:
1. Adding parameter in delete methods to delete or disconnect all profiles based on the default one that is being deleted (not for stakeholder).
	2. In delete methods remove iterations (for deleting inner elements) and call "deleteTree()" method.
2020-06-22 19:58:40 +00:00
Konstantina Galouni 67cf2d9812 [Trunk | Monitor Service]:
1. Stakeholder.java: Field 'name' added.
2. Section.java: In method 'copyFromDefault()' initialize indicators (empty list).
3. StakeholderDAO.java & MongoDBStakeholderDAO.java: Added method 'Stakeholder findByTopicsContaining(String topic);' (needed to find in which Stakeholder a Topic belongs - section needs stakeholderAlias).
4. TopicDAO.java & MongoDBTopicDAO.java: Added method 'Topic findByCategoriesContaining(String category);' (needed to find in which Topic a Category belongs - section needs stakeholderAlias).
5. CategoryDAO.java & MongoDBCategoryDAO.java: Added method 'Category findBySubCategoriesContaining(String subCategory);' (needed to find in which Category a SubCategory belongs - section needs stakeholderAlias).
6. TopicController.java & CategoryController.java & SubCategoryController.java & SectionController.java & IndicatorController.java:
	Bug fixes & changed logic for updates on default profile: When a value in a profile is same as the value in default, inherit changes in default value, otherwise keep local profile's options.
2020-05-18 09:17:05 +00:00
Konstantina Galouni 6565055c6a [Trunk | Monitor Service]:
1. Section entity level added. Hierarchy changed from: Stakeholder > Topic > Category > SubCategory > Indicator to: Stakeholder > Topic > Category > SubCategory > Section > Indicator.
2. Section.java & SectionDAO.java & MongoDBSectionDAO.java & SectionController.java: New entity 'Section', DAOs for Section, Controller for section added.
3. In all controllers fix hierarchy of model to include Section.
4. SubCategoryController.java & IndicatorController.java: Helper method 'checkForExceptions()' added (instead of checking in every method separately).
2020-01-10 10:48:24 +00:00
Konstantina Galouni acda0c638e StakeholderController.java & TopicController.java & CategoryController.java & SubCategoryController.java: toggle methods for status and access added. 2019-12-23 11:45:07 +00:00
Konstantina Galouni 0ee5ff1e0e 1. pom.xml: Add dependency for "uoa-help-texts-library" (will be renamed).
2. UoaMonitorServiceApplication.java: Add @PropertySource path used in dl170.
3. MongoConnection.java: @EnableMongoRepositories not only from: eu.dnetlib.uoamonitorservice.dao, but also: eu.dnetlib.uoahelptexts.dao.
4. GoogleConfig.java & MailConfig.java: [Deleted]: Functionality available on library project.
5. EmailController.java: [New]: Used for contact-us page in portal.
6. ExceptionsHandler.java & /controllers/: Add more and detailed logs.
7. Stakeholder.java:
        a. Field 'logoUrl' added.
        b. Method 'getType()' returns type.name() and 'setType()' gets String and converts it into StakeholderType.
8. Topic.java & Category.java & SubCategory.java & Indicator.java: 
	a. Field 'boolean isDefault' changed to 'String defaultId'.
	b. Method copyFromDefault() added to create a clone from default entity (topic, category, subcategory, indicator).
9. Category.java & SubCategory.java: Field 'String description' added.
10. SubCategory.java: Field 'String stakeholderId' added | method createOverviewSubCategory(Category) added.
11. Indicator.java & IndicatorPath.java: Method 'getType()' returns type.name() and 'setType()' gets String and converts it into IndicatorType / IndicatorPathType.
12. IndicatorPath.java: Constructor and copy constructor added.
13. StakeholderDAO.java & MongoDBStakeholderDAO.java: 
	a. Method findByIsDefaultProfile() changed to: findByDefaultId() & findByDefaultIdNot().
	b. Method findByIsDefaultProfileAndType() changed to: findByDefaultIdAndType() & findByDefaultIdNotAndType().
14. SubCategoryDAO.java & MongoDBSubCategoryDAO.java & IndicatorDAO.java & MongoDBSubCategoryDAO.java: Method 'findByDefaultId()' added.
15. StakeholderController.java: Handle creationDate and updateDate | Add more exceptional cases.
16. TopicController.java:
        a. Helper method 'onSaveDefaultTopic()' added (save cloned topic on stakeholders based on this default Stakeholder).
        b. Helper method 'onUpdateDefaultTopic()' added (update cloned topics based on this default topic).
17. CategoryController.java:
        a. Remove 'subCategory.setIsDefault(true);' when a category is created.
        b. Helper method 'onSaveDefaultCategory()' added (save cloned category on topics based on this default Topic).
        c. Helper method 'onUpdateDefaultCategory()' added (update cloned categories based on this default category).
18. SubCategoryController.java:
        a. Helper method 'onSaveDefaultSubCategory()' added (save cloned subCategory on topics based on this default Category).
        b. Helper method 'onUpdateDefaultSubCategory()' added (update cloned subCategories based on this default subCategory).
19. IndicatorController.java:
        a. Helper method 'onSaveDefaultIndicator()' added (save cloned indicator on subCategories based on this default SubCategory).
        b. Helper method 'onUpdateDefaultIndicator()' added (update cloned indicators based on this default indicator).
        c. Helper method 'parameterMapping()' added to map correct parameter values on parameters depending on stakeholder info.
        d. Method 'toggleIndicatorStatus()' added to toggle 'isActive' field.
        e. Method 'toggleIndicatorAccess()' added to toggle 'isPublic' field.
        f. Helper method 'toggleIndicator()' added to update indicator when a field is toggled.
2019-12-19 15:04:25 +00:00
Konstantina Galouni 26f7388680 1. Schema changes: Move each entity on its own collection - each entity keeps ids for its sub-entities.
2. New controllers for each entity: TopicController.java, CategoryController.java, SubCategoryController.java, IndicatorController.java.
3. New DAOs for each entity: TopicDAO.java, MongoDBTopicDAO.java, CategoryDAO.java, MongoDBCategoryDAO.java, SubCategoryDAO.java, MongoDBSubCategoryDAO.java.
4. New custom Exceptions: EntityNotFoundException.java, PathNotValidException.java.
5. ExceptionsHandler.java: Handle new EntityNotFoundException (id not in db) and PathNotValidException (id exists in db but not in path given).
2019-11-22 15:50:59 +00:00