public final class SocialResourceUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SocialResourceUtils.AVATAR_SIZE
enum for avartar's size.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ASI_UGC_PREFIX
The SRP prefix.
|
static java.lang.String |
CC_ASIPATH |
static java.lang.String |
CC_CONSUMER_KEY |
static java.lang.String |
CC_HOST_URL |
static java.lang.String |
CC_REPORT_SUITE |
static java.lang.String |
CC_SECRET_KEY |
static java.lang.String |
DEFAULT_AVATAR
Default avatar URL.
|
static java.lang.String |
GRAVATAR_PREFIX |
static java.lang.String |
PATH_UGC
The path to the user-generated content.
|
static java.lang.String |
SRP_CONFIGURATION_CONF_ROOT
Where config definitions are stored.
|
static java.lang.String |
SRP_CONFIGURATION_ROOT |
static java.lang.String |
SRP_DEFAULT_CONFIG_CONF_PATH |
static java.lang.String |
SRP_DEFAULT_CONFIG_PATH |
Modifier and Type | Method and Description |
---|---|
static boolean |
causeByInvalidItemStateException(java.lang.Exception e)
Check to see if the specified exception caused by a jcr InvalidItemStateException.
|
static 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.
|
static java.lang.String |
getAvatar(UserProperties userProperties,
java.lang.String absoluteDefaultAvatar,
SocialResourceUtils.AVATAR_SIZE size)
Returns the userProperties avatar URL or
DEFAULT_AVATAR if profile has no avatar defined. |
static java.lang.String |
getAvatar(UserProperties userProperties,
java.lang.String absoluteDefaultAvatar,
java.lang.String size)
Returns the userProperties avatar URL or
DEFAULT_AVATAR if profile has no avatar defined. |
static Configuration |
getFirstCloudStorageConfig(ResourceResolver resolver)
Deprecated.
No longer using cloud storage, will return the default configuration.
|
static SocialResource |
getSocialResource(Resource res)
Check if a resource is a wrapped resource, and unwrap until a SocialResource is found.
|
static java.lang.String |
getUniqueUGCResourceName(ResourceResolver resourceResolver,
java.lang.String ugcPath,
SocialResourceProvider resourceProvider,
java.lang.String nodeName) |
static UserProperties |
getUserProperties(ResourceResolver resolver,
java.lang.String userId)
Returns the user properties denoted by the given
userId . |
static boolean |
isCloudUGC(java.lang.String path)
Check if path is non JCR based.
|
static boolean |
isSocialResource(Resource res)
Check if a given resource is an instance of SocialResource.
|
public static java.lang.String GRAVATAR_PREFIX
public static final java.lang.String PATH_UGC
public static final java.lang.String ASI_UGC_PREFIX
public static final java.lang.String DEFAULT_AVATAR
public static final java.lang.String CC_ASIPATH
public static final java.lang.String CC_HOST_URL
public static final java.lang.String CC_REPORT_SUITE
public static final java.lang.String CC_CONSUMER_KEY
public static final java.lang.String CC_SECRET_KEY
public static final java.lang.String SRP_CONFIGURATION_CONF_ROOT
public static final java.lang.String SRP_CONFIGURATION_ROOT
public static final java.lang.String SRP_DEFAULT_CONFIG_CONF_PATH
public static final java.lang.String SRP_DEFAULT_CONFIG_PATH
public static java.lang.Boolean checkPermission(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 check@Deprecated public static Configuration getFirstCloudStorageConfig(ResourceResolver resolver)
resolver
- the resolver to usepublic static UserProperties getUserProperties(ResourceResolver resolver, java.lang.String userId)
userId
. The user props are looked for using the
provided resource resolver, so as to ensure that the user properties are only accessible to users having the
necessary access rights on the requested user properties.resolver
- The ResourceResolver
.userId
- The user id for which to retrieve the user properties.UserProperties
or null
if not found.public static java.lang.String getAvatar(UserProperties userProperties, java.lang.String absoluteDefaultAvatar, SocialResourceUtils.AVATAR_SIZE size)
DEFAULT_AVATAR
if profile has no avatar defined.userProperties
- The userProperties (may be null)absoluteDefaultAvatar
- The absolute default avatarsize
- The avatar size (for example, 32x48)public static java.lang.String getAvatar(UserProperties userProperties, java.lang.String absoluteDefaultAvatar, java.lang.String size)
DEFAULT_AVATAR
if profile has no avatar defined.userProperties
- The userProperties (may be null)absoluteDefaultAvatar
- The absolute default avatarsize
- The avatar size (for example, 32)public static boolean isCloudUGC(java.lang.String path)
InternalSocialResourceUtilities.ASI_UGC_PREFIX
, which is enforced in the cloudconfig UI.path
- the path to the ugc resourcepublic static boolean isSocialResource(Resource res)
res
- the resource to checkpublic static SocialResource getSocialResource(Resource res)
res
- resource to unwrappublic static boolean causeByInvalidItemStateException(java.lang.Exception e)
e
- The exceptionpublic static java.lang.String getUniqueUGCResourceName(ResourceResolver resourceResolver, java.lang.String ugcPath, SocialResourceProvider resourceProvider, java.lang.String nodeName)
Copyright © 2010 - 2020 Adobe. All Rights Reserved