Examples of VFSContainer


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

    }
  }


  private void saveWikiPageProperties(OLATResourceable ores, WikiPage page) {
    VFSContainer wikiContentContainer = getWikiContainer(ores, WIKI_RESOURCE_FOLDER_NAME);
    VFSLeaf leaf = (VFSLeaf) wikiContentContainer.resolve(page.getPageId() + "." + WIKI_PROPERTIES_SUFFIX);
    if (leaf == null) leaf = wikiContentContainer.createChildLeaf(page.getPageId() + "." + WIKI_PROPERTIES_SUFFIX);
    Properties p = getPageProperties(page);
    try {
      p.store(leaf.getOutputStream(false), "wiki page meta properties");
    } catch (IOException e) {
      throw new OLATRuntimeException(WikiManager.class, "failed to save wiki page properties for page with id: " + page.getPageId() +" and olatresource: " + ores.getResourceableId(), e);
View Full Code Here

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

   * @param ores
   * @param folderName
   * @return the Vfs container or null if not found
   */
  public VFSContainer getWikiContainer(OLATResourceable ores, String folderName) {
    VFSContainer wikiRootContainer = getWikiRootContainer(ores);
    return (VFSContainer) wikiRootContainer.resolve(folderName);
  }
View Full Code Here

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

 
/**
* Return the SCORM Root folder
*/
  public static VFSContainer getScormRootFolder() {
    VFSContainer canonicalRoot = new LocalFolderImpl(new File(FolderConfig.getCanonicalRoot()));
    return (VFSContainer)canonicalRoot.resolve("scorm");
  }
View Full Code Here

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

      // append export timestamp to avoid overwriting previous export
      Date tmp = new Date(System.currentTimeMillis());
      java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH_mm_ss_SSS");
      forumName += "_"+formatter.format(tmp);
     
      VFSContainer container = new LocalFolderImpl(exportDirectory);
      VFSItem vfsItem = container.resolve(forumName);
     
      if (vfsItem == null || !(vfsItem instanceof VFSContainer)){
        vfsItem = container.createChildContainer(forumName);
      }
      container = (VFSContainer)vfsItem;
       
      ForumRTFFormatter rtff = new ForumRTFFormatter(container, false)
      ForumArchiveManager fam = ForumArchiveManager.getInstance();
View Full Code Here

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

    Set<String> mimeTypes = new HashSet<String>();
    mimeTypes.add("image/gif");
    mimeTypes.add("image/jpg");
    mimeTypes.add("image/jpeg");
    mimeTypes.add("image/png");
    VFSContainer uploadContainer = new LocalFolderImpl(uploadDir);
    uploadCtr = new FileUploadController(getWindowControl(), uploadContainer, ureq, this.limitKB, this.limitKB, mimeTypes, false);
    uploadCtr.hideTitleAndFieldset();
    listenTo(uploadCtr);
    folderContainer.put("uploadCtr", uploadCtr.getInitialComponent());
    putInitialPanel(folderContainer);
View Full Code Here

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

  /**
   * @see org.olat.course.nodes.GenericCourseNode#archiveNodeData(java.util.Locale, org.olat.course.ICourse, java.io.File, java.lang.String)
   */
  public void archiveNodeData(Locale locale, ICourse course, File exportDirectory, String charset) {
    VFSContainer exportContainer = new LocalFolderImpl(exportDirectory);
    VFSContainer wikiExportContainer = (VFSContainer)exportContainer.resolve(WikiManager.WIKI_RESOURCE_FOLDER_NAME);
    if(wikiExportContainer == null){
      wikiExportContainer = exportContainer.createChildContainer(WikiManager.WIKI_RESOURCE_FOLDER_NAME);
    }
    String exportDirName = getShortTitle()+"_"+Formatter.formatDatetimeFilesystemSave(new Date(System.currentTimeMillis()));
    VFSContainer destination = wikiExportContainer.createChildContainer(exportDirName);
    if (destination==null) {
      Tracing.logError("archiveNodeData: Could not create destination directory: wikiExportContainer="+wikiExportContainer+", exportDirName="+exportDirName, getClass());
    }
    String repoRef = (String)this.getModuleConfiguration().get("reporef");
    OLATResourceable ores = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(repoRef, true).getOlatResource();
   
    VFSContainer container = WikiManager.getInstance().getWikiContainer(ores, WikiManager.WIKI_RESOURCE_FOLDER_NAME);
    if(container!=null) { //the container could be null if the wiki is an old empty one - so nothing to archive
      VFSContainer parent = container.getParentContainer();
      VFSLeaf wikiZip = WikiToZipUtils.getWikiAsZip(parent);
      destination.copyFrom(wikiZip);
    }
  }
View Full Code Here

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

    // add optinal download link, see class comments in DisclaimerFormController
    // Add the additional link to the form (depending on the configuration)
    if (RegistrationModule.isDisclaimerAdditionaLinkText()) {
      File disclaimerDir = new File(WebappHelper.getUserDataRoot() + "/customizing/disclaimer/");
      disclaimerDir.mkdirs();
      VFSContainer disclaimerContainer = new LocalFolderImpl(disclaimerDir);
      String i18nIfiedFilename = translate("disclaimer.filedownloadurl");
      this.downloadFile = (VFSLeaf)disclaimerContainer.resolve(i18nIfiedFilename);
      if (this.downloadFile != null) {
        this.downloadLink = LinkFactory.createLink("disclaimer.additionallinktext", main, this);
        this.downloadLink.setTarget("_blank");
       
        if (i18nIfiedFilename.toLowerCase().endsWith(".pdf")) {
View Full Code Here

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

    // mount /static/themes, filter out CVS!
    String staticAbsPath = WebappHelper.getContextRoot() + "/static/themes";
    File themesFile = new File(staticAbsPath);
    LocalFolderImpl vfsThemes = new LocalFolderImpl(themesFile);
    vfsThemes.setDefaultItemFilter(new VFSItemExcludePrefixFilter(new String[]{"CVS","cvs"} ));
    VFSContainer vfsCont = vfsThemes;
    return vfsCont;
  }
View Full Code Here

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

      //
      Manager manager = ManagerFactory.getManager();
      RepositoryManager rm = RepositoryManager.getInstance();
      RepositoryEntry myEntry;
      HashMap logmsg = new HashMap();
      VFSContainer qtiTmpDir = new LocalFolderImpl(QTIEditorPackage.getTmpBaseDir());
      VFSContainerFilter foldersOnly = new VFSContainerFilter();
      //folders in ../tmp/qtieditor hold the usernames
      List foldersUsername = qtiTmpDir.getItems(foldersOnly);
      for (Iterator iter = foldersUsername.iterator(); iter.hasNext();) {
        VFSContainer folderOfUser = (VFSContainer) iter.next();
        //the users folders holds folders with ids of OLATResourceable's
        List oResFolders = folderOfUser.getItems(foldersOnly);
        for (Iterator resources = oResFolders.iterator(); resources.hasNext();) {
          VFSContainer folderOfResource = (VFSContainer) resources.next();
          folderOfResource.createChildContainer(QTIEditorPackage.FOLDERNAMEFOR_CHANGELOG);
         
          //these are eiterh surveys or tests
          //try it as testresource then as survey, after this give up
          Long oresId = new Long(folderOfResource.getName());
          FileResource fr = new TestFileResource();
          fr.overrideResourceableId(oresId);
          myEntry = rm.lookupRepositoryEntry(fr,false);
          if(myEntry==null){
            //no qti test found, try the qti survey
View Full Code Here

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

   
    for (Iterator iter = courseEntries.iterator(); iter.hasNext();) {
      RepositoryEntry re = (RepositoryEntry) iter.next();
      OLATResourceable res = re.getOlatResource();
      ICourse course = CourseFactory.loadCourse(res.getResourceableId());
      VFSContainer courseFolder = course.getCourseFolderContainer();
      //NamedContainerImpl cfContainer = new NamedContainerImpl(Formatter.makeStringFilesystemSave(course.getCourseTitle()), courseFolder);
      NamedContainerImpl cfContainer;
      cfContainer = new NamedContainerImpl(Formatter.makeStringFilesystemSave(course.getCourseTitle()), courseFolder);
      cfRoot.addContainer(cfContainer);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.