public class UGCUtil
extends java.lang.Object
Constructor and Description |
---|
UGCUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getIdFromResource(Resource resource)
Returns the given
resource 's name without selectors and / or file extension. |
static java.lang.String |
getPagePath(Resource resource)
Returns the given
resource 's path without its potential /jcr:content/... suffix, thus
representing a page path. |
static java.lang.String |
prepareUserGeneratedContent(ResourceResolver resolver,
java.lang.String pagePath)
Gets or creates user generated content node
|
static java.lang.String |
resourceToUGCPath(Resource resource)
This method maps the given
resource to its equivalent path in /usergenerated, e.g. |
static 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. |
public static java.lang.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 java.lang.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 java.lang.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 java.lang.String prepareUserGeneratedContent(ResourceResolver resolver, java.lang.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 nodepublic static java.lang.String getIdFromResource(Resource resource)
resource
's name without selectors and / or file extension.resource
- The resource from which to retrieve its name.String
representing the id.Copyright © 2010 - 2020 Adobe. All Rights Reserved