public final class SocialResourceUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SocialResourceUtils.AVATAR_SIZE
enum for avartar's size.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
ASI_UGC_PREFIX
The SRP prefix.
|
static String |
CC_ASIPATH |
static String |
CC_CONSUMER_KEY |
static String |
CC_HOST_URL |
static String |
CC_REPORT_SUITE |
static String |
CC_SECRET_KEY |
static String |
DEFAULT_AVATAR
Default avatar URL.
|
static String |
GRAVATAR_PREFIX |
static String |
PATH_UGC
The path to the user-generated content.
|
static String |
SRP_CONFIGURATION_ROOT
Where config definitions are stored.
|
static String |
SRP_DEFAULT_CONFIG_PATH |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
causeByInvalidItemStateException(Exception e)
Check to see if the specified exception caused by a jcr InvalidItemStateException.
|
static Boolean |
checkPermission(ResourceResolver resolver,
String path,
String action)
Checks a path and an action based on the passed in resolver.
|
static String |
getAvatar(UserProperties userProperties,
String absoluteDefaultAvatar,
SocialResourceUtils.AVATAR_SIZE size)
Returns the userProperties avatar URL or
CollabUtil#DEFAULT_AVATAR if profile has no avatar defined. |
static String |
getAvatar(UserProperties userProperties,
String absoluteDefaultAvatar,
String size)
Returns the userProperties avatar URL or
CollabUtil#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 String |
getUniqueUGCResourceName(ResourceResolver resourceResolver,
String ugcPath,
SocialResourceProvider resourceProvider,
String nodeName) |
static UserProperties |
getUserProperties(ResourceResolver resolver,
String userId)
Returns the user properties denoted by the given
userId. |
static boolean |
isCloudUGC(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 String GRAVATAR_PREFIX
public static final String PATH_UGC
public static final String ASI_UGC_PREFIX
public static final String DEFAULT_AVATAR
public static final String CC_ASIPATH
public static final String CC_HOST_URL
public static final String CC_REPORT_SUITE
public static final String CC_CONSUMER_KEY
public static final String CC_SECRET_KEY
public static final String SRP_CONFIGURATION_ROOT
public static final String SRP_DEFAULT_CONFIG_PATH
public static Boolean checkPermission(ResourceResolver resolver, String path, 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, 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 String getAvatar(UserProperties userProperties, String absoluteDefaultAvatar, SocialResourceUtils.AVATAR_SIZE size)
CollabUtil#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 String getAvatar(UserProperties userProperties, String absoluteDefaultAvatar, String size)
CollabUtil#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(String path)
SocialUtils#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(Exception e)
e - The exceptionpublic static String getUniqueUGCResourceName(ResourceResolver resourceResolver, String ugcPath, SocialResourceProvider resourceProvider, String nodeName)
"Copyright © 2010 - 2017 Adobe Systems Incorporated. All Rights Reserved"