public class ManageDriveServiceImpl extends Object implements ManageDriveService, org.picocontainer.Startable
| Modifier and Type | Field and Description |
|---|---|
static String |
DRIVE_PARAMATER_GROUP_ID |
static String |
DRIVE_PARAMATER_USER_ID |
static String |
GROUPS_DRIVE_NAME |
static String |
GROUPS_DRIVE_ROOT_NODE |
static String |
PERSONAL_DRIVE_NAME |
static String |
PERSONAL_DRIVE_PRIVATE_FOLDER_NAME |
static String |
PERSONAL_DRIVE_PUBLIC_FOLDER_NAME |
static String |
PERSONAL_DRIVE_ROOT_NODE |
static String |
USER_DRIVE_NAME |
COLLABORATION_DRIVE| Constructor and Description |
|---|
ManageDriveServiceImpl(org.exoplatform.services.jcr.RepositoryService jcrService,
org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator,
DMSConfiguration dmsConfiguration,
org.exoplatform.services.cache.CacheService caService,
org.exoplatform.services.organization.OrganizationService organizationService)
Constructor method
Construcs RepositoryService, NodeHierarchyCreator, baseDrivePath_
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDrive(String name,
String workspace,
String permissions,
String homePath,
String views,
String icon,
boolean viewReferences,
boolean viewNonDocument,
boolean viewSideBar,
boolean showHiddenNode,
String allowCreateFolder,
String allowNodeTypesOnTree)
Register a new drive to workspace or update if the drive is existing
|
void |
clearAllDrivesCache()
Clear all drives cache
|
void |
clearGroupCache(String userId)
Clear group drives cache
|
List<DriveData> |
getAllDriveByPermission(String permission)
Return the list of DriveData
This method will look up in all workspaces of repository to find DriveData with
specified permission
|
List<DriveData> |
getAllDrives()
This method will look up in all workspaces of current repository to find DriveData
|
List<DriveData> |
getAllDrives(boolean withVirtualDrives)
This method will look up in all workspaces of current repository to find DriveData
|
Set<String> |
getDeletedDriveNames()
Get deleted drive names.
|
DriveData |
getDriveByName(String name)
Return an DriveData Object
|
List<DriveData> |
getDriveByUserRoles(String userId,
List<String> userRoles)
Get all drives by user roles
|
String |
getDriveOfDefaultWorkspace()
Get Drive name which point to root folder of default workspace
|
List<DriveData> |
getGroupDrives(String userId,
List<String> userRoles)
Get all group drives
|
DriveData |
getGroupDriveTemplate()
Get the Groups drive
|
List<DriveData> |
getMainDrives(String userId,
List<String> userRoles)
Get all main drives.
|
List<DriveData> |
getPersonalDrives(String userId)
Get all personal drives.
|
protected List<String> |
getUserMemberships(String userId) |
protected boolean |
hasPermissionOnDrive(DriveData drive,
List<String> userMemberships) |
void |
init()
Init drive node with specified repository
|
boolean |
isUsedView(String viewName)
This method will check to make sure the view is not in used before remove this view
|
boolean |
isVitualDrive(String driveName)
Check if a drive is vitual(Group Drive Template)
|
boolean |
newRoleUpdated()
Inform when have new role added
|
void |
removeDrive(String driveName)
Remove drive with specified drive name and repository
|
void |
setManageDrivePlugin(ManageDrivePlugin drivePlugin)
Add new ManageDrivePlugin to drivePlugins_
|
void |
setNewRoleUpdated(boolean newRoleUpdated)
Set the status of new added role
|
void |
start()
Implemented method from Startable class
init all ManageDrivePlugin
|
void |
stop()
Implemented method from Startable class
|
public static final String GROUPS_DRIVE_NAME
public static final String GROUPS_DRIVE_ROOT_NODE
public static final String PERSONAL_DRIVE_NAME
public static final String PERSONAL_DRIVE_PUBLIC_FOLDER_NAME
public static final String PERSONAL_DRIVE_PRIVATE_FOLDER_NAME
public static final String USER_DRIVE_NAME
public static final String PERSONAL_DRIVE_ROOT_NODE
public static final String DRIVE_PARAMATER_USER_ID
public static final String DRIVE_PARAMATER_GROUP_ID
public ManageDriveServiceImpl(org.exoplatform.services.jcr.RepositoryService jcrService,
org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator,
DMSConfiguration dmsConfiguration,
org.exoplatform.services.cache.CacheService caService,
org.exoplatform.services.organization.OrganizationService organizationService)
throws Exception
jcrService - nodeHierarchyCreator - Exceptionpublic void start()
start in interface org.picocontainer.Startablepublic void stop()
stop in interface org.picocontainer.Startablepublic void init()
throws Exception
init in interface ManageDriveServiceExceptionpublic void setManageDrivePlugin(ManageDrivePlugin drivePlugin)
drivePlugin - public List<DriveData> getAllDrives() throws Exception
getAllDrives in interface ManageDriveServiceExceptionpublic List<DriveData> getAllDrives(boolean withVirtualDrives) throws Exception
getAllDrives in interface ManageDriveServicewithVirtualDrives - true: include Virtual Drives, false: not include Virtual DrivesExceptionpublic DriveData getDriveByName(String name) throws Exception
getDriveByName in interface ManageDriveServicename - the string contain the drive nameExceptionDriveDatapublic void addDrive(String name, String workspace, String permissions, String homePath, String views, String icon, boolean viewReferences, boolean viewNonDocument, boolean viewSideBar, boolean showHiddenNode, String allowCreateFolder, String allowNodeTypesOnTree) throws Exception
addDrive in interface ManageDriveServicename - drive nameworkspace - the workspace name where will store the drivepermissions - specify who can access to this drivehomePath - specify the location of driveviews - include all views can see in driveicon - the drive icon which can see in drive browserviewReferences - the boolean to set default for drive can view
references node or notviewNonDocument - the boolean to set default for drive can view non
document node or notviewSideBar - the boolean to set default for drive can view side bar
or notshowHiddenNode - the boolean to set default for drive can see hidden
node or notallowCreateFolder - the string to specify which type of folder can add
in the driveExceptionpublic List<DriveData> getAllDriveByPermission(String permission) throws Exception
getAllDriveByPermission in interface ManageDriveServicepermission - the string contain the permissionExceptionDriveDatapublic void removeDrive(String driveName) throws Exception
removeDrive in interface ManageDriveServicedriveName - drive nameExceptionpublic boolean isUsedView(String viewName) throws Exception
isUsedView in interface ManageDriveServiceviewName - view nameExceptionpublic List<DriveData> getDriveByUserRoles(String userId, List<String> userRoles) throws Exception
getDriveByUserRoles in interface ManageDriveServiceuserId - User nameuserRoles - Roles of userExceptionpublic List<DriveData> getGroupDrives(String userId, List<String> userRoles) throws Exception
getGroupDrives in interface ManageDriveServiceuserId - Name of useruserRoles - Roles of userExceptionpublic DriveData getGroupDriveTemplate()
getGroupDriveTemplate in interface ManageDriveServicepublic List<DriveData> getMainDrives(String userId, List<String> userRoles) throws Exception
getMainDrives in interface ManageDriveServiceuserId - Name of useruserRoles - Roles of userExceptionpublic List<DriveData> getPersonalDrives(String userId) throws Exception
getPersonalDrives in interface ManageDriveServiceuserId - Name of userExceptionprotected boolean hasPermissionOnDrive(DriveData drive, List<String> userMemberships)
protected List<String> getUserMemberships(String userId) throws Exception
Exceptionpublic boolean isVitualDrive(String driveName)
isVitualDrive in interface ManageDriveServicedriveName - the string contain the drive namepublic void clearAllDrivesCache()
clearAllDrivesCache in interface ManageDriveServicepublic void clearGroupCache(String userId)
clearGroupCache in interface ManageDriveServiceuserId - User name of current userpublic boolean newRoleUpdated()
newRoleUpdated in interface ManageDriveServicepublic void setNewRoleUpdated(boolean newRoleUpdated)
setNewRoleUpdated in interface ManageDriveServicepublic String getDriveOfDefaultWorkspace() throws Exception
getDriveOfDefaultWorkspace in interface ManageDriveServiceExceptionpublic Set<String> getDeletedDriveNames() throws Exception
ManageDriveServicegetDeletedDriveNames in interface ManageDriveServiceExceptionCopyright © 2003–2019 eXo Platform SAS. All rights reserved.