Package org.olat.repository

Examples of org.olat.repository.RepositoryEntryImportExport


  public void exportNode(File exportDirectory, ICourse course) {
    RepositoryEntry re = WikiEditController.getWikiReference(getModuleConfiguration(), false);
    if (re == null) return;
    File fExportDirectory = new File(exportDirectory, getIdent());
    fExportDirectory.mkdirs();
    RepositoryEntryImportExport reie = new RepositoryEntryImportExport(re, fExportDirectory);
    reie.exportDoExport();
  }
View Full Code Here


   *      org.olat.course.ICourse, org.olat.core.gui.UserRequest,
   *      org.olat.core.gui.control.WindowControl)
   */
  public Controller importNode(File importDirectory, ICourse course, boolean unattendedImport, UserRequest ureq, WindowControl wControl) {
    File importSubdir = new File(importDirectory, getIdent());
    RepositoryEntryImportExport rie = new RepositoryEntryImportExport(importSubdir);
    if (!rie.anyExportedPropertiesAvailable()) return null;

    // do import referenced repository entries
    if (unattendedImport) {
      Identity admin = ManagerFactory.getManager().findIdentityByName("administrator");
      ImportReferencesController.doImport(rie, this, ImportReferencesController.IMPORT_WIKI ,true, admin);
View Full Code Here

    // export right groups
    PersistingCourseGroupManager.getInstance(this).exportCourseRightGroups(fExportedDataDir);
    // export repo metadata
    RepositoryManager rm = RepositoryManager.getInstance();
    RepositoryEntry myRE = rm.lookupRepositoryEntry(this, true);
    RepositoryEntryImportExport importExport = new RepositoryEntryImportExport(myRE, fExportedDataDir);
    importExport.exportDoExportProperties();
   
    //OLAT-5368: do intermediate commit to avoid transaction timeout
    // discussion intermediatecommit vs increased transaction timeout:
    //  pro intermediatecommit: not much
    //  pro increased transaction timeout: would fix OLAT-5368 but only move the problem
View Full Code Here

  }

  private void processSharedFolder(UserRequest ureq) {
    // if shared folder controller exists we did already import this one.
    if (sharedFolderImportController == null) {
      RepositoryEntryImportExport sfImportExport = SharedFolderManager.getInstance().getRepositoryImportExport(getExportDataDir(course));
      sharedFolderImportController = new ImportSharedfolderReferencesController(sfImportExport, course, ureq, getWindowControl());
      sharedFolderImportController.addControllerListener(this);
      myPanel.setContent(sharedFolderImportController.getInitialComponent());
    }
  }
View Full Code Here

  }

  private void processGlossary(UserRequest ureq) {
    // if glossary controller exists we did already import this one.
    if (glossaryImportController == null) {
      RepositoryEntryImportExport sfImportExport = GlossaryManager.getInstance().getRepositoryImportExport(getExportDataDir(course));
      glossaryImportController = new ImportGlossaryReferencesController(sfImportExport, course, ureq, getWindowControl());
      glossaryImportController.addControllerListener(this);
      myPanel.setContent(glossaryImportController.getInitialComponent());
    }
  }
View Full Code Here

    //  pro increased transaction timeout: would fix OLAT-5368 but only move the problem
    //@TODO OLAT-2597: real solution is a long-running background-task concept...
    DBFactory.getInstance().intermediateCommit();

    // export properties
    RepositoryEntryImportExport reImportExport = new RepositoryEntryImportExport(re, fExportBaseDirectory);
    return reImportExport.exportDoExport();
  }
View Full Code Here

    return reImportExport.exportDoExport();
  }
 
  public RepositoryEntryImportExport getRepositoryImportExport(File importDataDir) {
    File fImportBaseDirectory = new File(importDataDir, "sharedfolder");
    return new RepositoryEntryImportExport(fImportBaseDirectory);
  }
View Full Code Here

    File courseExportData = ImportCourseController.getExportDataDir(course);
    // get the export data directory
    // create the repository entry
    RepositoryManager rm = RepositoryManager.getInstance();
    RepositoryEntry re = rm.createRepositoryEntryInstance("administrator");
    RepositoryEntryImportExport importExport = new RepositoryEntryImportExport(courseExportData);
    String softKey = importExport.getSoftkey();
    RepositoryEntry existingEntry = rm.lookupRepositoryEntryBySoftkey(softKey, false);
    if (existingEntry != null) {
      Tracing.logInfo("RepositoryEntry with softkey " + softKey + " already exists. Course will not be deployed.", CourseFactory.class);
      CourseFactory.deleteCourse(newCourseResource);
      return existingEntry;
    }
    // ok, continue import
    newCourseResource = OLATResourceManager.getInstance().findOrPersistResourceable(newCourseResource);
    re.setOlatResource(newCourseResource);
    re.setSoftkey(softKey);
    re.setInitialAuthor(importExport.getInitialAuthor());
    re.setDisplayname(importExport.getDisplayName());
    re.setResourcename(importExport.getResourceName());
    re.setDescription(importExport.getDescription());
    re.setCanLaunch(true);
   
    // set access configuration
    re.setAccess(access);
   
View Full Code Here

  }
 
  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

   * @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.repository.RepositoryEntryImportExport

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.