Search in sources :

Example 1 with OpenMeetingsException

use of org.olat.modules.openmeetings.manager.OpenMeetingsException in project OpenOLAT by OpenOLAT.

the class OpenMeetingsRunController method doStart.

private void doStart(UserRequest ureq) {
    if (room == null && room.getRoomId() <= 0) {
        showError("room.notfound.error");
    } else {
        try {
            String securedHash = openMeetingsManager.setUserToRoom(getIdentity(), room.getRoomId(), moderator);
            String url = openMeetingsManager.getURL(getIdentity(), room.getRoomId(), securedHash, getLocale());
            RedirectMediaResource redirect = new RedirectMediaResource(url);
            ureq.getDispatchResult().setResultingMediaResource(redirect);
        } catch (OpenMeetingsException e) {
            showError(e.i18nKey());
        }
    }
}
Also used : RedirectMediaResource(org.olat.core.gui.media.RedirectMediaResource) OpenMeetingsException(org.olat.modules.openmeetings.manager.OpenMeetingsException)

Example 2 with OpenMeetingsException

use of org.olat.modules.openmeetings.manager.OpenMeetingsException in project OpenOLAT by OpenOLAT.

the class OpenMeetingsRunController method redirectToGuestRoom.

private void redirectToGuestRoom(String firstName, String lastName) {
    if (room == null && room.getRoomId() <= 0) {
        showError("room.notfound.error");
    } else {
        try {
            String securedHash = openMeetingsManager.setGuestUserToRoom(firstName, lastName, room.getRoomId());
            String url = openMeetingsManager.getURL(getIdentity(), room.getRoomId(), securedHash, getLocale());
            DisplayOrDownloadComponent cmp = new DisplayOrDownloadComponent("openCommand", url);
            mainVC.put("openCmd", cmp);
        } catch (OpenMeetingsException e) {
            showError(e.i18nKey());
        }
    }
}
Also used : DisplayOrDownloadComponent(org.olat.core.gui.components.download.DisplayOrDownloadComponent) OpenMeetingsException(org.olat.modules.openmeetings.manager.OpenMeetingsException)

Example 3 with OpenMeetingsException

use of org.olat.modules.openmeetings.manager.OpenMeetingsException in project OpenOLAT by OpenOLAT.

the class CollaborationTools method deleteTools.

/**
 * delete all CollaborationTools stuff from the database, which is related to
 * the calling OLATResourceable.
 */
public void deleteTools(BusinessGroup businessGroupTodelete) {
    NarrowedPropertyManager npm = NarrowedPropertyManager.getInstance(ores);
    /*
		 * delete the forum, if existing
		 */
    ForumManager fom = ForumManager.getInstance();
    Property forumKeyProperty = npm.findProperty(null, null, PROP_CAT_BG_COLLABTOOLS, KEY_FORUM);
    if (forumKeyProperty != null) {
        // if there was a forum, delete it
        Long forumKey = forumKeyProperty.getLongValue();
        if (forumKey == null)
            throw new AssertException("property had no longValue, prop:" + forumKeyProperty);
        fom.deleteForum(forumKey);
    }
    /*
		 * delete the folder, if existing
		 */
    OlatRootFolderImpl vfsContainer = new OlatRootFolderImpl(getFolderRelPath(), null);
    File fFolderRoot = vfsContainer.getBasefile();
    if (fFolderRoot.exists()) {
        FileUtils.deleteDirsAndFiles(fFolderRoot, true, true);
    }
    /*
		 * delete the wiki if existing
		 */
    VFSContainer rootContainer = WikiManager.getInstance().getWikiRootContainer(ores);
    if (rootContainer != null)
        rootContainer.delete();
    /*
		 * Delete calendar if exists
		 */
    if (businessGroupTodelete != null) {
        CoreSpringFactory.getImpl(ImportToCalendarManager.class).deleteGroupImportedCalendars(businessGroupTodelete);
        CoreSpringFactory.getImpl(CalendarManager.class).deleteGroupCalendar(businessGroupTodelete);
    }
    /*
		 * delete chatRoom
		 */
    // no cleanup needed, automatically done when last user exits the room
    /*
		 * delete all Properties defining enabled/disabled CollabTool XY and the
		 * news content
		 */
    npm.deleteProperties(null, null, PROP_CAT_BG_COLLABTOOLS, null);
    /*
		 * Delete OpenMeetings room
		 */
    OpenMeetingsModule omModule = CoreSpringFactory.getImpl(OpenMeetingsModule.class);
    if (omModule.isEnabled()) {
        OpenMeetingsManager omManager = CoreSpringFactory.getImpl(OpenMeetingsManager.class);
        try {
            omManager.deleteAll(ores, null, null);
        } catch (OpenMeetingsException e) {
            log.error("A room could not be deleted for group: " + ores, e);
        }
    }
    /*
		 * and last but not least the cache is reseted
		 */
    cacheToolStates.clear();
    this.dirty = true;
}
Also used : AssertException(org.olat.core.logging.AssertException) VFSContainer(org.olat.core.util.vfs.VFSContainer) OpenMeetingsModule(org.olat.modules.openmeetings.OpenMeetingsModule) ImportToCalendarManager(org.olat.commons.calendar.manager.ImportToCalendarManager) ImportToCalendarManager(org.olat.commons.calendar.manager.ImportToCalendarManager) CalendarManager(org.olat.commons.calendar.CalendarManager) OlatRootFolderImpl(org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl) ForumManager(org.olat.modules.fo.manager.ForumManager) OpenMeetingsException(org.olat.modules.openmeetings.manager.OpenMeetingsException) NarrowedPropertyManager(org.olat.properties.NarrowedPropertyManager) Property(org.olat.properties.Property) File(java.io.File) OpenMeetingsManager(org.olat.modules.openmeetings.manager.OpenMeetingsManager)

Example 4 with OpenMeetingsException

use of org.olat.modules.openmeetings.manager.OpenMeetingsException in project OpenOLAT by OpenOLAT.

the class OpenMeetingsRecordingController method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source == downloadLink) {
        try {
            String url = openMeetingsManager.getRecordingURL(recording);
            MediaResource downloadUrl = new RedirectMediaResource(url);
            ureq.getDispatchResult().setResultingMediaResource(downloadUrl);
        } catch (OpenMeetingsException e) {
            logError("", e);
        }
    }
}
Also used : RedirectMediaResource(org.olat.core.gui.media.RedirectMediaResource) OpenMeetingsException(org.olat.modules.openmeetings.manager.OpenMeetingsException) MediaResource(org.olat.core.gui.media.MediaResource) RedirectMediaResource(org.olat.core.gui.media.RedirectMediaResource)

Example 5 with OpenMeetingsException

use of org.olat.modules.openmeetings.manager.OpenMeetingsException in project OpenOLAT by OpenOLAT.

the class OpenMeetingsRecordingsController method loadModel.

private void loadModel() {
    try {
        List<OpenMeetingsRecording> recordings = openMeetingsManager.getRecordings(roomId);
        List<OpenMeetingsRecording> readyRecordings = new ArrayList<OpenMeetingsRecording>(recordings.size());
        for (OpenMeetingsRecording recording : recordings) {
            if (StringHelper.containsNonWhitespace(recording.getDownloadName())) {
                readyRecordings.add(recording);
            }
        }
        ((OpenMeetingsRecordingsDataModel) tableCtr.getTableDataModel()).setObjects(readyRecordings);
        tableCtr.modelChanged();
    } catch (OpenMeetingsException e) {
        showError(e.i18nKey());
    }
}
Also used : OpenMeetingsRecording(org.olat.modules.openmeetings.model.OpenMeetingsRecording) ArrayList(java.util.ArrayList) OpenMeetingsException(org.olat.modules.openmeetings.manager.OpenMeetingsException)

Aggregations

OpenMeetingsException (org.olat.modules.openmeetings.manager.OpenMeetingsException)14 RedirectMediaResource (org.olat.core.gui.media.RedirectMediaResource)4 OpenMeetingsManager (org.olat.modules.openmeetings.manager.OpenMeetingsManager)4 File (java.io.File)2 ArrayList (java.util.ArrayList)2 CalendarManager (org.olat.commons.calendar.CalendarManager)2 ImportToCalendarManager (org.olat.commons.calendar.manager.ImportToCalendarManager)2 OlatRootFolderImpl (org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl)2 DisplayOrDownloadComponent (org.olat.core.gui.components.download.DisplayOrDownloadComponent)2 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)2 MediaResource (org.olat.core.gui.media.MediaResource)2 OLATResourceable (org.olat.core.id.OLATResourceable)2 AssertException (org.olat.core.logging.AssertException)2 VFSContainer (org.olat.core.util.vfs.VFSContainer)2 ForumManager (org.olat.modules.fo.manager.ForumManager)2 OpenMeetingsModule (org.olat.modules.openmeetings.OpenMeetingsModule)2 OpenMeetingsRecording (org.olat.modules.openmeetings.model.OpenMeetingsRecording)2 OpenMeetingsRoom (org.olat.modules.openmeetings.model.OpenMeetingsRoom)2 NarrowedPropertyManager (org.olat.properties.NarrowedPropertyManager)2 Property (org.olat.properties.Property)2