@Transactional(propagation=REQUIRED) public abstract class BlogManagementBase extends Object implements BlogManagement
BlogManagement
, provides access to all services and
entities referenced by this service.BlogManagement
PROPERTY_KEY_PERSONAL_TOPIC_USER_ID
Constructor and Description |
---|
BlogManagementBase() |
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 |
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.
|
long |
getBlogCount() |
List<BlogData> |
getMostUsedBlogs(int numberOfMaxResults,
boolean sortByTitle)
Retrieve a collection of writable blogs the current user has written to.
|
protected Principal |
getPrincipal()
Gets the current
principal if one has been set, otherwise returns
null . |
protected abstract Blog |
handleCreateBlog(CreationBlogTO blogDetails)
Performs the core logic for
createBlog(CreationBlogTO) |
protected abstract void |
handleDeleteBlog(Long blogId,
Long newBlogId)
Performs the core logic for
deleteBlog(Long, Long) |
protected abstract void |
handleDeleteBlogs(Long[] blogIds)
Performs the core logic for
deleteBlogs(Long[]) |
protected abstract Blog |
handleFindBlogByIdentifier(String identifier)
Performs the core logic for
findBlogByIdentifier(String) |
protected abstract Blog |
handleFindBlogByIdentifierWithoutAuthorizationCheck(String alias)
Performs the core logic for
findBlogByIdentifierWithoutAuthorizationCheck(String) |
protected abstract Blog |
handleFindBlogByIdWithoutAuthorizationCheck(Long blogId)
Retrieves a blog by its ID.
|
protected abstract List<Blog> |
handleFindBlogsById(Long[] blogIds)
Performs the core logic for
findBlogsById(Long[]) |
protected abstract long |
handleGetBlogCount()
Performs the core logic for
getBlogCount() |
protected abstract List<BlogData> |
handleGetMostUsedBlogs(int numberOfMaxResults,
boolean sortByTitle)
Performs the core logic for
getMostUsedBlogs(int,boolean ) |
protected abstract Blog |
handleUpdateBlog(Long blogId,
BlogTO blog)
Performs the core logic for
updateBlog(Long, BlogTO) |
Blog |
updateBlog(Long blogId,
BlogTO blog)
Update the blog data including title, description alias, tags and properties but not access
rights.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createDefaultBlog, generateUniqueBlogAlias, getBlogByAlias, getBlogById, getBlogById, getBlogId, getLastUsedBlogs, getMinimalBlogInfo, resetGlobalPermissions
public Blog createBlog(CreationBlogTO blogDetails) throws NonUniqueBlogIdentifierException, BlogIdentifierValidationException, BlogNotFoundException, BlogAccessException
createBlog
in interface BlogManagement
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 validBlogNotFoundException
- in case the topic to be added as the parent topic does not existBlogAccessException
- in case the current user is not manager of the topic that should be added as the
parent topicpublic void deleteBlog(Long blogId, Long newBlogId) throws NoteManagementAuthorizationException, BlogNotFoundException
BlogManagement
deleteBlog
in interface BlogManagement
blogId
- The ID of the blog to deletenewBlogId
- An optional ID of a blog to move the notes to before deleting the blogNoteManagementAuthorizationException
- if the current user is not manager of the blog to deleteBlogNotFoundException
- if the blog to delete does not existBlogManagement.deleteBlog(Long, Long)
public void deleteBlogs(Long[] blogIds) throws AuthorizationException
BlogManagement
deleteBlogs
in interface BlogManagement
blogIds
- The IDs of the blogs to deleteAuthorizationException
- if the current user is not client manager or the manager of all the blogsBlogManagement.deleteBlogs(Long[])
@Transactional(readOnly=true) public Blog findBlogByIdentifier(String identifier) throws BlogAccessException
findBlogByIdentifier
in interface BlogManagement
identifier
- the name identifier/alias of the blogBlogAccessException
- in case the current user has no read access to the topic@Transactional(readOnly=true) public Blog findBlogByIdentifierWithoutAuthorizationCheck(String alias)
findBlogByIdentifierWithoutAuthorizationCheck
in interface BlogManagement
alias
- the name identifier/alias of the blog@Transactional(readOnly=true) public Blog findBlogByIdWithoutAuthorizationCheck(Long blogId)
findBlogByIdWithoutAuthorizationCheck
in interface BlogManagement
blogId
- the ID of the blog@Transactional(readOnly=true) public List<Blog> findBlogsById(Long[] blogIds)
BlogManagement
findBlogsById
in interface BlogManagement
blogIds
- the IDs of the blogs to retrieveBlogManagement.findBlogsById(Long[])
@Transactional(readOnly=true) public long getBlogCount()
getBlogCount
in interface BlogManagement
BlogManagement.getBlogCount()
@Transactional(readOnly=true) public List<BlogData> getMostUsedBlogs(int numberOfMaxResults, boolean sortByTitle)
BlogManagement
getMostUsedBlogs
in interface BlogManagement
numberOfMaxResults
- The maximal number of blogs to returnsortByTitle
- If true, the result will be sorted by title.BlogManagement#getMostUsedBlogs(com.communote.server.core.filter.ResultSpecification)
protected Principal getPrincipal()
principal
if one has been set, otherwise returns
null
.protected abstract Blog handleCreateBlog(CreationBlogTO blogDetails) throws NonUniqueBlogIdentifierException, BlogIdentifierValidationException, BlogNotFoundException, BlogAccessException
createBlog(CreationBlogTO)
BlogAccessException
- 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 existNonUniqueBlogIdentifierException
BlogIdentifierValidationException
protected abstract void handleDeleteBlog(Long blogId, Long newBlogId) throws NoteManagementAuthorizationException, BlogNotFoundException
deleteBlog(Long, Long)
protected abstract void handleDeleteBlogs(Long[] blogIds) throws AuthorizationException
deleteBlogs(Long[])
AuthorizationException
protected abstract Blog handleFindBlogByIdentifier(String identifier) throws BlogAccessException
findBlogByIdentifier(String)
BlogAccessException
protected abstract Blog handleFindBlogByIdentifierWithoutAuthorizationCheck(String alias)
findBlogByIdentifierWithoutAuthorizationCheck(String)
protected abstract Blog handleFindBlogByIdWithoutAuthorizationCheck(Long blogId)
blogId
- the ID of the blogprotected abstract List<Blog> handleFindBlogsById(Long[] blogIds)
findBlogsById(Long[])
protected abstract long handleGetBlogCount()
getBlogCount()
protected abstract List<BlogData> handleGetMostUsedBlogs(int numberOfMaxResults, boolean sortByTitle)
getMostUsedBlogs(int,boolean )
protected abstract Blog handleUpdateBlog(Long blogId, BlogTO blog) throws NonUniqueBlogIdentifierException, BlogIdentifierValidationException, BlogAccessException
updateBlog(Long, BlogTO)
blogId
- ID of the blog to updateblog
- 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 blogpublic Blog updateBlog(Long blogId, BlogTO blog) throws NonUniqueBlogIdentifierException, BlogIdentifierValidationException, BlogAccessException
BlogManagement
updateBlog
in interface BlogManagement
blogId
- ID of the blog to updateblog
- 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.