diff --git a/src/main/java/de/bps/course/nodes/VCCourseNode.java b/src/main/java/de/bps/course/nodes/VCCourseNode.java index 88de8b60fcda2c5a1e28db895168824a66354468..b83de59023be726363ed84849e4112e5a978738f 100644 --- a/src/main/java/de/bps/course/nodes/VCCourseNode.java +++ b/src/main/java/de/bps/course/nodes/VCCourseNode.java @@ -27,6 +27,7 @@ import org.olat.core.gui.components.stack.StackedController; import org.olat.core.gui.control.Controller; import org.olat.core.gui.control.WindowControl; import org.olat.core.gui.control.generic.tabbable.TabbableController; +import org.olat.core.gui.control.generic.tabbable.TabbableDefaultController; import org.olat.core.id.Roles; import org.olat.core.util.Util; import org.olat.core.util.ValidationStatus; @@ -46,6 +47,7 @@ import org.olat.course.run.userview.UserCourseEnvironment; import org.olat.repository.RepositoryEntry; import org.olat.repository.RepositoryManager; +import de.bps.course.nodes.vc.NoProviderController; import de.bps.course.nodes.vc.VCConfiguration; import de.bps.course.nodes.vc.VCEditController; import de.bps.course.nodes.vc.VCRunController; @@ -106,15 +108,23 @@ public class VCCourseNode extends AbstractAccessableCourseNode { // load and check configuration String providerId = getModuleConfiguration().getStringValue(CONF_PROVIDER_ID); VCProvider provider = providerId == null ? VCProviderFactory.createDefaultProvider() : VCProviderFactory.createProvider(providerId); - VCConfiguration config = handleConfig(provider); - // create room if configured to do it immediately - if(config.isCreateMeetingImmediately()) { - Long key = course.getResourceableId(); - // here, the config is empty in any case, thus there are no start and end dates - provider.createClassroom(key + "_" + this.getIdent(), this.getShortName(), this.getLongTitle(), null, null, config); + + TabbableDefaultController childTabCntrllr; + if(provider != null) { + VCConfiguration config = handleConfig(provider); + // create room if configured to do it immediately + if(config.isCreateMeetingImmediately()) { + Long key = course.getResourceableId(); + // here, the config is empty in any case, thus there are no start and end dates + provider.createClassroom(key + "_" + this.getIdent(), this.getShortName(), this.getLongTitle(), null, null, config); + } + // create edit controller + childTabCntrllr = new VCEditController(ureq, wControl, this, course, userCourseEnv, provider, config); + } else { + //empty panel + childTabCntrllr = new NoProviderController(ureq, wControl); } - // create edit controller - VCEditController childTabCntrllr = new VCEditController(ureq, wControl, this, course, userCourseEnv, provider, config); + NodeEditController nodeEditCtr = new NodeEditController(ureq, wControl, course.getEditorTreeModel(), course, chosenNode, course.getCourseEnvironment() .getCourseGroupManager(), userCourseEnv, childTabCntrllr); nodeEditCtr.addControllerListener(childTabCntrllr); @@ -176,8 +186,7 @@ public class VCCourseNode extends AbstractAccessableCourseNode { // load configuration final String providerId = getModuleConfiguration().getStringValue(CONF_PROVIDER_ID); VCProvider provider = providerId == null ? VCProviderFactory.createDefaultProvider() : VCProviderFactory.createProvider(providerId); - VCConfiguration config = handleConfig(provider); - boolean invalid = !config.isConfigValid(); + boolean invalid = provider == null || !handleConfig(provider).isConfigValid(); if (invalid) { String[] params = new String[] { this.getShortTitle() }; String shortKey = "error.config.short"; diff --git a/src/main/java/de/bps/course/nodes/vc/NoProviderController.java b/src/main/java/de/bps/course/nodes/vc/NoProviderController.java new file mode 100644 index 0000000000000000000000000000000000000000..4f0a56610ef765548cef5c632fe8300a966e1685 --- /dev/null +++ b/src/main/java/de/bps/course/nodes/vc/NoProviderController.java @@ -0,0 +1,62 @@ +/** + * <a href="http://www.openolat.org"> + * OpenOLAT - Online Learning and Training</a><br> + * <p> + * Licensed under the Apache License, Version 2.0 (the "License"); <br> + * you may not use this file except in compliance with the License.<br> + * You may obtain a copy of the License at the + * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a> + * <p> + * Unless required by applicable law or agreed to in writing,<br> + * software distributed under the License is distributed on an "AS IS" BASIS, <br> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br> + * See the License for the specific language governing permissions and <br> + * limitations under the License. + * <p> + * Initial code contributed and copyrighted by<br> + * frentix GmbH, http://www.frentix.com + * <p> + */ +package de.bps.course.nodes.vc; + +import org.olat.core.gui.UserRequest; +import org.olat.core.gui.components.Component; +import org.olat.core.gui.components.tabbedpane.TabbedPane; +import org.olat.core.gui.components.velocity.VelocityContainer; +import org.olat.core.gui.control.Event; +import org.olat.core.gui.control.WindowControl; +import org.olat.core.gui.control.generic.tabbable.TabbableDefaultController; + +/** + * + * this is a dummy controller to show only a tab with an error message. + * + * Initial date: 29.05.2013<br> + * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com + * + */ +public class NoProviderController extends TabbableDefaultController { + + private final VelocityContainer noProviderVc; + + public NoProviderController(UserRequest ureq, WindowControl wControl) { + super(ureq, wControl); + noProviderVc = createVelocityContainer("noprovider"); + } + + @Override + public void addTabs(TabbedPane tabbedPane) { + tabbedPane.addTab(translate(VCEditController.PANE_TAB_VCCONFIG), noProviderVc); + // + } + + @Override + protected void event(UserRequest ureq, Component source, Event event) { + // + } + + @Override + protected void doDispose() { + // + } +} \ No newline at end of file diff --git a/src/main/java/de/bps/course/nodes/vc/_content/noprovider.html b/src/main/java/de/bps/course/nodes/vc/_content/noprovider.html new file mode 100644 index 0000000000000000000000000000000000000000..1bb32217bc7f6a56cb0bcc15a31c2decd9806c68 --- /dev/null +++ b/src/main/java/de/bps/course/nodes/vc/_content/noprovider.html @@ -0,0 +1,3 @@ +<div class="b_warning"> + $r.translate("error.config.noprovider") +</div> \ No newline at end of file diff --git a/src/main/java/de/bps/course/nodes/vc/_i18n/LocalStrings_de.properties b/src/main/java/de/bps/course/nodes/vc/_i18n/LocalStrings_de.properties index a3faa4c8fe77cd984a189df783e4f33d611553e9..5448c643ce905a09ceb6b49de66ae92a6aeb6a8b 100644 --- a/src/main/java/de/bps/course/nodes/vc/_i18n/LocalStrings_de.properties +++ b/src/main/java/de/bps/course/nodes/vc/_i18n/LocalStrings_de.properties @@ -8,7 +8,7 @@ config.header.extended=Erweiterte Konfiguration config.select.vc=System f\u00fcr virtuellen Klassenraum error.config.short=Konfiguration von "{0}" fehlerhaft error.config.long=Die Konfiguration des Kursbausteins "{0}" ist fehlerhaft oder unvollst\u00e4ndig. - +error.config.noprovider=Es gibt kein Provider für virtuellen Klassenzimmer in diesem OpenOLAT eingestellt. Bitte fragen Sie ihr Administrator! error.update.room=Das virtuelle Klassenzimmer konnte nicht mit den aktuellen Einstellungen synchronisiert werden. Bitte wenden Sie sich an Ihren Betreuer oder Ihre Systemadministratoren. delete.meeting.title=Virtuelles Klassenzimmers l\u00f6schen diff --git a/src/main/java/de/bps/course/nodes/vc/_i18n/LocalStrings_en.properties b/src/main/java/de/bps/course/nodes/vc/_i18n/LocalStrings_en.properties index ac66b5cc024ab5c2c9a892b1be9191e2ee8ee38a..0973b8bde6aabcd16e297a227d6bf50d25bfce95 100644 --- a/src/main/java/de/bps/course/nodes/vc/_i18n/LocalStrings_en.properties +++ b/src/main/java/de/bps/course/nodes/vc/_i18n/LocalStrings_en.properties @@ -8,7 +8,7 @@ config.header.extended=Extended configuration config.select.vc=System for virtual classroom error.config.short=Configuration of "{0}" contains errors error.config.long=The configuration of the course node "{0}" contains errors or is incomplete. - +error.config.noprovider=There isn't any virtual classroom provider configured for this OpenOLAT, please ask for administrator. error.update.room=Sorry! An error occured while synchronizing the virtual class room with the actual configuration. Please, inform your tutor or system administrator. delete.meeting.title=Delete virtual classroom