@Deprecated
public interface SocialUtils
Modifier and Type | Interface and Description |
---|---|
static class |
SocialUtils.AVATAR_SIZE
Deprecated.
enum for avartar's size.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ASI_UGC_PREFIX
Deprecated.
The SRP prefix.
|
static java.lang.String |
BUCKET_TYPE
Deprecated.
Property name for bucket resource type.
|
static java.lang.String |
CC_ASIPATH
Deprecated.
|
static java.lang.String |
CC_CONSUMER_KEY
Deprecated.
|
static java.lang.String |
CC_HOST_URL
Deprecated.
|
static java.lang.String |
CC_REPORT_SUITE
Deprecated.
|
static java.lang.String |
CC_SECRET_KEY
Deprecated.
|
static java.lang.String |
COMMENT_CS_RESOURCE_TYPE
Deprecated.
The resource type for the comments component.
|
static java.lang.String |
COMMENT_NODE_TYPE
Deprecated.
The comment node type.
|
static java.lang.String |
COMMENTID_SEPARATOR
Deprecated.
|
static java.lang.String |
DEFAULT_AVATAR
Deprecated.
Default avatar URL.
|
static java.lang.String |
GROUP_MEMBERGROUP
Deprecated.
Property name for group's member group.
|
static java.lang.String |
NN_COMMENT_ATTACHMENTS
Deprecated.
The property name for the Comment Attachments folder.
|
static java.lang.String |
PATH_UGC
Deprecated.
The path to the user-generated content.
|
static java.lang.String |
PN_ATTACHMENT_LIST
Deprecated.
|
static java.lang.String |
PN_BASETYPE
Deprecated.
|
static java.lang.String |
PN_COMMENT_RESOURCETYPE
Deprecated.
|
static java.lang.String |
PN_CS_ROOT
Deprecated.
|
static java.lang.String |
PN_DATE
Deprecated.
|
static java.lang.String |
PN_DS_KEY
Deprecated.
|
static java.lang.String |
PN_ENTITY
Deprecated.
|
static java.lang.String |
PN_IS_REPLY
Deprecated.
|
static java.lang.String |
PN_PARENTID
Deprecated.
|
static java.lang.String |
PN_POST_RESOURCETYPE
Deprecated.
|
static java.lang.String |
PN_REMOTE_UGC_LOCATION
Deprecated.
Property name for pointing a Social component to remote piece of UGC.
|
static java.lang.String |
PN_SLING_RESOURCETYPE
Deprecated.
|
static java.lang.String |
PN_TOPIC_RESOURCETYPE
Deprecated.
|
static java.lang.String |
PROP_COMPONENT
Deprecated.
The property name for the path to the comments component.
|
static java.lang.String |
SRP_CLOUD_PATH
Deprecated.
The Cloud prefix.
|
static java.lang.String |
SRP_JSRP_PATH
Deprecated.
JSRP prefix.
|
static java.lang.String |
SRP_MONGO_PATH
Deprecated.
Mongo prefix.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canAddNode(Session session,
java.lang.String path)
Deprecated.
Can add node at path.
|
java.lang.Boolean |
checkPermission(ResourceResolver resolver,
java.lang.String path,
java.lang.String action)
Deprecated.
Checks a path and an action based on the passed in resolver.
|
Node |
createNode(ResourceResolver resolver,
java.lang.String path,
java.lang.String nodeType)
Deprecated.
Create node.
|
java.lang.String |
createUniqueNameHint(java.lang.String message)
Deprecated.
|
java.lang.String |
createUniqueNameHint(java.lang.String message,
int numRandomChars)
Deprecated.
|
java.lang.String |
generateRandomString(int length)
Deprecated.
Generates a (secure) random string with the given length.
|
java.lang.String |
getAvatar(UserProperties userProperties)
Deprecated.
Returns the userProperties avatar URL or
InternalSCFUtilities.DEFAULT_AVATAR if profile has no avatar defined. |
java.lang.String |
getAvatar(UserProperties userProperties,
int size)
Deprecated.
Returns the userProperties avatar URL or
InternalSCFUtilities.DEFAULT_AVATAR if profile has no avatar defined. |
java.lang.String |
getAvatar(UserProperties userProperties,
java.lang.String absoluteDefaultAvatar)
Deprecated.
Returns the userProperties avatar URL or
InternalSCFUtilities.DEFAULT_AVATAR if profile has no avatar defined. |
java.lang.String |
getAvatar(UserProperties userProperties,
java.lang.String absoluteDefaultAvatar,
SocialUtils.AVATAR_SIZE size)
Deprecated.
Returns the userProperties avatar URL or absoluteDefaultAvatar if profile has no avatar defined.
|
java.lang.String |
getCommonStorePath(Resource resource)
Deprecated.
This method maps the given
resource to its equivalent resource path based on applicable global
shared storage cloud config settings. |
SocialResourceProvider |
getConfiguredProvider(Resource resource)
Deprecated.
A simple way of getting the configured SocialResourceProvider for a resource.
|
Page |
getContainingPage(Resource resource)
Deprecated.
Finds the page which contains the given resource.
|
SocialResourceConfiguration |
getDefaultStorageConfig()
Deprecated.
From a resource get the configuration for the social data service.
|
Page |
getPage(java.lang.String path,
ResourceResolver resolver)
Deprecated.
|
java.lang.String |
getPagePath(Resource resource)
Deprecated.
Returns the given
resource 's path without its potential /jcr:content/... suffix, thus
representing a page path. |
java.lang.String |
getPagePath(java.lang.String path)
Deprecated.
Returns the given
resource 's path without its potential /jcr:content/... suffix, thus
representing a page path. |
Resource |
getResourceAtPath(ResourceResolver resolver,
java.lang.String path)
Deprecated.
Return a resource at path.
|
Resource |
getResourceAtPath(ResourceResolver resolver,
java.lang.String path,
java.lang.String resourceType)
Deprecated.
Return a resource at path.
|
java.lang.String |
getResourceTypeForIncludedResource(Resource component,
java.lang.String defaultResourceType,
java.lang.String designPropertyName)
Deprecated.
Returns the resource type of a Component when it is included dynamically via cq:include.
|
java.lang.String |
getResourceTypeFromDesign(Resource resource,
java.lang.String styleProperty,
java.lang.String defaultValue)
Deprecated.
|
java.lang.String |
getSocialProfileURL(java.lang.String username,
ResourceResolver resolver,
Page page)
Deprecated.
Gets the social profile url for a user based on the page being passed in.
|
SocialResourceProvider |
getSocialResourceProvider(Resource resource)
Deprecated.
Get a SocialResourceProvider given a resource.
|
SocialResourceProvider |
getSocialResourceProvider(ResourceResolver resolver,
java.lang.String path)
Deprecated.
Get a SocialResourceProvider given a path and a resolver.
|
SocialResourceProvider |
getSocialResourceProvider(java.lang.String path)
Deprecated.
|
Configuration |
getStorageCloudServiceConfig(Resource resource)
Deprecated.
use getStorageConfig
|
SocialResourceConfiguration |
getStorageConfig(Resource resource)
Deprecated.
From a resource get the configuration for the social data service.
|
TranslationManager |
getTranslationManager()
Deprecated.
|
TranslationSaveQueue |
getTranslationSaveQueue()
Deprecated.
Return reference to TranslationSaveQueue to save translation batch jobs.
|
Resource |
getUGCResource(Resource userResource)
Deprecated.
Gets the base UGC Resource from a SocialResource.
|
Resource |
getUGCResource(Resource userResource,
ResourceResolverFactory rrf)
Deprecated.
|
Resource |
getUGCResource(Resource userResource,
ResourceResolverFactory rrf,
java.lang.String resourceTypeHint)
Deprecated.
|
Resource |
getUGCResource(Resource userResource,
java.lang.String resourceTypeHint)
Deprecated.
Gets the base UGC Resource from a SocialResource.
|
UserProperties |
getUserProperties(ResourceResolver resolver,
java.lang.String userId)
Deprecated.
Returns the user properties denoted by the given
userId . |
boolean |
hasModeratePermissions(Resource resource)
Deprecated.
Check if the login user can moderate a given resource.
|
boolean |
isResourceOwner(Resource resource)
Deprecated.
Check if the login user is the resource owner.
|
boolean |
isUserInGroups(ResourceResolver resolver,
java.lang.String userId,
java.util.List<java.lang.String> groupIds)
Deprecated.
Checks if is user in group.
|
java.lang.String |
mapUGCPath(Resource resource)
Deprecated.
Map a UGC path, avoiding multiple round trips.
|
java.lang.String |
mapUGCPath(java.lang.String ugcPath,
ResourceResolver resolver)
Deprecated.
Map a UGC path, avoiding multiple round trips.
|
boolean |
mayAccessUGC(ResourceResolver resolver)
Deprecated.
May access ugc.
|
boolean |
mayPost(ResourceResolver resolver,
Resource resource)
Deprecated.
Indicates whether the user within the given resource resolver has enough permissions to post to the given
resource component.
|
java.lang.String |
prepareUserGeneratedContent(ResourceResolver resolver,
java.lang.String path)
Deprecated.
Prepare user generated content for the specified path.
|
java.lang.String |
resourceToACLPath(Resource resource)
Deprecated.
This method maps the given
resource to its equivalent path in UGC for ACL checking. |
java.lang.String |
resourceToUGCPath(Resource resource)
Deprecated.
Use resourceToACLPath or resourceToUGCStoragePath
|
java.lang.String |
resourceToUGCStoragePath(Resource resource)
Deprecated.
This method maps the given
resource to its equivalent UGC page path. |
java.lang.String |
UGCToResourcePath(Resource resource)
Deprecated.
This method maps the given
resource in /content/usergenerated to its equivalent path in the normal
content tree, e.g. |
java.lang.String |
UGCToResourcePath(java.lang.String ugcPath,
ResourceResolver resolver)
Deprecated.
This method maps the given
resource in /content/usergenerated to its equivalent path in the normal
content tree, e.g. |
static final java.lang.String PN_PARENTID
static final java.lang.String PN_DATE
static final java.lang.String PN_COMMENT_RESOURCETYPE
static final java.lang.String PN_TOPIC_RESOURCETYPE
static final java.lang.String PN_POST_RESOURCETYPE
static final java.lang.String PN_SLING_RESOURCETYPE
static final java.lang.String PN_DS_KEY
static final java.lang.String PN_CS_ROOT
static final java.lang.String PN_BASETYPE
static final java.lang.String PN_ATTACHMENT_LIST
static final java.lang.String PN_IS_REPLY
static final java.lang.String PN_ENTITY
static final java.lang.String CC_ASIPATH
static final java.lang.String CC_HOST_URL
static final java.lang.String CC_REPORT_SUITE
static final java.lang.String CC_CONSUMER_KEY
static final java.lang.String CC_SECRET_KEY
static final java.lang.String COMMENTID_SEPARATOR
static final java.lang.String PROP_COMPONENT
static final java.lang.String COMMENT_CS_RESOURCE_TYPE
static final java.lang.String PATH_UGC
static final java.lang.String ASI_UGC_PREFIX
static final java.lang.String SRP_CLOUD_PATH
static final java.lang.String SRP_MONGO_PATH
static final java.lang.String SRP_JSRP_PATH
static final java.lang.String PN_REMOTE_UGC_LOCATION
static final java.lang.String BUCKET_TYPE
static final java.lang.String GROUP_MEMBERGROUP
static final java.lang.String COMMENT_NODE_TYPE
static final java.lang.String DEFAULT_AVATAR
static final java.lang.String NN_COMMENT_ATTACHMENTS
java.lang.String createUniqueNameHint(java.lang.String message)
java.lang.String createUniqueNameHint(java.lang.String message, int numRandomChars)
java.lang.String getResourceTypeFromDesign(Resource resource, java.lang.String styleProperty, java.lang.String defaultValue)
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 checkResource getUGCResource(Resource userResource)
userResource
- a path to a resource that needs to have its UGC Resource located.@Deprecated Resource getUGCResource(Resource userResource, ResourceResolverFactory rrf)
Resource getUGCResource(Resource userResource, java.lang.String resourceTypeHint)
userResource
- a path to a resource that needs to have its UGC Resource located.resourceTypeHint
- the resource type to set on the root node in the UGC tree, this is used when components
are cq:included onto a page@Deprecated Resource getUGCResource(Resource userResource, ResourceResolverFactory rrf, java.lang.String resourceTypeHint)
java.lang.String generateRandomString(int length)
length
- length of random string.@Deprecated Configuration getStorageCloudServiceConfig(Resource resource)
resource
- the base resource to check the cloud configuration forSocialResourceConfiguration getStorageConfig(Resource resource)
resource
- the base resource to get the configuration forSocialResourceConfiguration getDefaultStorageConfig()
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.java.lang.String getAvatar(UserProperties userProperties)
InternalSCFUtilities.DEFAULT_AVATAR
if profile has no avatar defined.userProperties
- The userProperties (may be null)java.lang.String getAvatar(UserProperties userProperties, java.lang.String absoluteDefaultAvatar)
InternalSCFUtilities.DEFAULT_AVATAR
if profile has no avatar defined.userProperties
- The userProperties (may be null)absoluteDefaultAvatar
- The absolute default avatarjava.lang.String getAvatar(UserProperties userProperties, java.lang.String absoluteDefaultAvatar, SocialUtils.AVATAR_SIZE size)
userProperties
- The userProperties (may be null)absoluteDefaultAvatar
- The absolute default avatarsize
- The avatar size (for example, 32)java.lang.String getAvatar(UserProperties userProperties, int size)
InternalSCFUtilities.DEFAULT_AVATAR
if profile has no avatar defined.userProperties
- The userProperties (may be null)size
- The avatar size (for example, 32)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.java.lang.String getPagePath(java.lang.String path)
resource
's path without its potential /jcr:content/... suffix, thus
representing a page path.path
- The path to check.String
representing the page path.Node createNode(ResourceResolver resolver, java.lang.String path, java.lang.String nodeType) throws SocialException
resolver
- The ResourceResolver
to use for persisting values.path
- The path of the node to be creatednodeType
- The node typeSocialException
- if error occurs in Social Collaboration@Deprecated 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. Note:
This method maps the Cloud Storage path to the JCR marker used for ACL checking, not the path that is used as
the resource path for the user generated content itselfresource
- The resource to transpose to the comment's UCG path.String
representing the equivalent UCG path.java.lang.String resourceToACLPath(Resource resource)
resource
to its equivalent path in UGC for ACL checking. For cloud
storage a component like: /content/site/en/page/jcr:content/par/forum will map to
/content/usergenerated/content/site/en/page/. For JCR content,
/content/site/en/page/jcr:content/par/forum will map to:
/content/usergenerated/content/site/en/page/ Note: This method maps the Cloud Storage path to the JCR
marker used for ACL checking, not the path that is used as the resource path for the user generated content
itselfresource
- The resource to transpose to the comment's UCG path.String
representing the equivalent UCG path.java.lang.String resourceToUGCStoragePath(Resource resource)
resource
to its equivalent UGC page path. For cloud storage a component
like: /content/site/en/page/jcr:content/par/forum will map to
/content/usergenerated/asi/cloud/content/site/en/page/. For JCR content,
/content/site/en/page/jcr:content/par/forum will map to:
/content/usergenerated/content/site/en/page/ Note: A cloud path can not be used for ACL checking. See
resourceToACLPath for mapping the resource to a UGC path suitable for ACL checking (returns the 'marker' in
/content/usergenerated/content)resource
- The resource to transpose to the cloud UGC path.String
representing the equivalent cloud UCG path.boolean canAddNode(Session session, java.lang.String path)
session
- sessionpath
- pathboolean mayPost(ResourceResolver resolver, Resource resource)
PATH_UGC
path are checked instead.resolver
- The ResourceResolver
resource
- The Resource
component.true
if the user may post.java.lang.String prepareUserGeneratedContent(ResourceResolver resolver, java.lang.String path) throws SocialException
resolver
- The ResourceResolver
to use for persisting values.path
- The page pathSocialException
- if error occurs in Social Collaborationjava.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.java.lang.String UGCToResourcePath(java.lang.String ugcPath, ResourceResolver resolver)
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.ugcPath
- The path to transpose.resolver
- The resource resolver to use.String
representing the equivalent normal content path.java.lang.String mapUGCPath(Resource resource)
resource
- The resource to transpose.java.lang.String mapUGCPath(java.lang.String ugcPath, ResourceResolver resolver)
ugcPath
- the ugc path to mapresolver
- the resolver to usePage getContainingPage(Resource resource)
resource
- the resource for which the page is to be foundPage getPage(java.lang.String path, ResourceResolver resolver)
path
- path to the pageresolver
- resolver to usPage
object for the given path if a page exists, null otherwise.SocialResourceProvider getConfiguredProvider(Resource resource)
resource
- The resource to use as the base of the resolutionjava.lang.String getSocialProfileURL(java.lang.String username, ResourceResolver resolver, Page page)
username
- user to find the profile for.resolver
- the resolver to use, which must have read access to the profile otherpage
- the page to use as the basis for the search for "cq:socialProfilePage" property.boolean hasModeratePermissions(Resource resource)
resource
- The resource to checkjava.lang.String getResourceTypeForIncludedResource(Resource component, java.lang.String defaultResourceType, java.lang.String designPropertyName)
component
- the component to determine the type fordefaultResourceType
- the fall back if no suitable matchers are founddesignPropertyName
- the name of the design property to try and useboolean mayAccessUGC(ResourceResolver resolver)
resolver
- the resolverTranslationManager getTranslationManager()
SocialResourceProvider getSocialResourceProvider(Resource resource)
resource
- The resource to return the provider for.SocialResourceProvider getSocialResourceProvider(ResourceResolver resolver, java.lang.String path)
path
- The path to return the provider for.resolver
- A resolver with sufficient privileges to fetch a resource within the asi path.@Deprecated SocialResourceProvider getSocialResourceProvider(java.lang.String path)
path
- The path to return the provider for.Resource getResourceAtPath(ResourceResolver resolver, java.lang.String path)
resolver
- Resolver to usepath
- The path to get the resource atResource getResourceAtPath(ResourceResolver resolver, java.lang.String path, java.lang.String resourceType)
resolver
- Resolver to usepath
- The path to get the resource atresourceType
- Resource type of returned SyntheticResource.boolean isResourceOwner(Resource resource)
resource
- The resource to checkTranslationSaveQueue getTranslationSaveQueue()
java.lang.String getCommonStorePath(Resource resource)
resource
to its equivalent resource path based on applicable global
shared storage cloud config settings.resource
- The resource to transpose.boolean isUserInGroups(ResourceResolver resolver, java.lang.String userId, java.util.List<java.lang.String> groupIds)
resolver
- The ResourceResolver
used to get the user information. Should be ServiceUser/Admin user
resolver if not checking for current useruserId
- the user idgroupIds
- the group ids"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"