Search in sources :

Example 36 with License

use of org.olat.core.commons.services.license.License 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)

Example 37 with License

use of org.olat.core.commons.services.license.License in project openolat by klemens.

the class LicenseServiceImpl method createDefaultLicense.

@Override
public License createDefaultLicense(LicenseHandler handler, Identity licensor) {
    LicenseType defautlLicenseType = getDefaultLicenseType(handler);
    String licensorName = licensorFactory.create(handler, licensor);
    License license = new LicenseImpl();
    license.setLicenseType(defautlLicenseType);
    license.setLicensor(licensorName);
    return license;
}
Also used : License(org.olat.core.commons.services.license.License) ResourceLicense(org.olat.core.commons.services.license.ResourceLicense) LicenseType(org.olat.core.commons.services.license.LicenseType) LicenseImpl(org.olat.core.commons.services.license.model.LicenseImpl)

Example 38 with License

use of org.olat.core.commons.services.license.License in project openolat by klemens.

the class LicenseServiceImpl method createLicense.

@Override
public License createLicense(LicenseType licenseType) {
    License license = new LicenseImpl();
    license.setLicenseType(licenseType);
    return license;
}
Also used : License(org.olat.core.commons.services.license.License) ResourceLicense(org.olat.core.commons.services.license.ResourceLicense) LicenseImpl(org.olat.core.commons.services.license.model.LicenseImpl)

Aggregations

License (org.olat.core.commons.services.license.License)38 LicenseType (org.olat.core.commons.services.license.LicenseType)12 VFSLeaf (org.olat.core.util.vfs.VFSLeaf)10 Test (org.junit.Test)8 Date (java.util.Date)6 LicenseService (org.olat.core.commons.services.license.LicenseService)6 ResourceLicense (org.olat.core.commons.services.license.ResourceLicense)6 LicenseImpl (org.olat.core.commons.services.license.model.LicenseImpl)6 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)6 LockInfo (org.olat.core.util.vfs.lock.LockInfo)6 File (java.io.File)4 FolderLicenseHandler (org.olat.core.commons.modules.bc.FolderLicenseHandler)4 MetaInfo (org.olat.core.commons.modules.bc.meta.MetaInfo)4 MetaTagged (org.olat.core.commons.modules.bc.meta.tagged.MetaTagged)4 OLATResourceable (org.olat.core.id.OLATResourceable)4 OlatRelPathImpl (org.olat.core.util.vfs.OlatRelPathImpl)4 VFSContainer (org.olat.core.util.vfs.VFSContainer)4 ArrayList (java.util.ArrayList)2 Map (java.util.Map)2 GroupRoles (org.olat.basesecurity.GroupRoles)2