Search in sources :

Example 1 with VCProvider

use of de.bps.course.nodes.vc.provider.VCProvider in project OpenOLAT by OpenOLAT.

the class VCCourseNode method createNodeRunConstructionResult.

@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    updateModuleConfigDefaults(false);
    // check if user is moderator of the virtual classroom
    Roles roles = ureq.getUserSession().getRoles();
    boolean moderator = roles.isOLATAdmin();
    Long key = userCourseEnv.getCourseEnvironment().getCourseResourceableId();
    if (!moderator) {
        if (roles.isInstitutionalResourceManager() | roles.isAuthor()) {
            RepositoryManager rm = RepositoryManager.getInstance();
            ICourse course = CourseFactory.loadCourse(key);
            RepositoryEntry re = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
            if (re != null) {
                moderator = rm.isOwnerOfRepositoryEntry(ureq.getIdentity(), re);
                if (!moderator) {
                    moderator = rm.isInstitutionalRessourceManagerFor(ureq.getIdentity(), ureq.getUserSession().getRoles(), re);
                }
            }
        }
    }
    // load configuration
    final String providerId = getModuleConfiguration().getStringValue(CONF_PROVIDER_ID);
    VCProvider provider = providerId == null ? VCProviderFactory.createDefaultProvider() : VCProviderFactory.createProvider(providerId);
    VCConfiguration config = handleConfig(provider);
    // create run controller
    Controller runCtr = new VCRunController(ureq, wControl, key + "_" + getIdent(), getShortName(), getLongTitle(), config, provider, moderator, userCourseEnv.isCourseReadOnly());
    Controller controller = TitledWrapperHelper.getWrapper(ureq, wControl, runCtr, this, "o_vc_icon");
    return new NodeRunConstructionResult(controller);
}
Also used : VCRunController(de.bps.course.nodes.vc.VCRunController) Roles(org.olat.core.id.Roles) RepositoryManager(org.olat.repository.RepositoryManager) ICourse(org.olat.course.ICourse) RepositoryEntry(org.olat.repository.RepositoryEntry) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) TabbableDefaultController(org.olat.core.gui.control.generic.tabbable.TabbableDefaultController) NoProviderController(de.bps.course.nodes.vc.NoProviderController) VCEditController(de.bps.course.nodes.vc.VCEditController) VCRunController(de.bps.course.nodes.vc.VCRunController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) ConditionEditController(org.olat.course.condition.ConditionEditController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult) VCProvider(de.bps.course.nodes.vc.provider.VCProvider) VCConfiguration(de.bps.course.nodes.vc.VCConfiguration)

Example 2 with VCProvider

use of de.bps.course.nodes.vc.provider.VCProvider in project OpenOLAT by OpenOLAT.

the class VCCourseNode method isConfigValid.

public StatusDescription isConfigValid() {
    if (oneClickStatusCache != null) {
        return oneClickStatusCache[0];
    }
    StatusDescription status = StatusDescription.NOERROR;
    // load configuration
    final String providerId = getModuleConfiguration().getStringValue(CONF_PROVIDER_ID);
    VCProvider provider = providerId == null ? VCProviderFactory.createDefaultProvider() : VCProviderFactory.createProvider(providerId);
    boolean invalid = provider == null || !handleConfig(provider).isConfigValid();
    if (invalid) {
        String[] params = new String[] { this.getShortTitle() };
        String shortKey = "error.config.short";
        String longKey = "error.config.long";
        String translationPackage = VCEditController.class.getPackage().getName();
        status = new StatusDescription(ValidationStatus.ERROR, shortKey, longKey, params, translationPackage);
        status.setDescriptionForUnit(getIdent());
        status.setActivateableViewIdentifier(VCEditController.PANE_TAB_VCCONFIG);
    }
    return status;
}
Also used : VCEditController(de.bps.course.nodes.vc.VCEditController) StatusDescription(org.olat.course.editor.StatusDescription) VCProvider(de.bps.course.nodes.vc.provider.VCProvider)

Example 3 with VCProvider

use of de.bps.course.nodes.vc.provider.VCProvider in project OpenOLAT by OpenOLAT.

the class AdobeConnectCleanupJob method executeWithDB.

@Override
public void executeWithDB(JobExecutionContext arg0) throws JobExecutionException {
    if (!VCProviderFactory.existsProvider(providerId)) {
        // same as dummy job
        return;
    }
    VCProvider provider = VCProviderFactory.createProvider(providerId);
    if (!provider.isEnabled()) {
        return;
    }
    if (!(provider instanceof AdobeConnectProvider)) {
        logger.error("Invalid configuration: defined a virtual classroom cleanup job and provider implementation doesn't fit");
        return;
    }
    AdobeConnectProvider adobe = (AdobeConnectProvider) provider;
    if (!adobe.isProviderAvailable()) {
        logger.debug("Tried to cleanup Adobe Connect meetings but it's actually not available");
        return;
    }
    // cleanup unused meetings
    if (cleanupMeetings) {
        logger.info("Start cleaning unused Adobe Connect meetings");
        cleanupMeetings(adobe, daysToKeep);
    }
    // cleanup unused moderator guest accounts
    if (cleanupModerators) {
        logger.info("Start cleaning unused Adobe Connect moderator guest accounts");
        cleanupModerators(adobe);
    }
}
Also used : VCProvider(de.bps.course.nodes.vc.provider.VCProvider)

Example 4 with VCProvider

use of de.bps.course.nodes.vc.provider.VCProvider in project openolat by klemens.

the class VCCourseNode method createNodeRunConstructionResult.

@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    updateModuleConfigDefaults(false);
    // check if user is moderator of the virtual classroom
    Roles roles = ureq.getUserSession().getRoles();
    boolean moderator = roles.isOLATAdmin();
    Long key = userCourseEnv.getCourseEnvironment().getCourseResourceableId();
    if (!moderator) {
        if (roles.isInstitutionalResourceManager() | roles.isAuthor()) {
            RepositoryManager rm = RepositoryManager.getInstance();
            ICourse course = CourseFactory.loadCourse(key);
            RepositoryEntry re = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
            if (re != null) {
                moderator = rm.isOwnerOfRepositoryEntry(ureq.getIdentity(), re);
                if (!moderator) {
                    moderator = rm.isInstitutionalRessourceManagerFor(ureq.getIdentity(), ureq.getUserSession().getRoles(), re);
                }
            }
        }
    }
    // load configuration
    final String providerId = getModuleConfiguration().getStringValue(CONF_PROVIDER_ID);
    VCProvider provider = providerId == null ? VCProviderFactory.createDefaultProvider() : VCProviderFactory.createProvider(providerId);
    VCConfiguration config = handleConfig(provider);
    // create run controller
    Controller runCtr = new VCRunController(ureq, wControl, key + "_" + getIdent(), getShortName(), getLongTitle(), config, provider, moderator, userCourseEnv.isCourseReadOnly());
    Controller controller = TitledWrapperHelper.getWrapper(ureq, wControl, runCtr, this, "o_vc_icon");
    return new NodeRunConstructionResult(controller);
}
Also used : VCRunController(de.bps.course.nodes.vc.VCRunController) Roles(org.olat.core.id.Roles) RepositoryManager(org.olat.repository.RepositoryManager) ICourse(org.olat.course.ICourse) RepositoryEntry(org.olat.repository.RepositoryEntry) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) TabbableDefaultController(org.olat.core.gui.control.generic.tabbable.TabbableDefaultController) NoProviderController(de.bps.course.nodes.vc.NoProviderController) VCEditController(de.bps.course.nodes.vc.VCEditController) VCRunController(de.bps.course.nodes.vc.VCRunController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) ConditionEditController(org.olat.course.condition.ConditionEditController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult) VCProvider(de.bps.course.nodes.vc.provider.VCProvider) VCConfiguration(de.bps.course.nodes.vc.VCConfiguration)

Example 5 with VCProvider

use of de.bps.course.nodes.vc.provider.VCProvider in project openolat by klemens.

the class VCCourseNode method isConfigValid.

public StatusDescription isConfigValid() {
    if (oneClickStatusCache != null) {
        return oneClickStatusCache[0];
    }
    StatusDescription status = StatusDescription.NOERROR;
    // load configuration
    final String providerId = getModuleConfiguration().getStringValue(CONF_PROVIDER_ID);
    VCProvider provider = providerId == null ? VCProviderFactory.createDefaultProvider() : VCProviderFactory.createProvider(providerId);
    boolean invalid = provider == null || !handleConfig(provider).isConfigValid();
    if (invalid) {
        String[] params = new String[] { this.getShortTitle() };
        String shortKey = "error.config.short";
        String longKey = "error.config.long";
        String translationPackage = VCEditController.class.getPackage().getName();
        status = new StatusDescription(ValidationStatus.ERROR, shortKey, longKey, params, translationPackage);
        status.setDescriptionForUnit(getIdent());
        status.setActivateableViewIdentifier(VCEditController.PANE_TAB_VCCONFIG);
    }
    return status;
}
Also used : VCEditController(de.bps.course.nodes.vc.VCEditController) StatusDescription(org.olat.course.editor.StatusDescription) VCProvider(de.bps.course.nodes.vc.provider.VCProvider)

Aggregations

VCProvider (de.bps.course.nodes.vc.provider.VCProvider)12 VCConfiguration (de.bps.course.nodes.vc.VCConfiguration)6 VCEditController (de.bps.course.nodes.vc.VCEditController)6 NoProviderController (de.bps.course.nodes.vc.NoProviderController)4 TabbableDefaultController (org.olat.core.gui.control.generic.tabbable.TabbableDefaultController)4 NodeEditController (org.olat.course.editor.NodeEditController)4 VCRunController (de.bps.course.nodes.vc.VCRunController)2 Controller (org.olat.core.gui.control.Controller)2 TabbableController (org.olat.core.gui.control.generic.tabbable.TabbableController)2 Roles (org.olat.core.id.Roles)2 ICourse (org.olat.course.ICourse)2 ConditionEditController (org.olat.course.condition.ConditionEditController)2 StatusDescription (org.olat.course.editor.StatusDescription)2 AbstractAccessableCourseNode (org.olat.course.nodes.AbstractAccessableCourseNode)2 CourseNode (org.olat.course.nodes.CourseNode)2 NodeRunConstructionResult (org.olat.course.run.navigation.NodeRunConstructionResult)2 RepositoryEntry (org.olat.repository.RepositoryEntry)2 RepositoryManager (org.olat.repository.RepositoryManager)2