@Service(value="noteManagement") public class NoteManagementImpl extends NoteManagementBase
NoteManagementCONSTANT_MENTION_DISCUSSION_PARTICIPANTS, CONSTANT_MENTION_TOPIC_AUTHORS, CONSTANT_MENTION_TOPIC_MANAGERS, CONSTANT_MENTION_TOPIC_READERS, USER_NOTE_PROPERTY_KEY_LIKE| Constructor and Description |
|---|
NoteManagementImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
correctTopicOfComment(Long noteId)
Corrects the topic of a comment note if it does not equal the topic of the discussion root
note.
|
AutosaveNoteData |
getAutosave(Long noteId,
Long parentNoteId,
Collection<StringPropertyTO> properties,
Locale locale)
Return an autosave of the current user.
|
<T> T |
getNote(Long noteId,
Converter<Note,T> converter)
Method to get a specific note.
|
NoteData |
getNote(long noteId,
NoteRenderContext renderContext) |
long |
getNoteCount()
Returns the number of notes created within the current client.
|
protected NoteModificationResult |
handleCreateNote(NoteStoringTO noteStoringTO,
Set<String> additionalBlogIds)
Performs the core logic for
NoteManagementBase.createNote(NoteStoringTO, Set) |
protected void |
handleDeleteAutosave(Long postId)
Performs the core logic for
NoteManagementBase.deleteAutosave(Long) |
protected void |
handleDeleteNote(Long postId,
boolean deleteSystemPosts,
boolean clientManagerCanDelete)
Performs the core logic for
NoteManagementBase.deleteNote(Long, boolean, boolean) |
protected Set<Long> |
handleDeleteNotesOfUser(Long userId)
Performs the core logic for
NoteManagementBase.deleteNotesOfUser(Long) |
protected List<SimpleNoteListItem> |
handleGetCommentsOfDiscussion(Long noteId)
Performs the core logic for
NoteManagementBase.getCommentsOfDiscussion(Long) |
protected Long |
handleGetDiscussionId(Long noteId)
Implementation of
NoteManagementBase.getDiscussionId(Long) |
protected DiscussionNoteData |
handleGetNoteWithComments(Long noteId,
QueryResultConverter<SimpleNoteListItem,DiscussionNoteData> converter)
Performs the core logic for
NoteManagementBase.getNoteWithComments(Long, QueryResultConverter) |
protected int |
handleGetNumberOfNotesInDiscussion(Long noteId)
Performs the core logic for
NoteManagementBase.getNumberOfNotesInDiscussion(Long) |
protected int |
handleGetNumberOfReplies(Long noteId)
Performs the core logic for
NoteManagementBase.getNumberOfReplies(Long) |
protected NoteModificationResult |
handleUpdateNote(NoteStoringTO noteStoringTO,
Long noteId,
Set<String> additionalBlogIds) |
void |
moveToTopic(Long discussionId,
Long topicId)
Method to move a given discussion to another topic.
|
boolean |
noteExists(Long noteId)
Checks whether a note exists.
|
void |
updateFollowableItems(Long noteId,
boolean updateChildren)
Update the followable items of a given note and optionally although of its children.
|
void |
updateLastDiscussionCreationDate(Long noteId,
Timestamp creationDate)
Method to update the last discussion creation date.
|
createNote, deleteAutosave, deleteNote, deleteNotesOfUser, getCommentsOfDiscussion, getDiscussionId, getNoteWithComments, getNumberOfNotesInDiscussion, getNumberOfReplies, getPrincipal, updateNotepublic void correctTopicOfComment(Long noteId)
NoteManagementnoteId - ID of the comment note that was created or updated@Transactional(readOnly=true) public AutosaveNoteData getAutosave(Long noteId, Long parentNoteId, Collection<StringPropertyTO> properties, Locale locale)
NoteManagementnoteId - the ID of a note to get the autosave of the edit operation of this note. Can be
null.parentNoteId - the ID of a parent note to get the autosave of a comment to this note. Can be
null.properties - properties which should be used to get filters for finding an autosave. The
filters are resolved with the help of the registered
AutosavePropertyFilterProvider the re
Can be null.locale - the locale to use when filling localizable content of the note like tags@Transactional(readOnly=true) public NoteData getNote(long noteId, NoteRenderContext renderContext) throws NoteNotFoundException, AuthorizationException
noteId - The note id.renderContext - The rendering context. If the render mode of the context is null, no
NoteRenderingPreProcessors will be called.NoteNotFoundException - Thrown, when there is no note for this id.AuthorizationException - Thrown, when the user is not allowed to access the note.@Transactional(readOnly=true) public <T> T getNote(Long noteId, Converter<Note,T> converter)
T - Type of the return value.noteId - The notes id.converter - The converter to convert the note.@Transactional(readOnly=true) public long getNoteCount()
protected NoteModificationResult handleCreateNote(NoteStoringTO noteStoringTO, Set<String> additionalBlogIds) throws BlogNotFoundException, NoteManagementAuthorizationException, NoteStoringPreProcessorException
NoteManagementBaseNoteManagementBase.createNote(NoteStoringTO, Set)handleCreateNote in class NoteManagementBaseBlogNotFoundExceptionNoteManagementAuthorizationExceptionNoteStoringPreProcessorExceptionprotected void handleDeleteAutosave(Long postId) throws NoteManagementAuthorizationException
NoteManagementBase.deleteAutosave(Long)handleDeleteAutosave in class NoteManagementBaseNoteManagementAuthorizationExceptionprotected void handleDeleteNote(Long postId, boolean deleteSystemPosts, boolean clientManagerCanDelete) throws NoteManagementAuthorizationException
NoteManagementBase.deleteNote(Long, boolean, boolean)handleDeleteNote in class NoteManagementBaseNoteManagementAuthorizationExceptionprotected Set<Long> handleDeleteNotesOfUser(Long userId) throws AuthorizationException
NoteManagementBase.deleteNotesOfUser(Long)handleDeleteNotesOfUser in class NoteManagementBaseAuthorizationExceptionprotected List<SimpleNoteListItem> handleGetCommentsOfDiscussion(Long noteId) throws NoteNotFoundException
NoteManagementBase.getCommentsOfDiscussion(Long)handleGetCommentsOfDiscussion in class NoteManagementBasenoteId - the ID of the noteNoteNotFoundException - in case the note does not existsprotected Long handleGetDiscussionId(Long noteId) throws NoteNotFoundException
NoteManagementBase.getDiscussionId(Long)handleGetDiscussionId in class NoteManagementBasenoteId - the ID of the note for which the discussion ID should be returnedNoteNotFoundException - in case the note does not existprotected DiscussionNoteData handleGetNoteWithComments(Long noteId, QueryResultConverter<SimpleNoteListItem,DiscussionNoteData> converter) throws NoteNotFoundException, AuthorizationException
NoteManagementBase.getNoteWithComments(Long, QueryResultConverter)handleGetNoteWithComments in class NoteManagementBasenoteId - the id of the note to retrieveconverter - the converter to use for filling the commentsNoteNotFoundException - if the requested note does not existAuthorizationException - if the current user has no read access to the noteprotected int handleGetNumberOfNotesInDiscussion(Long noteId) throws NoteNotFoundException
NoteManagementBase.getNumberOfNotesInDiscussion(Long)handleGetNumberOfNotesInDiscussion in class NoteManagementBasenoteId - the ID of the noteNoteNotFoundException - in case the note does not existsprotected int handleGetNumberOfReplies(Long noteId) throws NoteNotFoundException
NoteManagementBase.getNumberOfReplies(Long)handleGetNumberOfReplies in class NoteManagementBaseNoteNotFoundExceptionprotected NoteModificationResult handleUpdateNote(NoteStoringTO noteStoringTO, Long noteId, Set<String> additionalBlogIds) throws BlogNotFoundException, NoteNotFoundException, NoteManagementAuthorizationException, NoteStoringPreProcessorException
handleUpdateNote in class NoteManagementBaseBlogNotFoundExceptionNoteNotFoundExceptionNoteManagementAuthorizationExceptionNoteStoringPreProcessorExceptionpublic void moveToTopic(Long discussionId, Long topicId) throws NoteManagementAuthorizationException
discussionId - Id of the discussion to move.topicId - If of the new topic.NoteManagementAuthorizationException - Thrown, when the use isn't allowed to write within the given topic.@Transactional(readOnly=true) public boolean noteExists(Long noteId)
NoteManagementnoteId - the ID of the note to retrievepublic void updateFollowableItems(Long noteId, boolean updateChildren)
noteId - Id of the note to update.updateChildren - If true, all children will be updated too.Copyright © 2019 Communote team. All rights reserved.