public final class BlogManagementHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
REG_EXP_TOPIC_NAME_IDENTIFIER
Regular expression for the name identifier of a topic
|
Modifier and Type | Method and Description |
---|---|
static boolean |
canSetAllCanReadWrite() |
static org.springframework.security.access.AccessDeniedException |
convertException(BlogAccessException ba)
Convert the exception to an
AccessDeniedException . |
static org.springframework.security.access.AccessDeniedException |
convertException(BlogNotFoundException nf)
Convert the exception to an
AccessDeniedException Needed to not break existing
behavior after removing old assertBlogAccess(Blog) method. |
static long |
getCountLimit()
Gets the blog limit.
|
static <E extends BlogData> |
sortedBlogList(List<E> blogList)
Sort a list of topics alphabetically by the title
|
static List<UserBlogData> |
sortedUserBlogList(List<UserBlogData> userBlogListItem)
Returns the list of user blog list items whose blog titles are localized.
|
static void |
validateNameIdentifier(String identifier)
Validate if the given identifier can be used as topic/blog alias
|
public static final String REG_EXP_TOPIC_NAME_IDENTIFIER
public static boolean canSetAllCanReadWrite()
public static org.springframework.security.access.AccessDeniedException convertException(BlogAccessException ba)
AccessDeniedException
. Needed to not break existing
behavior after removing old assertBlogAccess(Blog) method. This method should not not be used
when writing new backend code.ba
- the exception to convertpublic static org.springframework.security.access.AccessDeniedException convertException(BlogNotFoundException nf)
AccessDeniedException
Needed to not break existing
behavior after removing old assertBlogAccess(Blog) method. This method should not not be used
when writing new backend code.nf
- the exception to convertpublic static long getCountLimit()
public static <E extends BlogData> List<E> sortedBlogList(List<E> blogList)
blogList
- the list of blog itemspublic static List<UserBlogData> sortedUserBlogList(List<UserBlogData> userBlogListItem)
userBlogListItem
- the list of user blog list itemspublic static void validateNameIdentifier(String identifier) throws BlogIdentifierValidationException
identifier
- the identifier to checkBlogIdentifierValidationException
- thrown if the identifier is not validCopyright © 2019 Communote team. All rights reserved.