@Service public class TopicHierarchyService extends Object
Constructor and Description |
---|
TopicHierarchyService() |
Modifier and Type | Method and Description |
---|---|
void |
addTopic(Long parentTopicId,
Long childTopicId)
Method to add a topic as child to another topic.
|
void |
removeTopic(Long parentTopicId,
Long childTopicId)
Method to remove a topic as child from another topic.
|
void |
updateTopicStructure(Long topicId,
TopicStructureTO structureChangeTO)
Update the topic structure for a given topic
|
public void addTopic(Long parentTopicId, Long childTopicId) throws BlogNotFoundException, BlogAccessException, ToplevelTopicCannotBeChildException, ParentIsAlreadyChildDataIntegrityViolationException
parentTopicId
- Id of the parent topic.childTopicId
- Id of the child topic.BlogAccessException
- in case the current user is not manager of the parent topic or has no read access
to the child topicBlogNotFoundException
- in case the parent and/or child topic do not existToplevelTopicCannotBeChildException
- in case the child topic is a top-level topicParentIsAlreadyChildDataIntegrityViolationException
- in case the parent would be added as its own childpublic void removeTopic(Long parentTopicId, Long childTopicId) throws BlogAccessException
parentTopicId
- Id of the parent topic.childTopicId
- Id of the child topic.BlogAccessException
- in case the current user is not manager of the parent topic or has no read access
to the child topicpublic void updateTopicStructure(Long topicId, TopicStructureTO structureChangeTO) throws BlogNotFoundException, AuthorizationException, ToplevelTopicCannotBeChildException, ToplevelTopicIsAlreadyChildBlogManagementException
topicId
- the ID of the topicstructureChangeTO
- TO describing the changes to conductBlogNotFoundException
- in case the topic or one of the child topics to add or remove do not existAuthorizationException
- in case the the current user is not authorized change the top-level state or add
or remove child topicsToplevelTopicCannotBeChildException
- in case one of the child topics to add is a top-level topicToplevelTopicIsAlreadyChildBlogManagementException
- in case the topic should be made a top level topic but is already a child of
another topicParentIsAlreadyChildDataIntegrityViolationException
- in case the parent would be added as its own childCopyright © 2019 Communote team. All rights reserved.