use of org.olat.modules.taxonomy.TaxonomyLevelTypeRef in project OpenOLAT by OpenOLAT.
the class EditTaxonomyLevelController method formOK.
@Override
protected void formOK(UserRequest ureq) {
if (level == null) {
TaxonomyLevel selectedParentLevel = null;
if (parentLevel == null) {
if (pathEl != null && pathEl.isEnabled() && pathEl.isOneSelected() && !"-".equals(pathEl.getSelectedKey())) {
TaxonomyLevelRef ref = new TaxonomyLevelRefImpl(new Long(pathEl.getSelectedKey()));
selectedParentLevel = taxonomyService.getTaxonomyLevel(ref);
}
} else {
selectedParentLevel = parentLevel;
}
level = taxonomyService.createTaxonomyLevel(identifierEl.getValue(), displayNameEl.getValue(), descriptionEl.getValue(), null, null, selectedParentLevel, taxonomy);
} else {
level = taxonomyService.getTaxonomyLevel(level);
level.setIdentifier(identifierEl.getValue());
level.setDisplayName(displayNameEl.getValue());
level.setDescription(descriptionEl.getValue());
}
String selectedTypeKey = taxonomyLevelTypeEl.getSelectedKey();
if (StringHelper.containsNonWhitespace(selectedTypeKey)) {
TaxonomyLevelTypeRef typeRef = new TaxonomyLevelTypeRefImpl(new Long(selectedTypeKey));
TaxonomyLevelType type = taxonomyService.getTaxonomyLevelType(typeRef);
level.setType(type);
} else {
level.setType(null);
}
if (StringHelper.isLong(sortOrderEl.getValue())) {
level.setSortOrder(new Integer(sortOrderEl.getValue()));
} else {
level.setSortOrder(null);
}
level = taxonomyService.updateTaxonomyLevel(level);
fireEvent(ureq, Event.DONE_EVENT);
}
use of org.olat.modules.taxonomy.TaxonomyLevelTypeRef in project openolat by klemens.
the class EditTaxonomyLevelController method formOK.
@Override
protected void formOK(UserRequest ureq) {
if (level == null) {
TaxonomyLevel selectedParentLevel = null;
if (parentLevel == null) {
if (pathEl != null && pathEl.isEnabled() && pathEl.isOneSelected() && !"-".equals(pathEl.getSelectedKey())) {
TaxonomyLevelRef ref = new TaxonomyLevelRefImpl(new Long(pathEl.getSelectedKey()));
selectedParentLevel = taxonomyService.getTaxonomyLevel(ref);
}
} else {
selectedParentLevel = parentLevel;
}
level = taxonomyService.createTaxonomyLevel(identifierEl.getValue(), displayNameEl.getValue(), descriptionEl.getValue(), null, null, selectedParentLevel, taxonomy);
} else {
level = taxonomyService.getTaxonomyLevel(level);
level.setIdentifier(identifierEl.getValue());
level.setDisplayName(displayNameEl.getValue());
level.setDescription(descriptionEl.getValue());
}
String selectedTypeKey = taxonomyLevelTypeEl.getSelectedKey();
if (StringHelper.containsNonWhitespace(selectedTypeKey)) {
TaxonomyLevelTypeRef typeRef = new TaxonomyLevelTypeRefImpl(new Long(selectedTypeKey));
TaxonomyLevelType type = taxonomyService.getTaxonomyLevelType(typeRef);
level.setType(type);
} else {
level.setType(null);
}
if (StringHelper.isLong(sortOrderEl.getValue())) {
level.setSortOrder(new Integer(sortOrderEl.getValue()));
} else {
level.setSortOrder(null);
}
level = taxonomyService.updateTaxonomyLevel(level);
fireEvent(ureq, Event.DONE_EVENT);
}
Aggregations