public interface BlogManagement
| Modifier and Type | Field and Description |
|---|---|
static String |
PROPERTY_KEY_PERSONAL_TOPIC_USER_ID
Key of the property which marks a topic as the personal topic of a user.
|
| Modifier and Type | Method and Description |
|---|---|
Blog |
createBlog(CreationBlogTO blogDetails)
Create a new blog and set the user referenced in the transfer object as its manager.
|
void |
createDefaultBlog(String blogName)
Create a default topic if there is no such topic yet.
|
void |
deleteBlog(Long blogId,
Long newBlogId)
Delete a blog with all its notes
|
void |
deleteBlogs(Long[] blogIds)
Delete a selection of blogs.
|
Blog |
findBlogByIdentifier(String identifier)
Retrieve a blog by its alias.
|
Blog |
findBlogByIdentifierWithoutAuthorizationCheck(String alias)
Retrieve a blog by its alias.
|
Blog |
findBlogByIdWithoutAuthorizationCheck(Long blogId)
Retrieve a blog by its ID.
|
List<Blog> |
findBlogsById(Long[] blogIds)
Return the blogs for the given IDs.
|
String |
generateUniqueBlogAlias(String aliasBase,
String previousAlias)
Tries to find a valid blog alias that is not yet used by another blog
|
<T> T |
getBlogByAlias(String alias,
Converter<Blog,T> converter)
Return the details of a blog.
|
Blog |
getBlogById(Long topicId,
boolean needTags)
Retrieve a blog by its ID.
|
<T> T |
getBlogById(Long blogId,
Converter<Blog,T> converter)
Return the details of a blog.
|
long |
getBlogCount() |
Long |
getBlogId(String alias)
Get the ID of a topic identified by the alias.
|
List<BlogData> |
getLastUsedBlogs(int numberOfMaxResults,
boolean sortByTitle)
Retrieve a collection of the writable blogs the current user has written to.
|
MinimalBlogData |
getMinimalBlogInfo(Long blogId)
Return the minimal set of information on a blog, even if the current user is not allowed to
read it.
|
List<BlogData> |
getMostUsedBlogs(int numberOfMaxResults,
boolean sortByTitle)
Retrieve a collection of writable blogs the current user has written to.
|
void |
resetGlobalPermissions()
Removes "all read" and "all write" permissions from all blogs.
|
Blog |
updateBlog(Long blogId,
BlogTO blogDetails)
Update the blog data including title, description alias, tags and properties but not access
rights.
|
static final String PROPERTY_KEY_PERSONAL_TOPIC_USER_ID
Blog createBlog(CreationBlogTO blogDetails) throws NonUniqueBlogIdentifierException, BlogIdentifierValidationException, BlogNotFoundException, BlogAccessException
blogDetails - transfer object holding the details of the blog to be createdNonUniqueBlogIdentifierException - in case the blog alias is not uniqueBlogIdentifierValidationException - in case the blog alias is not validBlogAccessException - in case the current user is not manager of the topic that should be added as the
parent topicBlogNotFoundException - in case the topic to be added as the parent topic does not existvoid createDefaultBlog(String blogName) throws NonUniqueBlogIdentifierException, BlogIdentifierValidationException
blogName - the name of the topic to createNonUniqueBlogIdentifierException - in case the blog alias of the default blog is not uniqueBlogIdentifierValidationException - in case the blog alias of the default blog is not validvoid deleteBlog(Long blogId, Long newBlogId) throws NoteManagementAuthorizationException, BlogNotFoundException
blogId - The ID of the blog to deletenewBlogId - An optional ID of a blog to move the notes to before deleting the blogBlogNotFoundException - if the blog to delete does not existNoteManagementAuthorizationException - if the current user is not manager of the blog to deletevoid deleteBlogs(Long[] blogIds) throws AuthorizationException
blogIds - The IDs of the blogs to deleteAuthorizationException - if the current user is not client manager or the manager of all the blogsBlog findBlogByIdentifier(String identifier) throws BlogAccessException
identifier - the name identifier/alias of the blogBlogAccessException - in case the current user has no read access to the topicBlog findBlogByIdentifierWithoutAuthorizationCheck(String alias)
alias - the name identifier/alias of the blogBlog findBlogByIdWithoutAuthorizationCheck(Long blogId)
blogId - the ID of the blogList<Blog> findBlogsById(Long[] blogIds)
blogIds - the IDs of the blogs to retrieveString generateUniqueBlogAlias(String aliasBase, String previousAlias) throws NonUniqueBlogIdentifierException
aliasBase - the alias value to start with. If this value is not a valid alias, it will be
converted into a valid string.previousAlias - if this alias is generated it will not be considered as a duplicate. Providing
this value is especially useful when generating an alias for a blog update. Can be
null.NonUniqueBlogIdentifierException - in case no unique identifier could be generated<T> T getBlogByAlias(String alias, Converter<Blog,T> converter) throws BlogAccessException
T - the type of the resulting objectalias - the alias of the topicconverter - the converter to use for creating the result objectBlogAccessException - in case the current user has no access to the topicBlog getBlogById(Long topicId, boolean needTags) throws BlogNotFoundException, BlogAccessException
getBlogById(Long, Converter) should be used instead.topicId - the ID of the blogneedTags - If true tags will also be loaded.BlogAccessException - in case the current user has no read access to the topicBlogNotFoundException - in case the topic does not exist<T> T getBlogById(Long blogId, Converter<Blog,T> converter) throws BlogAccessException
T - the type of the resulting objectblogId - the ID of the blogconverter - the converter to use for creating the result objectBlogAccessException - in case the current user has no access to the topiclong getBlogCount()
Long getBlogId(String alias)
alias - the alias of the topicList<BlogData> getLastUsedBlogs(int numberOfMaxResults, boolean sortByTitle)
numberOfMaxResults - The maximal number of blogs to returnsortByTitle - If true, the result will be sorted by title.MinimalBlogData getMinimalBlogInfo(Long blogId)
blogId - the ID of the topicList<BlogData> getMostUsedBlogs(int numberOfMaxResults, boolean sortByTitle)
numberOfMaxResults - The maximal number of blogs to returnsortByTitle - If true, the result will be sorted by title.void resetGlobalPermissions()
Blog updateBlog(Long blogId, BlogTO blogDetails) throws NonUniqueBlogIdentifierException, BlogIdentifierValidationException, BlogAccessException
blogId - ID of the blog to updateblogDetails - transfer object holding the details of the blog to be updatedNonUniqueBlogIdentifierException - in case the new blog alias is not uniqueBlogIdentifierValidationException - in case the new blog alias is not validBlogAccessException - in case the current user has not the required permission to update the blogCopyright © 2019 Communote team. All rights reserved.