Search in sources :

Example 1 with Room

use of org.apache.openmeetings.db.entity.room.Room in project openmeetings by apache.

the class RoomDao method get.

public List<Room> get() {
    OpenJPAEntityManager oem = OpenJPAPersistence.cast(em);
    boolean qrce = oem.getFetchPlan().getQueryResultCacheEnabled();
    try {
        // update in cache during update
        oem.getFetchPlan().setQueryResultCacheEnabled(false);
        TypedQuery<Room> q = oem.createNamedQuery("getBackupRooms", Room.class);
        @SuppressWarnings("unchecked") OpenJPAQuery<Room> kq = OpenJPAPersistence.cast(q);
        kq.getFetchPlan().addFetchGroups("roomModerators", "roomGroups", "roomFiles");
        return kq.getResultList();
    } finally {
        oem.getFetchPlan().setQueryResultCacheEnabled(qrce);
    }
}
Also used : OpenJPAEntityManager(org.apache.openjpa.persistence.OpenJPAEntityManager) Room(org.apache.openmeetings.db.entity.room.Room)

Example 2 with Room

use of org.apache.openmeetings.db.entity.room.Room in project openmeetings by apache.

the class MessageDialog method onSubmit.

@Override
protected void onSubmit(AjaxRequestTarget target) {
    PrivateMessage m = getModelObject();
    m.setInserted(new Date());
    User owner = userDao.get(getUserId());
    if (m.isBookedRoom()) {
        Room r = m.getRoom();
        r.setName(m.getSubject());
        r.setComment("");
        r.setCapacity(100L);
        r.setAppointment(true);
        r.setAllowUserQuestions(true);
        r = roomDao.update(r, getUserId());
        Appointment a = new Appointment();
        a.setTitle(m.getSubject());
        a.setDescription(m.getMessage());
        a.setRoom(r);
        a.setStart(CalendarWebHelper.getDate(start.getModelObject()));
        a.setEnd(CalendarWebHelper.getDate(end.getModelObject()));
        List<MeetingMember> attendees = new ArrayList<>();
        for (User to : modelTo.getObject()) {
            MeetingMember mm = new MeetingMember();
            mm.setUser(to);
            mm.setDeleted(false);
            mm.setInserted(a.getInserted());
            mm.setUpdated(a.getUpdated());
            mm.setAppointment(a);
            attendees.add(mm);
        }
        a.setOwner(owner);
        a.setMeetingMembers(attendees);
        apptDao.update(a, getUserId(), false);
        m.setRoom(r);
    } else {
        m.setRoom(null);
    }
    for (User to : modelTo.getObject()) {
        if (to.getId() == null) {
            userDao.update(to, getUserId());
        }
        // to send
        PrivateMessage p = new PrivateMessage(m);
        p.setTo(to);
        p.setFolderId(SENT_FOLDER_ID);
        msgDao.update(p, getUserId());
        // to inbox
        p = new PrivateMessage(m);
        p.setOwner(to);
        p.setFolderId(INBOX_FOLDER_ID);
        msgDao.update(p, getUserId());
        if (to.getAddress() != null) {
            String aLinkHTML = (isPrivate && to.getType() == Type.user) ? "<br/><br/>" + "<a href='" + getContactsLink() + "'>" + Application.getString("1302", to.getLanguageId()) + "</a><br/>" : "";
            String invitationLink = "";
            if (p.isBookedRoom()) {
                Invitation i = inviteManager.getInvitation(to, p.getRoom(), false, null, Valid.Period, owner, to.getLanguageId(), CalendarHelper.getDate(start.getModelObject(), to.getTimeZoneId()), CalendarHelper.getDate(end.getModelObject(), to.getTimeZoneId()), null);
                invitationLink = getInvitationLink(i, WebSession.get().getExtendedProperties().getBaseUrl());
                if (invitationLink == null) {
                    invitationLink = "";
                } else {
                    invitationLink = // 
                    "<br/>" + Application.getString("503", to.getLanguageId()) + "<br/><a href='" + invitationLink + "'>" + Application.getString("504", to.getLanguageId()) + "</a><br/>";
                }
            }
            String subj = p.getSubject() == null ? "" : p.getSubject();
            handler.send(to.getAddress().getEmail(), Application.getString("1301", to.getLanguageId()) + subj, (p.getMessage() == null ? "" : p.getMessage().replaceAll("\\<.*?>", "")) + aLinkHTML + invitationLink);
        }
    }
}
Also used : Appointment(org.apache.openmeetings.db.entity.calendar.Appointment) User(org.apache.openmeetings.db.entity.user.User) MeetingMember(org.apache.openmeetings.db.entity.calendar.MeetingMember) ArrayList(java.util.ArrayList) Invitation(org.apache.openmeetings.db.entity.room.Invitation) PrivateMessage(org.apache.openmeetings.db.entity.user.PrivateMessage) Room(org.apache.openmeetings.db.entity.room.Room) Date(java.util.Date)

Example 3 with Room

use of org.apache.openmeetings.db.entity.room.Room in project openmeetings by apache.

the class AppointmentDialog method createAppRoom.

public static Room createAppRoom() {
    Room r = new Room();
    r.setAppointment(true);
    r.hide(RoomElement.MicrophoneStatus);
    if (r.getType() == null) {
        r.setType(Room.Type.conference);
    }
    return r;
}
Also used : Room(org.apache.openmeetings.db.entity.room.Room)

Example 4 with Room

use of org.apache.openmeetings.db.entity.room.Room in project openmeetings by apache.

the class RoomMenuPanel method onInitialize.

@Override
protected void onInitialize() {
    exitMenuItem = new RoomMenuItem(getString("308"), getString("309"), "room menu exit") {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            exit(target);
        }
    };
    filesMenu = new RoomMenuItem(getString("245"), null, false);
    actionsSubMenu.init();
    pollsSubMenu.init();
    add((menuPanel = new MenuPanel("menu", getMenu())).setVisible(isVisible()));
    add(askBtn.add(AttributeModifier.replace(ATTR_TITLE, getString("84"))));
    Label demo = new Label("demo", Model.of(""));
    Room r = room.getRoom();
    add(demo.setVisible(r.isDemoRoom() && r.getDemoTime() != null && room.getRoom().getDemoTime().intValue() > 0));
    if (demo.isVisible()) {
        demo.add(new OmRedirectTimerBehavior(room.getRoom().getDemoTime().intValue(), "637") {

            private static final long serialVersionUID = 1L;

            @Override
            protected void onTimer(int remain) {
                getComponent().add(AttributeModifier.replace(ATTR_TITLE, getText("639", remain)));
            }

            @Override
            protected void onFinish(AjaxRequestTarget target) {
                exit(target);
            }
        });
    }
    super.onInitialize();
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) MenuPanel(org.apache.openmeetings.web.common.menu.MenuPanel) OmRedirectTimerBehavior(org.apache.openmeetings.web.room.OmRedirectTimerBehavior) Label(org.apache.wicket.markup.html.basic.Label) RoomMenuItem(org.apache.openmeetings.web.common.menu.RoomMenuItem) Room(org.apache.openmeetings.db.entity.room.Room)

Example 5 with Room

use of org.apache.openmeetings.db.entity.room.Room in project openmeetings by apache.

the class StartSharingButton method onClick.

@Override
public void onClick(AjaxRequestTarget target) {
    try (InputStream jnlp = getClass().getClassLoader().getResourceAsStream("APPLICATION.jnlp")) {
        app = IOUtils.toString(jnlp, UTF_8);
        Client c = cm.get(uid);
        String sid = c.getSid();
        Long roomId = c.getRoom().getId();
        JSONObject s = VideoSettings.getInitJson(sid);
        String _url = s.getString(VideoSettings.URL);
        Room room = roomDao.get(roomId);
        app = app.replace("$native", String.valueOf(s.getBoolean(FLASH_NATIVE_SSL))).replace("$codebase", WebSession.get().getExtendedProperties().getCodebase()).replace("$applicationName", getApplicationName()).replace("$url", _url).replace("$fallback", s.getString(VideoSettings.FALLBACK)).replace("$sid", sid).replace("$labels", getLabels("730", "731", "732", "733", "734", "735", "737", "738", "739", "740", "741", "742", "844", "869", "870", "871", "872", "878", "1089", "1090", "1091", "1092", "1093", "1465", "1466", "1467", "1468", "1469", "1470", "1471", "1472", "1473", "1474", "1475", "1476", "1477", "1589", "1598", "1078")).replace("$defaultQuality", String.valueOf(cfgDao.getLong(CONFIG_SCREENSHARING_QUALITY, 1L))).replace("$defaultFps", String.valueOf(cfgDao.getLong(CONFIG_SCREENSHARING_FPS, 10L))).replace("$showFps", String.valueOf(cfgDao.getBool(CONFIG_SCREENSHARING_FPS_SHOW, true))).replace("$allowRemote", String.valueOf(cfgDao.getBool(CONFIG_SCREENSHARING_ALLOW_REMOTE, true))).replace("$allowRecording", String.valueOf(room.isAllowRecording() && (0 == scm.getRecordingCount(roomId)))).replace("$allowPublishing", String.valueOf(0 == scm.getPublishingCount(roomId)));
        download.initiate(target);
    } catch (Exception e) {
        log.error("Unexpected error while creating jnlp file", e);
    }
}
Also used : JSONObject(com.github.openjson.JSONObject) InputStream(java.io.InputStream) Client(org.apache.openmeetings.db.entity.basic.Client) Room(org.apache.openmeetings.db.entity.room.Room)

Aggregations

Room (org.apache.openmeetings.db.entity.room.Room)54 Test (org.junit.Test)9 ArrayList (java.util.ArrayList)7 RoomDTO (org.apache.openmeetings.db.dto.room.RoomDTO)7 User (org.apache.openmeetings.db.entity.user.User)7 Path (javax.ws.rs.Path)6 Appointment (org.apache.openmeetings.db.entity.calendar.Appointment)6 WebMethod (javax.jws.WebMethod)5 ServiceResult (org.apache.openmeetings.db.dto.basic.ServiceResult)5 RoomGroup (org.apache.openmeetings.db.entity.room.RoomGroup)5 Date (java.util.Date)4 GET (javax.ws.rs.GET)4 Client (org.apache.openmeetings.db.entity.basic.Client)4 MeetingMember (org.apache.openmeetings.db.entity.calendar.MeetingMember)4 RoomDao (org.apache.openmeetings.db.dao.room.RoomDao)3 Recording (org.apache.openmeetings.db.entity.record.Recording)3 RoomModerator (org.apache.openmeetings.db.entity.room.RoomModerator)3 WebSession (org.apache.openmeetings.web.app.WebSession)3 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)3 Label (org.apache.wicket.markup.html.basic.Label)3