SocialUtils重构

上次更新: 2023-12-07
  • 主题:
  • Communities
    查看有关此主题的更多信息
  • 创建对象:
  • User

已弃用SocialUtils包

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

下表列出了取代的方法 SocialUtils 方法。

SocialResourceUtilities包

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

SCFUtilities包

中的方法 com.adobe.cq.social.utilities.scf.api.SCFUtitles
字符串getAvatar(UserProperties userProperties)
字符串getAvatar(UserProperties userProperties, int size)
字符串getAvatar(UserProperties userProperties, String absoluteDefaultAvatar)
字符串getAvatar(UserProperties userProperties, String absoluteDefaultAvatar, SocialUtils.AVATAR_SIZE)
页面getContainingPage(Resource)
字符串getSocialProfileURL(字符串用户名,ResourceResolver解析程序,页面)
UserProperties getUserProperties(ResourceResolver resolver, String userId)

仅供内部使用

布尔值canAddNode(会话会话,字符串路径)
字符串createUniqueNameHint(字符串消息)
字符串createUniqueNameHint(String message, int numRandomChars)
字符串generateRandomString(int length)
SocialResourceConfiguration getDefaultStorageConfig()
Page getPage(String path, ResourceResolver resolver)
字符串getPagePath(Resource)
字符串getPagePath(字符串路径)
字符串getResourceTypeForIncludedResource(资源组件,字符串defaultResourceType,字符串designPropertyName)
字符串getResourceTypeFromDesign(Resource, String styleProperty, String defaultValue)
boolean isResourceOwner(Resource resource)
字符串mapUGCPath(Resource)
字符串mapUGCPath(String ugcPath, ResourceResolver resolver)
布尔mayPost(ResourceResolver resolver, Resource)
String prepareUserGeneratedContent(ResourceResolver resolver, String path)

方法不再可用

节点createNode(ResourceResolver resolver, String path, String nodeType)
资源getResourceAtPath(ResourceResolver resolver, String path)
资源getResourceAtPath(ResourceResolver解析器,字符串路径,字符串资源类型)
配置getStorageCloudServiceConfig(资源)
TranslationManager getTranslationManager()
TranslationSaveQueue getTranslationSaveQueue()
布尔值mayAccessUGC(ResourceResolver resolver)

在此页面上