use of org.olat.core.commons.services.license.LicenseType in project OpenOLAT by OpenOLAT.
the class LicenseAdminConfigController method doSetDefaultLicenceType.
private void doSetDefaultLicenceType(FormItem source, SingleSelection singleSelection) {
if (singleSelection.isOneSelected()) {
String selectedKey = singleSelection.getSelectedKey();
LicenseHandler handler = (LicenseHandler) source.getUserObject();
LicenseType licenseType = licenseService.loadLicenseTypeByKey(selectedKey);
licenseModule.setDefaultLicenseTypeKey(handler, String.valueOf(licenseType.getKey()));
}
}
use of org.olat.core.commons.services.license.LicenseType in project OpenOLAT by OpenOLAT.
the class LicenseAdminConfigController method doActivateLicenseType.
private void doActivateLicenseType(MultipleSelectionElement multipleSelectionElement) {
boolean doActivate = multipleSelectionElement.isAtLeastSelected(1) ? true : false;
HandlerLicenseType handlerLicenseType = (HandlerLicenseType) multipleSelectionElement.getUserObject();
LicenseHandler handler = handlerLicenseType.getHandler();
LicenseType licenseType = handlerLicenseType.getLicenseType();
if (doActivate) {
licenseService.activate(handler, licenseType);
reloadDefaultLicenseTypeEl(handler);
} else {
if (isDefaultLicenseType(handler, licenseType)) {
showWarning("error.is.default.license.type");
loadModel();
} else {
licenseService.deactivate(handler, licenseType);
reloadDefaultLicenseTypeEl(handler);
}
}
// checkboxes of enabled handlers was deactivated after deactivating a license type.
initGeneralElements();
}
use of org.olat.core.commons.services.license.LicenseType in project OpenOLAT by OpenOLAT.
the class LicenseAdminConfigController method loadModel.
private void loadModel() {
List<LicenseType> licenseTypes = licenseService.loadLicenseTypes();
Collections.sort(licenseTypes);
List<LicenseTypeRow> rows = new ArrayList<>();
for (LicenseType licenseType : licenseTypes) {
List<MultipleSelectionElement> formItems = createActivationCheckBoxes(licenseType, licenseHandlers);
LicenseTypeRow licenseTypeRow = new LicenseTypeRow(licenseType, formItems);
rows.add(licenseTypeRow);
}
dataModel.setObjects(rows);
tableEl.reset();
}
use of org.olat.core.commons.services.license.LicenseType in project OpenOLAT by OpenOLAT.
the class LicenseAdminConfigController method doUp.
private void doUp(int index) {
LicenseType downLicenseType = dataModel.getObject(index - 1).getLicenseType();
LicenseType upLicenseType = dataModel.getObject(index).getLicenseType();
;
switchLicenseTypes(downLicenseType, upLicenseType);
}
use of org.olat.core.commons.services.license.LicenseType in project OpenOLAT by OpenOLAT.
the class LicenseAdminConfigController method doDown.
private void doDown(int index) {
LicenseType downLicenseType = dataModel.getObject(index).getLicenseType();
LicenseType upLicenseType = dataModel.getObject(index + 1).getLicenseType();
;
switchLicenseTypes(downLicenseType, upLicenseType);
}
Aggregations