Class SoapFolderClient
- java.lang.Object
-
- com.logicaldoc.webservice.soap.client.SoapClient<FolderService>
-
- com.logicaldoc.webservice.soap.client.SoapFolderClient
-
- All Implemented Interfaces:
FolderService
public class SoapFolderClient extends SoapClient<FolderService> implements FolderService
Folder Web Service client.- Since:
- 7.5
- Author:
- Marco Meschieri - LogicalDOC
-
-
Constructor Summary
Constructors Constructor Description SoapFolderClient(String endpoint)SoapFolderClient(String endpoint, int gzipThreshold, boolean log, int timeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopy(String sid, long folderId, long parentId, int foldersOnly, int inheritSecurity)Copies an existing folder with the given identifier.WSFoldercreate(String sid, WSFolder folder)Creates a new folder.WSFoldercreateAlias(String sid, long parentId, long foldRef)Creates a new folder aliaslongcreateFolder(String sid, long parentId, String name)Create a new folder.WSFoldercreatePath(String sid, long parentId, String path)Creates the folder for the specified path.voiddelete(String sid, long folderId)Deletes an existing folder.WSFolderfindByPath(String sid, String path)Finds the folder at the specified pathWSFoldergetDefaultWorkspace(String sid)Gets the Default workspaceWSFoldergetFolder(String sid, long folderId)Gets an existing folderWSRight[]getGrantedGroups(String sid, long folderId)Retrieves the list of granted groups for the given folderWSRight[]getGrantedUsers(String sid, long folderId)Retrieves the list of granted users for the given folder.WSFolder[]getPath(String sid, long folderId)Computes the path from the root to the target folder.WSFoldergetRootFolder(String sid)Gets root metadatavoidgrantGroup(String sid, long folderId, long groupId, int permissions, boolean recursive)Grants group permission to the foldervoidgrantUser(String sid, long folderId, long userId, int permissions, boolean recursive)Grants user permission to the folder.booleanisGranted(String sid, long folderId, int permission)Tests if the current user has a specific permission on a folderbooleanisReadable(String sid, long folderId)Tests if a folder is readable.booleanisWritable(String sid, long folderId)Tests if a folder is writableWSFolder[]listChildren(String sid, long folderId)Lists all direct folders of a parent folder.
Attention: readable only sub-folders are returned.WSFolder[]listWorkspaces(String sid)Retrieves the list of all workspaces.voidmove(String sid, long folderId, long parentId)Moves an existing folder with the given identifier.voidrename(String sid, long folderId, String name)Renames an existing folder.voidupdate(String sid, WSFolder folder)Updates an existing folder.-
Methods inherited from class com.logicaldoc.webservice.soap.client.SoapClient
setMaxChildElements
-
-
-
-
Constructor Detail
-
SoapFolderClient
public SoapFolderClient(String endpoint, int gzipThreshold, boolean log, int timeout) throws IOException
- Throws:
IOException
-
SoapFolderClient
public SoapFolderClient(String endpoint) throws IOException
- Throws:
IOException
-
-
Method Detail
-
create
public WSFolder create(String sid, WSFolder folder) throws Exception
Description copied from interface:FolderServiceCreates a new folder. The user can completely customize the folder through a value object containing the folder's metadata- Specified by:
createin interfaceFolderService- Parameters:
sid- Session identifierfolder- value object containing the folder's metadata- Returns:
- The value object containing the folder's metadata
- Throws:
Exception- error during folder creation
-
createFolder
public long createFolder(String sid, long parentId, String name) throws Exception
Description copied from interface:FolderServiceCreate a new folder.- Specified by:
createFolderin interfaceFolderService- Parameters:
sid- Session identifierparentId- The parent's IDname- The new folder's name- Returns:
- The newly created folder ID
- Throws:
Exception- error during folder creation
-
delete
public void delete(String sid, long folderId) throws Exception
Description copied from interface:FolderServiceDeletes an existing folder.- Specified by:
deletein interfaceFolderService- Parameters:
sid- Session identifierfolderId- The folder id- Throws:
Exception- error in the server application
-
getFolder
public WSFolder getFolder(String sid, long folderId) throws Exception
Description copied from interface:FolderServiceGets an existing folder- Specified by:
getFolderin interfaceFolderService- Parameters:
sid- Session identifierfolderId- The folder id- Returns:
- A value object containing the folder's metadata
- Throws:
Exception- error in the server application
-
isReadable
public boolean isReadable(String sid, long folderId) throws Exception
Description copied from interface:FolderServiceTests if a folder is readable.- Specified by:
isReadablein interfaceFolderService- Parameters:
sid- Session identifierfolderId- The folder id- Returns:
- True if the identifier denotes a readable folder, otherwise false.
- Throws:
Exception- error in the server application
-
move
public void move(String sid, long folderId, long parentId) throws Exception
Description copied from interface:FolderServiceMoves an existing folder with the given identifier.- Specified by:
movein interfaceFolderService- Parameters:
sid- Session identifierfolderId- The folder idparentId- The folder id of the new parent folder- Throws:
Exception- error in the server application
-
copy
public void copy(String sid, long folderId, long parentId, int foldersOnly, int inheritSecurity) throws Exception
Description copied from interface:FolderServiceCopies an existing folder with the given identifier.- Specified by:
copyin interfaceFolderService- Parameters:
sid- Session identifierfolderId- The folder idparentId- The folder id of the target folderfoldersOnly- If 1, only the folders will be copied and not the documentsinheritSecurity- If 1, the new folders will inherit the target's security policies- Throws:
Exception- error during copy
-
rename
public void rename(String sid, long folderId, String name) throws Exception
Description copied from interface:FolderServiceRenames an existing folder.- Specified by:
renamein interfaceFolderService- Parameters:
sid- Session identifierfolderId- The folder idname- The new folder name- Throws:
Exception- error during folder rename
-
listChildren
public WSFolder[] listChildren(String sid, long folderId) throws Exception
Description copied from interface:FolderServiceLists all direct folders of a parent folder.
Attention: readable only sub-folders are returned.- Specified by:
listChildrenin interfaceFolderService- Parameters:
sid- identifier of th sessionfolderId- identifier of the folder- Returns:
- Array of folders contained in the folder
- Throws:
Exception- error in the server application
-
getRootFolder
public WSFolder getRootFolder(String sid) throws Exception
Description copied from interface:FolderServiceGets root metadata- Specified by:
getRootFolderin interfaceFolderService- Parameters:
sid- Session identifier- Returns:
- A value object containing the folder's metadata
- Throws:
Exception- error in the server application
-
getDefaultWorkspace
public WSFolder getDefaultWorkspace(String sid) throws Exception
Description copied from interface:FolderServiceGets the Default workspace- Specified by:
getDefaultWorkspacein interfaceFolderService- Parameters:
sid- Session identifier- Returns:
- A value object containing the workspace's metadata
- Throws:
Exception- error in the server application
-
isWritable
public boolean isWritable(String sid, long folderId) throws Exception
Description copied from interface:FolderServiceTests if a folder is writable- Specified by:
isWritablein interfaceFolderService- Parameters:
sid- Session identifierfolderId- The folder id- Returns:
- True if the identifier denotes a writable folder, otherwise false
- Throws:
Exception- error in the server application
-
getPath
public WSFolder[] getPath(String sid, long folderId) throws Exception
Description copied from interface:FolderServiceComputes the path from the root to the target folder.- Specified by:
getPathin interfaceFolderService- Parameters:
sid- Session identifierfolderId- The target folder id- Returns:
- The list of folder, the first is the root, the last is the target folder
- Throws:
Exception- error in the server application
-
getGrantedGroups
public WSRight[] getGrantedGroups(String sid, long folderId) throws Exception
Description copied from interface:FolderServiceRetrieves the list of granted groups for the given folder- Specified by:
getGrantedGroupsin interfaceFolderService- Parameters:
sid- Session identifierfolderId- Folder id- Returns:
- 'error' if error occurred, the right objects collection
- Throws:
Exception- error in the server application
-
getGrantedUsers
public WSRight[] getGrantedUsers(String sid, long folderId) throws Exception
Description copied from interface:FolderServiceRetrieves the list of granted users for the given folder.- Specified by:
getGrantedUsersin interfaceFolderService- Parameters:
sid- Session identifierfolderId- Folder id- Returns:
- 'error' if error occurred, the right objects collection.
- Throws:
Exception- error in the server application
-
grantGroup
public void grantGroup(String sid, long folderId, long groupId, int permissions, boolean recursive) throws Exception
Description copied from interface:FolderServiceGrants group permission to the folder- Specified by:
grantGroupin interfaceFolderService- Parameters:
sid- Session identifierfolderId- Folder idgroupId- Group Idpermissions- the permission integer representation. If '0', the group will be not granted to access the folder.recursive- recursion option. If true, the grant operation is applied also to the subfolders- Throws:
Exception- error in the server application
-
grantUser
public void grantUser(String sid, long folderId, long userId, int permissions, boolean recursive) throws Exception
Description copied from interface:FolderServiceGrants user permission to the folder.- Specified by:
grantUserin interfaceFolderService- Parameters:
sid- Session identifierfolderId- Folder iduserId- User Idpermissions- the permission integer representation. If '0', the user will be not granted to access the folder.recursive- recursion option. If true, the grant operation is applied also to the subfolders.- Throws:
Exception- error in the server application
-
update
public void update(String sid, WSFolder folder) throws Exception
Description copied from interface:FolderServiceUpdates an existing folder. To perform this you need the RENAME permission.- Specified by:
updatein interfaceFolderService- Parameters:
sid- Session identifierfolder- The folders metadata(please compile the ID)- Throws:
Exception- error during update
-
createPath
public WSFolder createPath(String sid, long parentId, String path) throws Exception
Description copied from interface:FolderServiceCreates the folder for the specified path. All unexisting nodes specified in the path will be created- Specified by:
createPathin interfaceFolderService- Parameters:
sid- Session identifierparentId- The parent folderpath- The folder's path(for example /Default/dog/cat/mouse)- Returns:
- The created folder
- Throws:
Exception- error in the server application
-
listWorkspaces
public WSFolder[] listWorkspaces(String sid) throws Exception
Description copied from interface:FolderServiceRetrieves the list of all workspaces.- Specified by:
listWorkspacesin interfaceFolderService- Parameters:
sid- Session identifier- Returns:
- the list of all workspaces
- Throws:
Exception- error in the server application
-
findByPath
public WSFolder findByPath(String sid, String path) throws Exception
Description copied from interface:FolderServiceFinds the folder at the specified path- Specified by:
findByPathin interfaceFolderService- Parameters:
sid- Session identifierpath- The folder's path(for example /Default/dog/cat/mouse)- Returns:
- The created folder
- Throws:
Exception- error in the server application
-
isGranted
public boolean isGranted(String sid, long folderId, int permission) throws Exception
Description copied from interface:FolderServiceTests if the current user has a specific permission on a folder- Specified by:
isGrantedin interfaceFolderService- Parameters:
sid- Session identifierfolderId- The folder idpermission- The permission representation- Returns:
- True if the identifier denotes a granted permission, otherwise false
- Throws:
Exception- error in the server application
-
createAlias
public WSFolder createAlias(String sid, long parentId, long foldRef) throws Exception
Description copied from interface:FolderServiceCreates a new folder alias- Specified by:
createAliasin interfaceFolderService- Parameters:
sid- Session identifierparentId- The parent folderfoldRef- The referenced folder- Returns:
- The newly created alias
- Throws:
Exception- error during alias creation
-
-