2019-11-22 16:50:59 +01:00
package eu.dnetlib.uoamonitorservice.controllers ;
2024-03-14 18:01:28 +01:00
import eu.dnetlib.uoamonitorservice.dto.SubCategoryFull ;
import eu.dnetlib.uoamonitorservice.entities.Category ;
import eu.dnetlib.uoamonitorservice.entities.Stakeholder ;
import eu.dnetlib.uoamonitorservice.entities.SubCategory ;
import eu.dnetlib.uoamonitorservice.entities.Topic ;
2024-03-08 19:55:51 +01:00
import eu.dnetlib.uoamonitorservice.primitives.Visibility ;
2024-03-14 18:01:28 +01:00
import eu.dnetlib.uoamonitorservice.service.CategoryService ;
import eu.dnetlib.uoamonitorservice.service.StakeholderService ;
import eu.dnetlib.uoamonitorservice.service.SubCategoryService ;
import eu.dnetlib.uoamonitorservice.service.TopicService ;
2022-10-10 14:27:17 +02:00
import org.apache.logging.log4j.LogManager ;
import org.apache.logging.log4j.Logger ;
2019-11-22 16:50:59 +01:00
import org.springframework.beans.factory.annotation.Autowired ;
2020-11-11 13:45:59 +01:00
import org.springframework.security.access.prepost.PreAuthorize ;
2019-11-22 16:50:59 +01:00
import org.springframework.web.bind.annotation.* ;
@RestController
@CrossOrigin ( origins = " * " )
public class SubCategoryController {
2022-10-10 14:27:17 +02:00
private final Logger log = LogManager . getLogger ( this . getClass ( ) ) ;
2019-11-22 16:50:59 +01:00
2024-03-14 18:01:28 +01:00
private final StakeholderService stakeholderService ;
private final TopicService topicService ;
private final CategoryService categoryService ;
private final SubCategoryService subCategoryService ;
2019-11-22 16:50:59 +01:00
@Autowired
2024-03-14 18:01:28 +01:00
public SubCategoryController ( StakeholderService stakeholderService , TopicService topicService , CategoryService categoryService , SubCategoryService subCategoryService ) {
this . stakeholderService = stakeholderService ;
this . topicService = topicService ;
this . categoryService = categoryService ;
this . subCategoryService = subCategoryService ;
2019-11-22 16:50:59 +01:00
}
2024-03-14 18:01:28 +01:00
/ * @PreAuthorize ( " isAuthenticated() " )
2019-11-22 16:50:59 +01:00
@RequestMapping ( value = " /{stakeholderId}/{topicId}/{categoryId}/save " , method = RequestMethod . POST )
2020-01-10 11:48:24 +01:00
public SubCategory < Section < Indicator > > saveSubCategory ( @PathVariable ( " stakeholderId " ) String stakeholderId ,
@PathVariable ( " topicId " ) String topicId ,
@PathVariable ( " categoryId " ) String categoryId ,
@RequestBody SubCategory < Section < Indicator > > subcategoryFull ) {
2019-11-22 16:50:59 +01:00
log . debug ( " save subcategory " ) ;
2019-12-19 16:04:25 +01:00
log . debug ( " Alias: " + subcategoryFull . getAlias ( ) + " - Id: " + subcategoryFull . getId ( ) + " - Stakeholder: " + stakeholderId + " - Topic: " + topicId + " - Category: " + categoryId ) ;
2019-11-22 16:50:59 +01:00
2020-01-10 11:48:24 +01:00
Category category = checkForExceptions ( stakeholderId , topicId , categoryId ) ;
2020-05-18 11:17:05 +02:00
2020-11-11 13:45:59 +01:00
SubCategory < String > subCategory = new SubCategory < > ( subcategoryFull ) ;
Date date = new Date ( ) ;
subCategory . setUpdateDate ( date ) ;
subcategoryFull . setUpdateDate ( date ) ;
[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 15:24:27 +01:00
List < String > chartSections = new ArrayList < > ( ) ;
List < String > numberSections = new ArrayList < > ( ) ;
2020-05-18 11:17:05 +02:00
SubCategory < String > oldSubcategory = null ;
if ( subcategoryFull . getId ( ) ! = null ) {
oldSubcategory = subCategoryDAO . findById ( subcategoryFull . getId ( ) ) ;
[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 15:24:27 +01:00
if ( oldSubcategory = = null ) {
// EXCEPTION - SubCategory not found
throw new EntityNotFoundException ( " save subcategory: SubCategory with id: " + subcategoryFull . getId ( ) + " not found " ) ;
}
for ( String chartSectionId : oldSubcategory . getCharts ( ) ) {
Section section = sectionDAO . findById ( chartSectionId ) ;
if ( section = = null ) {
// EXCEPTION - Section not found
throw new EntityNotFoundException ( " Save subcategory: Chart section with id: " + chartSectionId + " not found (section exists in subcategory: " + subCategory . getId ( ) + " ) " ) ;
}
chartSections . add ( section . getId ( ) ) ;
}
for ( String numberSectionId : oldSubcategory . getNumbers ( ) ) {
Section section = sectionDAO . findById ( numberSectionId ) ;
if ( section = = null ) {
// EXCEPTION - Section not found
throw new EntityNotFoundException ( " Save subcategory: Number section with id: " + numberSectionId + " not found (section exists in subcategory: " + subCategory . getId ( ) + " ) " ) ;
}
numberSections . add ( section . getId ( ) ) ;
}
2020-11-11 13:45:59 +01:00
} else { // subcategory does not exist in DB
subCategory . setCreationDate ( date ) ;
subcategoryFull . setCreationDate ( date ) ;
[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 15:24:27 +01:00
for ( Section chartSection : subcategoryFull . getCharts ( ) ) {
chartSections . add ( chartSection . getId ( ) ) ;
}
for ( Section numberSection : subcategoryFull . getNumbers ( ) ) {
numberSections . add ( numberSection . getId ( ) ) ;
}
2020-05-18 11:17:05 +02:00
}
[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 15:24:27 +01:00
subCategory . setCharts ( chartSections ) ;
2020-01-10 11:48:24 +01:00
subCategory . setNumbers ( numberSections ) ;
2024-03-08 19:55:51 +01:00
Stakeholder stakeholder = stakeholderDAO . findById ( stakeholderId ) ;
2020-01-10 11:48:24 +01:00
if ( stakeholder . getDefaultId ( ) = = null ) {
if ( subcategoryFull . getId ( ) = = null ) {
2020-11-11 13:45:59 +01:00
subCategoryDAO . save ( subCategory ) ;
2020-01-10 11:48:24 +01:00
onSaveDefaultSubCategory ( subCategory , categoryId ) ;
2019-11-22 16:50:59 +01:00
} else {
2020-05-18 11:17:05 +02:00
onUpdateDefaultSubCategory ( subCategory , oldSubcategory ) ;
2020-11-11 13:45:59 +01:00
subCategoryDAO . save ( subCategory ) ;
2019-11-22 16:50:59 +01:00
}
2020-11-11 13:45:59 +01:00
} else {
subCategoryDAO . save ( subCategory ) ;
2019-11-22 16:50:59 +01:00
}
2020-01-10 11:48:24 +01:00
List < String > subcategories = category . getSubCategories ( ) ;
int index = subcategories . indexOf ( subCategory . getId ( ) ) ;
if ( index = = - 1 ) {
subcategories . add ( subCategory . getId ( ) ) ;
categoryDAO . save ( category ) ;
log . debug ( " Subcategory saved! " ) ;
subcategoryFull . setId ( subCategory . getId ( ) ) ;
}
2019-11-22 16:50:59 +01:00
return subcategoryFull ;
}
2019-12-19 16:04:25 +01:00
public void onSaveDefaultSubCategory ( SubCategory subCategory , String categoryId ) {
log . debug ( " On save default subCategory " ) ;
List < Category > categories = categoryDAO . findByDefaultId ( categoryId ) ;
for ( Category category : categories ) {
SubCategory subCategoryNew = new SubCategory ( ) ;
subCategoryNew . copyFromDefault ( subCategory ) ;
subCategoryDAO . save ( subCategoryNew ) ;
List < String > subCategories = category . getSubCategories ( ) ;
subCategories . add ( subCategoryNew . getId ( ) ) ;
categoryDAO . save ( category ) ;
}
}
2020-05-18 11:17:05 +02:00
public void onUpdateDefaultSubCategory ( SubCategory subCategory , SubCategory oldSubcategory ) {
2019-12-19 16:04:25 +01:00
log . debug ( " On update default subCategory " ) ;
List < SubCategory > subCategories = subCategoryDAO . findByDefaultId ( subCategory . getId ( ) ) ;
boolean changed = false ;
for ( SubCategory subCategoryBasedOnDefault : subCategories ) {
2020-05-18 11:17:05 +02:00
if ( subCategory . getName ( ) ! = null & & ! subCategory . getName ( ) . equals ( subCategoryBasedOnDefault . getName ( ) )
& & ( oldSubcategory . getName ( ) = = null | | oldSubcategory . getName ( ) . equals ( subCategoryBasedOnDefault . getName ( ) ) ) ) {
subCategoryBasedOnDefault . setName ( subCategory . getName ( ) ) ;
2020-09-28 13:59:00 +02:00
subCategoryBasedOnDefault . setAlias ( subCategory . getAlias ( ) ) ;
2019-12-19 16:04:25 +01:00
changed = true ;
}
2020-05-18 11:17:05 +02:00
if ( subCategory . getDescription ( ) ! = null & & ! subCategory . getDescription ( ) . equals ( subCategoryBasedOnDefault . getDescription ( ) )
& & ( oldSubcategory . getDescription ( ) = = null | | oldSubcategory . getDescription ( ) . equals ( subCategoryBasedOnDefault . getDescription ( ) ) ) ) {
subCategoryBasedOnDefault . setDescription ( subCategory . getDescription ( ) ) ;
2019-12-19 16:04:25 +01:00
changed = true ;
}
if ( ! changed ) {
2020-05-18 11:17:05 +02:00
continue ;
2019-12-19 16:04:25 +01:00
}
2020-11-11 13:45:59 +01:00
subCategoryBasedOnDefault . setUpdateDate ( subCategory . getUpdateDate ( ) ) ;
2019-12-19 16:04:25 +01:00
subCategoryDAO . save ( subCategoryBasedOnDefault ) ;
}
2024-03-14 18:01:28 +01:00
} * /
2019-12-19 16:04:25 +01:00
2020-11-11 13:45:59 +01:00
@PreAuthorize ( " isAuthenticated() " )
2019-11-22 16:50:59 +01:00
@RequestMapping ( value = " /{stakeholderId}/{topicId}/{categoryId}/{subcategoryId}/delete " , method = RequestMethod . DELETE )
public boolean deleteSubCategory ( @PathVariable ( " stakeholderId " ) String stakeholderId ,
@PathVariable ( " topicId " ) String topicId ,
@PathVariable ( " categoryId " ) String categoryId ,
2020-06-22 21:58:40 +02:00
@PathVariable ( " subcategoryId " ) String subcategoryId ,
@RequestParam ( required = false ) String children ) {
2019-11-22 16:50:59 +01:00
log . debug ( " delete subcategory " ) ;
2024-03-14 18:01:28 +01:00
log . debug ( " Id: " + subcategoryId + " - Stakeholder: " + stakeholderId + " - Topic: " + topicId + " - Category: " + categoryId ) ;
Stakeholder stakeholder = this . stakeholderService . findById ( stakeholderId ) ;
Topic topic = this . topicService . findByPath ( stakeholder , topicId ) ;
Category category = this . categoryService . findByPath ( topic , categoryId ) ;
SubCategory subCategory = this . subCategoryService . findByPath ( category , subcategoryId ) ;
this . subCategoryService . delete ( stakeholder . getType ( ) , subCategory , true ) ;
2020-06-22 21:58:40 +02:00
return true ;
}
2024-03-14 18:01:28 +01:00
/ * @PreAuthorize ( " isAuthenticated() " )
2020-06-25 11:55:46 +02:00
@RequestMapping ( value = " /{stakeholderId}/{topicId}/{categoryId}/reorder " , method = RequestMethod . POST )
public List < SubCategory > reorderSubCategories ( @PathVariable ( " stakeholderId " ) String stakeholderId ,
@PathVariable ( " topicId " ) String topicId ,
@PathVariable ( " categoryId " ) String categoryId ,
@RequestBody List < String > subCategories ) {
log . debug ( " reorder subCategories " ) ;
log . debug ( " Stakeholder: " + stakeholderId + " - Topic: " + topicId + " - Category: " + categoryId ) ;
Category < String > category = checkForExceptions ( stakeholderId , topicId , categoryId ) ;
[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 15:24:27 +01:00
List < String > oldSubcategories = category . getSubCategories ( ) ;
for ( String subcategoryId : oldSubcategories ) {
if ( ! subCategories . contains ( subcategoryId ) ) {
subCategories . add ( subcategoryId ) ;
}
}
2020-06-25 11:55:46 +02:00
category . setSubCategories ( subCategories ) ;
List < SubCategory > subCategoriesFull = new ArrayList < > ( ) ;
for ( String subCategoryId : subCategories ) {
[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 15:24:27 +01:00
SubCategory subCategory = subCategoryDAO . findById ( subCategoryId ) ;
if ( subCategory = = null ) {
// EXCEPTION - SubCategory not found
throw new EntityNotFoundException ( " Reorder subCategories: subCategory with id: " + subCategoryId + " not found " ) ;
}
subCategoriesFull . add ( subCategory ) ;
2020-06-25 11:55:46 +02:00
}
[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 15:24:27 +01:00
categoryDAO . save ( category ) ;
log . debug ( " SubCategories reordered! " ) ;
2020-06-25 11:55:46 +02:00
return subCategoriesFull ;
2024-03-14 18:01:28 +01:00
} * /
2020-06-25 11:55:46 +02:00
2020-11-11 13:45:59 +01:00
@PreAuthorize ( " isAuthenticated() " )
@RequestMapping ( value = " /{stakeholderId}/{topicId}/{categoryId}/{subcategoryId}/change-visibility " , method = RequestMethod . POST )
2024-03-14 18:01:28 +01:00
public SubCategoryFull changeSubCategoryVisibility ( @PathVariable ( " stakeholderId " ) String stakeholderId ,
@PathVariable ( " topicId " ) String topicId ,
@PathVariable ( " categoryId " ) String categoryId ,
@PathVariable ( " subcategoryId " ) String subcategoryId ,
@RequestParam ( " visibility " ) Visibility visibility ,
@RequestParam ( defaultValue = " false " ) Boolean propagate ) {
log . debug ( " change subCategory visibility: " + visibility + " - toggle propagate: " + propagate ) ;
log . debug ( " Stakeholder: " + stakeholderId + " - Topic: " + topicId + " - Category: " + categoryId + " - SubCategory: " + subcategoryId ) ;
Stakeholder stakeholder = this . stakeholderService . findById ( stakeholderId ) ;
Topic topic = this . topicService . findByPath ( stakeholder , topicId ) ;
Category category = this . categoryService . findByPath ( topic , categoryId ) ;
SubCategory subCategory = this . subCategoryService . findByPath ( category , subcategoryId ) ;
return this . subCategoryService . changeVisibility ( stakeholder . getType ( ) , stakeholder . getAlias ( ) , subCategory , visibility , propagate ) ;
2020-06-22 21:58:40 +02:00
}
2019-11-22 16:50:59 +01:00
}