Search in sources :

Example 1 with QuotaManager

use of org.olat.core.util.vfs.QuotaManager in project OpenOLAT by OpenOLAT.

the class FolderCallback method initFolderQuota.

private void initFolderQuota(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());
    }
}
Also used : Quota(org.olat.core.util.vfs.Quota) QuotaManager(org.olat.core.util.vfs.QuotaManager)

Example 2 with QuotaManager

use of org.olat.core.util.vfs.QuotaManager in project OpenOLAT by OpenOLAT.

the class FolderNodeCallback method getQuota.

/**
 * @see org.olat.modules.bc.callbacks.SecurityCallback#getQuotaKB(org.olat.modules.bc.Path)
 */
@Override
public Quota getQuota() {
    if (nodeFolderQuota == null) {
        QuotaManager qm = QuotaManager.getInstance();
        nodeFolderQuota = qm.getCustomQuota(relPath);
        if (nodeFolderQuota == null) {
            Quota defQuota = qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_NODES);
            nodeFolderQuota = qm.createQuota(relPath, defQuota.getQuotaKB(), defQuota.getUlLimitKB());
        }
    }
    return nodeFolderQuota;
}
Also used : Quota(org.olat.core.util.vfs.Quota) QuotaManager(org.olat.core.util.vfs.QuotaManager)

Example 3 with QuotaManager

use of org.olat.core.util.vfs.QuotaManager in project openolat by klemens.

the class GenericQuotaEditController method event.

@Override
public void event(UserRequest ureq, Controller source, Event event) {
    if (source == quotaForm) {
        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);
        }
    }
}
Also used : QuotaManager(org.olat.core.util.vfs.QuotaManager)

Example 4 with QuotaManager

use of org.olat.core.util.vfs.QuotaManager in project OpenOLAT by OpenOLAT.

the class FullAccessWithLazyQuotaCallback method getQuota.

@Override
public Quota getQuota() {
    if (super.getQuota() == null) {
        QuotaManager qm = QuotaManager.getInstance();
        Quota q = qm.getCustomQuota(folderPath);
        if (q == null) {
            Quota defQuota = qm.getDefaultQuota(defaultQuota);
            q = QuotaManager.getInstance().createQuota(folderPath, defQuota.getQuotaKB(), defQuota.getUlLimitKB());
        }
        super.setQuota(q);
    }
    return super.getQuota();
}
Also used : Quota(org.olat.core.util.vfs.Quota) QuotaManager(org.olat.core.util.vfs.QuotaManager)

Example 5 with QuotaManager

use of org.olat.core.util.vfs.QuotaManager in project OpenOLAT by OpenOLAT.

the class GenericQuotaViewController method initMyContent.

private void initMyContent() {
    QuotaManager qm = QuotaManager.getInstance();
    myContent = createVelocityContainer("edit");
    myContent.contextPut("notEnoughPrivilege", Boolean.FALSE);
    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));
    myContent.contextPut("feeds", qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_FEEDS));
}
Also used : QuotaManager(org.olat.core.util.vfs.QuotaManager)

Aggregations

QuotaManager (org.olat.core.util.vfs.QuotaManager)26 Quota (org.olat.core.util.vfs.Quota)18 Path (javax.ws.rs.Path)4 CollaborationTools (org.olat.collaboration.CollaborationTools)4 OlatRootFolderImpl (org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl)4 SubscriptionContext (org.olat.core.commons.services.notifications.SubscriptionContext)4 Identity (org.olat.core.id.Identity)4 VFSWebServiceSecurityCallback (org.olat.core.util.vfs.restapi.VFSWebServiceSecurityCallback)4 VFSWebservice (org.olat.core.util.vfs.restapi.VFSWebservice)4 BusinessGroup (org.olat.group.BusinessGroup)4 BusinessGroupService (org.olat.group.BusinessGroupService)4 File (java.io.File)2 OLATSecurityException (org.olat.core.logging.OLATSecurityException)2 FullAccessWithQuotaCallback (org.olat.core.util.vfs.callbacks.FullAccessWithQuotaCallback)2 VFSSecurityCallback (org.olat.core.util.vfs.callbacks.VFSSecurityCallback)2 CourseConfig (org.olat.course.config.CourseConfig)2 Reference (org.olat.resource.references.Reference)2