use of org.apache.openmeetings.db.entity.room.Room in project openmeetings by apache.
the class RoomWebService method open.
/**
* Method to remotely open rooms. If a room is closed all users
* inside the room and all users that try to enter it will be redirected to
* the redirectURL that is defined in the Room-Object.
*
* Returns positive value if authentication was successful.
*
* @param sid
* The SID of the User. This SID must be marked as Loggedin
* @param id
* the room id
*
* @return - 1 in case of success, -2 otherwise
*/
@WebMethod
@GET
@Path("/open/{id}")
public ServiceResult open(@WebParam(name = "sid") @QueryParam("sid") String sid, @WebParam(name = "id") @PathParam("id") long id) {
return performCall(sid, User.Right.Soap, sd -> {
Room room = roomDao.get(id);
room.setClosed(false);
roomDao.update(room, sd.getUserId());
return new ServiceResult("Opened", Type.SUCCESS);
});
}
use of org.apache.openmeetings.db.entity.room.Room in project openmeetings by apache.
the class RoomWebService method add.
/**
* Adds a new Room like through the Frontend
*
* @param sid
* The SID from getSession
* @param room
* room object
*
* @return - id of the user added or error code
*/
@WebMethod
@POST
@Path("/")
public RoomDTO add(@WebParam(name = "sid") @QueryParam("sid") String sid, @WebParam(name = "room") @FormParam("room") RoomDTO room) {
return performCall(sid, User.Right.Soap, sd -> {
Room r = room.get(fileDao);
r = updateRtoRoom(r, sd.getUserId());
return new RoomDTO(r);
});
}
use of org.apache.openmeetings.db.entity.room.Room in project openmeetings by apache.
the class TestRoomService method testCreate2.
@Test
public void testCreate2() {
Room.Type type = Room.Type.presentation;
String name = "Unit Test Ext Room2";
String comment = "Unit Test Ext Room Comments2";
RoomDTO r = new RoomDTO();
r.setType(type);
r.setName(name);
r.setComment(comment);
r.setCapacity(CAPACITY);
createAndValidate(r);
}
use of org.apache.openmeetings.db.entity.room.Room in project openmeetings by apache.
the class TestRoomService method testCreate1.
@Test
public void testCreate1() {
String extId = UUID.randomUUID().toString();
Room.Type type = Room.Type.presentation;
String name = "Unit Test Ext Room1";
String comment = "Unit Test Ext Room Comments1";
RoomDTO r = new RoomDTO();
r.setType(type);
r.setName(name);
r.setComment(comment);
r.setCapacity(CAPACITY);
r.setExternalType(UNIT_TEST_EXT_TYPE);
r.setExternalId(extId);
createAndValidate(r);
}
use of org.apache.openmeetings.db.entity.room.Room in project openmeetings by apache.
the class TestRoomService method testExternal.
@Test
public void testExternal() {
ServiceResult sr = login();
String extId = UUID.randomUUID().toString();
Room.Type type = Room.Type.presentation;
String name = "Unit Test Ext Room";
String comment = "Unit Test Ext Room Comments";
RoomDTO r = new RoomDTO();
r.setType(type);
r.setName(name);
r.setComment(comment);
r.setCapacity(CAPACITY);
RoomDTO room = getClient(getRoomUrl()).path(String.format("/%s/%s/%s", type, UNIT_TEST_EXT_TYPE, extId)).query("sid", sr.getMessage()).query("room", r.toString()).get(RoomDTO.class);
assertNotNull("Valid room should be returned", room);
assertNotNull("Room ID should be not empty", room.getId());
RoomDTO room1 = getClient(getRoomUrl()).path(String.format("/%s/%s/%s", Room.Type.presentation, UNIT_TEST_EXT_TYPE, extId)).query("sid", sr.getMessage()).get(RoomDTO.class);
assertNotNull("Valid room should be returned", room1);
assertEquals("Same Room should be returned", room.getId(), room1.getId());
}
Aggregations