Class SoapFolderService
- java.lang.Object
-
- com.logicaldoc.webservice.AbstractService
-
- com.logicaldoc.webservice.soap.endpoint.SoapFolderService
-
- All Implemented Interfaces:
FolderService
- Direct Known Subclasses:
RestFolderService
public class SoapFolderService extends AbstractService implements FolderService
Folder Web Service Implementation- Since:
- 5.2
- Author:
- Matteo Caruso - LogicalDOC
-
-
Constructor Summary
Constructors Constructor Description SoapFolderService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
copy(String sid, long folderId, long targetId, int foldersOnly, String securityOption)
Copies an existing folder with the given identifier.WSFolder
create(String sid, WSFolder wsFolder)
Creates a new folder.WSFolder
createAlias(String sid, long parentId, long foldRef)
Creates a new folder aliaslong
createFolder(String sid, long parentId, String name)
Create a new folder.WSFolder
createPath(String sid, long parentId, String path)
Creates the folder for the specified path.void
delete(String sid, long folderId)
Deletes an existing folder.WSFolder
findByPath(String sid, String path)
Finds the folder at the specified pathWSFolder
getDefaultWorkspace(String sid)
Gets the Default workspaceWSFolder
getFolder(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.WSFolder
getRootFolder(String sid)
Gets root metadatavoid
grantGroup(String sid, long folderId, long groupId, int permissions, boolean recursive)
Grants group permission to the foldervoid
grantUser(String sid, long folderId, long userId, int permissions, boolean recursive)
Grants user permission to the folder.boolean
isGranted(String sid, long folderId, int permission)
Tests if the current user has a specific permission on a folderboolean
isReadable(String sid, long folderId)
Tests if a folder is readable.boolean
isWritable(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.void
merge(String sid, long sourceId, long targetId)
Merges the contents of folder into a targetvoid
move(String sid, long folderId, long parentId)
Moves an existing folder with the given identifier.void
rename(String sid, long folderId, String name)
Renames an existing folder.void
update(String sid, WSFolder wsFolder)
Updates an existing folder.-
Methods inherited from class com.logicaldoc.webservice.AbstractService
convertDateToString, convertStringToDate, getContext, getMessageContext, isValidateSession, setContext, setMessageContext, setValidateSession
-
-
-
-
Method Detail
-
create
public WSFolder create(String sid, WSFolder wsFolder) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException
Description copied from interface:FolderService
Creates a new folder. The user can completely customize the folder through a value object containing the folder's metadata- Specified by:
create
in interfaceFolderService
- Parameters:
sid
- Session identifierwsFolder
- value object containing the folder's metadata- Returns:
- The value object containing the folder's metadata
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permission
-
createAlias
public WSFolder createAlias(String sid, long parentId, long foldRef) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException
Description copied from interface:FolderService
Creates a new folder alias- Specified by:
createAlias
in interfaceFolderService
- Parameters:
sid
- Session identifierparentId
- The parent folderfoldRef
- The referenced folder- Returns:
- The newly created alias
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permission
-
createFolder
public long createFolder(String sid, long parentId, String name) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException
Description copied from interface:FolderService
Create a new folder.- Specified by:
createFolder
in interfaceFolderService
- Parameters:
sid
- Session identifierparentId
- The parent's IDname
- The new folder's name- Returns:
- The newly created folder ID
- Throws:
AuthenticationException
- Invalid sessionPermissionException
- The user does not have the required permissionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
delete
public void delete(String sid, long folderId) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException
Description copied from interface:FolderService
Deletes an existing folder.- Specified by:
delete
in interfaceFolderService
- Parameters:
sid
- Session identifierfolderId
- The folder id- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permission
-
getFolder
public WSFolder getFolder(String sid, long folderId) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException
Description copied from interface:FolderService
Gets an existing folder- Specified by:
getFolder
in interfaceFolderService
- Parameters:
sid
- Session identifierfolderId
- The folder id- Returns:
- A value object containing the folder's metadata
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permission
-
findByPath
public WSFolder findByPath(String sid, String path) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException
Description copied from interface:FolderService
Finds the folder at the specified path- Specified by:
findByPath
in interfaceFolderService
- Parameters:
sid
- Session identifierpath
- The folder's path(for example /Default/dog/cat/mouse)- Returns:
- The created folder
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permission
-
isReadable
public boolean isReadable(String sid, long folderId) throws AuthenticationException, WebserviceException, PersistenceException
Description copied from interface:FolderService
Tests if a folder is readable.- Specified by:
isReadable
in interfaceFolderService
- Parameters:
sid
- Session identifierfolderId
- The folder id- Returns:
- True if the identifier denotes a readable folder, otherwise false.
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
listChildren
public WSFolder[] listChildren(String sid, long folderId) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException
Description copied from interface:FolderService
Lists all direct folders of a parent folder.
Attention: readable only sub-folders are returned.- Specified by:
listChildren
in interfaceFolderService
- Parameters:
sid
- identifier of th sessionfolderId
- identifier of the folder- Returns:
- Array of folders contained in the folder
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permission
-
move
public void move(String sid, long folderId, long parentId) throws PersistenceException, AuthenticationException, WebserviceException
Description copied from interface:FolderService
Moves an existing folder with the given identifier.- Specified by:
move
in interfaceFolderService
- Parameters:
sid
- Session identifierfolderId
- The folder idparentId
- The folder id of the new parent folder- Throws:
PersistenceException
- Error in the databaseAuthenticationException
- Invalid sessionWebserviceException
- Error in the webservice
-
copy
public void copy(String sid, long folderId, long targetId, int foldersOnly, String securityOption) throws AuthenticationException, WebserviceException, PersistenceException
Description copied from interface:FolderService
Copies an existing folder with the given identifier.- Specified by:
copy
in interfaceFolderService
- Parameters:
sid
- Session identifierfolderId
- The folder idtargetId
- The folder id of the target folderfoldersOnly
- If 1, only the folders will be copied and not the documentssecurityOption
- How to assign the security policies to the newly created folders:- null or none: empty security policies
- inherit: the new folder will point to the parent for the security policies
- replicate: the new folder will have a copy of the security policies of the source folder
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
rename
public void rename(String sid, long folderId, String name) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException
Description copied from interface:FolderService
Renames an existing folder.- Specified by:
rename
in interfaceFolderService
- Parameters:
sid
- Session identifierfolderId
- The folder idname
- The new folder name- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permission
-
getRootFolder
public WSFolder getRootFolder(String sid) throws AuthenticationException, WebserviceException, PersistenceException
Description copied from interface:FolderService
Gets root metadata- Specified by:
getRootFolder
in interfaceFolderService
- Parameters:
sid
- Session identifier- Returns:
- A value object containing the folder's metadata
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
getDefaultWorkspace
public WSFolder getDefaultWorkspace(String sid) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException
Description copied from interface:FolderService
Gets the Default workspace- Specified by:
getDefaultWorkspace
in interfaceFolderService
- Parameters:
sid
- Session identifier- Returns:
- A value object containing the workspace's metadata
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permission
-
isWritable
public boolean isWritable(String sid, long folderId) throws AuthenticationException, WebserviceException, PersistenceException
Description copied from interface:FolderService
Tests if a folder is writable- Specified by:
isWritable
in interfaceFolderService
- Parameters:
sid
- Session identifierfolderId
- The folder id- Returns:
- True if the identifier denotes a writable folder, otherwise false
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
isGranted
public boolean isGranted(String sid, long folderId, int permission) throws AuthenticationException, WebserviceException, PersistenceException
Description copied from interface:FolderService
Tests if the current user has a specific permission on a folder- Specified by:
isGranted
in interfaceFolderService
- Parameters:
sid
- Session identifierfolderId
- The folder idpermission
- The permission representation- Returns:
- True if the identifier denotes a granted permission, otherwise false
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
getPath
public WSFolder[] getPath(String sid, long folderId) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException
Description copied from interface:FolderService
Computes the path from the root to the target folder.- Specified by:
getPath
in 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:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permission
-
grantUser
public void grantUser(String sid, long folderId, long userId, int permissions, boolean recursive) throws PersistenceException, PermissionException, AuthenticationException, WebserviceException
Description copied from interface:FolderService
Grants user permission to the folder.- Specified by:
grantUser
in 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:
PersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionAuthenticationException
- Invalid sessionWebserviceException
- Error in the webservice
-
grantGroup
public void grantGroup(String sid, long folderId, long groupId, int permissions, boolean recursive) throws PermissionException, PersistenceException, AuthenticationException, WebserviceException
Description copied from interface:FolderService
Grants group permission to the folder- Specified by:
grantGroup
in 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:
PermissionException
- The user does not have the required permissionPersistenceException
- Error in the databaseAuthenticationException
- Invalid sessionWebserviceException
- Error in the webservice
-
getGrantedUsers
public WSRight[] getGrantedUsers(String sid, long folderId) throws AuthenticationException, WebserviceException, PersistenceException
Description copied from interface:FolderService
Retrieves the list of granted users for the given folder.- Specified by:
getGrantedUsers
in interfaceFolderService
- Parameters:
sid
- Session identifierfolderId
- Folder id- Returns:
- 'error' if error occurred, the right objects collection.
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
getGrantedGroups
public WSRight[] getGrantedGroups(String sid, long folderId) throws AuthenticationException, WebserviceException, PersistenceException
Description copied from interface:FolderService
Retrieves the list of granted groups for the given folder- Specified by:
getGrantedGroups
in interfaceFolderService
- Parameters:
sid
- Session identifierfolderId
- Folder id- Returns:
- 'error' if error occurred, the right objects collection
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
update
public void update(String sid, WSFolder wsFolder) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException
Description copied from interface:FolderService
Updates an existing folder. To perform this you need the RENAME permission.- Specified by:
update
in interfaceFolderService
- Parameters:
sid
- Session identifierwsFolder
- The folders metadata(please compile the ID)- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permission
-
createPath
public WSFolder createPath(String sid, long parentId, String path) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException
Description copied from interface:FolderService
Creates the folder for the specified path. All unexisting nodes specified in the path will be created- Specified by:
createPath
in interfaceFolderService
- Parameters:
sid
- Session identifierparentId
- The parent folderpath
- The folder's path(for example /Default/dog/cat/mouse)- Returns:
- the folder that represents the given path
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permission
-
listWorkspaces
public WSFolder[] listWorkspaces(String sid) throws AuthenticationException, WebserviceException, PersistenceException
Description copied from interface:FolderService
Retrieves the list of all workspaces.- Specified by:
listWorkspaces
in interfaceFolderService
- Parameters:
sid
- Session identifier- Returns:
- array of workspaces
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
merge
public void merge(String sid, long sourceId, long targetId) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException
Description copied from interface:FolderService
Merges the contents of folder into a target- Specified by:
merge
in interfaceFolderService
- Parameters:
sid
- Session identifiersourceId
- Identifier of the source foldertargetId
- Identifier of the target folder- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permission
-
-