Package com.logicaldoc.webservice.rest
Interface FolderService
- All Known Implementing Classes:
RestFolderService
,RestFolderSwagger
@Consumes("application/json")
@Produces("application/json")
public interface FolderService
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Copies an existing folder with the given identifier.createAlias
(long parentId, long foldRef) Creates a new folder aliaslong
createFolder
(long parentId, String name) createPath
(long parentId, String path) createSimple
(String folderPath) createSimpleForm
(String folderPath) createSimpleJSON
(String jsonstr) void
delete
(long folderId) findByPath
(String path) Finds the folder at the specified pathgetAccessControlList
(long folderId) Retrieves the access control listGets the Default workspacegetFolder
(long folderId) getPath
(long folderId) getPathString
(long folderId) Gets the root folderboolean
Tests if the current user has a specific permission on a folderboolean
isReadable
(long folderId) Tests if a folder is readable.boolean
isWritable
(long folderId) Tests if a folder is writablelistChildren
(long folderId) Retrieves the list of all workspaces.void
move
(long folderId, long parentId) Moves an existing folder with the given identifier.void
Renames an existing folder.void
setAccessControlList
(long folderId, List<WSAccessControlEntry> acl) Sets the Access Control Listvoid
Updates an existing folder.
-
Method Details
-
create
@POST @Path("/create") WSFolder create(WSFolder folder) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException -
createSimple
@POST @Path("/createSimple") @Consumes({"text/plain","application/json"}) WSFolder createSimple(String folderPath) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException -
createSimpleForm
@POST @Path("/createSimpleForm") @Consumes("application/x-www-form-urlencoded") WSFolder createSimpleForm(@FormParam("folderPath") String folderPath) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException -
createSimpleJSON
@POST @Path("/createSimpleJSON") @Consumes("application/json") WSFolder createSimpleJSON(String jsonstr) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException -
createPath
@POST @Path("/createPath") @Consumes("application/x-www-form-urlencoded") WSFolder createPath(@FormParam("parentId") long parentId, @FormParam("path") String path) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException -
findByPath
@GET @Path("/findByPath") @Produces("application/json") WSFolder findByPath(@QueryParam("path") String path) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Finds the folder at the specified path- Parameters:
path
- the path- Returns:
- the folder
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentials
-
getRootFolder
@GET @Path("/getRootFolder") @Produces("application/json") WSFolder getRootFolder() throws AuthenticationException, WebserviceException, PersistenceExceptionGets the root folder- Returns:
- the root folder
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid credentials
-
createFolder
@POST @Path("/createFolder") @Consumes("application/x-www-form-urlencoded") @Produces({"text/plain","application/json","application/xml"}) long createFolder(@FormParam("parentId") long parentId, @FormParam("name") String name) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException -
getFolder
@GET @Path("/getFolder") @Produces({"application/json","application/xml"}) WSFolder getFolder(@QueryParam("folderId") long folderId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException -
delete
@DELETE @Path("/delete") void delete(@QueryParam("folderId") long folderId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException -
listChildren
@GET @Path("/listChildren") @Produces({"application/json","application/xml"}) List<WSFolder> listChildren(@QueryParam("folderId") long folderId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException -
getPath
@GET @Path("/getPath") List<WSFolder> getPath(@QueryParam("folderId") long folderId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException -
getPathString
@GET @Path("/getPathString") String getPathString(@QueryParam("folderId") long folderId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException -
update
@PUT @Path("/update") void update(WSFolder folder) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Updates an existing folder. To perform this you need the RENAME permission.- Parameters:
folder
- The folders metadata(please compile the ID)- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentials
-
rename
@PUT @Path("/rename") void rename(@QueryParam("folderId") long folderId, @QueryParam("name") String name) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Renames an existing folder.- Parameters:
folderId
- The folder idname
- The new folder name- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentials
-
move
@PUT @Path("/move") void move(@QueryParam("folderId") long folderId, @QueryParam("parentId") long parentId) throws AuthenticationException, PersistenceException, WebserviceException, PermissionException Moves an existing folder with the given identifier.- Parameters:
folderId
- The folder idparentId
- The folder id of the new parent folder- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid credentialsPermissionException
- The current user does not have enough permissions
-
createAlias
@POST @Path("/createAlias") WSFolder createAlias(@FormParam("parentId") long parentId, @FormParam("foldRef") long foldRef) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Creates a new folder alias- Parameters:
parentId
- The parent folderfoldRef
- The referenced folder- Returns:
- The newly created alias
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentials
-
getDefaultWorkspace
@GET @Path("/getDefaultWorkspace") WSFolder getDefaultWorkspace() throws AuthenticationException, PermissionException, WebserviceException, PersistenceExceptionGets the Default workspace- Returns:
- A value object containing the workspace's metadata
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentials
-
listWorkspaces
@GET @Path("/listWorkspaces") List<WSFolder> listWorkspaces() throws AuthenticationException, WebserviceException, PersistenceExceptionRetrieves the list of all workspaces.- Returns:
- the list of all workspaces
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid credentials
-
isReadable
@GET @Path("/isReadable") boolean isReadable(@QueryParam("folderId") long folderId) throws AuthenticationException, WebserviceException, PersistenceException Tests if a folder is readable.- Parameters:
folderId
- The folder id- Returns:
- True if the identifier denotes a readable folder, otherwise false.
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid credentials
-
isWritable
@GET @Path("/isWritable") boolean isWritable(@QueryParam("folderId") long folderId) throws AuthenticationException, WebserviceException, PersistenceException Tests if a folder is writable- Parameters:
folderId
- The folder id- Returns:
- True if the identifier denotes a writable folder, otherwise false
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid credentials
-
isGranted
@GET @Path("/isGranted") boolean isGranted(@QueryParam("folderId") long folderId, @QueryParam("permission") String permission) throws AuthenticationException, WebserviceException, PersistenceException Tests if the current user has a specific permission on a folder- Parameters:
folderId
- The folder idpermission
- The permission to check (eg: 'read', 'write', ...)- Returns:
- True if the identifier denotes a granted permission, otherwise false
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid credentials
-
copy
@POST @Path("/copy") void copy(@FormParam("folderId") long folderId, @FormParam("targetId") long targetId, @FormParam("foldersOnly") int foldersOnly, @FormParam("securityOption") String securityOption) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException Copies an existing folder with the given identifier.- Parameters:
folderId
- 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:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid credentialsPermissionException
- The current user does not have enough permissions
-
setAccessControlList
@PUT @Path("/setAccessControlList") void setAccessControlList(@QueryParam("folderId") long folderId, List<WSAccessControlEntry> acl) throws PersistenceException, PermissionException, AuthenticationException, WebserviceException Sets the Access Control List- Parameters:
folderId
- Folder idacl
- the complete Access Control List- Throws:
PersistenceException
- Error in the databaseWebserviceException
- Error in the webserviceAuthenticationException
- Invalid sessionPermissionException
- The user does not have the required permission
-
getAccessControlList
@GET @Path("/getAccessControlList") List<WSAccessControlEntry> getAccessControlList(@QueryParam("folderId") long folderId) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException Retrieves the access control list- Parameters:
folderId
- Folder id- Returns:
- 'error' if error occurred, the right objects collection
- Throws:
PermissionException
- The permission has not been grantedPersistenceException
- Error in the databaseWebserviceException
- Error in the webserviceAuthenticationException
- Invalid session
-