public interface NoteManagement
Note: Usage of this class directly is prohibited. To avoid errors
NoteService should be used.
| Modifier and Type | Field and Description |
|---|---|
static String |
CONSTANT_MENTION_DISCUSSION_PARTICIPANTS
Pattern used for mention all discussion participants.
|
static String |
CONSTANT_MENTION_TOPIC_AUTHORS
Pattern used for mention all users with at least one note within the topic.
|
static String |
CONSTANT_MENTION_TOPIC_MANAGERS
Pattern used for mention all managers of the topic.
|
static String |
CONSTANT_MENTION_TOPIC_READERS
Pattern used for mention all users with at least read access to the topic.
|
static String |
USER_NOTE_PROPERTY_KEY_LIKE
Property key for the like feature.
|
| 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.
|
NoteModificationResult |
createNote(NoteStoringTO noteStoringTO,
Set<String> additionalBlogNameIds)
Creates a note from the supplied transfer object.
|
void |
deleteAutosave(Long noteId)
Deletes an autosave identified by the passed ID.
|
void |
deleteNote(Long noteId,
boolean deleteSystemPosts,
boolean clientManagerCanDelete)
Deletes a user tagged post and all its comments.
|
Set<Long> |
deleteNotesOfUser(Long userId)
Delete all notes and drafts of a user.
|
AutosaveNoteData |
getAutosave(Long noteId,
Long parentNoteId,
Collection<StringPropertyTO> properties,
Locale locale)
Return an autosave of the current user.
|
List<SimpleNoteListItem> |
getCommentsOfDiscussion(Long noteId)
Returns all the notes of a discussion excluding the root note.
|
Long |
getDiscussionId(Long noteId)
Returns the ID of the discussion the note is part of.
|
<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.
|
DiscussionNoteData |
getNoteWithComments(Long noteId,
QueryResultConverter<SimpleNoteListItem,DiscussionNoteData> converter)
Returns a note with its comments which are ordered according to the provided converter.
|
int |
getNumberOfNotesInDiscussion(Long noteId)
Returns the number of notes in a discussion.
|
int |
getNumberOfReplies(Long noteId)
Returns the number of replies to a note.
|
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.
|
NoteModificationResult |
updateNote(NoteStoringTO noteStoringTO,
Long noteId,
Set<String> additionalBlogNameIds)
Updates an existing note with the data of the supplied transfer object.
|
static final String CONSTANT_MENTION_DISCUSSION_PARTICIPANTS
static final String CONSTANT_MENTION_TOPIC_MANAGERS
static final String CONSTANT_MENTION_TOPIC_AUTHORS
static final String CONSTANT_MENTION_TOPIC_READERS
static final String USER_NOTE_PROPERTY_KEY_LIKE
void correctTopicOfComment(Long noteId)
noteId - ID of the comment note that was created or updatedNoteModificationResult createNote(NoteStoringTO noteStoringTO, Set<String> additionalBlogNameIds) throws BlogNotFoundException, NoteManagementAuthorizationException, NoteStoringPreProcessorException
noteStoringTO - The note to create.additionalBlogNameIds - set of blog aliases for creating crossposts. These aliases will be ignore, if the
note is a comment to another note.BlogNotFoundException - in case the target blog does not existNoteManagementAuthorizationException - in case the user is not authorized to create the note, for instance if he has no
write access to the target blogNoteStoringPreProcessorException - in case one of the pre processors failedvoid deleteAutosave(Long noteId) throws NoteManagementAuthorizationException
noteId - The notes id.NoteManagementAuthorizationException - Thrown, when it is not possible to access the note.void deleteNote(Long noteId, boolean deleteSystemPosts, boolean clientManagerCanDelete) throws NoteManagementAuthorizationException
noteId - Id of the note to delete.deleteSystemPosts - If true system notes will also be deleted.clientManagerCanDelete - If true notes will also be deleted, if the current user is a client manager.NoteManagementAuthorizationException - Thrown, when the user is not allowed to access the note.Set<Long> deleteNotesOfUser(Long userId) throws AuthorizationException
userId - ID of the user whose notes should be deletedAuthorizationException - in case the current user is not the internal system user, the client manager or
the creator of the notesAutosaveNoteData getAutosave(Long noteId, Long parentNoteId, Collection<StringPropertyTO> properties, Locale locale)
noteId - 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 tagsList<SimpleNoteListItem> getCommentsOfDiscussion(Long noteId) throws NoteNotFoundException
noteId - the ID of the note whose discussion will be evaluatedNoteNotFoundException - in case the note does not existLong getDiscussionId(Long noteId) throws NoteNotFoundException
noteId - the ID of the note for which the discussion ID should be returnedNoteNotFoundException - in case the note does not existNoteData 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.<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.long getNoteCount()
DiscussionNoteData getNoteWithComments(Long noteId, QueryResultConverter<SimpleNoteListItem,DiscussionNoteData> converter) throws NoteNotFoundException, AuthorizationException
noteId - 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 noteint getNumberOfNotesInDiscussion(Long noteId) throws NoteNotFoundException
noteId - the ID of the note whose discussion will be evaluatedNoteNotFoundException - in case the note does not existint getNumberOfReplies(Long noteId) throws NoteNotFoundException
noteId - the ID of the noteNoteNotFoundException - Thrown, when the note doesn't exist.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.boolean noteExists(Long noteId)
noteId - the ID of the note to retrievevoid updateFollowableItems(Long noteId, boolean updateChildren)
noteId - Id of the note to update.updateChildren - If true, all children will be updated too.void updateLastDiscussionCreationDate(Long noteId, Timestamp creationDate)
noteId - Id of the note, which is part of the discussion.creationDate - The new date to set.NoteModificationResult updateNote(NoteStoringTO noteStoringTO, Long noteId, Set<String> additionalBlogNameIds) throws BlogNotFoundException, NoteNotFoundException, NoteManagementAuthorizationException, NoteStoringPreProcessorException
noteStoringTO - The note to create.noteId - the ID of the note to updateadditionalBlogNameIds - set of blog aliases for creating crossposts. These aliases will be ignore, if the
note is a comment to another note.BlogNotFoundException - in case the target blog does not existNoteNotFoundException - in case the note to update does not existNoteManagementAuthorizationException - in case the user is not authorized to update the note, for instance if he has no
write access to the blog or is not the author of the noteNoteStoringPreProcessorException - in case one of the pre processors failedCopyright © 2019 Communote team. All rights reserved.