public final class SocialResourceUtils extends Object implements org.osgi.framework.BundleActivator
Modifier and Type | Field and Description |
---|---|
static String |
GRAVATAR_PREFIX |
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,
SocialUtils.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 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.
|
void |
start(org.osgi.framework.BundleContext context) |
void |
stop(org.osgi.framework.BundleContext context) |
public static String GRAVATAR_PREFIX
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, SocialUtils.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 void start(org.osgi.framework.BundleContext context) throws Exception
start
in interface org.osgi.framework.BundleActivator
Exception
"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"