Folder
From LogicalDOC Community Wiki
Methods related to folder management.
WSFolder create(String sid, WSFolder folder)
This operation allows to create a new folder with the metadata contained into the folder value object.
Parameters
- sid - The session identifier.
- folder - A folder value object containing the folder metadata.
Returns
- A WSFolder.
Throws
- Exception - If there is any error creating the folder.
void update(String sid, WSFolder folder)
Updates the folder's metadata like name and description. You need the RENAME permission
Parameters
- sid - The session identifier.
- folder - A folder value object containing the folder metadata.
Returns
- void.
Throws
- Exception - If there is any error updating the folder.
WSFolder getFolder(String sid, long folderId)
This operation allows to retrieve an existing folder with the given identifier.
Parameters
- sid - The session identifier.
- folderId - The folder identifier.
Returns
- A WSFolder.
Throws
- Exception - If there is any error retrieving the folder.
WSFolder getRootFolder(String sid)
This operation retrieves the root folder
Parameters
- sid - The session identifier.
Returns
- A WSFolder.
Throws
- Exception - If there is any error retrieving the folder.
void delete(String sid, long folderId)
This operation allows to delete an existing folder.
Parameters
- sid - The session identifier.
- folderId - The folder identifier.
Returns
- none
Throws
- Exception - If the folder doesn't exist.
void rename(String sid, long folderId, String name)
This operation allows to rename an existing folder.
Parameters
- sid - The session identifier.
- folderId - The folder identifier.
- name - The new folder name.
Returns
- none
Throws
- Exception - If the folder doesn't exist or there is already a folder in the repository with the same name in the same folder.
void move(String sid, long folderId, long parentId)
This operation allows to move an existing folder on the parent folder with the given identifier.
Parameters
- sid - The session identifier.
- folderId - The folder identifier.
- parentId - The destination parent folder id.
Returns
- none
Throws
- Exception - If the folder doesn't exist or there is already a folder in the repository with the same name in the same folder or the current user doesn't have the add childs permission on the parent folder.
WSFolder[] list(String sid, long folderId)
This operation allows to retrieve all the folders(direct and indirect) inside an existing folder with the given identifier. Attention: if the current user can read the folderId, all sub-folders are returned without regards to read permission.
Parameters
- sid - The session identifier.
- folderId - The folder identifier.
Returns
- An array of WSFolder.
Throws
- Exception - If the folder doesn't exist.
WSFolder[] listChildren(String sid, long folderId)
This operation allows to retrieve all the direct folders inside an existing folder with the given identifier. Attention: readable only sub-folders are returned.
Parameters
- sid - The session identifier.
- folderId - The folder identifier.
Returns
- An array of WSFolder.
Throws
- Exception - If the folder doesn't exist.
boolean isReadable(String sid, long folderId)
This operation allows to check if the current user can read the folder with the given identifier.
Parameters
- sid - The session identifier.
- folderId - The folder identifier.
Returns
- True if the current user can read the folder
Throws
- Exception - If there is any error accessing the folder.
boolean isWriteable(String sid, long folderId)
This operation allows to check if the current user can write in the folder with the given identifier.
Parameters
- sid - The session identifier.
- folderId - The folder identifier.
Returns
- True if the current user can write in the folder
Throws
- Exception - If there is any error accessing the folder.
void grantUser(String sid, long folderId, long userId, int permissions, boolean recursive)
This operation allows to grant user permission on a folder.
Parameters
- sid - The session identifier.
- folderId - The folder identifier.
- userId - The user identifier.
- permissions - The permissions integer representation.
- recursive - The recursion option. If true, the grant operation is applied also to the subfolders.
Returns
- none
Throws
- Exception - If there is any error granting the user on the folder.
void grantGroup(String sid, long folderId, long groupId, int permissions, boolean recursive)
This operation allows to grant group permission on a folder.
Parameters
- sid - The session identifier.
- folderId - The folder identifier.
- groupId - The group identifier.
- permissions - The permissions integer representation.
- recursive - The recursion option. If true, the grant operation is applied also to the subfolders.
Returns
- none
Throws
- Exception - If there is any error granting the group on the folder.
Right[] getGrantedUsers(String sid, long folderId)
This operation allows to retrieve the list of granted users on a folder.
Parameters
- sid - The session identifier.
- folderId - The folder identifier.
Returns
- An array of Right.
Throws
- Exception - If there is any error retrieving the users permissions on the folder.
WSFolder[] getPath(String sid, long folderId)
Computes the path from the root to the target folder.
Parameters
- sid - The session identifier.
- folderId - The folder identifier.
Returns
- The list of folder, the first is the root, the last is the target folder.
Throws
- Exception - If there is any error computing the path.
Right[] getGrantedGroups(String sid, long folderId)
This operation allows to retrieve the list of granted groups on a folder.
Parameters
- sid - The session identifier.
- folderId - The folder identifier.
Returns
- An array of Right.
Throws
- Exception - If there is any error.
WSFolder createPath(String sid, long parentId, String path)
Creates the folder for the specified path. All unexisting nodes specified in the path will be created.
Parameters
- sid - The session identifier.
- parentId - The parent identifier.
Returns
- The newly created folder.
Throws
- Exception - If there is any error or the user doesn't have the ADD CHILD permission
WSFolder getDefaultWorkspace(String sid)
Retrieves the Default workspace
Parameters
- sid - The session identifier.
Returns
- The Default workspace.
Throws
- Exception - If there is any error
WSFolder[] listWorkspaces(String sid)
Lists all the workspaces in the system
Parameters
- sid - The session identifier.
Returns
- The list of workspaces.
Throws
- Exception - If there is any error.

del.icio.us
reddit