use of org.olat.core.gui.media.MediaResource in project OpenOLAT by OpenOLAT.
the class AssessmentTestComposerController method doExportDocx.
private void doExportDocx(UserRequest ureq) {
exportLatch = new CountDownLatch(1);
MediaResource mr = new QTI21WordExport(resolvedAssessmentTest, unzippedContRoot, unzippedDirRoot, getLocale(), "UTF-8", exportLatch);
ureq.getDispatchResult().setResultingMediaResource(mr);
}
use of org.olat.core.gui.media.MediaResource in project OpenOLAT by OpenOLAT.
the class PaypalAccessController method redirectToPaypal.
private void redirectToPaypal(UserRequest ureq, PayResponse response) {
String nextUrl = paypalManager.getPayRedirectUrl(response);
MediaResource redirect = new RedirectMediaResource(nextUrl);
ureq.getDispatchResult().setResultingMediaResource(redirect);
}
use of org.olat.core.gui.media.MediaResource in project OpenOLAT by OpenOLAT.
the class PaypalMapper method handle.
@Override
public MediaResource handle(String relPath, HttpServletRequest request) {
List<ContextEntry> entries = null;
UserSession usess = CoreSpringFactory.getImpl(UserSessionManager.class).getUserSession(request);
try {
entries = BusinessControlFactory.getInstance().createCEListFromString(businessPath);
if (relPath.indexOf(';') > 0) {
relPath = relPath.substring(0, relPath.indexOf(';'));
}
if (relPath.indexOf('?') > 0) {
relPath = relPath.substring(0, relPath.indexOf('?'));
}
String uuid = relPath.substring(1, relPath.length() - 5);
paypalManager.updateTransaction(uuid);
usess.putEntryInNonClearedStore("paypal-uuid", uuid);
} catch (Exception e) {
log.error("", e);
usess.putEntryInNonClearedStore("paypal-mapper-error", Boolean.TRUE);
}
String resourceUrl = BusinessControlFactory.getInstance().getBusinessPathAsURIFromCEList(entries);
MediaResource redirect = new RedirectMediaResource(Settings.getServerContextPathURI() + "/auth/" + resourceUrl);
return redirect;
}
use of org.olat.core.gui.media.MediaResource in project OpenOLAT by OpenOLAT.
the class IQIdentityListCourseNodeController method doExportResults.
private void doExportResults(UserRequest ureq) {
List<Identity> identities = getIdentities();
if (identities != null && !identities.isEmpty()) {
MediaResource resource;
CourseEnvironment courseEnv = getCourseEnvironment();
if (isTestQTI21()) {
resource = new QTI21ResultsExportMediaResource(courseEnv, identities, (IQTESTCourseNode) courseNode, getLocale());
} else {
resource = new QTI12ResultsExportMediaResource(courseEnv, getLocale(), identities, (IQTESTCourseNode) courseNode);
}
ureq.getDispatchResult().setResultingMediaResource(resource);
} else {
showWarning("error.no.assessed.users");
}
}
use of org.olat.core.gui.media.MediaResource in project OpenOLAT by OpenOLAT.
the class PFCoachController method downloadFromSelection.
private void downloadFromSelection(UserRequest ureq) {
List<Long> identitykeys = new ArrayList<>();
for (Integer i : dropboxTable.getMultiSelectedIndex()) {
identitykeys.add(tableModel.getObject(i).getIdentity().getIdentityKey());
}
List<Identity> identities = securityManager.loadIdentityByKeys(identitykeys);
MediaResource resource = new FileSystemExport(identities, pfNode, courseEnv, getLocale());
ureq.getDispatchResult().setResultingMediaResource(resource);
}
Aggregations