public interface SocialResourceUtilities
Modifier and Type | Method and Description |
---|---|
java.lang.Boolean |
checkPermission(ResourceResolver resolver,
java.lang.String path,
java.lang.String action)
Checks a path and an action based on the passed in resolver.
|
SocialResourceProvider |
getSocialResourceProvider(Resource resource)
Get a SocialResourceProvider given a resource.
|
SocialResourceConfiguration |
getStorageConfig(Resource resource)
From a resource get the configuration for the social data service.
|
Resource |
getUGCResource(Resource userResource)
Gets the base UGC Resource from a SocialResource.
|
Resource |
getUGCResource(Resource userResource,
java.lang.String resourceTypeHint)
Gets the base UGC Resource from a SocialResource.
|
boolean |
hasModeratePermissions(Resource resource)
Check if the login user can moderate a given resource.
|
java.lang.String |
resourceToACLPath(Resource resource)
This method maps the given
resource to its equivalent path in UGC for ACL checking. |
java.lang.String |
resourceToUGCStoragePath(Resource resource)
This method maps the given
resource to its equivalent UGC page path. |
java.lang.String |
ugcToResourcePath(Resource resource)
This method maps the given
resource in /content/usergenerated to its equivalent path in the normal
content tree, e.g. |
java.lang.String |
ugcToResourcePath(java.lang.String ugcPath)
This method maps the given
resource in /content/usergenerated to its equivalent path in the normal
content tree, e.g. |
@CheckForNull java.lang.String resourceToACLPath(@Nullable Resource resource)
resource
to its equivalent path in UGC for ACL checking. For cloud
storage a component like: /content/site/en/page/jcr:content/par/forum will map to
/content/usergenerated/content/site/en/page/. For JCR content,
/content/site/en/page/jcr:content/par/forum will map to:
/content/usergenerated/content/site/en/page/ Note: This method maps the Cloud Storage path to the JCR
marker used for ACL checking, not the path that is used as the resource path for the user generated content
itselfresource
- The resource to transpose to the comment's UCG path.String
representing the equivalent UCG path.@CheckForNull java.lang.String resourceToUGCStoragePath(@Nullable Resource resource)
resource
to its equivalent UGC page path. For cloud storage a component
like: /content/site/en/page/jcr:content/par/forum will map to
/content/usergenerated/asi/cloud/content/site/en/page/. For JCR content,
/content/site/en/page/jcr:content/par/forum will map to:
/content/usergenerated/content/site/en/page/ Note: A cloud path can not be used for ACL checking. See
resourceToACLPath for mapping the resource to a UGC path suitable for ACL checking (returns the 'marker' in
/content/usergenerated/content)resource
- The resource to transpose to the cloud UGC path.String
representing the equivalent cloud UCG path.java.lang.String ugcToResourcePath(@Nonnull Resource resource)
resource
in /content/usergenerated to its equivalent path in the normal
content tree, e.g. as the relationship of a comment in //content/usergenerated/content/test to its
parent resource at /content/test.resource
- The resource to transpose.String
representing the equivalent normal content path.@CheckForNull java.lang.String ugcToResourcePath(@Nullable java.lang.String ugcPath)
resource
in /content/usergenerated to its equivalent path in the normal
content tree, e.g. as the relationship of a comment in //content/usergenerated/content/test to its
parent resource at /content/test.ugcPath
- The path to transpose.String
representing the equivalent normal content path.@CheckForNull Resource getUGCResource(Resource userResource)
userResource
- a path to a resource that needs to have its UGC Resource located.@CheckForNull Resource getUGCResource(Resource userResource, java.lang.String resourceTypeHint)
userResource
- a path to a resource that needs to have its UGC Resource located.resourceTypeHint
- the resource type to set on the root node in the UGC tree, this is used when components
are cq:included onto a page@CheckForNull SocialResourceConfiguration getStorageConfig(Resource resource)
resource
- the base resource to get the configuration for@CheckForNull SocialResourceProvider getSocialResourceProvider(@Nullable Resource resource)
resource
- The resource to return the provider for.boolean hasModeratePermissions(@Nonnull Resource resource)
resource
- The resource to checkjava.lang.Boolean checkPermission(@Nonnull ResourceResolver resolver, java.lang.String path, java.lang.String action)
resolver
- the resource resolver to use to evaluate the permissionspath
- the path to the resource to checkaction
- the action to checkCopyright © 2010 - 2020 Adobe. All Rights Reserved