Examples of OlatNamedContainerImpl


Examples of org.olat.core.commons.modules.bc.vfs.OlatNamedContainerImpl

    Quota dropboxQuota = QuotaManager.getInstance().getCustomQuota(dropboxPath);
    if (dropboxQuota == null) {
      dropboxQuota = QuotaManager.getInstance().getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_NODES);
    }
    OlatRootFolderImpl rootFolder = new OlatRootFolderImpl( getRelativeDropBoxFilePath(ureq.getIdentity()), null);
    VFSContainer dropboxContainer = new OlatNamedContainerImpl(ureq.getIdentity().getName(), rootFolder);
    FullAccessWithQuotaCallback secCallback = new FullAccessWithQuotaCallback(dropboxQuota);
    rootFolder.setLocalSecurityCallback(secCallback);
    int ulLimit = QuotaManager.getInstance().getUploadLimitKB(dropboxQuota.getQuotaKB(),dropboxQuota.getUlLimitKB(),dropboxContainer);
    return ulLimit;
  }
View Full Code Here

Examples of org.olat.core.commons.modules.bc.vfs.OlatNamedContainerImpl

   * @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 == vfButton){
      OlatNamedContainerImpl namedContainer = BCCourseNode.getNodeFolderContainer(bcNode, course.getCourseEnvironment());
      Quota quota = QuotaManager.getInstance().getCustomQuota(namedContainer.getRelPath());
      if (quota == null) {
        Quota defQuota = QuotaManager.getInstance().getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_NODES);
        quota = QuotaManager.getInstance().createQuota(namedContainer.getRelPath(), defQuota.getQuotaKB(), defQuota.getUlLimitKB());
      }
      VFSSecurityCallback secCallback = new FullAccessWithQuotaCallback(quota);
      namedContainer.setLocalSecurityCallback(secCallback);
      CloseableModalController cmc = new CloseableModalController(getWindowControl(), translate("close"),
          new FolderRunController(namedContainer, false, ureq, getWindowControl()).getInitialComponent());
      cmc.activate();
      return;
    }
View Full Code Here

Examples of org.olat.core.commons.modules.bc.vfs.OlatNamedContainerImpl

      List assignedProps = cpm.listCourseNodeProperties(node, null, null, TaskController.PROP_ASSIGNED);
      if (assignedProps.size() == 0) {
        // no task assigned
        String relPath = TACourseNode.getTaskFolderPathRelToFolderRoot(course, node);
        OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(relPath, null);
        OlatNamedContainerImpl namedFolder = new OlatNamedContainerImpl(translate("taskfolder"), rootFolder);
        namedFolder.setLocalSecurityCallback(getTaskFolderSecCallback(relPath));
        frc = new FolderRunController(namedFolder, false, ureq, getWindowControl());
        CloseableModalController cmc = new CloseableModalController(getWindowControl(), translate("folder.close"), frc
            .getInitialComponent());
        cmc.activate();
      } else {
        // already assigned task => open dialog with warn
        String[] args = new String[] { new Integer(assignedProps.size()).toString() };       
        dialogBoxController = this.activateOkCancelDialog(ureq, "", getTranslator().translate("taskfolder.overwriting.confirm", args), dialogBoxController);
        List cs = new ArrayList();
        cs.add(dialogBoxController);
        LayoutController vcc = new LayoutController(Layouts.VERTICAL, cs);             
      }
    } else if (source == modulesForm) {
      if (event == Form.EVNT_FORM_CANCELLED) {
        return;
      } else if (event == Form.EVNT_VALIDATION_OK) {
        config.set(TACourseNode.CONF_TASK_ENABLED, new Boolean(modulesForm.hasTask()));
        config.set(TACourseNode.CONF_DROPBOX_ENABLED, new Boolean(modulesForm.hasDropbox()));       
        config.set(TACourseNode.CONF_RETURNBOX_ENABLED, new Boolean(modulesForm.hasReturnbox()));       
        config.set(TACourseNode.CONF_SCORING_ENABLED, new Boolean(modulesForm.hasScoring()));
        config.set(TACourseNode.CONF_SOLUTION_ENABLED, new Boolean(modulesForm.hasSolution()));
        myTabbedPane.setEnabled(taskTabPosition, modulesForm.hasTask());
        if (modulesForm.hasTask()) {
          accessabilityVC.put("taskCondition", taskConditionC.getInitialComponent());
        } else {
          accessabilityVC.remove(taskConditionC.getInitialComponent());
        }
        myTabbedPane.setEnabled(dropboxTabPosition, modulesForm.hasDropbox());
        if (modulesForm.hasDropbox()) {
          accessabilityVC.put("dropCondition", dropConditionC.getInitialComponent());
        } else {
          accessabilityVC.remove(dropConditionC.getInitialComponent());
        }
        //add/remove returnboxConditionC     
        if (modulesForm.hasReturnbox()) {
          accessabilityVC.put("returnboxCondition", returnboxConditionC.getInitialComponent());
        } else {
          accessabilityVC.remove(returnboxConditionC.getInitialComponent());
        }       
        myTabbedPane.setEnabled(scoringTabPosition, modulesForm.hasScoring());
        if (modulesForm.hasScoring()) {
          accessabilityVC.put("scoringCondition", scoringConditionC.getInitialComponent());
        } else {
          accessabilityVC.remove(scoringConditionC.getInitialComponent());
        }
        myTabbedPane.setEnabled(solutionTabPosition, modulesForm.hasSolution());
        if (modulesForm.hasSolution()) {
          accessabilityVC.put("solutionCondition", solutionConditionC.getInitialComponent());
        } else {
          accessabilityVC.remove(solutionConditionC.getInitialComponent());
        }
       
        fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
        return;
      }
    } else if (source == dropboxForm) {
      if (event == Form.EVNT_FORM_CANCELLED) {
        return;
      } else if (event == Form.EVNT_VALIDATION_OK) {
        config.set(TACourseNode.CONF_DROPBOX_ENABLEMAIL, new Boolean(dropboxForm.mailEnabled()));
        config.set(TACourseNode.CONF_DROPBOX_CONFIRMATION, dropboxForm.getConfirmation());
        fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
        return;
      }
    } else if (source == vfButton) {     
      if (log.isDebug()) log.debug("Event for sampleVC");
      // switch to new dialog
      OlatNamedContainerImpl namedContainer = TACourseNode.getNodeFolderContainer(node, course.getCourseEnvironment());
      Quota quota = QuotaManager.getInstance().getCustomQuota(namedContainer.getRelPath());
      if (quota == null) {
        Quota defQuota = QuotaManager.getInstance().getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_NODES);
        quota = QuotaManager.getInstance().createQuota(namedContainer.getRelPath(), defQuota.getQuotaKB(), defQuota.getUlLimitKB());
      }
      VFSSecurityCallback secCallback = new FullAccessWithQuotaCallback(quota);
      namedContainer.setLocalSecurityCallback(secCallback);
      CloseableModalController cmc = new CloseableModalController(getWindowControl(), translate("close"),
        new FolderRunController(namedContainer, false, ureq, getWindowControl()).getInitialComponent());
      cmc.activate();
     
      if (log.isDebug()) log.debug("Switch to sample folder dialog : DONE");
View Full Code Here

Examples of org.olat.core.commons.modules.bc.vfs.OlatNamedContainerImpl

    } else if (source == dialogBoxController) {     
      if (DialogBoxUIFactory.isOkEvent(event)) {
        // ok: open task folder
        String relPath = TACourseNode.getTaskFolderPathRelToFolderRoot(course, node);
        OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(relPath, null);
        OlatNamedContainerImpl namedFolder = new OlatNamedContainerImpl(translate("taskfolder"), rootFolder);
        namedFolder.setLocalSecurityCallback(getTaskFolderSecCallback(relPath));
        frc = new FolderRunController(namedFolder, false, urequest, getWindowControl());
        CloseableModalController cmc = new CloseableModalController(getWindowControl(), translate("folder.close"), frc
            .getInitialComponent());
        cmc.activate();
        fireEvent(urequest, Event.CHANGED_EVENT);
View Full Code Here

Examples of org.olat.core.commons.modules.bc.vfs.OlatNamedContainerImpl

    addLoggingResourceable(LoggingResourceable.wrap(ne.getCourseNode()));

    // offer subscription, but not to guests
    SubscriptionContext nodefolderSubContext = (isGuestOnly ? null : CourseModule.createSubscriptionContext(courseEnv, ne.getCourseNode()));

    OlatNamedContainerImpl namedContainer = BCCourseNode.getNodeFolderContainer((BCCourseNode) ne.getCourseNode(), courseEnv);
    VFSSecurityCallback scallback = new FolderNodeCallback(namedContainer.getRelPath(), ne, isOlatAdmin, isGuestOnly, nodefolderSubContext);
    namedContainer.setLocalSecurityCallback(scallback);
    frc = new FolderRunController(namedContainer, false, true, ureq, getWindowControl());
    setInitialComponent(frc.getInitialComponent());
  }
View Full Code Here

Examples of org.olat.core.commons.modules.bc.vfs.OlatNamedContainerImpl

   *      org.olat.course.run.userview.NodeEvaluation)
   */
  public static OlatNamedContainerImpl getNodeFolderContainer(TACourseNode node, CourseEnvironment courseEnvironment) {
    String path = getFoldernodePathRelToFolderBase(courseEnvironment, node);
    OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(path, null);
    OlatNamedContainerImpl namedFolder = new OlatNamedContainerImpl(TACourseNode.SOLUTION_FOLDER_NAME, rootFolder);
    return namedFolder;
  }
View Full Code Here

Examples of org.olat.core.commons.modules.bc.vfs.OlatNamedContainerImpl

    } else if (menuCommand.equals(CMD_FOLDER)) {

      String chosenUserFolderRelPath = FolderConfig.getUserHome(identity.getName()) + "/public";

      OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(chosenUserFolderRelPath, null);
      OlatNamedContainerImpl namedFolder = new OlatNamedContainerImpl(firstLastName, rootFolder);
     
      //decided in plenum to have read only view in the personal visit card, even for admin
      VFSSecurityCallback secCallback = new ReadOnlyCallback();
      namedFolder.setLocalSecurityCallback(secCallback);
     
      removeAsListenerAndDispose(folderRunController);
      folderRunController = new FolderRunController(namedFolder, false, true, ureq, getWindowControl());
      listenTo(folderRunController);
      myContent.put("userinfo", folderRunController.getInitialComponent());
View Full Code Here

Examples of org.olat.core.commons.modules.bc.vfs.OlatNamedContainerImpl

                      + "Dies ist<br />der Test&nbsp;Text"
                      + "</body></html>"; // Text = 'Dies ist der Test Text'
    String text = "Test HTML Seite fuer JUnit Test Dies ist der Test\u00A0Text";
    // Create a test HTML File 
    OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(rootPath , null);
    OlatNamedContainerImpl namedFolder = new OlatNamedContainerImpl(filePath, rootFolder);
    VFSLeaf leaf = (VFSLeaf)namedFolder.resolve(htmlFileName);
    if (leaf != null) {
      leaf.delete();
    }
    leaf = namedFolder.createChildLeaf(htmlFileName);
    BufferedOutputStream bos = new BufferedOutputStream(leaf.getOutputStream(false));
    FileUtils.save(bos,htmlText,"utf-8");
    try {
      bos.close();
     
View Full Code Here

Examples of org.olat.core.commons.modules.bc.vfs.OlatNamedContainerImpl

  protected void initReturnbox(UserRequest ureq, WindowControl wControl, ModuleConfiguration config, CourseNode node, UserCourseEnvironment userCourseEnv, boolean previewMode) {
    translator = new PackageTranslator(PACKAGE, ureq.getLocale());
    myContent = new VelocityContainer("taskVC", VELOCITY_ROOT + "/returnbox.html", translator, this);
    // returnbox display
    OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(getReturnboxPathFor(userCourseEnv.getCourseEnvironment(), node, ureq.getIdentity()) , null);
    OlatNamedContainerImpl namedContainer = new OlatNamedContainerImpl(ureq.getIdentity().getName(), rootFolder);
    namedContainer.setLocalSecurityCallback(new ReadOnlyCallback());
    returnboxFolderRunController = new FolderRunController(namedContainer, false, ureq, wControl);
    returnboxFolderRunController.addControllerListener(this);
    myContent.put("returnbox", returnboxFolderRunController.getInitialComponent());
    // notification
    if ( !previewMode && !ureq.getUserSession().getRoles().isGuestOnly()) {
View Full Code Here

Examples of org.olat.core.commons.modules.bc.vfs.OlatNamedContainerImpl

    } else if (source == dialogBoxController) {     
      if (DialogBoxUIFactory.isOkEvent(event)) {
        // ok: open task folder
        String relPath = TACourseNode.getTaskFolderPathRelToFolderRoot(CourseFactory.loadCourse(courseId), node);
        OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(relPath, null);
        OlatNamedContainerImpl namedFolder = new OlatNamedContainerImpl(translate("taskfolder"), rootFolder);
        namedFolder.setLocalSecurityCallback(new FolderCallback(relPath, false));
       
        removeAsListenerAndDispose(frc);
        frc = new FolderRunController(namedFolder, false, urequest, getWindowControl());
        listenTo (frc);
       
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.