use of org.olat.core.commons.services.license.ResourceLicense in project openolat by klemens.
the class QTIMetadataConverter method createLicense.
public void createLicense(QuestionItemImpl poolItem, String licenseText, String licensor) {
ResourceLicense license = licenseService.loadOrCreateLicense(poolItem);
if (StringHelper.containsNonWhitespace(licenseText)) {
String mappedLicenseText = mapLicenseTypeName(licenseText);
LicenseType licenseType = licenseService.loadLicenseTypeByName(mappedLicenseText);
if (licenseType == null) {
licenseType = licenseService.loadFreetextLicenseType();
license.setFreetext(mappedLicenseText);
} else {
license.setFreetext(null);
}
license.setLicenseType(licenseType);
}
if (StringHelper.containsNonWhitespace(licensor)) {
license.setLicensor(licensor);
}
licenseService.update(license);
}
Aggregations