public class CloudFileActionService extends Object implements org.picocontainer.Startable
| Modifier and Type | Class and Description |
|---|---|
protected class |
CloudFileActionService.LinkRemoveListener
Act on ecd:cloudFileLinkGroup property removal on a cloud file symlink and
then unshare the file from the group where it was shared by the link.
|
protected class |
CloudFileActionService.LinkTrashListener
Act on Cloud File symlink trashing.
|
| Modifier and Type | Field and Description |
|---|---|
protected org.exoplatform.clouddrive.CloudDriveService |
cloudDrive
The cloud drive.
|
protected org.exoplatform.services.cms.CmsService |
cmsService
The cms service.
|
protected org.exoplatform.services.cms.drives.ManageDriveService |
documentDrives
The document drives.
|
protected static String |
ECD_CLOUDFILELINK
The Constant ECD_CLOUDFILELINK.
|
protected static String |
ECD_SHAREIDENTITY
The Constant ECD_SHAREIDENTITY.
|
protected static String |
EXO_OWNEABLE
The Constant EXO_OWNEABLE.
|
protected static String |
EXO_PRIVILEGEABLE
The Constant EXO_PRIVILEGEABLE.
|
protected static String |
EXO_TRASHFOLDER
The Constant EXO_TRASHFOLDER.
|
protected org.exoplatform.clouddrive.jcr.NodeFinder |
finder
Node finder facade on actual storage implementation.
|
protected String |
groupsPath
The groups path.
|
protected org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator |
hierarchyCreator
The hierarchy creator.
|
protected org.exoplatform.services.jcr.RepositoryService |
jcrService
The jcr service.
|
protected org.exoplatform.services.cms.link.LinkManager |
linkManager
The link manager.
|
protected org.exoplatform.services.listener.ListenerService |
listenerService
The listener service.
|
protected static org.exoplatform.services.log.Log |
LOG
The Constant LOG.
|
protected static String[] |
MANAGER_PERMISSION
The Constant MANAGER_PERMISSION.
|
protected static String |
MIX_VERSIONABLE
The Constant MIX_VERSIONABLE.
|
protected org.exoplatform.services.organization.OrganizationService |
orgService
The org service.
|
protected static String[] |
READER_PERMISSION
The Constant READER_PERMISSION.
|
protected Map<String,String> |
removedLinks
Symlink to cloud file UUID mappings.
|
protected Map<String,String> |
removedShared
Cloud file UUID to shared group name mappings.
|
protected org.exoplatform.services.jcr.ext.app.SessionProviderService |
sessionProviders
The session providers.
|
protected static String |
SHARE_CLOUD_FILES_SPACES
The Constant SHARE_CLOUD_FILES_SPACES.
|
protected static String |
SPACES_GROUP
The Constant SPACES_GROUP.
|
protected org.exoplatform.services.cms.documents.TrashService |
trash
The trash.
|
protected String |
usersPath
The users path.
|
protected org.exoplatform.clouddrive.ThreadExecutor |
workerExecutor
Trashed symlinks removal workers.
|
| Constructor and Description |
|---|
CloudFileActionService(org.exoplatform.clouddrive.CloudDriveService cloudDrive,
org.exoplatform.services.jcr.RepositoryService jcrService,
org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders,
org.exoplatform.services.organization.OrganizationService orgService,
org.exoplatform.clouddrive.jcr.NodeFinder finder,
org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator hierarchyCreator,
org.exoplatform.services.cms.link.LinkManager linkManager,
org.exoplatform.services.cms.drives.ManageDriveService documentDrives,
org.exoplatform.services.cms.documents.TrashService trash,
org.exoplatform.services.listener.ListenerService listeners,
org.exoplatform.services.cms.CmsService cmsService)
Instantiates a new cloud file action service.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
documentName(javax.jcr.Node document)
Find pretty name of the document.
|
protected javax.jcr.NodeIterator |
getCloudFileLinks(javax.jcr.Node targetNode,
String shareIdentity,
boolean useSystemSession)
Gets the cloud file links.
|
String |
getDriveNameFromPath(String nodePath)
Deprecated.
|
org.exoplatform.services.cms.drives.DriveData |
getNodeDrive(javax.jcr.Node node)
Gets the node drive.
|
org.exoplatform.services.cms.drives.DriveData |
getUserDrive(String userName)
Gets the user drive.
|
javax.jcr.Node |
getUserPublicNode(String userName)
Gets the user public node.
|
boolean |
isGroupDrive(org.exoplatform.services.cms.drives.DriveData drive)
Checks if is group drive.
|
boolean |
isUserDrive(org.exoplatform.services.cms.drives.DriveData drive)
Checks if is user drive.
|
javax.jcr.Node |
linkFile(javax.jcr.Node srcNode,
javax.jcr.Node destNode,
String destIdentity)
Link file.
|
javax.jcr.Node |
linkShareToUser(javax.jcr.Node fileNode,
org.exoplatform.clouddrive.CloudDrive fileDrive,
String userName)
Link share to user.
|
protected void |
listenFileLinks()
Listen file links.
|
javax.jcr.Node |
markRemoveLink(javax.jcr.Node linkNode)
Mark remove link.
|
String |
postSharedActivity(javax.jcr.Node node,
javax.jcr.Node link,
String comment)
Post shared activity.
|
void |
removeLinks(javax.jcr.Node fileNode,
String shareIdentity)
Removes the links.
|
protected void |
removePermissions(javax.jcr.Node node,
boolean deep,
String... identities)
Remove read permissions on the target node for all given identities (e.g.
|
protected void |
setAllPermissions(javax.jcr.Node node,
String... identities)
Set all available permissions to given node for given identities.
|
protected void |
setParentPermissions(javax.jcr.Node parent,
String... identities)
Set permissions on a parent node of a link target: all child nodes will
become exo:privilegeable (thus copy permissions from its priviligeable
parent).
|
protected void |
setPermissions(javax.jcr.Node node,
boolean deep,
boolean forcePrivilegeable,
String... identities)
Set read permissions on the target node to all given identities (e.g.
|
protected void |
setPermissions(javax.jcr.Node node,
String... identities)
Set read permissions on the target node to all given identities (e.g.
|
void |
shareCloudFile(javax.jcr.Node fileNode,
org.exoplatform.clouddrive.CloudDrive cloudDrive,
String... identities)
Share cloud file.
|
void |
start() |
void |
stop() |
protected javax.jcr.Session |
systemSession()
System session in default workspace of current JCR repository.
|
void |
unshareCloudFile(javax.jcr.Node fileNode,
org.exoplatform.clouddrive.CloudDrive cloudDrive,
String... identities)
Unshare cloud file.
|
protected static final org.exoplatform.services.log.Log LOG
protected static final String SPACES_GROUP
protected static final String SHARE_CLOUD_FILES_SPACES
protected static final String EXO_OWNEABLE
protected static final String EXO_PRIVILEGEABLE
protected static final String ECD_CLOUDFILELINK
protected static final String ECD_SHAREIDENTITY
protected static final String MIX_VERSIONABLE
protected static final String EXO_TRASHFOLDER
protected static final String[] READER_PERMISSION
protected static final String[] MANAGER_PERMISSION
protected final org.exoplatform.clouddrive.CloudDriveService cloudDrive
protected final org.exoplatform.services.jcr.RepositoryService jcrService
protected final org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator hierarchyCreator
protected final org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders
protected final org.exoplatform.services.organization.OrganizationService orgService
protected final org.exoplatform.services.cms.link.LinkManager linkManager
protected final org.exoplatform.services.cms.drives.ManageDriveService documentDrives
protected final org.exoplatform.services.cms.documents.TrashService trash
protected final org.exoplatform.services.listener.ListenerService listenerService
protected final org.exoplatform.services.cms.CmsService cmsService
protected final Map<String,String> removedShared
protected final org.exoplatform.clouddrive.jcr.NodeFinder finder
protected final org.exoplatform.clouddrive.ThreadExecutor workerExecutor
protected final String groupsPath
protected final String usersPath
public CloudFileActionService(org.exoplatform.clouddrive.CloudDriveService cloudDrive,
org.exoplatform.services.jcr.RepositoryService jcrService,
org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders,
org.exoplatform.services.organization.OrganizationService orgService,
org.exoplatform.clouddrive.jcr.NodeFinder finder,
org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator hierarchyCreator,
org.exoplatform.services.cms.link.LinkManager linkManager,
org.exoplatform.services.cms.drives.ManageDriveService documentDrives,
org.exoplatform.services.cms.documents.TrashService trash,
org.exoplatform.services.listener.ListenerService listeners,
org.exoplatform.services.cms.CmsService cmsService)
cloudDrive - the cloud drivejcrService - the jcr servicesessionProviders - the session providersorgService - the org servicefinder - the finderhierarchyCreator - the hierarchy creatorlinkManager - the link managerdocumentDrives - the document drivestrash - the trashlisteners - the listenerscmsService - the cms servicepublic boolean isGroupDrive(org.exoplatform.services.cms.drives.DriveData drive)
drive - the drivepublic boolean isUserDrive(org.exoplatform.services.cms.drives.DriveData drive)
drive - the drivepublic javax.jcr.Node linkShareToUser(javax.jcr.Node fileNode,
org.exoplatform.clouddrive.CloudDrive fileDrive,
String userName)
throws Exception
fileNode - the file nodefileDrive - the file driveuserName - the user nameException - the exceptionpublic org.exoplatform.services.cms.drives.DriveData getUserDrive(String userName) throws Exception
userName - the user nameException - the exceptionpublic javax.jcr.Node getUserPublicNode(String userName) throws Exception
userName - the user nameException - the exceptionpublic void removeLinks(javax.jcr.Node fileNode,
String shareIdentity)
throws javax.jcr.RepositoryException
fileNode - the file nodeshareIdentity - the share identityjavax.jcr.RepositoryException - the repository exceptionpublic org.exoplatform.services.cms.drives.DriveData getNodeDrive(javax.jcr.Node node)
throws Exception
node - the nodeException - the exception@Deprecated public String getDriveNameFromPath(String nodePath) throws CloudFileActionException
nodePath - the node pathCloudFileActionException - the cloud file action exceptionpublic javax.jcr.Node linkFile(javax.jcr.Node srcNode,
javax.jcr.Node destNode,
String destIdentity)
throws org.exoplatform.clouddrive.NotCloudDriveException,
org.exoplatform.clouddrive.DriveRemovedException,
javax.jcr.RepositoryException,
org.exoplatform.clouddrive.CloudDriveException
srcNode - the src nodedestNode - the dest nodedestIdentity - the dest identityorg.exoplatform.clouddrive.NotCloudDriveException - the not cloud drive exceptionorg.exoplatform.clouddrive.DriveRemovedException - the drive removed exceptionjavax.jcr.RepositoryException - the repository exceptionorg.exoplatform.clouddrive.CloudDriveException - the cloud drive exceptionpublic javax.jcr.Node markRemoveLink(javax.jcr.Node linkNode)
throws org.exoplatform.clouddrive.NotCloudDriveException,
org.exoplatform.clouddrive.DriveRemovedException,
javax.jcr.RepositoryException,
org.exoplatform.clouddrive.CloudDriveException
linkNode - the link nodeorg.exoplatform.clouddrive.NotCloudDriveException - the not cloud drive exceptionorg.exoplatform.clouddrive.DriveRemovedException - the drive removed exceptionjavax.jcr.RepositoryException - the repository exceptionorg.exoplatform.clouddrive.CloudDriveException - the cloud drive exceptionpublic void shareCloudFile(javax.jcr.Node fileNode,
org.exoplatform.clouddrive.CloudDrive cloudDrive,
String... identities)
throws org.exoplatform.clouddrive.NotCloudDriveException,
org.exoplatform.clouddrive.DriveRemovedException,
javax.jcr.RepositoryException,
org.exoplatform.clouddrive.CloudDriveException
fileNode - the file nodecloudDrive - the cloud driveidentities - the identitiesorg.exoplatform.clouddrive.NotCloudDriveException - the not cloud drive exceptionorg.exoplatform.clouddrive.DriveRemovedException - the drive removed exceptionjavax.jcr.RepositoryException - the repository exceptionorg.exoplatform.clouddrive.CloudDriveException - the cloud drive exceptionpublic void unshareCloudFile(javax.jcr.Node fileNode,
org.exoplatform.clouddrive.CloudDrive cloudDrive,
String... identities)
throws org.exoplatform.clouddrive.NotCloudDriveException,
org.exoplatform.clouddrive.DriveRemovedException,
javax.jcr.RepositoryException,
org.exoplatform.clouddrive.CloudDriveException
fileNode - the file nodecloudDrive - the cloud driveidentities - the identitiesorg.exoplatform.clouddrive.NotCloudDriveException - the not cloud drive exceptionorg.exoplatform.clouddrive.DriveRemovedException - the drive removed exceptionjavax.jcr.RepositoryException - the repository exceptionorg.exoplatform.clouddrive.CloudDriveException - the cloud drive exceptionpublic String postSharedActivity(javax.jcr.Node node, javax.jcr.Node link, String comment) throws org.exoplatform.clouddrive.CloudDriveException
node - the nodelink - the linkcomment - the commentorg.exoplatform.clouddrive.CloudDriveException - the cloud drive exceptionpublic void start()
start in interface org.picocontainer.Startablepublic void stop()
stop in interface org.picocontainer.Startableprotected void listenFileLinks()
throws javax.jcr.RepositoryException
javax.jcr.RepositoryException - the repository exceptionprotected void setPermissions(javax.jcr.Node node,
String... identities)
throws AccessControlException,
javax.jcr.RepositoryException
exo:privilegeable it will add
such mixin to allow set the permissions first. Requested permissions will
be set to all children nodes if the child already
exo:privilegeable.node - Node link target nodeidentities - array of String with user identifiers (names or
memberships)AccessControlException - the access control exceptionjavax.jcr.RepositoryException - the repository exceptionprotected void setPermissions(javax.jcr.Node node,
boolean deep,
boolean forcePrivilegeable,
String... identities)
throws AccessControlException,
javax.jcr.RepositoryException
exo:privilegeable and forcePrivilegeable is
false. If deep is true the target
children nodes will be checked also for a need to set the requested
permissions. node - Node link target nodedeep - Boolean if true then also children nodes
will be set to the requested permissionsforcePrivilegeable - Boolean if true and node not
yet exo:privilegeable it will add such mixin to allow
set the permissions.identities - array of String with user identifiers (names or
memberships)AccessControlException - the access control exceptionjavax.jcr.RepositoryException - the repository exceptionprotected void removePermissions(javax.jcr.Node node,
boolean deep,
String... identities)
throws AccessControlException,
javax.jcr.RepositoryException
deep is true then
permissions will be removed on all ancestor nodes (sub-tree for folders).node - Node link target nodedeep - Boolean if true then also remove the
permissions from children nodesidentities - array of String with user identifiers (names or
memberships)AccessControlException - the access control exceptionjavax.jcr.RepositoryException - the repository exceptionprotected void setParentPermissions(javax.jcr.Node parent,
String... identities)
throws AccessControlException,
javax.jcr.RepositoryException
parent - the parentidentities - the identitiesAccessControlException - the access control exceptionjavax.jcr.RepositoryException - the repository exceptionprotected void setAllPermissions(javax.jcr.Node node,
String... identities)
throws AccessControlException,
javax.jcr.RepositoryException
node - the nodeidentities - the identitiesAccessControlException - the access control exceptionjavax.jcr.RepositoryException - the repository exceptionprotected String documentName(javax.jcr.Node document) throws javax.jcr.RepositoryException
document - the documentjavax.jcr.RepositoryException - the repository exceptionprotected javax.jcr.Session systemSession()
throws javax.jcr.RepositoryException
javax.jcr.RepositoryException - the repository exceptionprotected javax.jcr.NodeIterator getCloudFileLinks(javax.jcr.Node targetNode,
String shareIdentity,
boolean useSystemSession)
throws javax.jcr.RepositoryException
targetNode - the target nodeshareIdentity - the share identityuseSystemSession - the use system sessionjavax.jcr.RepositoryException - the repository exceptionCopyright © 2003–2018 eXo Platform SAS. All rights reserved.