Search in sources :

Example 1 with FolderLicenseHandler

use of org.olat.core.commons.modules.bc.FolderLicenseHandler in project OpenOLAT by OpenOLAT.

the class VFSResourceRoot method addLicense.

private void addLicense(MetaInfo meta, Identity identity) {
    LicenseService licenseService = CoreSpringFactory.getImpl(LicenseService.class);
    LicenseModule licenseModule = CoreSpringFactory.getImpl(LicenseModule.class);
    FolderLicenseHandler licenseHandler = CoreSpringFactory.getImpl(FolderLicenseHandler.class);
    if (licenseModule.isEnabled(licenseHandler)) {
        License license = licenseService.createDefaultLicense(licenseHandler, identity);
        meta.setLicenseTypeKey(String.valueOf(license.getLicenseType().getKey()));
        meta.setLicenseTypeName(license.getLicenseType().getName());
        meta.setLicensor(license.getLicensor());
        meta.setLicenseText(LicenseUIFactory.getLicenseText(license));
    }
}
Also used : FolderLicenseHandler(org.olat.core.commons.modules.bc.FolderLicenseHandler) LicenseService(org.olat.core.commons.services.license.LicenseService) License(org.olat.core.commons.services.license.License) LicenseModule(org.olat.core.commons.services.license.LicenseModule)

Example 2 with FolderLicenseHandler

use of org.olat.core.commons.modules.bc.FolderLicenseHandler in project openolat by klemens.

the class VFSResourceRoot method addLicense.

private void addLicense(MetaInfo meta, Identity identity) {
    LicenseService licenseService = CoreSpringFactory.getImpl(LicenseService.class);
    LicenseModule licenseModule = CoreSpringFactory.getImpl(LicenseModule.class);
    FolderLicenseHandler licenseHandler = CoreSpringFactory.getImpl(FolderLicenseHandler.class);
    if (licenseModule.isEnabled(licenseHandler)) {
        License license = licenseService.createDefaultLicense(licenseHandler, identity);
        meta.setLicenseTypeKey(String.valueOf(license.getLicenseType().getKey()));
        meta.setLicenseTypeName(license.getLicenseType().getName());
        meta.setLicensor(license.getLicensor());
        meta.setLicenseText(LicenseUIFactory.getLicenseText(license));
    }
}
Also used : FolderLicenseHandler(org.olat.core.commons.modules.bc.FolderLicenseHandler) LicenseService(org.olat.core.commons.services.license.LicenseService) License(org.olat.core.commons.services.license.License) LicenseModule(org.olat.core.commons.services.license.LicenseModule)

Aggregations

FolderLicenseHandler (org.olat.core.commons.modules.bc.FolderLicenseHandler)2 License (org.olat.core.commons.services.license.License)2 LicenseModule (org.olat.core.commons.services.license.LicenseModule)2 LicenseService (org.olat.core.commons.services.license.LicenseService)2