Package org.olat.course.config

Examples of org.olat.course.config.CourseConfig


    importedRepositoryEntry.setOwnerGroup(newGroup);
    rm.saveRepositoryEntry(importedRepositoryEntry);
   
    if (!keepSoftkey) {
      // set the new shared folder reference
      CourseConfig courseConfig = course.getCourseEnvironment().getCourseConfig();
      courseConfig.setSharedFolderSoftkey(importedRepositoryEntry.getSoftkey());
      CourseSharedFolderController.updateRefTo(importedRepositoryEntry, course);     
      CourseFactory.setCourseConfig(course.getResourceableId(), courseConfig);
    }
   
    return importedRepositoryEntry;
View Full Code Here


      if (event == ReferencableEntriesSearchController.EVENT_REPOSITORY_ENTRY_SELECTED) {
        // repository search controller done
        RepositoryEntry re = searchController.getSelectedEntry();
        if (re != null) {
          CourseConfigManager ccm = CourseConfigManagerImpl.getInstance();
          CourseConfig courseConfig = course.getCourseEnvironment().getCourseConfig();
          courseConfig.setSharedFolderSoftkey(re.getSoftkey());
          ccm.saveConfigTo(course, courseConfig);
          CourseSharedFolderController.updateRefTo(re, course);
          getWindowControl().setInfo(getTranslator().translate("import.reattach.success"));
          fireEvent(ureq, Event.DONE_EVENT);
        }
View Full Code Here

      continueButton = LinkFactory.createButton("import.redetails.continue", importGlossaryVC, this);
      return;
    } else if (source == noopButton) {
      // delete reference
      CourseConfigManager ccm = CourseConfigManagerImpl.getInstance();
      CourseConfig courseConfig = course.getCourseEnvironment().getCourseConfig();
      courseConfig.setGlossarySoftKey(null);
      ccm.saveConfigTo(course, courseConfig);
      fireEvent(ureq, Event.DONE_EVENT);
    } else if (source == cancelButton) {
      fireEvent(ureq, Event.CANCELLED_EVENT);
    } else if (source == continueButton) {
View Full Code Here

    importedRepositoryEntry.setOwnerGroup(newGroup);
    rm.saveRepositoryEntry(importedRepositoryEntry);

    if (!keepSoftkey) {
      // set the new glossary reference
      CourseConfig courseConfig = course.getCourseEnvironment().getCourseConfig();
      courseConfig.setGlossarySoftKey(importedRepositoryEntry.getSoftkey());
      ReferenceManager.getInstance().addReference(course, importedRepositoryEntry.getOlatResource(),
          GlossaryManager.GLOSSARY_REPO_REF_IDENTIFYER);     
      CourseFactory.setCourseConfig(course.getResourceableId(), courseConfig);
    }
View Full Code Here

      if (event == ReferencableEntriesSearchController.EVENT_REPOSITORY_ENTRY_SELECTED) {
        // repository search controller done
        RepositoryEntry re = searchController.getSelectedEntry();
        if (re != null) {
          CourseConfigManager ccm = CourseConfigManagerImpl.getInstance();
          CourseConfig courseConfig = course.getCourseEnvironment().getCourseConfig();
          courseConfig.setGlossarySoftKey(re.getSoftkey());
          ccm.saveConfigTo(course, courseConfig);
          ReferenceManager.getInstance().addReference(course, re.getOlatResource(), GlossaryManager.GLOSSARY_REPO_REF_IDENTIFYER);
          getWindowControl().setInfo(getTranslator().translate("import.reattach.success"));
          fireEvent(ureq, Event.DONE_EVENT);
        }
View Full Code Here

      nodeListPos = 0;
      boolean finished = processNodeList(ureq);
      if (finished) {
        // no node wanted to provide a controller to import its stuff. We're finished processing the nodes.
        // now process any shared folder reference...
        CourseConfig courseConfig = course.getCourseEnvironment().getCourseConfig();
        if (courseConfig.hasCustomSharedFolder()) {
          processSharedFolder(ureq);
        }
        else if (courseConfig.hasGlossary()) {
          processGlossary(ureq);
        }
        else {
          // only when no sharedFolder and no glossary
          //getWindowControl().pushAsModalDialog(translator.translate("import.suc.title"), finishedMessage);
          // save the editor tree model, to persist any changes made during import.         
          CourseFactory.saveCourseEditorTreeModel(course.getResourceableId());
          callback.finished(ureq);
        }
      }
    } else if (source == activeImportController) {
      if (event == Event.DONE_EVENT) {
        // continues to search through the list of nodes
        boolean finished = processNodeList(ureq);
        if (finished) {
          CourseConfig courseConfig = CourseConfigManagerImpl.getInstance().loadConfigFor(course);
          if (courseConfig.hasCustomSharedFolder()) {
            processSharedFolder(ureq);
          } else if (courseConfig.hasGlossary()) {
            processGlossary(ureq);
          } else {
            //getWindowControl().pushAsModalDialog(translator.translate("import.suc.title"), finishedMessage);
            // save the editor tree model, to persist any changes made during import.           
            CourseFactory.saveCourseEditorTreeModel(course.getResourceableId());
            callback.finished(ureq);
          }
        }
      } else if (event == Event.CANCELLED_EVENT) {
        callback.canceled(ureq);
        return;
      } else if (event == Event.FAILED_EVENT) {
        callback.canceled(ureq);
        getWindowControl().setError(getTranslator().translate("add.failed"));
        return;
      }
    } else if (source == sharedFolderImportController) {
      if (event == Event.DONE_EVENT) {
        CourseConfig courseConfig = CourseConfigManagerImpl.getInstance().loadConfigFor(course);
        if (courseConfig.hasGlossary()) {
          processGlossary(ureq);
        } else {
          //getWindowControl().pushAsModalDialog(translator.translate("import.suc.title"), finishedMessage);
          // save the editor tree model, to persist any changes made during import.         
          CourseFactory.saveCourseEditorTreeModel(course.getResourceableId());
View Full Code Here

    File fTargetCourseBasePath = targetCourse.getCourseBaseContainer().getBasefile();
   
    synchronized (sourceCourse) { // o_clusterNOK - cannot be solved with doInSync since could take too long (leads to error: "Lock wait timeout exceeded")
      // copy configuration
      CourseConfig courseConf = CourseConfigManagerImpl.getInstance().copyConfigOf(sourceCourse);
      targetCourse.setCourseConfig(courseConf);
      // save structures
      targetCourse.setRunStructure((Structure) XStreamHelper.xstreamClone(sourceCourse.getRunStructure()));
      targetCourse.saveRunStructure();
      targetCourse.setEditorTreeModel((CourseEditorTreeModel) XStreamHelper.xstreamClone(sourceCourse.getEditorTreeModel()));
View Full Code Here

    File fCanonicalCourseBasePath = newCourse.getCourseBaseContainer().getBasefile();
    if (ZipUtil.unzip(zipFile, fCanonicalCourseBasePath)) {
      // Load course strucure now
      try {
        newCourse.load();
        CourseConfig cc = CourseConfigManagerImpl.getInstance().loadConfigFor(newCourse);               
        //newCourse is not in cache yet, so we cannot call setCourseConfig()
        newCourse.setCourseConfig(cc);
        putCourseInCache(newCourse.getResourceableId(), newCourse);           
        return newCourse;
      } catch (AssertException ae) {
View Full Code Here

      registerReferences(course, childNode);
    }
  }
 
  private static void deployReferencedSharedFolders(File importDirectory, ICourse course) {
    CourseConfig cc = course.getCourseEnvironment().getCourseConfig();
    if (!cc.hasCustomSharedFolder()) return;
    RepositoryEntryImportExport importExport = SharedFolderManager.getInstance()
      .getRepositoryImportExport(importDirectory);
    Identity owner = ManagerFactory.getManager().findIdentityByName("administrator");
    ImportSharedfolderReferencesController.doImport(importExport, course, false, owner);
  }
View Full Code Here

   * Deploy referenced glossaries using the administrator account as owner
   * @param importDirectory
   * @param course
   */
  private static void deployReferencedGlossary(File importDirectory, ICourse course) {
    CourseConfig cc = course.getCourseEnvironment().getCourseConfig();
    if (!cc.hasGlossary()) return;
    RepositoryEntryImportExport importExport = GlossaryManager.getInstance().getRepositoryImportExport(importDirectory);
    Identity owner = ManagerFactory.getManager().findIdentityByName("administrator");
    ImportGlossaryReferencesController.doImport(importExport, course, false, owner);
  }
View Full Code Here

TOP

Related Classes of org.olat.course.config.CourseConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.