Search in sources :

Example 1 with GoToError

use of org.olat.modules.gotomeeting.model.GoToError in project OpenOLAT by OpenOLAT.

the class GoToTrainingWebService method handleUnexpectedException.

private Response handleUnexpectedException() {
    GoToError status = new GoToError(GoToErrors.Unkown);
    GoToErrorVO error = new GoToErrorVO(status, "GoToTraining server returned an unexpected error");
    return Response.serverError().entity(error).status(Status.INTERNAL_SERVER_ERROR).build();
}
Also used : GoToError(org.olat.modules.gotomeeting.model.GoToError)

Example 2 with GoToError

use of org.olat.modules.gotomeeting.model.GoToError in project OpenOLAT by OpenOLAT.

the class EditTrainingController method formOK.

@Override
protected void formOK(UserRequest ureq) {
    String name = nameEl.getValue();
    String description = descriptionEl.getValue();
    Date start = startDateEl.getDate();
    Date end = endDateEl.getDate();
    GoToError error = new GoToError();
    if (meeting == null) {
        String selectedKeyStr = organizersEl.getSelectedKey();
        int selectedIndex = Integer.parseInt(selectedKeyStr);
        GoToOrganizer organizer = availablesOrganizers.get(selectedIndex);
        meetingManager.scheduleTraining(organizer, name, null, description, start, end, entry, subIdent, businessGroup, error);
    } else {
        meetingManager.updateTraining(meeting, name, description, start, end, error);
    }
    if (error.hasError()) {
        fireEvent(ureq, new GoToErrorEvent(error));
    } else {
        fireEvent(ureq, Event.DONE_EVENT);
    }
}
Also used : GoToOrganizer(org.olat.modules.gotomeeting.GoToOrganizer) GoToError(org.olat.modules.gotomeeting.model.GoToError) Date(java.util.Date)

Example 3 with GoToError

use of org.olat.modules.gotomeeting.model.GoToError in project OpenOLAT by OpenOLAT.

the class GoToMeetingController method doJoin.

private void doJoin(UserRequest ureq) {
    boolean join = false;
    GoToError error = new GoToError();
    if (registrant == null) {
        registrant = meetingMgr.registerTraining(meeting, getIdentity(), error);
    }
    if (registrant != null) {
        String joinUrl = registrant.getJoinUrl();
        if (joinUrl != null) {
            RedirectMediaResource redirect = new RedirectMediaResource(joinUrl);
            ureq.getDispatchResult().setResultingMediaResource(redirect);
            join = true;
        }
    }
    if (!join) {
        final String errorMessage;
        if (error.hasError()) {
            if (error.getError() != null) {
                errorMessage = translate(error.getError().i18nKey());
            } else {
                errorMessage = translate("error.code.unkown");
            }
        } else {
            errorMessage = translate("error.code.unkown");
        }
        ControllerCreator creator = BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, new ControllerCreator() {

            @Override
            public Controller createController(UserRequest lureq, WindowControl lwControl) {
                // Wrap in column layout, popup window needs a layout controller
                String title = "";
                String text = errorMessage;
                Controller ctr = MessageUIFactory.createErrorMessage(lureq, lwControl, title, text);
                LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(lureq, lwControl, ctr);
                layoutCtr.addDisposableChildController(ctr);
                return layoutCtr;
            }
        });
        openInNewBrowserWindow(ureq, creator);
    }
    updateButtons();
}
Also used : GoToError(org.olat.modules.gotomeeting.model.GoToError) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) RedirectMediaResource(org.olat.core.gui.media.RedirectMediaResource) WindowControl(org.olat.core.gui.control.WindowControl) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) Controller(org.olat.core.gui.control.Controller) BasicController(org.olat.core.gui.control.controller.BasicController) ControllerCreator(org.olat.core.gui.control.creator.ControllerCreator) UserRequest(org.olat.core.gui.UserRequest)

Example 4 with GoToError

use of org.olat.modules.gotomeeting.model.GoToError in project OpenOLAT by OpenOLAT.

the class GoToRecordingsController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    // add the table
    FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(RecordingsCols.name.i18nHeaderKey(), RecordingsCols.name.ordinal(), true, RecordingsCols.name.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(RecordingsCols.start.i18nHeaderKey(), RecordingsCols.start.ordinal(), true, RecordingsCols.start.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(RecordingsCols.end.i18nHeaderKey(), RecordingsCols.end.ordinal(), true, RecordingsCols.end.name()));
    columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("select", translate("select"), "select"));
    tableModel = new GoToRecordingsTableModel(columnsModel);
    GoToError error = new GoToError();
    List<GoToRecordingsG2T> recordings = meetingMgr.getRecordings(meeting, error);
    if (recordings == null) {
        recordings = new ArrayList<>(1);
    }
    tableModel.setObjects(recordings);
    tableEl = uifactory.addTableElement(getWindowControl(), "recordings", tableModel, getTranslator(), formLayout);
    tableEl.setEmtpyTableMessageKey("recordings.empty");
    tableEl.setCustomizeColumns(false);
}
Also used : GoToError(org.olat.modules.gotomeeting.model.GoToError) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) GoToRecordingsG2T(org.olat.modules.gotomeeting.model.GoToRecordingsG2T) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)

Example 5 with GoToError

use of org.olat.modules.gotomeeting.model.GoToError in project OpenOLAT by OpenOLAT.

the class EditOrganizerController method formOK.

@Override
protected void formOK(UserRequest ureq) {
    String name = accountLabelEl.getValue();
    String username = usernameEl.getValue();
    String password = passwordEl.getValue();
    GoToError error = new GoToError();
    if (meetingManager.addOrganizer(name, username, password, owner, error)) {
        fireEvent(ureq, Event.DONE_EVENT);
    } else {
        showWarning("error.code." + error.getErrorCode());
    }
}
Also used : GoToError(org.olat.modules.gotomeeting.model.GoToError)

Aggregations

GoToError (org.olat.modules.gotomeeting.model.GoToError)16 RedirectMediaResource (org.olat.core.gui.media.RedirectMediaResource)4 GoToOrganizer (org.olat.modules.gotomeeting.GoToOrganizer)4 Date (java.util.Date)2 Response (javax.ws.rs.core.Response)2 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)2 UserRequest (org.olat.core.gui.UserRequest)2 DefaultFlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)2 FlexiTableColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel)2 Controller (org.olat.core.gui.control.Controller)2 WindowControl (org.olat.core.gui.control.WindowControl)2 BasicController (org.olat.core.gui.control.controller.BasicController)2 ControllerCreator (org.olat.core.gui.control.creator.ControllerCreator)2 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)2 GoToMeeting (org.olat.modules.gotomeeting.GoToMeeting)2 GoToRecordingsG2T (org.olat.modules.gotomeeting.model.GoToRecordingsG2T)2