Examples of VFSMediaResource


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

   * @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)
   */
  @Override
  public void event(UserRequest ureq, Component source, Event event) {
    if (source == this.downloadLink) {
      ureq.getDispatchResult().setResultingMediaResource(new VFSMediaResource(this.downloadFile));
      // Prevent "do not press reload" message.
      this.downloadLink.setDirty(false);
    }
  }
View Full Code Here

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

  private void doFileDelivery(UserRequest ureq, Long forumKey) {
    OlatRootFolderImpl forumContainer = getForumContainer(forumKey);
    VFSLeaf vl = (VFSLeaf) forumContainer.getItems(new VFSLeafFilter()).get(0);
   
    //ureq.getDispatchResult().setResultingMediaResource(new FileDialogMediaResource(vl));
    ureq.getDispatchResult().setResultingMediaResource(new VFSMediaResource(vl));
  }
View Full Code Here

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

        // if an entry in a manifest points e.g. to a pdf file and the iframe
        // controller has not been initialized display it non-inline
        VFSItem currentItem = rootContainer.resolve(identifierRes);
        MediaResource mr;
        if (currentItem == null || !(currentItem instanceof VFSLeaf)) mr = new NotFoundMediaResource(identifierRes);
        else mr = new VFSMediaResource((VFSLeaf) currentItem);
        ureq.getDispatchResult().setResultingMediaResource(mr);
        // Prevent 'don't reload' warning
        cpTree.setDirty(false);
      }
    }
View Full Code Here

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


  private void deliverMediaFile(UserRequest ureq, String command) {
    VFSLeaf leaf = (VFSLeaf)WikiManager.getInstance().getMediaFolder(ores).resolve(command);
    if(leaf == null) showError("wiki.error.file.not.found");
    else ureq.getDispatchResult().setResultingMediaResource(new VFSMediaResource(leaf));
  }
View Full Code Here

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

        @SuppressWarnings("unused")
        public MediaResource handle(String relPath, HttpServletRequest request) {
          VFSItem vfsItem = courseFolder.resolve(relPath);
          MediaResource mr;
          if (vfsItem == null || !(vfsItem instanceof VFSLeaf)) mr = new NotFoundMediaResource(relPath);
          else mr = new VFSMediaResource((VFSLeaf) vfsItem);
          return mr;
        }
      };
      String uri = mapreg.register(cssUriMapper);
      final String fulluri = uri + cssFileRef; // the stylesheet's relative
View Full Code Here

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

    // velocity counter starts at 1
    List<VFSItem> attachments = new ArrayList<VFSItem>();
    attachments.addAll((Collection<VFSItem>) messageMap.get("attachments"));
    VFSItem vI = attachments.get(pos - 1);
    VFSLeaf vl = (VFSLeaf) vI;
    ureq.getDispatchResult().setResultingMediaResource(new VFSMediaResource(vl));
  }
View Full Code Here

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

      fireEvent(ureq, Event.CANCELLED_EVENT);
    } else if (source == file && event.wasTriggerdBy(FormEvent.ONCHANGE)) {
      // display the uploaded file
      if (file.isUploadSuccess()) {
        File newFile = file.getUploadFile();
        MediaResource newResource = new VFSMediaResource(new LocalFileImpl(newFile));
        setImage(newResource);
      }
    } else if (source == deleteImageLink && event.wasTriggerdBy(FormEvent.ONCLICK)) {
      unsetImage();
    }
View Full Code Here

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

   * @see org.olat.modules.webFeed.managers.FeedManager#createMediaResource(java.lang.Long,
   *      java.lang.String, java.lang.String, java.lang.String)
   */
  @Override
  public MediaResource createItemMediaFile(OLATResourceable feed, String itemId, String fileName) {
    VFSMediaResource mediaResource = null;
    // Brute force method for fast delivery
    try {
      VFSItem item = getItemsContainer(feed);
      item = item.resolve(itemId);
      item = item.resolve(MEDIA_DIR);
      item = item.resolve(fileName);
      mediaResource = new VFSMediaResource((VFSLeaf) item);
    } catch (NullPointerException e) {
      log.debug("Media resource could not be created from file: ", fileName);
    }
    return mediaResource;
  }
View Full Code Here

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

   * @see org.olat.modules.webFeed.managers.FeedManager#createMediaResource(java.lang.Long,
   *      java.lang.String, java.lang.String)
   */
  @Override
  public MediaResource createFeedMediaFile(OLATResourceable feed, String fileName) {
    VFSMediaResource mediaResource = null;
    // Brute force method for fast delivery
    try {
      VFSItem item = getFeedMediaContainer(feed);
      item = item.resolve(fileName);
      mediaResource = new VFSMediaResource((VFSLeaf) item);
    } catch (NullPointerException e) {
      log.debug("Media resource could not be created from file: ", fileName);
    }
    return mediaResource;
  }
View Full Code Here

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

   * @see org.olat.modules.webFeed.managers.FeedManager#getFeedArchiveMediaResource(org.olat.core.id.OLATResourceable)
   */
  @Override
  public VFSMediaResource getFeedArchiveMediaResource(OLATResourceable resource) {
    VFSLeaf zip = getFeedArchive(resource);
    return new VFSMediaResource(zip);
  }
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.