Examples of QuotaManager


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

    // we do a little trick here and wrap it again in a NamedContainerImpl so
    // it doesn't show up as a OlatRootFolderImpl to prevent it from editing its MetaData
    OlatNamedContainerImpl vfsNamedPrivate = new OlatNamedContainerImpl("private", vfsPrivate);
   
    // set quota for this merge source
    QuotaManager qm = QuotaManager.getInstance();
    Quota quota = qm.getCustomQuotaOrDefaultDependingOnRole(identity, getRootPathFor(identity));
    FullAccessWithQuotaCallback secCallback = new FullAccessWithQuotaCallback(quota);

    homeMergeSource.setLocalSecurityCallback(secCallback);
    homeMergeSource.addContainer(vfsNamedPublic);
    homeMergeSource.addContainer(vfsNamedPrivate);
View Full Code Here

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

    // generate course folder
    File fCourseFolder = isolatedCourseFolder.getBasefile();
    if (!fCourseFolder.exists() && !fCourseFolder.mkdirs()) throw new OLATRuntimeException(this.getClass(),
        "could not create course's coursefolder path:" + fCourseFolder.getAbsolutePath(), null);
   
    QuotaManager qm = QuotaManager.getInstance();
    Quota q = qm.getCustomQuota(isolatedCourseFolder.getRelPath());
    if (q == null){
      Quota defQuota = qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_COURSE);
      q = QuotaManager.getInstance().createQuota(isolatedCourseFolder.getRelPath(), defQuota.getQuotaKB(), defQuota.getUlLimitKB());
    }
    FullAccessWithQuotaCallback secCallback = new FullAccessWithQuotaCallback(q);
    isolatedCourseFolder.setLocalSecurityCallback(secCallback);
    return isolatedCourseFolder;
View Full Code Here

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

  public void event(UserRequest ureq, Controller source, Event event) {
    if (source == quotaForm) {
      if (event == Form.EVNT_FORM_CANCELLED) {
        fireEvent(ureq, Event.CANCELLED_EVENT);
      } else if (event == Event.DONE_EVENT) {
        QuotaManager qm = QuotaManager.getInstance();
        currentQuota = QuotaManager.getInstance().createQuota(quotaForm.getPath(), new Long(quotaForm.getQuotaKB()), new Long(quotaForm.getULLimit()));
        qm.setCustomQuotaKB(currentQuota);
        fireEvent(ureq, Event.CHANGED_EVENT);
      }
    }
  }
View Full Code Here

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

  /**
   *
   */
  public void refresh() {
    QuotaManager qm = QuotaManager.getInstance();
    quotaList = qm.listCustomQuotasKB();
  }
View Full Code Here

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

  GenericQuotaEditController(UserRequest ureq, WindowControl wControl, String relPath, boolean modalMode) {
    super(ureq, wControl);
    this.modalMode = modalMode;
   
    // check if quota foqf.cannot.del.defaultr this path already exists
    QuotaManager qm = QuotaManager.getInstance();
    this.currentQuota = qm.getCustomQuota(relPath);
    // init velocity context
    initMyContent(ureq);
    if (currentQuota == null) {
      this.currentQuota = QuotaManager.getInstance().createQuota(relPath, null, null);
      myContent.contextPut("editQuota", Boolean.FALSE);     
View Full Code Here

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

    myContent.contextPut("modalMode", Boolean.valueOf(modalMode));
    addQuotaButton = LinkFactory.createButtonSmall("qf.new", myContent, this);
    delQuotaButton = LinkFactory.createButtonSmall("qf.del", myContent, this);
    cancelButton = LinkFactory.createButtonSmall("cancel", myContent, this);
   
    QuotaManager qm = QuotaManager.getInstance();
    //TODO loop over QuotaManager.getDefaultQuotaIdentifyers instead
    myContent.contextPut("users",qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_USERS));
    myContent.contextPut("powerusers",qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_POWER));
    myContent.contextPut("groups",qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_GROUPS));
    myContent.contextPut("repository",qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_REPO));
    myContent.contextPut("coursefolder",qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_COURSE));
    myContent.contextPut("nodefolder",qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_NODES));
  }
View Full Code Here

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

  private CourseNode courseNode;

  public ReturnboxFullAccessCallback(String relPath, UserCourseEnvironment userCourseEnv, CourseNode courseNode) {
    this.userCourseEnv = userCourseEnv;
    this.courseNode = courseNode;
    QuotaManager qm = QuotaManager.getInstance();
    quota = qm.getCustomQuota(relPath);
    if (quota == null) { // if no custom quota set, use the default quotas...
      Quota defQuota = qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_POWER);
      quota = QuotaManager.getInstance().createQuota(relPath, defQuota.getQuotaKB(), defQuota.getUlLimitKB());
    }
  }
View Full Code Here

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

    this.folderLocked = folderLocked;
    initTaskFolderQuota(relPath);
  }

  private void initTaskFolderQuota(String relPath) {
    QuotaManager qm = QuotaManager.getInstance();
    folderQuota = qm.getCustomQuota(relPath);
    if (folderQuota == null) {
      Quota defQuota = qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_POWER);
      folderQuota = QuotaManager.getInstance().createQuota(relPath, defQuota.getQuotaKB(), defQuota.getUlLimitKB());
    }
  }
View Full Code Here

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

  public FolderNodeCallback(String relPath, NodeEvaluation ne, boolean isOlatAdmin, boolean isGuestOnly, SubscriptionContext nodefolderSubContext) {
    this.ne = ne;
    this.isOlatAdmin = isOlatAdmin;
    this.isGuestOnly = isGuestOnly;
    this.nodefolderSubContext = nodefolderSubContext;
    QuotaManager qm = QuotaManager.getInstance();
    nodeFolderQuota = qm.getCustomQuota(relPath);
    if (nodeFolderQuota == null) {
      Quota defQuota = qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_NODES);
      nodeFolderQuota = QuotaManager.getInstance().createQuota(relPath, defQuota.getQuotaKB(), defQuota.getUlLimitKB());
    }
  }
View Full Code Here

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

   * Node folder quota has to be ionitialized only once for all of the paths.
   *
   * @param path
   */
  private void initSharedFolderQuota(String relPath) {
    QuotaManager qm = QuotaManager.getInstance();
    sharedFolderQuota = qm.getCustomQuota(relPath);
    if (sharedFolderQuota == null) {
      Quota defQuota = qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_COURSE);
      sharedFolderQuota = QuotaManager.getInstance().createQuota(relPath, defQuota.getQuotaKB(), defQuota.getUlLimitKB());
    }
  }
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.