Class JCRDocumentsUtil
- java.lang.Object
-
- org.exoplatform.documents.storage.jcr.util.JCRDocumentsUtil
-
public class JCRDocumentsUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringDOCUMENTS_NODEstatic StringGROUPS_PATH_ALIASprotected static Map<org.exoplatform.documents.constant.DocumentSortField,String>SORT_FIELDS_ES_CORRESPONDINGprotected static Map<org.exoplatform.documents.constant.DocumentSortField,String>SORT_FIELDS_JCR_CORRESPONDINGstatic StringUSER_PRIVATE_ROOT_NODEstatic StringUSER_PUBLIC_ROOT_NODE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringcleanString(String str)Clean string.static voidcomputeDocumentAcl(javax.jcr.Node node, org.exoplatform.documents.model.AbstractNode documentNode, org.exoplatform.services.security.Identity aclIdentity, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService)static javax.jcr.NodegetGroupNode(org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator, javax.jcr.Session session, String groupId)static StringgetGroupsPath(org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator)static javax.jcr.NodegetIdentityRootNode(org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator, String username, org.exoplatform.social.core.identity.model.Identity ownerIdentity, org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider)static javax.jcr.NodegetIdentityRootNode(org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator, org.exoplatform.social.core.identity.model.Identity ownerIdentity, javax.jcr.Session session)static StringgetMimeType(javax.jcr.Node node)static javax.jcr.NodegetNode(javax.jcr.Session session, org.exoplatform.documents.model.FileNode fileNode, DocumentFileSearchResult fileSearchResult)static javax.jcr.NodegetNodeById(javax.jcr.Session session, String nodeId)static javax.jcr.NodegetNodeByIdentifier(javax.jcr.Session session, String nodeId)static javax.jcr.NodegetNodeByPath(javax.jcr.Session session, String nodePath)static StringgetSortDirection(org.exoplatform.documents.model.DocumentNodeFilter filter)static StringgetSortField(org.exoplatform.documents.model.DocumentNodeFilter filter, boolean isJcr)static longgetUserIdentityId(org.exoplatform.social.core.manager.IdentityManager identityManager, String username)static org.exoplatform.services.jcr.ext.common.SessionProvidergetUserSessionProvider(org.exoplatform.services.jcr.RepositoryService repositoryService, org.exoplatform.services.security.Identity aclIdentity)static voidretrieveFileContentProperties(javax.jcr.Node content, org.exoplatform.documents.model.FileNode fileNode)static voidretrieveFileProperties(org.exoplatform.social.core.manager.IdentityManager identityManager, javax.jcr.Node node, org.exoplatform.services.security.Identity aclIdentity, org.exoplatform.documents.model.AbstractNode documentNode, org.exoplatform.social.core.space.spi.SpaceService spaceService)static org.exoplatform.documents.model.FileNodetoFileNode(org.exoplatform.social.core.manager.IdentityManager identityManager, javax.jcr.Session session, org.exoplatform.services.security.Identity aclIdentity, org.exoplatform.commons.api.search.data.SearchResult searchResult, org.exoplatform.social.core.space.spi.SpaceService spaceService)static org.exoplatform.documents.model.FileNodetoFileNode(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.services.security.Identity aclIdentity, javax.jcr.Node node, String sourceID, org.exoplatform.social.core.space.spi.SpaceService spaceService)static voidtoFileNode(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.services.security.Identity aclIdentity, javax.jcr.Node node, org.exoplatform.documents.model.FileNode fileNode, org.exoplatform.social.core.space.spi.SpaceService spaceService)static List<org.exoplatform.documents.model.FileNode>toFileNodes(org.exoplatform.social.core.manager.IdentityManager identityManager, javax.jcr.NodeIterator nodeIterator, org.exoplatform.services.security.Identity aclIdentity, javax.jcr.Session session, org.exoplatform.social.core.space.spi.SpaceService spaceService, boolean includeHiddenFiles, int offset, int limit)static org.exoplatform.documents.model.FolderNodetoFolderNode(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.services.security.Identity aclIdentity, javax.jcr.Node node, String sourceID, org.exoplatform.social.core.space.spi.SpaceService spaceService)static List<org.exoplatform.documents.model.AbstractNode>toNodes(org.exoplatform.social.core.manager.IdentityManager identityManager, javax.jcr.Session session, javax.jcr.NodeIterator nodeIterator, org.exoplatform.services.security.Identity aclIdentity, org.exoplatform.social.core.space.spi.SpaceService spaceService, boolean includeHiddenFiles)
-
-
-
Field Detail
-
GROUPS_PATH_ALIAS
public static final String GROUPS_PATH_ALIAS
- See Also:
- Constant Field Values
-
DOCUMENTS_NODE
public static final String DOCUMENTS_NODE
- See Also:
- Constant Field Values
-
USER_PRIVATE_ROOT_NODE
public static final String USER_PRIVATE_ROOT_NODE
- See Also:
- Constant Field Values
-
USER_PUBLIC_ROOT_NODE
public static final String USER_PUBLIC_ROOT_NODE
- See Also:
- Constant Field Values
-
SORT_FIELDS_ES_CORRESPONDING
protected static final Map<org.exoplatform.documents.constant.DocumentSortField,String> SORT_FIELDS_ES_CORRESPONDING
-
-
Method Detail
-
getGroupNode
public static javax.jcr.Node getGroupNode(org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator, javax.jcr.Session session, String groupId) throws javax.jcr.RepositoryException- Throws:
javax.jcr.RepositoryException
-
getGroupsPath
public static String getGroupsPath(org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator)
-
toFileNodes
public static List<org.exoplatform.documents.model.FileNode> toFileNodes(org.exoplatform.social.core.manager.IdentityManager identityManager, javax.jcr.NodeIterator nodeIterator, org.exoplatform.services.security.Identity aclIdentity, javax.jcr.Session session, org.exoplatform.social.core.space.spi.SpaceService spaceService, boolean includeHiddenFiles, int offset, int limit)
-
toNodes
public static List<org.exoplatform.documents.model.AbstractNode> toNodes(org.exoplatform.social.core.manager.IdentityManager identityManager, javax.jcr.Session session, javax.jcr.NodeIterator nodeIterator, org.exoplatform.services.security.Identity aclIdentity, org.exoplatform.social.core.space.spi.SpaceService spaceService, boolean includeHiddenFiles)
-
toFolderNode
public static org.exoplatform.documents.model.FolderNode toFolderNode(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.services.security.Identity aclIdentity, javax.jcr.Node node, String sourceID, org.exoplatform.social.core.space.spi.SpaceService spaceService)
-
toFileNode
public static org.exoplatform.documents.model.FileNode toFileNode(org.exoplatform.social.core.manager.IdentityManager identityManager, javax.jcr.Session session, org.exoplatform.services.security.Identity aclIdentity, org.exoplatform.commons.api.search.data.SearchResult searchResult, org.exoplatform.social.core.space.spi.SpaceService spaceService)
-
toFileNode
public static org.exoplatform.documents.model.FileNode toFileNode(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.services.security.Identity aclIdentity, javax.jcr.Node node, String sourceID, org.exoplatform.social.core.space.spi.SpaceService spaceService)
-
toFileNode
public static void toFileNode(org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.services.security.Identity aclIdentity, javax.jcr.Node node, org.exoplatform.documents.model.FileNode fileNode, org.exoplatform.social.core.space.spi.SpaceService spaceService)
-
getNode
public static javax.jcr.Node getNode(javax.jcr.Session session, org.exoplatform.documents.model.FileNode fileNode, DocumentFileSearchResult fileSearchResult) throws javax.jcr.RepositoryException- Throws:
javax.jcr.RepositoryException
-
retrieveFileProperties
public static void retrieveFileProperties(org.exoplatform.social.core.manager.IdentityManager identityManager, javax.jcr.Node node, org.exoplatform.services.security.Identity aclIdentity, org.exoplatform.documents.model.AbstractNode documentNode, org.exoplatform.social.core.space.spi.SpaceService spaceService) throws javax.jcr.RepositoryException- Throws:
javax.jcr.RepositoryException
-
retrieveFileContentProperties
public static void retrieveFileContentProperties(javax.jcr.Node content, org.exoplatform.documents.model.FileNode fileNode) throws javax.jcr.RepositoryException- Throws:
javax.jcr.RepositoryException
-
computeDocumentAcl
public static void computeDocumentAcl(javax.jcr.Node node, org.exoplatform.documents.model.AbstractNode documentNode, org.exoplatform.services.security.Identity aclIdentity, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService) throws javax.jcr.RepositoryException- Throws:
javax.jcr.RepositoryException
-
getNodeByIdentifier
public static javax.jcr.Node getNodeByIdentifier(javax.jcr.Session session, String nodeId)
-
getNodeById
public static javax.jcr.Node getNodeById(javax.jcr.Session session, String nodeId)
-
getNodeByPath
public static javax.jcr.Node getNodeByPath(javax.jcr.Session session, String nodePath)
-
getIdentityRootNode
public static javax.jcr.Node getIdentityRootNode(org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator, String username, org.exoplatform.social.core.identity.model.Identity ownerIdentity, org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider) throws Exception- Throws:
Exception
-
getIdentityRootNode
public static javax.jcr.Node getIdentityRootNode(org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator, org.exoplatform.social.core.identity.model.Identity ownerIdentity, javax.jcr.Session session) throws Exception- Throws:
Exception
-
getSortDirection
public static String getSortDirection(org.exoplatform.documents.model.DocumentNodeFilter filter)
-
getSortField
public static String getSortField(org.exoplatform.documents.model.DocumentNodeFilter filter, boolean isJcr)
-
getUserSessionProvider
public static org.exoplatform.services.jcr.ext.common.SessionProvider getUserSessionProvider(org.exoplatform.services.jcr.RepositoryService repositoryService, org.exoplatform.services.security.Identity aclIdentity)
-
getUserIdentityId
public static long getUserIdentityId(org.exoplatform.social.core.manager.IdentityManager identityManager, String username)
-
cleanString
public static String cleanString(String str)
Clean string.- Parameters:
str- the str- Returns:
- the string
-
getMimeType
public static String getMimeType(javax.jcr.Node node)
-
-