Search in sources :

Example 16 with RoomServicePortType

use of org.apache.openmeetings.axis.services.RoomServicePortType in project OpenOLAT by OpenOLAT.

the class OpenMeetingsManagerImpl method getOpenOLATRooms.

@Override
public List<OpenMeetingsRoom> getOpenOLATRooms() {
    try {
        String adminSID = adminLogin();
        RoomServicePortType roomWs = getRoomWebService();
        GetRoomsWithCurrentUsersByListAndType getRooms = new GetRoomsWithCurrentUsersByListAndType();
        getRooms.setAsc(true);
        getRooms.setExternalRoomType(getOpenOLATExternalType());
        getRooms.setOrderby("name");
        getRooms.setStart(0);
        getRooms.setMax(2000);
        getRooms.setSID(adminSID);
        Map<Long, RoomReturnInfo> realRooms = new HashMap<Long, RoomReturnInfo>();
        // get rooms on openmeetings
        List<RoomReturn> roomsRet = roomWs.getRoomsWithCurrentUsersByListAndType(adminSID, 0, 2000, "name", true, getOpenOLATExternalType());
        if (roomsRet != null) {
            for (RoomReturn roomRet : roomsRet) {
                RoomReturnInfo info = new RoomReturnInfo();
                info.setName(roomRet.getName());
                info.setRoomId(roomRet.getRoomId());
                int numOfUsers = 0;
                if (roomRet.getRoomUser() != null) {
                    for (RoomUser user : roomRet.getRoomUser()) {
                        if (user != null) {
                            numOfUsers++;
                        }
                    }
                }
                info.setNumOfUsers(numOfUsers);
                realRooms.put(new Long(roomRet.getRoomId()), info);
            }
        }
        // get properties saved
        List<OpenMeetingsRoomReference> props = openMeetingsDao.getReferences();
        Map<Long, String> roomIdToResources = getResourceNames(props);
        List<OpenMeetingsRoom> rooms = new ArrayList<OpenMeetingsRoom>();
        for (OpenMeetingsRoomReference prop : props) {
            Long roomId = new Long(prop.getRoomId());
            RoomReturnInfo infos = realRooms.get(roomId);
            if (infos != null) {
                OpenMeetingsRoom room = openMeetingsDao.deserializeRoom(prop.getConfig());
                room.setReference(prop);
                room.setName(infos.getName());
                room.setNumOfUsers(infos.getNumOfUsers());
                String resourceName = roomIdToResources.get(roomId);
                if (resourceName != null) {
                    room.setResourceName(resourceName);
                }
                rooms.add(room);
            }
        }
        return rooms;
    } catch (Exception e) {
        log.error("", e);
        return null;
    }
}
Also used : RoomUser(org.apache.openmeetings.axis.services.xsd.RoomUser) OpenMeetingsRoom(org.olat.modules.openmeetings.model.OpenMeetingsRoom) GetRoomsWithCurrentUsersByListAndType(org.apache.openmeetings.axis.services.GetRoomsWithCurrentUsersByListAndType) RoomReturn(org.apache.openmeetings.axis.services.xsd.RoomReturn) HashMap(java.util.HashMap) OpenMeetingsRoomReference(org.olat.modules.openmeetings.model.OpenMeetingsRoomReference) ArrayList(java.util.ArrayList) ConnectException(java.net.ConnectException) RoomServicePortType(org.apache.openmeetings.axis.services.RoomServicePortType) RoomReturnInfo(org.olat.modules.openmeetings.model.RoomReturnInfo)

Example 17 with RoomServicePortType

use of org.apache.openmeetings.axis.services.RoomServicePortType in project openolat by klemens.

the class OpenMeetingsManagerImpl method getRoomById.

private OpenMeetingsRoom getRoomById(String sid, OpenMeetingsRoom room, long roomId) throws OpenMeetingsException {
    try {
        RoomServicePortType roomWs = getRoomWebService();
        Room omRoom = roomWs.getRoomById(sid, roomId);
        if (omRoom != null) {
            room.setComment(omRoom.getComment());
            if (omRoom.isIsModeratedRoom() != null) {
                room.setModerated(omRoom.isIsModeratedRoom());
            }
            if (omRoom.isIsAudioOnly() != null) {
                room.setAudioOnly(omRoom.isIsAudioOnly());
            }
            room.setName(omRoom.getName());
            if (omRoom.getRoomsId() != null) {
                room.setRoomId(omRoom.getRoomsId());
            } else {
                room.setRoomId(roomId);
            }
            room.setSize(omRoom.getNumberOfPartizipants());
            room.setType(omRoom.getRoomtype().getRoomtypesId());
            room.setClosed(omRoom.isIsClosed());
            return room;
        } else {
            return null;
        }
    } catch (Exception e) {
        log.error("", e);
        throw translateException(e, 0);
    }
}
Also used : RoomServicePortType(org.apache.openmeetings.axis.services.RoomServicePortType) OpenMeetingsRoom(org.olat.modules.openmeetings.model.OpenMeetingsRoom) Room(org.apache.openmeetings.persistence.beans.room.xsd.Room) ConnectException(java.net.ConnectException)

Example 18 with RoomServicePortType

use of org.apache.openmeetings.axis.services.RoomServicePortType in project openolat by klemens.

the class OpenMeetingsManagerImpl method deleteRoom.

@Override
public boolean deleteRoom(OpenMeetingsRoom room) {
    try {
        String adminSID = adminLogin();
        RoomServicePortType roomWs = getRoomWebService();
        long ret = roomWs.deleteRoom(adminSID, room.getRoomId());
        boolean ok = ret > 0;
        if (ok && room.getReference() != null) {
            openMeetingsDao.delete(room.getReference());
        }
        return ok;
    } catch (Exception e) {
        log.error("", e);
        return false;
    }
}
Also used : RoomServicePortType(org.apache.openmeetings.axis.services.RoomServicePortType) ConnectException(java.net.ConnectException)

Example 19 with RoomServicePortType

use of org.apache.openmeetings.axis.services.RoomServicePortType in project openolat by klemens.

the class OpenMeetingsManagerImpl method getRoomWebService.

private final RoomServicePortType getRoomWebService() {
    RoomService ss = new RoomService();
    RoomServicePortType port = ss.getRoomServiceHttpSoap11Endpoint();
    String endPoint = getOpenMeetingsEndPoint() + "RoomService?wsdl";
    ((BindingProvider) port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endPoint);
    return port;
}
Also used : RoomService(org.apache.openmeetings.axis.services.RoomService) RoomServicePortType(org.apache.openmeetings.axis.services.RoomServicePortType)

Example 20 with RoomServicePortType

use of org.apache.openmeetings.axis.services.RoomServicePortType in project openolat by klemens.

the class OpenMeetingsManagerImpl method getRecordings.

@Override
public List<OpenMeetingsRecording> getRecordings(long roomId) throws OpenMeetingsException {
    try {
        String adminSID = adminLogin();
        RoomServicePortType roomWs = getRoomWebService();
        List<FlvRecording> recordings = roomWs.getFlvRecordingByRoomId(adminSID, roomId);
        List<OpenMeetingsRecording> recList = new ArrayList<OpenMeetingsRecording>();
        if (recordings != null) {
            for (FlvRecording recording : recordings) {
                if (recording != null) {
                    OpenMeetingsRecording rec = new OpenMeetingsRecording();
                    rec.setRoomId(recording.getRoomId());
                    rec.setRecordingId(recording.getFlvRecordingId());
                    rec.setFilename(recording.getFileName());
                    rec.setDownloadName(recording.getFileHash());
                    rec.setDownloadNameAlt(recording.getAlternateDownload());
                    rec.setPreviewImage(recording.getPreviewImage());
                    rec.setWidth(recording.getFlvWidth());
                    rec.setHeight(recording.getFlvHeight());
                    recList.add(rec);
                }
            }
        }
        return recList;
    } catch (Exception e) {
        log.error("", e);
        throw translateException(e, 0);
    }
}
Also used : FlvRecording(org.apache.openmeetings.persistence.beans.flvrecord.xsd.FlvRecording) OpenMeetingsRecording(org.olat.modules.openmeetings.model.OpenMeetingsRecording) ArrayList(java.util.ArrayList) RoomServicePortType(org.apache.openmeetings.axis.services.RoomServicePortType) ConnectException(java.net.ConnectException)

Aggregations

RoomServicePortType (org.apache.openmeetings.axis.services.RoomServicePortType)20 ConnectException (java.net.ConnectException)18 ArrayList (java.util.ArrayList)4 RoomReturn (org.apache.openmeetings.axis.services.xsd.RoomReturn)4 RoomUser (org.apache.openmeetings.axis.services.xsd.RoomUser)4 OpenMeetingsRoom (org.olat.modules.openmeetings.model.OpenMeetingsRoom)4 OpenMeetingsRoomReference (org.olat.modules.openmeetings.model.OpenMeetingsRoomReference)4 HashMap (java.util.HashMap)2 GetRoomsWithCurrentUsersByListAndType (org.apache.openmeetings.axis.services.GetRoomsWithCurrentUsersByListAndType)2 RoomService (org.apache.openmeetings.axis.services.RoomService)2 FlvRecording (org.apache.openmeetings.persistence.beans.flvrecord.xsd.FlvRecording)2 Room (org.apache.openmeetings.persistence.beans.room.xsd.Room)2 OpenMeetingsRecording (org.olat.modules.openmeetings.model.OpenMeetingsRecording)2 RoomReturnInfo (org.olat.modules.openmeetings.model.RoomReturnInfo)2