use of org.olat.modules.portfolio.ui.media.UploadMedia in project openolat by klemens.
the class MediaUploadController method formOK.
@Override
protected void formOK(UserRequest ureq) {
if (mediaReference == null) {
String title = titleEl.getValue();
String description = descriptionEl.getValue();
File uploadedFile = fileEl.getUploadFile();
String uploadedFilename = fileEl.getUploadFileName();
MediaHandler mediaHandler = getHandler();
if (mediaHandler != null) {
UploadMedia mObject = new UploadMedia(uploadedFile, uploadedFilename, fileEl.getUploadMimeType());
mediaReference = mediaHandler.createMedia(title, description, mObject, businessPath, getIdentity());
}
} else {
// TODO can we update an artefact?
}
List<String> updatedCategories = categoriesEl.getValueList();
portfolioService.updateCategories(mediaReference, updatedCategories);
fireEvent(ureq, Event.DONE_EVENT);
}
use of org.olat.modules.portfolio.ui.media.UploadMedia in project OpenOLAT by OpenOLAT.
the class MediaUploadController method formOK.
@Override
protected void formOK(UserRequest ureq) {
if (mediaReference == null) {
String title = titleEl.getValue();
String description = descriptionEl.getValue();
File uploadedFile = fileEl.getUploadFile();
String uploadedFilename = fileEl.getUploadFileName();
MediaHandler mediaHandler = getHandler();
if (mediaHandler != null) {
UploadMedia mObject = new UploadMedia(uploadedFile, uploadedFilename, fileEl.getUploadMimeType());
mediaReference = mediaHandler.createMedia(title, description, mObject, businessPath, getIdentity());
}
} else {
// TODO can we update an artefact?
}
List<String> updatedCategories = categoriesEl.getValueList();
portfolioService.updateCategories(mediaReference, updatedCategories);
fireEvent(ureq, Event.DONE_EVENT);
}
Aggregations