Commit Graph

10 Commits

Author SHA1 Message Date
Konstantinos Triantafyllou 8a56c3ad8b Save category, subcategory, section refactor. 2024-03-27 14:07:41 +02:00
Konstantinos Triantafyllou 959d553ca4 [new-model]: Refactor all delete and change visibility methods. 2024-03-13 00:20:55 +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
Konstantina Galouni b7a4471385 [Trunk | Monitor Service]:
1. In all enums, add capitalized values too (maybe in the future, lowercased values will be removed - NOT NOW).
2. Visibility.java: New enumeration Visibility added with values: PUBLIC, RESTRICTED, PRIVATE (will replace isPublic and isActive fields).
3. Stakeholder.java: 
	a. Add field "isUpload" (default value: false) to define if "logoUrl" is a link, or a locally uploaded image.
	b. Remove fields "isActive" and "isPublic" and add field "visibility" (default value: Visibility.PRIVATE).
	c. Remove unused field "managers" (managers are defined from aai roles).
4. Topic.java & Category.java & SubCategory.java: 
	a. Remove fields "isActive" and "isPublic" and add field "visibility" (default value: Visibility.PRIVATE).
	b. Add fields "creationDate" and "updateDate".
5. Section.java: Add fields "creationDate" and "updateDate".
6. Indicator.java: 
	a. Rename enumeration "IndicatorWidth" to "IndicatorSize" (will be used for width and height).
	b. Add field "additionalDescription" (for default profiles, "description" can now be changed only by default profiles settings,
						while "additionalDescription" can also be changed by managers too).
	c. Add field "height" (default value:  IndicatorSize.MEDIUM).
	d. Remove fields "isActive" and "isPublic" and add field "visibility" (default value: Visibility.PRIVATE).
	e. Add fields "creationDate" and "updateDate".
2020-11-11 11:20:10 +00:00
Konstantina Galouni ff38145b25 [Trunk | Monitor Service]:
1. trunk/src/test/java/eu/dnetlib/uoamonitorservice: New folders for tests.
2. ExceptionsHandler.java: Replace "log.debug" with "log.error".
3. Stakeholder.java: Field 'description' and getter/ setter methods added.
4. Topic.java: Field 'icon' and getter/ setter methods added | In method "copyFromDefault()", set "isActive" and "isPublic" fields of new Topic same as the values from default Topic.
5. TopicController.java: In method "onUpdateDefaultTopic()", add update for icon.
6. Category.java & SubCategory.java & Indicator.java: 
	In method "copyFromDefault()", set "isActive" and "isPublic" fields of new Category/ SubCategory/ Indicator same as the values from default Category/ SubCategory/ Indicator.
7. IndicatorController.java: 
	a. [Bug fix] Add some null checks when updating number indicators.
	b. In method "parameterMapping()" comment replacement of "index_id", "index_name", "index_shortName" in indicatorPath.url (number indicators only).
2020-06-17 11:37:42 +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
Konstantina Galouni 6bed8383d5 1. Add IndicatorDAO.java & MongoDBIndicatorDAO.java.
2. StakeholderDAO.java & MongoDBStakeholderDAO.java: Add methods 'findById()' and  'delete()'.
3. Category.java & SubCategory.java & Topic.java: Add fields 'id' and 'isDefault' and getters/setters for 'isDefault'.
4. Indicator.java: Add field 'isDefault' and getters/setters.
5. IndicatorPath.java: Change 'image' to 'other' in IndicatorPathType enum.
6. StakeholderController.java: Add methods: 'deleteStakeholder()' (by id), 'deleteTopic()', 'deleteCategory()', 'deleteSubCategory()', 'reorderIndicators()'.
2019-11-19 13:05:43 +00:00
Konstantina Galouni 4adda29adc 1. Stakeholder.java: Create constructor and copy constructor & change getters-setters for 'isDeafult', 'isPublic' and 'isActive' fields.
2. Topic.java: Create constructor and copy constructor & change getters-setters for 'isPublic' and 'isActive' fields.
3. Category.java: Create constructor and copy constructor & change getters-setters for 'isOverview, 'isPublic' and 'isActive' fields & remove field 'description'.
4. SubCategory.java: Create constructor and copy constructor & change getters-setters for 'isPublic' and 'isActive' fields & remove field 'description' & 
		     make charts and numbers (List) generic (String or Indicator).
5. Indicator.java: Change getters-setters for 'indicatorPaths', 'isPublic' and 'isActive' fields & create method: public boolean hasType(String str), to check if "chart" or "number".
6. IndicatorPath.java: Add fields in schema (chartObject, parameters, filters) & add in enum IndicatorPathType types: pie, line, image.
7. MongoDBStakeholderDAO.java & StakeholderDAO.java: Add method: Stakeholder findByAlias(String Alias)
8. StakeholderController.java: 
	a. Add method: public Stakeholder setIndicatorsForStakeholder(Stakeholder stakeholder) to replace indicator ids with Indicator objects 
	(used by: getAllStakeholders, getAllDefaultStakeholders, getAllRealStakeholders, getStakeholder (by alias))
	b. Add method: public Stakeholder getStakeholder(@PathVariable("alias") String alias) - /stakeholder/{alias}
	c. Add method: public Stakeholder saveStakeholder(@RequestBody Stakeholder stakeholder) - /stakeholder/save
	d. Add method: public boolean deleteIndicator(...) - /{stakeholder}/{topic}/{category}/{subcategory}/indicator/{id}
	e. Add method: public Indicator saveIndicator(...) - /{stakeholder}/{topic}/{category}/{subcategory}/indicator/save (in body send Indicator object)
2019-11-11 16:38:36 +00:00
Konstantina Galouni 1ff5f13223 Initial commit for monitor-service. 2019-11-04 09:03:49 +00:00