Constructor and Description |
---|
ForumUtil() |
Modifier and Type | Method and Description |
---|---|
static ForumUser |
createForumUser(String userId,
ResourceResolver resolver)
Return forum user.
|
static Forum |
getForum(Page page)
Retrieves first forum it finds within the given
Page . |
static boolean |
isForum(Resource resource)
Determines whether the given
Resource is a Forum by checking its resource type being
Forum.RESOURCE_TYPE . |
static boolean |
isHBS(Resource resource)
Checks if is hbs.
|
static boolean |
mayEdit(ResourceResolver resolver,
Authorizable authorizable,
Post post)
Deprecated.
Use
CollabUtil.hasModeratePermissions(Resource) instead. |
static boolean |
mayPost(ResourceResolver resolver,
Forum forum)
Indicates whether the user within the given resource resolver has enough permissions to post to the given
forum.
|
static void |
redirectToPage(Forum forum,
SlingHttpServletRequest request,
SlingHttpServletResponse response)
Redirect the browser to a forum page.
|
public static Forum getForum(Page page)
Page
.page
- The page.Forum
.public static boolean isForum(Resource resource)
Resource
is a Forum
by checking its resource type being
Forum.RESOURCE_TYPE
.resource
- The resource the check.true
if the given resource is a forum.public static boolean mayPost(ResourceResolver resolver, Forum forum)
CommentSystem.PATH_UGC
path
are checked instead.resolver
- The ResourceResolver
forum
- The Forum
true
if the user may post.@Deprecated public static boolean mayEdit(ResourceResolver resolver, Authorizable authorizable, Post post) throws RepositoryException
CollabUtil.hasModeratePermissions(Resource)
instead.CommentSystem.PATH_UGC
path
are checked instead.resolver
- The ResourceResolver
authorizable
- The Authorizable
post
- The Post
true
if the user may post.RepositoryException
- - thrown if there is error accessing repository.public static void redirectToPage(Forum forum, SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException
forum
- the forum to calculate the redirect onrequest
- the request from sling the user maderesponse
- the response to pass the redirect onIOException
- Thrown if there is I/O error.public static ForumUser createForumUser(String userId, ResourceResolver resolver)
userId
- The user id represents the userresolver
- The ResourceResolver
to use for persisting values.public static boolean isHBS(Resource resource)
resource
- the resource"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"