public class WCMCoreUtils extends Object
| Constructor and Description |
|---|
WCMCoreUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canAccessParentNode(javax.jcr.Node node)
Check permission can access to parent
|
static org.exoplatform.services.jcr.ext.common.SessionProvider |
createAnonimProvider() |
static void |
deployLinkToPortal(org.exoplatform.container.xml.InitParams initParams,
org.exoplatform.services.jcr.RepositoryService repositoryService,
LinkManager linkManager,
org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider,
String portalName) |
static void |
endRequest(org.exoplatform.services.organization.OrganizationService orgService) |
static String |
generateImageURI(javax.jcr.Node file,
String propertyName)
Generate uri.
|
static String |
getActiveStylesheet(javax.jcr.Node webcontent) |
static <T> List<T> |
getAllElementsOfListAccess(org.exoplatform.commons.utils.ListAccess<T> listAccess) |
static String |
getBarNavigationStyle()
Get the bar navigation style of UIToolbarContainer.gtmpl
|
static String |
getContainerNameFromJobContext(org.quartz.JobExecutionContext context) |
static Hashtable<String,String> |
getMetadataTemplates(javax.jcr.Node node) |
static javax.jcr.Node |
getNodeBySystemSession(javax.jcr.Node node)
Use only on system process
|
static String |
getPortalName() |
static String |
getProjectVersion() |
static String |
getRemoteUser() |
static org.exoplatform.services.jcr.core.ManageableRepository |
getRepository()
Get the current repository
|
static String |
getRestContextName() |
static <T> T |
getService(Class<T> clazz)
Gets the service.
|
static <T> T |
getService(Class<T> clazz,
String containerName)
Gets the service.
|
static String |
getSiteActiveJs(javax.jcr.Node siteNode) |
static String |
getSiteGlobalActiveJs(javax.jcr.Node siteNode)
gets the global javascript of given site node.
|
static String |
getSiteGlobalActiveJs(javax.jcr.Node siteNode,
org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider)
gets the global javascript of given site node.
|
static String |
getSiteGlobalActiveStylesheet(javax.jcr.Node siteNode)
gets the global css of given site node.
|
static String |
getSuperUser() |
static org.exoplatform.services.jcr.ext.common.SessionProvider |
getSystemSessionProvider()
Gets the system session provider.
|
static org.exoplatform.services.jcr.ext.common.SessionProvider |
getUserSessionProvider()
Gets the session provider.
|
static boolean |
hasPermission(String userId,
List<String> permissions,
boolean isNeedFullAccess)
Check current user has permission to access a node or not
- For each permission, compare with user's permissions
- If permission has membership type is "*", just check the user's group id only
- If permission has other membership types, then check the user's membership type and user's group id
|
static boolean |
isAnonim() |
static boolean |
isDocumentNodeType(javax.jcr.Node node) |
static boolean |
isNodeTypeOrFrozenType(javax.jcr.Node node,
String type) |
static void |
startRequest(org.exoplatform.services.organization.OrganizationService orgService) |
public static <T> T getService(Class<T> clazz)
clazz - the clazzpublic static org.exoplatform.services.jcr.ext.common.SessionProvider getSystemSessionProvider()
public static javax.jcr.Node getNodeBySystemSession(javax.jcr.Node node)
throws javax.jcr.RepositoryException
node - javax.jcr.RepositoryExceptionpublic static boolean canAccessParentNode(javax.jcr.Node node)
node - public static org.exoplatform.services.jcr.ext.common.SessionProvider getUserSessionProvider()
public static boolean isAnonim()
public static org.exoplatform.services.jcr.ext.common.SessionProvider createAnonimProvider()
public static <T> T getService(Class<T> clazz, String containerName)
clazz - the classcontainerName - the container's namepublic static String getContainerNameFromJobContext(org.quartz.JobExecutionContext context)
public static boolean hasPermission(String userId, List<String> permissions, boolean isNeedFullAccess)
userId - the current user's namepermissions - the current nodeisNeedFullAccess - if true, count full access (4) then return true, if false, return true if match first permissionpublic static <T> List<T> getAllElementsOfListAccess(org.exoplatform.commons.utils.ListAccess<T> listAccess)
public static org.exoplatform.services.jcr.core.ManageableRepository getRepository()
public static void startRequest(org.exoplatform.services.organization.OrganizationService orgService)
throws Exception
Exceptionpublic static void endRequest(org.exoplatform.services.organization.OrganizationService orgService)
throws Exception
Exceptionpublic static String getActiveStylesheet(javax.jcr.Node webcontent) throws Exception
Exceptionpublic static String getSiteGlobalActiveStylesheet(javax.jcr.Node siteNode) throws Exception
siteNode - the root node of the siteExceptionpublic static String getSiteGlobalActiveJs(javax.jcr.Node siteNode) throws Exception
siteNode - the root node of the siteExceptionpublic static String getSiteGlobalActiveJs(javax.jcr.Node siteNode, org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider) throws Exception
siteNode - the root node of the siteExceptionpublic static String getSiteActiveJs(javax.jcr.Node siteNode) throws Exception
Exceptionpublic static Hashtable<String,String> getMetadataTemplates(javax.jcr.Node node) throws Exception
Exceptionpublic static String getRestContextName()
public static void deployLinkToPortal(org.exoplatform.container.xml.InitParams initParams,
org.exoplatform.services.jcr.RepositoryService repositoryService,
LinkManager linkManager,
org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider,
String portalName)
throws Exception
Exceptionpublic static String generateImageURI(javax.jcr.Node file, String propertyName) throws Exception
file - the nodepropertyName - the image property name, null if file is an image nodeException - the exceptionpublic static boolean isNodeTypeOrFrozenType(javax.jcr.Node node,
String type)
throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic static String getPortalName()
public static String getRemoteUser()
public static String getSuperUser()
public static boolean isDocumentNodeType(javax.jcr.Node node)
throws Exception
Exceptionpublic static String getBarNavigationStyle()
Copyright © 2003–2019 eXo Platform SAS. All rights reserved.