SocialUtils重构

已弃用的SocialUtils包

包​com.adobe.cq.social.ugcbase.SocialUtils​在AEM 6.1中已弃用。

下表列出了用于代替SocialUtils方法的方法。

SocialResourceUtilities包

com.adobe.cq.social.srp.utilities.api.SocialResourceUtilities中的方法
布尔型checkPermission(ResourceResolver, String path, String action)
SocialResourceProvider getSocialResourceProvider(资源)
SocialResourceConfiguration getStorageConfig(资源)
资源getUGCResource(Resource userResource)
资源getUGCResource(Resource userResource, ResourceResolverFactory rrf)
资源getUGCResource(Resource userResource, ResourceResolverFactory rrf, String resourceTypeHint)
资源getUGCResource(Resource userResource, String resourceTypeHint)
布尔值hasMediatePermissions(资源)
字符串resourceToACLPath(资源资源)
字符串resourceToUGCStoragePath(资源资源)
字符串UGCToResourcePath(资源资源)
字符串UGCToResourcePath(字符串ugcPath)
字符串UGCToResourcePath(字符串ugcPath, ResourceResolver)
com.adobe.cq.social.utilities.resource.api.SocialResourceUtilities中的方法
SocialResourceProvider getSocialResourceProvider(资源)

SCFUtilities包

com.adobe.cq.social.utilities.scf.api.SCFUtilites中的方法
字符串getAvatar(UserProperties userProperties)
字符串getAvatar(UserProperties userProperties, int size)
字符串getAvatar(UserProperties userProperties, String absoluteDefaultAvatar)
字符串getAvatar(UserProperties userProperties, String absoluteDefaultAvatar, SocialUtils.AVATAR_SIZE size)
页面getContainingPage(资源)
字符串getSocialProfileURL(字符串用户名, ResourceResolver, Page页)
UserProperties getUserProperties(ResourceResolver, String userId)

仅供内部使用

布尔canAddNode(会话会话,字符串路径)
字符串createUniqueNameHint(字符串消息)
字符串createUniqueNameHint(String message, int numRandomChars)
字符串generateRandomString(int length)
SocialResourceConfiguration getDefaultStorageConfig()
页面getPage(字符串路径, ResourceResolver)
字符串getPagePath(资源)
字符串getPagePath(字符串路径)
字符串getResourceTypeForIncludedResource(资源组件,字符串defaultResourceType,字符串designPropertyName)
字符串getResourceTypeFromDesign(资源,字符串样式属性,字符串默认值)
布尔值isResourceOwner(资源)
字符串mapUGCPath(资源)
字符串mapUGCPath(字符串ugcPath, ResourceResolver)
布尔型mayPost(ResourceResolver, Resource)
字符串prepareUserGeneratedContent(ResourceResolver, String path)

方法不再可用

Node createNode(ResourceResolver, String path, String nodeType)
Resource getResourceAtPath(ResourceResolver, String path)
Resource getResourceAtPath(ResourceResolver, String path, String resourceType)
配置getStorageCloudServiceConfig(资源)
TranslationManager getTranslationManager()
TranslationSaveQueue getTranslationSaveQueue()
布尔型mayAccessUGC(ResourceResolver)

在此页面上