uoa-monitor-service/src/main/java/eu/dnetlib/uoamonitorservice/entities/Indicator.java

95 lines
2.9 KiB
Java
Raw Normal View History

2019-11-04 10:03:49 +01:00
package eu.dnetlib.uoamonitorservice.entities;
import com.fasterxml.jackson.annotation.JsonProperty;
import eu.dnetlib.uoamonitorservice.generics.Common;
import eu.dnetlib.uoamonitorservice.primitives.IndicatorPath;
import eu.dnetlib.uoamonitorservice.primitives.IndicatorSize;
import eu.dnetlib.uoamonitorservice.primitives.IndicatorType;
import eu.dnetlib.uoamonitorservice.primitives.Visibility;
import org.springframework.data.annotation.CreatedDate;
2019-11-04 10:03:49 +01:00
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.LastModifiedDate;
2019-11-04 10:03:49 +01:00
import java.util.Date;
2019-11-04 10:03:49 +01:00
import java.util.List;
public class Indicator extends Common {
private String additionalDescription;
2019-11-04 10:03:49 +01:00
private IndicatorType type; //number,chart
private IndicatorSize width; //small,medium,large
private IndicatorSize height = IndicatorSize.MEDIUM; //small,medium,large
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 16:04:25 +01:00
private List<String> tags; // this field is not used anywhere now
2019-11-04 10:03:49 +01:00
private List<IndicatorPath> indicatorPaths;
public void copyFromDefault(Indicator defaultIndicator, Visibility visibility) {
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 16:04:25 +01:00
setName(defaultIndicator.getName());
setDescription(defaultIndicator.getDescription());
setAdditionalDescription(defaultIndicator.getAdditionalDescription());
setType(defaultIndicator.getType());
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 16:04:25 +01:00
setWidth(defaultIndicator.getWidth());
setHeight(defaultIndicator.getHeight());
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 16:04:25 +01:00
setTags(defaultIndicator.getTags());
setVisibility(visibility);
setCreationDate(defaultIndicator.getCreationDate());
setUpdateDate(defaultIndicator.getUpdateDate());
setDefaultId(defaultIndicator.getId());
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 16:04:25 +01:00
setIndicatorPaths(defaultIndicator.getIndicatorPaths());
}
public String getAdditionalDescription() {
return additionalDescription;
}
public void setAdditionalDescription(String description) {
this.additionalDescription = description;
}
public String getType() {
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 16:04:25 +01:00
if(type == null) {
return null;
}
return type.name();
2019-11-04 10:03:49 +01:00
}
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 16:04:25 +01:00
public void setType(String type) {
if(type == null) {
this.type = null;
} else {
IndicatorType indicatorType = IndicatorType.valueOf(type);
this.type = indicatorType;
}
2019-11-04 10:03:49 +01:00
}
public IndicatorSize getWidth() {
2019-11-04 10:03:49 +01:00
return width;
}
public void setWidth(IndicatorSize width) {
2019-11-04 10:03:49 +01:00
this.width = width;
}
public IndicatorSize getHeight() {
return height;
}
public void setHeight(IndicatorSize height) {
this.height = height;
}
2019-11-04 10:03:49 +01:00
public List<String> getTags() {
return tags;
}
public void setTags(List<String> tags) {
this.tags = tags;
}
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 17:38:36 +01:00
public List<IndicatorPath> getIndicatorPaths() {
2019-11-04 10:03:49 +01:00
return indicatorPaths;
}
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 17:38:36 +01:00
public void setIndicatorPaths(List<IndicatorPath> indicatorPaths) {
this.indicatorPaths = indicatorPaths;
}
2019-11-04 10:03:49 +01:00
}