Package org.olat.core.util.vfs

Examples of org.olat.core.util.vfs.VFSContainer


       
        relPath = targetDir.substring(personalFolderDir.length()).replace("\\", "/");
        targetDir = targetDir.substring(0, personalFolderDir.length());
      }
     
      VFSContainer targetFolder = new LocalFolderImpl(new File(targetDir));
      FolderRunController bcrun = new FolderRunController(targetFolder, true, ureq, getWindowControl());
      Component folderComponent = bcrun.getInitialComponent();
      if (relPath.length()!=0) {
        if (!relPath.endsWith("/")) {
          relPath = relPath + "/";
View Full Code Here


  }

  public MediaResource getAsMediaResource(OLATResourceable res) {
    String exportFileName = res.getResourceableId() + ".zip";
    File fExportZIP = new File(FolderConfig.getCanonicalTmpDir() + "/" + exportFileName);
    VFSContainer sharedFolder = SharedFolderManager.getInstance().getSharedFolder(res);
   
    //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
    //@TODO OLAT-2597: real solution is a long-running background-task concept...
    DBFactory.getInstance().intermediateCommit();

    ZipUtil.zip(sharedFolder.getItems(), new LocalFileImpl(fExportZIP));
    return new CleanupAfterDeliveryFileMediaResource(fExportZIP);
  }
View Full Code Here

    File fImportBaseDirectory = new File(importDataDir, "sharedfolder");
    return new RepositoryEntryImportExport(fImportBaseDirectory);
  }

  public void deleteSharedFolder(OLATResourceable res) {
    VFSContainer rootContainer = FileResourceManager.getInstance().getFileResourceRootImpl(res);
    VersionsManager.getInstance().delete(rootContainer,true);
    FileResourceManager.getInstance().deleteFileResource(res);
  }
View Full Code Here

    FileResourceManager.getInstance().deleteFileResource(res);
  }
 
  public SharedFolderFileResource createSharedFolder() {
    SharedFolderFileResource resource = new SharedFolderFileResource();
    VFSContainer rootContainer = FileResourceManager.getInstance().getFileResourceRootImpl(resource);
    if (rootContainer.createChildContainer(FOLDER_NAME) == null) return null;
    OLATResourceManager rm = OLATResourceManager.getInstance();
    OLATResource ores = rm.createOLATResourceInstance(resource);
    rm.saveOLATResource(ores);
    return resource;
  }
View Full Code Here

  public String archive(String archivFilePath, RepositoryEntry repoEntry) {
    String exportFileName = "del_sharedfolder_" + repoEntry.getOlatResource().getResourceableId() + ".zip";
    String fullFilePath = archivFilePath + File.separator + exportFileName;
    File fExportZIP = new File(fullFilePath);
    VFSContainer sharedFolder = SharedFolderManager.getInstance().getSharedFolder(repoEntry.getOlatResource());
    ZipUtil.zip(sharedFolder.getItems(), new LocalFileImpl(fExportZIP));
    return fullFilePath;
  }
View Full Code Here

      RepositoryEntry repoEntry = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(courseConfig.getGlossarySoftKey()false);
      if (repoEntry == null) {
        // seems to be removed
        return null;
      }
      VFSContainer glossaryFolder = GlossaryManager.getInstance().getGlossaryRootFolder(repoEntry.getOlatResource());
      String glossaryId = repoEntry.getOlatResource().getResourceableId().toString();
      return new GlossaryMarkupItemController(ureq, wControl, tmComponent, glossaryFolder, glossaryId);
    }
    return null;
  }
View Full Code Here

          false);
      if (repoEntry == null) {
        // seems to be removed
        return null;
      }
      VFSContainer glossaryFolder = GlossaryManager.getInstance().getGlossaryRootFolder(repoEntry.getOlatResource());
      return new GlossaryMainController(lwControl, lureq, glossaryFolder, repoEntry.getOlatResource(), allowGlossaryEditing);
    }
    return null;
  }
View Full Code Here

  /**
   * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
   */
  public void event(UserRequest ureq, Component source, Event event) {
    if (source == previewButton) {
      VFSContainer sharedFolderPreview = SharedFolderManager.getInstance().getNamedSharedFolder(re);
      sfdCtr = new SharedFolderDisplayController(ureq, getWindowControl(), sharedFolderPreview, re, true);
      cmc = new CloseableModalController(getWindowControl(), translator.translate("close"), sfdCtr.getInitialComponent());
      cmc.activate();
    }
  }
View Full Code Here

  private void addReadonlyFolder(MergeSource rootContainer, RepositoryEntry entry, SharedFolderManager sfm,
      List<RepositoryEntry> addedEntries) {
    //
    if (addedEntries == null || !PersistenceHelper.listContainsObjectByKey(addedEntries, entry)) {
      // add the entry (readonly)
      VFSContainer folder = sfm.getNamedSharedFolder(entry);
      folder.setLocalSecurityCallback(readOnlyCallback);
      rootContainer.addContainer(folder);
      addedEntries.add(entry);
    }
  }
View Full Code Here

    masteryMat = QTIEditHelper.getFeedbackMasteryMaterial(item);
    masteryMat = masteryMat == null ? new Material() : masteryMat;
    failureMat = QTIEditHelper.getFeedbackFailMaterial(item);
    failureMat = failureMat == null ? new Material() : failureMat;

    VFSContainer baseContainer = qtiPackage.getBaseDir();

    // Mastery Layout
    FormLayoutContainer masteryEditLayout = FormLayoutContainer.createCustomFormLayout("masteryEditLayout", getTranslator(), Util
        .getPackageVelocityRoot(this.getClass())
        + "/rich_text_and_edit_link.html");
View Full Code Here

TOP

Related Classes of org.olat.core.util.vfs.VFSContainer

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.