Class RestFolderService
- java.lang.Object
-
- com.logicaldoc.webservice.AbstractService
-
- com.logicaldoc.webservice.soap.endpoint.SoapFolderService
-
- com.logicaldoc.webservice.rest.endpoint.RestFolderService
-
- All Implemented Interfaces:
FolderService,FolderService
- Direct Known Subclasses:
RestFolderSwagger
@Path("/") @Consumes("application/json") @Produces("application/json") public class RestFolderService extends SoapFolderService implements FolderService
-
-
Constructor Summary
Constructors Constructor Description RestFolderService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopy(long folderId, long targetId, int foldersOnly, String securityOption)Copies an existing folder with the given identifier.WSFoldercreate(WSFolder folder)WSFoldercreateAlias(long parentId, long foldRef)Creates a new folder aliaslongcreateFolder(long parentId, String name)WSFoldercreatePath(long parentId, String path)WSFoldercreateSimple(String folderPath)WSFoldercreateSimpleForm(String folderPath)WSFoldercreateSimpleJSON(String jsonstr)voiddelete(long folderId)WSFolderfindByPath(String path)Finds the folder at the specified pathWSFoldergetDefaultWorkspace()Gets the Default workspaceWSFoldergetFolder(long folderId)WSRight[]getGrantedGroups(long folderId)Retrieves the list of granted groups for the given folderWSRight[]getGrantedUsers(long folderId)Retrieves the list of granted users for the given folder.WSFolder[]getPath(long folderId)StringgetPathString(long folderId)WSFoldergetRootFolder()Gets the root foldervoidgrantGroup(long folderId, long groupId, int permissions, boolean recursive)Grants group permission to the foldervoidgrantUser(long folderId, long userId, int permissions, boolean recursive)Grants user permission to the folder.booleanisGranted(long folderId, int permission)Tests if the current user has a specific permission on a folderbooleanisReadable(long folderId)Tests if a folder is readable.booleanisWritable(long folderId)Tests if a folder is writableWSFolder[]listChildren(long folderId)WSFolder[]listWorkspaces()Retrieves the list of all workspaces.voidmove(long folderId, long parentId)Moves an existing folder with the given identifier.voidrename(long folderId, String name)Renames an existing folder.voidupdate(WSFolder folder)Updates an existing folder.-
Methods inherited from class com.logicaldoc.webservice.soap.endpoint.SoapFolderService
copy, create, createAlias, createFolder, createPath, delete, findByPath, getDefaultWorkspace, getFolder, getGrantedGroups, getGrantedUsers, getPath, getRootFolder, grantGroup, grantUser, isGranted, isReadable, isWritable, listChildren, listWorkspaces, merge, move, rename, update
-
Methods inherited from class com.logicaldoc.webservice.AbstractService
convertDateToString, convertStringToDate, getContext, getMessageContext, isValidateSession, setContext, setMessageContext, setValidateSession
-
-
-
-
Method Detail
-
create
@POST @Path("/create") public WSFolder create(WSFolder folder) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException- Specified by:
createin interfaceFolderService- Throws:
AuthenticationExceptionPermissionExceptionWebserviceExceptionPersistenceException
-
createSimpleForm
@POST @Path("/createSimpleForm") @Consumes("application/x-www-form-urlencoded") public WSFolder createSimpleForm(@FormParam("folderPath") String folderPath) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException- Specified by:
createSimpleFormin interfaceFolderService- Throws:
AuthenticationExceptionPermissionExceptionWebserviceExceptionPersistenceException
-
createSimpleJSON
@POST @Path("/createSimpleJSON") @Consumes("application/json") public WSFolder createSimpleJSON(String jsonstr) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException- Specified by:
createSimpleJSONin interfaceFolderService- Throws:
AuthenticationExceptionPermissionExceptionWebserviceExceptionPersistenceException
-
createSimple
@POST @Path("/createSimple") @Consumes({"text/plain","application/json"}) public WSFolder createSimple(String folderPath) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException- Specified by:
createSimplein interfaceFolderService- Throws:
AuthenticationExceptionPermissionExceptionWebserviceExceptionPersistenceException
-
createPath
@POST @Path("/createPath") @Consumes("application/x-www-form-urlencoded") public WSFolder createPath(@FormParam("parentId") long parentId, @FormParam("path") String path) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException- Specified by:
createPathin interfaceFolderService- Throws:
AuthenticationExceptionPermissionExceptionWebserviceExceptionPersistenceException
-
findByPath
@GET @Path("/findByPath") @Produces("application/json") public WSFolder findByPath(@QueryParam("path") String path) throws AuthenticationException, PermissionException, WebserviceException, PersistenceExceptionDescription copied from interface:FolderServiceFinds the folder at the specified path- Specified by:
findByPathin interfaceFolderService- Parameters:
path- the path- Returns:
- the folder
- Throws:
AuthenticationException- Invalid credentialsPermissionException- The current user does not have enough permissionsWebserviceException- A generic error in the WebServicePersistenceException- Error in the database
-
getRootFolder
@GET @Path("/getRootFolder") @Produces("application/json") public WSFolder getRootFolder() throws AuthenticationException, WebserviceException, PersistenceExceptionDescription copied from interface:FolderServiceGets the root folder- Specified by:
getRootFolderin interfaceFolderService- Returns:
- the root folder
- Throws:
AuthenticationException- Invalid credentialsWebserviceException- A generic error in the WebServicePersistenceException- Error in the database
-
createFolder
@POST @Path("/createFolder") @Consumes("application/x-www-form-urlencoded") @Produces({"text/plain","application/json","application/xml"}) public long createFolder(@FormParam("parentId") long parentId, @FormParam("name") String name) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException- Specified by:
createFolderin interfaceFolderService- Throws:
AuthenticationExceptionPermissionExceptionWebserviceExceptionPersistenceException
-
getFolder
@GET @Path("/getFolder") @Produces({"application/json","application/xml"}) public WSFolder getFolder(@QueryParam("folderId") long folderId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException- Specified by:
getFolderin interfaceFolderService- Throws:
AuthenticationExceptionPermissionExceptionWebserviceExceptionPersistenceException
-
delete
@DELETE @Path("/delete") public void delete(@QueryParam("folderId") long folderId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException- Specified by:
deletein interfaceFolderService- Throws:
AuthenticationExceptionPermissionExceptionWebserviceExceptionPersistenceException
-
listChildren
@GET @Path("/listChildren") @Produces({"application/json","application/xml"}) public WSFolder[] listChildren(@QueryParam("folderId") long folderId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException- Specified by:
listChildrenin interfaceFolderService- Throws:
AuthenticationExceptionPermissionExceptionWebserviceExceptionPersistenceException
-
getPath
@GET @Path("/getPath") public WSFolder[] getPath(@QueryParam("folderId") long folderId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException- Specified by:
getPathin interfaceFolderService- Throws:
AuthenticationExceptionPermissionExceptionWebserviceExceptionPersistenceException
-
getPathString
@GET @Path("/getPathString") public String getPathString(@QueryParam("folderId") long folderId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException- Specified by:
getPathStringin interfaceFolderService- Throws:
AuthenticationExceptionPermissionExceptionWebserviceExceptionPersistenceException
-
update
@POST @Path("/update") public void update(WSFolder folder) throws AuthenticationException, PermissionException, WebserviceException, PersistenceExceptionDescription copied from interface:FolderServiceUpdates an existing folder. To perform this you need the RENAME permission.- Specified by:
updatein interfaceFolderService- Parameters:
folder- The folders metadata(please compile the ID)- Throws:
AuthenticationException- Invalid credentialsPermissionException- The current user does not have enough permissionsWebserviceException- A generic error in the WebServicePersistenceException- Error in the database
-
rename
@PUT @Path("/rename") public void rename(@QueryParam("folderId") long folderId, @QueryParam("name") String name) throws AuthenticationException, PermissionException, WebserviceException, PersistenceExceptionDescription copied from interface:FolderServiceRenames an existing folder.- Specified by:
renamein interfaceFolderService- Parameters:
folderId- The folder idname- The new folder name- Throws:
AuthenticationException- Invalid credentialsPermissionException- The current user does not have enough permissionsWebserviceException- A generic error in the WebServicePersistenceException- Error in the database
-
move
@PUT @Path("/move") public void move(@QueryParam("folderId") long folderId, @QueryParam("parentId") long parentId) throws AuthenticationException, PersistenceException, WebserviceExceptionDescription copied from interface:FolderServiceMoves an existing folder with the given identifier.- Specified by:
movein interfaceFolderService- Parameters:
folderId- The folder idparentId- The folder id of the new parent folder- Throws:
AuthenticationException- Invalid credentialsPersistenceException- Error in the databaseWebserviceException- A generic error in the WebService
-
createAlias
@POST @Path("/createAlias") @Consumes("application/x-www-form-urlencoded") public WSFolder createAlias(@FormParam("parentId") long parentId, @FormParam("foldRef") long foldRef) throws AuthenticationException, PermissionException, WebserviceException, PersistenceExceptionDescription copied from interface:FolderServiceCreates a new folder alias- Specified by:
createAliasin interfaceFolderService- Parameters:
parentId- The parent folderfoldRef- The referenced folder- Returns:
- The newly created alias
- Throws:
AuthenticationException- Invalid credentialsPermissionException- The current user does not have enough permissionsWebserviceException- A generic error in the WebServicePersistenceException- Error in the database
-
getDefaultWorkspace
@GET @Path("/getDefaultWorkspace") public WSFolder getDefaultWorkspace() throws AuthenticationException, PermissionException, WebserviceException, PersistenceExceptionDescription copied from interface:FolderServiceGets the Default workspace- Specified by:
getDefaultWorkspacein interfaceFolderService- Returns:
- A value object containing the workspace's metadata
- Throws:
AuthenticationException- Invalid credentialsPermissionException- The current user does not have enough permissionsWebserviceException- A generic error in the WebServicePersistenceException- Error in the database
-
listWorkspaces
@GET @Path("/listWorkspaces") public WSFolder[] listWorkspaces() throws AuthenticationException, WebserviceException, PersistenceExceptionDescription copied from interface:FolderServiceRetrieves the list of all workspaces.- Specified by:
listWorkspacesin interfaceFolderService- Returns:
- the list of all workspaces
- Throws:
AuthenticationException- Invalid credentialsWebserviceException- A generic error in the WebServicePersistenceException- Error in the database
-
isReadable
@GET @Path("/isReadable") public boolean isReadable(@QueryParam("folderId") long folderId) throws AuthenticationException, WebserviceException, PersistenceExceptionDescription copied from interface:FolderServiceTests if a folder is readable.- Specified by:
isReadablein interfaceFolderService- Parameters:
folderId- The folder id- Returns:
- True if the identifier denotes a readable folder, otherwise false.
- Throws:
AuthenticationException- Invalid credentialsWebserviceException- A generic error in the WebServicePersistenceException- Error in the database
-
isWritable
@GET @Path("/isWritable") public boolean isWritable(@QueryParam("folderId") long folderId) throws AuthenticationException, WebserviceException, PersistenceExceptionDescription copied from interface:FolderServiceTests if a folder is writable- Specified by:
isWritablein interfaceFolderService- Parameters:
folderId- The folder id- Returns:
- True if the identifier denotes a writable folder, otherwise false
- Throws:
AuthenticationException- Invalid credentialsWebserviceException- A generic error in the WebServicePersistenceException- Error in the database
-
isGranted
@GET @Path("/isGranted") public boolean isGranted(@QueryParam("folderId") long folderId, @QueryParam("permission") int permission) throws AuthenticationException, WebserviceException, PersistenceExceptionDescription copied from interface:FolderServiceTests if the current user has a specific permission on a folder- Specified by:
isGrantedin interfaceFolderService- Parameters:
folderId- The folder idpermission- The permission representation- Returns:
- True if the identifier denotes a granted permission, otherwise false
- Throws:
AuthenticationException- Invalid credentialsWebserviceException- A generic error in the WebServicePersistenceException- Error in the database
-
copy
@POST @Path("/copy") @Consumes("application/x-www-form-urlencoded") public void copy(@FormParam("folderId") long folderId, @FormParam("targetId") long targetId, @FormParam("foldersOnly") int foldersOnly, @FormParam("securityOption") String securityOption) throws AuthenticationException, WebserviceException, PersistenceExceptionDescription copied from interface:FolderServiceCopies an existing folder with the given identifier.- Specified by:
copyin interfaceFolderService- 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:
AuthenticationException- Invalid credentialsWebserviceException- A generic error in the WebServicePersistenceException- Error in the database
-
grantUser
@PUT @Path("/grantUser") public void grantUser(@QueryParam("folderId") long folderId, @QueryParam("userId") long userId, @QueryParam("permissions") int permissions, @QueryParam("recursive") boolean recursive) throws PermissionException, AuthenticationException, PersistenceException, WebserviceExceptionDescription copied from interface:FolderServiceGrants user permission to the folder.- Specified by:
grantUserin interfaceFolderService- Parameters:
folderId- 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:
PermissionException- The current user does not have enough permissionsAuthenticationException- Invalid credentialsPersistenceException- Error in the databaseWebserviceException- A generic error in the WebService
-
grantGroup
@PUT @Path("/grantGroup") public void grantGroup(@QueryParam("folderId") long folderId, @QueryParam("groupId") long groupId, @QueryParam("permissions") int permissions, @QueryParam("recursive") boolean recursive) throws PermissionException, AuthenticationException, PersistenceException, WebserviceExceptionDescription copied from interface:FolderServiceGrants group permission to the folder- Specified by:
grantGroupin interfaceFolderService- Parameters:
folderId- 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 current user does not have enough permissionsAuthenticationException- Invalid credentialsPersistenceException- Error in the databaseWebserviceException- A generic error in the WebService
-
getGrantedGroups
@GET @Path("/getGrantedGroups") public WSRight[] getGrantedGroups(@QueryParam("folderId") long folderId) throws AuthenticationException, WebserviceException, PersistenceExceptionDescription copied from interface:FolderServiceRetrieves the list of granted groups for the given folder- Specified by:
getGrantedGroupsin interfaceFolderService- Parameters:
folderId- Folder id- Returns:
- 'error' if error occurred, the right objects collection
- Throws:
AuthenticationException- Invalid credentialsWebserviceException- A generic error in the WebServicePersistenceException- Error in the database
-
getGrantedUsers
@GET @Path("/getGrantedUsers") public WSRight[] getGrantedUsers(@QueryParam("folderId") long folderId) throws AuthenticationException, WebserviceException, PersistenceExceptionDescription copied from interface:FolderServiceRetrieves the list of granted users for the given folder.- Specified by:
getGrantedUsersin interfaceFolderService- Parameters:
folderId- Folder id- Returns:
- 'error' if error occurred, the right objects collection.
- Throws:
AuthenticationException- Invalid credentialsWebserviceException- A generic error in the WebServicePersistenceException- Error in the database
-
-