public class UGCUtil extends Object
| Constructor and Description |
|---|
UGCUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getIdFromResource(Resource resource)
Returns the given
resource's name without selectors and / or file extension. |
static String |
getPagePath(Resource resource)
Returns the given
resource's path without its potential /jcr:content/... suffix, thus
representing a page path. |
static String |
prepareUserGeneratedContent(ResourceResolver resolver,
String pagePath)
Gets or creates user generated content node
|
static String |
resourceToUGCPath(Resource resource)
This method maps the given
resource to its equivalent path in /usergenerated, e.g. |
static String |
UGCToResourcePath(Resource resource)
This method maps the given
resource in /content/usergenerated to its equivalent path in the normal
content tree, e.g. |
public static String resourceToUGCPath(Resource resource)
resource to its equivalent path in /usergenerated, e.g. as the
relationship a page /content/test to its comment at /content/usergenerated/content/test.resource - The resource to transpose to the comment's UCG path.String representing the equivalent UCG path.public static String UGCToResourcePath(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.public static String getPagePath(Resource resource)
resource's path without its potential /jcr:content/... suffix, thus
representing a page path.resource - The resource to check.String representing the page path.public static String prepareUserGeneratedContent(ResourceResolver resolver, String pagePath) throws WCMException
resolver - The resource resolver.pagePath - The page path.String representing the UCG path.WCMException - If an error occurs while getting or creating user generated content nodeCopyright © 2010 - 2020 Adobe. All Rights Reserved