@Service @Transactional public class TopicHierarchyManagement extends Object
Constructor and Description |
---|
TopicHierarchyManagement() |
Modifier and Type | Method and Description |
---|---|
boolean |
addChildTopic(Long parentTopicId,
Long childTopicId)
Add a topic as child to another topic.
|
void |
removeAllConnections(Long topicId)
Removes all child and parent connections for the given topic.
|
boolean |
removeChildTopic(Long parentTopicId,
Long childTopicId)
Remove a child topic from its parent
|
void |
updateTopicStructure(Long topicId,
TopicStructureTO structureChange)
Update the topic structure for a given topic
|
public boolean addChildTopic(Long parentTopicId, Long childTopicId) throws BlogNotFoundException, BlogAccessException, ToplevelTopicCannotBeChildException
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 removeAllConnections(Long topicId) throws BlogAccessException
topicId
- The topic to remove all connections for.BlogAccessException
- in case the current user is not manager of the topic to be removed from its topic
structurepublic boolean removeChildTopic(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 structureChange) throws BlogNotFoundException, AuthorizationException, ToplevelTopicCannotBeChildException, ToplevelTopicIsAlreadyChildBlogManagementException
topicId
- the ID of the topicstructureChange
- 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.