Search in sources :

Example 1 with FileExplorerObject

use of org.apache.openmeetings.db.dto.file.FileExplorerObject in project openmeetings by apache.

the class TestFileService method testGetRoom.

@Test
public void testGetRoom() {
    ServiceResult r = login();
    FileExplorerObject fo = getClient(getFileUrl()).path("/room/5").query("sid", r.getMessage()).get(FileExplorerObject.class);
    assertNotNull(fo);
}
Also used : ServiceResult(org.apache.openmeetings.db.dto.basic.ServiceResult) FileExplorerObject(org.apache.openmeetings.db.dto.file.FileExplorerObject) Test(org.junit.Test)

Example 2 with FileExplorerObject

use of org.apache.openmeetings.db.dto.file.FileExplorerObject in project openmeetings by apache.

the class FileWebService method getRoom.

/**
 * Get a File Explorer Object by a given Room
 *
 * @param sid
 *            The SID of the User. This SID must be marked as logged in
 * @param roomId
 *            Room Id
 * @return - File Explorer Object by a given Room
 */
@WebMethod
@GET
@Path("/room/{id}")
public FileExplorerObject getRoom(@WebParam(name = "sid") @QueryParam("sid") String sid, @WebParam(name = "id") @PathParam("id") long roomId) {
    log.debug("getRoom::roomId {}", roomId);
    return performCall(sid, User.Right.Room, sd -> {
        FileExplorerObject fileExplorerObject = new FileExplorerObject();
        // Home File List
        List<FileItem> fList = fileDao.getByOwner(sd.getUserId());
        fileExplorerObject.setUser(fList, fileDao.getSize(fList));
        // Public File List
        List<FileItem> rList = fileDao.getByRoom(roomId);
        fileExplorerObject.setRoom(rList, fileDao.getSize(rList));
        return fileExplorerObject;
    });
}
Also used : FileItem(org.apache.openmeetings.db.entity.file.FileItem) FileExplorerObject(org.apache.openmeetings.db.dto.file.FileExplorerObject) WebMethod(javax.jws.WebMethod) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Aggregations

FileExplorerObject (org.apache.openmeetings.db.dto.file.FileExplorerObject)2 WebMethod (javax.jws.WebMethod)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 ServiceResult (org.apache.openmeetings.db.dto.basic.ServiceResult)1 FileItem (org.apache.openmeetings.db.entity.file.FileItem)1 Test (org.junit.Test)1