Class RestFolderService

    • Constructor Detail

      • RestFolderService

        public RestFolderService()
    • Method Detail

      • createPath

        @POST
        @Path("/createPath")
        @Consumes("application/x-www-form-urlencoded")
        public WSFolder createPath​(@FormParam("parentId")
                                   long parentId,
                                   @FormParam("path")
                                   String path)
                            throws Exception
        Specified by:
        createPath in interface FolderService
        Throws:
        Exception
      • findByPath

        @GET
        @Path("/findByPath")
        @Produces("application/json")
        public WSFolder findByPath​(@QueryParam("path")
                                   String path)
                            throws Exception
        Description copied from interface: FolderService
        Finds the folder at the specified path
        Specified by:
        findByPath in interface FolderService
        Parameters:
        path - the path
        Returns:
        the folder
        Throws:
        Exception - error in the server application
      • getRootFolder

        @GET
        @Path("/getRootFolder")
        @Produces("application/json")
        public WSFolder getRootFolder()
                               throws Exception
        Description copied from interface: FolderService
        Gets the root folder
        Specified by:
        getRootFolder in interface FolderService
        Returns:
        the root folder
        Throws:
        Exception - error in the server application
      • 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 Exception
        Specified by:
        createFolder in interface FolderService
        Throws:
        Exception
      • getFolder

        @GET
        @Path("/getFolder")
        @Produces({"application/json","application/xml"})
        public WSFolder getFolder​(@QueryParam("folderId")
                                  long folderId)
                           throws Exception
        Specified by:
        getFolder in interface FolderService
        Throws:
        Exception
      • listChildren

        @GET
        @Path("/listChildren")
        @Produces({"application/json","application/xml"})
        public WSFolder[] listChildren​(@QueryParam("folderId")
                                       long folderId)
                                throws Exception
        Specified by:
        listChildren in interface FolderService
        Throws:
        Exception
      • update

        @POST
        @Path("/update")
        public void update​(WSFolder folder)
                    throws Exception
        Description copied from interface: FolderService
        Updates an existing folder. To perform this you need the RENAME permission.
        Specified by:
        update in interface FolderService
        Parameters:
        folder - The folders metadata(please compile the ID)
        Throws:
        Exception - error during update
      • rename

        @PUT
        @Path("/rename")
        public void rename​(@QueryParam("folderId")
                           long folderId,
                           @QueryParam("name")
                           String name)
                    throws Exception
        Description copied from interface: FolderService
        Renames an existing folder.
        Specified by:
        rename in interface FolderService
        Parameters:
        folderId - The folder id
        name - The new folder name
        Throws:
        Exception - error during folder rename
      • move

        @PUT
        @Path("/move")
        public void move​(@QueryParam("folderId")
                         long folderId,
                         @QueryParam("parentId")
                         long parentId)
                  throws Exception
        Description copied from interface: FolderService
        Moves an existing folder with the given identifier.
        Specified by:
        move in interface FolderService
        Parameters:
        folderId - The folder id
        parentId - The folder id of the new parent folder
        Throws:
        Exception - error in the server application
      • createAlias

        @POST
        @Path("/createAlias")
        @Consumes("application/x-www-form-urlencoded")
        public WSFolder createAlias​(@FormParam("parentId")
                                    long parentId,
                                    @FormParam("foldRef")
                                    long foldRef)
                             throws Exception
        Description copied from interface: FolderService
        Creates a new folder alias
        Specified by:
        createAlias in interface FolderService
        Parameters:
        parentId - The parent folder
        foldRef - The referenced folder
        Returns:
        The newly created alias
        Throws:
        Exception - error during alias creation
      • getDefaultWorkspace

        @GET
        @Path("/getDefaultWorkspace")
        public WSFolder getDefaultWorkspace()
                                     throws Exception
        Description copied from interface: FolderService
        Gets the Default workspace
        Specified by:
        getDefaultWorkspace in interface FolderService
        Returns:
        A value object containing the workspace's metadata
        Throws:
        Exception - error in the server application
      • listWorkspaces

        @GET
        @Path("/listWorkspaces")
        public WSFolder[] listWorkspaces()
                                  throws Exception
        Description copied from interface: FolderService
        Retrieves the list of all workspaces.
        Specified by:
        listWorkspaces in interface FolderService
        Returns:
        the list of all workspaces
        Throws:
        Exception - error in the server application
      • isReadable

        @GET
        @Path("/isReadable")
        public boolean isReadable​(@QueryParam("folderId")
                                  long folderId)
                           throws Exception
        Description copied from interface: FolderService
        Tests if a folder is readable.
        Specified by:
        isReadable in interface FolderService
        Parameters:
        folderId - The folder id
        Returns:
        True if the identifier denotes a readable folder, otherwise false.
        Throws:
        Exception - error in the server application
      • isWritable

        @GET
        @Path("/isWritable")
        public boolean isWritable​(@QueryParam("folderId")
                                  long folderId)
                           throws Exception
        Description copied from interface: FolderService
        Tests if a folder is writable
        Specified by:
        isWritable in interface FolderService
        Parameters:
        folderId - The folder id
        Returns:
        True if the identifier denotes a writable folder, otherwise false
        Throws:
        Exception - error in the server application
      • isGranted

        @GET
        @Path("/isGranted")
        public boolean isGranted​(@QueryParam("folderId")
                                 long folderId,
                                 @QueryParam("permission")
                                 int permission)
                          throws Exception
        Description copied from interface: FolderService
        Tests if the current user has a specific permission on a folder
        Specified by:
        isGranted in interface FolderService
        Parameters:
        folderId - The folder id
        permission - The permission representation
        Returns:
        True if the identifier denotes a granted permission, otherwise false
        Throws:
        Exception - error in the server application
      • 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 Exception
        Description copied from interface: FolderService
        Copies an existing folder with the given identifier.
        Specified by:
        copy in interface FolderService
        Parameters:
        folderId - The folder id
        targetId - The folder id of the target folder
        foldersOnly - If 1, only the folders will be copied and not the documents
        securityOption - 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:
        Exception - error during copy
      • grantUser

        @PUT
        @Path("/grantUser")
        public void grantUser​(@QueryParam("folderId")
                              long folderId,
                              @QueryParam("userId")
                              long userId,
                              @QueryParam("permissions")
                              int permissions,
                              @QueryParam("recursive")
                              boolean recursive)
                       throws Exception
        Description copied from interface: FolderService
        Grants user permission to the folder.
        Specified by:
        grantUser in interface FolderService
        Parameters:
        folderId - Folder id
        userId - User Id
        permissions - 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
      • grantGroup

        @PUT
        @Path("/grantGroup")
        public void grantGroup​(@QueryParam("folderId")
                               long folderId,
                               @QueryParam("groupId")
                               long groupId,
                               @QueryParam("permissions")
                               int permissions,
                               @QueryParam("recursive")
                               boolean recursive)
                        throws Exception
        Description copied from interface: FolderService
        Grants group permission to the folder
        Specified by:
        grantGroup in interface FolderService
        Parameters:
        folderId - Folder id
        groupId - Group Id
        permissions - 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
      • getGrantedGroups

        @GET
        @Path("/getGrantedGroups")
        public WSRight[] getGrantedGroups​(@QueryParam("folderId")
                                          long folderId)
                                   throws Exception
        Description copied from interface: FolderService
        Retrieves the list of granted groups for the given folder
        Specified by:
        getGrantedGroups in interface FolderService
        Parameters:
        folderId - Folder id
        Returns:
        'error' if error occurred, the right objects collection
        Throws:
        Exception - error in the server application
      • getGrantedUsers

        @GET
        @Path("/getGrantedUsers")
        public WSRight[] getGrantedUsers​(@QueryParam("folderId")
                                         long folderId)
                                  throws Exception
        Description copied from interface: FolderService
        Retrieves the list of granted users for the given folder.
        Specified by:
        getGrantedUsers in interface FolderService
        Parameters:
        folderId - Folder id
        Returns:
        'error' if error occurred, the right objects collection.
        Throws:
        Exception - error in the server application