Package org.olat.core.commons.modules.bc

Examples of org.olat.core.commons.modules.bc.FileSelection


  }
 
  public Controller execute(FolderComponent fc, UserRequest ureq, WindowControl windowControl, Translator trans) {
    this.folderComponent = fc;
    this.translator = trans;
    this.fileSelection = new FileSelection(ureq, fc.getCurrentContainerPath());
       
    main = new VelocityContainer("mc", VELOCITY_ROOT + "/movecopy.html", translator, this);
    main.contextPut("fileselection", fileSelection);
   
    //check if command is executed on a file list containing invalid filenames or paths
View Full Code Here


  }
 
 
  public Controller execute(FolderComponent folderComponent, UserRequest ureq, WindowControl wContr, Translator trans) {
    this.translator = trans;
    FileSelection selection = new FileSelection(ureq, folderComponent.getCurrentContainerPath());
    VFSContainer currentContainer = folderComponent.getCurrentContainer();
    if (!(currentContainer.canWrite() == VFSConstants.YES))
      throw new AssertException("Cannot unzip to folder. Writing denied.");
     
    //check if command is executed on a file containing invalid filenames or paths - checks if the resulting folder has a valid name
    if(selection.getInvalidFileNames().size()>0) {       
      status = FolderCommandStatus.STATUS_INVALID_NAME;
      return null;
    }   
   
    List<String> lockedFiles = new ArrayList<String>();
    for (String sItem:selection.getFiles()) {
      VFSItem vfsItem = currentContainer.resolve(sItem);
      if (vfsItem instanceof VFSLeaf) {
        boolean isAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
        lockedFiles.addAll(checkLockedFiles((VFSLeaf)vfsItem, currentContainer, ureq.getIdentity(), isAdmin));
      }
    }
   
    if(!lockedFiles.isEmpty()) {
      String msg = MetaInfoHelper.renderLockedMessageAsHtml(trans, null, lockedFiles);
      List<String> buttonLabels = Collections.singletonList(trans.translate("ok"));
      lockedFiledCtr = activateGenericDialog(ureq, trans.translate("lock.title"), msg, buttonLabels, lockedFiledCtr);
      return null;
    }
   
    boolean fileNotExist = false;
    for (String sItem:selection.getFiles()) {
      VFSItem vfsItem = currentContainer.resolve(sItem);
      if (vfsItem != null && (vfsItem instanceof VFSLeaf)) {
        if (!doUnzip((VFSLeaf)vfsItem, currentContainer, ureq, wContr)) {
          status = FolderCommandStatus.STATUS_FAILED;
          break;
View Full Code Here

  }

  public Controller execute(FolderComponent fc, UserRequest ureq, WindowControl wContr, Translator trans) {
    this.translator = trans;
    this.folderComponent = fc;
    this.fileSelection = new FileSelection(ureq, fc.getCurrentContainerPath());

    VFSContainer currentContainer = folderComponent.getCurrentContainer();
    List<String> lockedFiles = MetaInfoHelper.hasLockedFiles(currentContainer, fileSelection, ureq);
    if (lockedFiles.isEmpty()) {
      String msg = trans.translate("del.confirm") + "<p>" + fileSelection.renderAsHtml() + "</p>";   
View Full Code Here

    status = FolderCommandHelper.sanityCheck(wControl, folderComponent);
    if(status == FolderCommandStatus.STATUS_FAILED) {
      return null;
    }
 
    selection = new FileSelection(ureq, folderComponent.getCurrentContainerPath());
    status = FolderCommandHelper.sanityCheck3(wControl, folderComponent, selection);
    if(status == FolderCommandStatus.STATUS_FAILED) {
      return null;
    }
   
View Full Code Here

TOP

Related Classes of org.olat.core.commons.modules.bc.FileSelection

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.