use of org.olat.core.gui.media.StreamedMediaResource in project OpenOLAT by OpenOLAT.
the class PortfolioHandler method getAsMediaResource.
/**
* Transform the map in a XML file and zip it (Repository export want a zip)
* @see org.olat.repository.handlers.RepositoryHandler#getAsMediaResource(org.olat.core.id.OLATResourceable)
*/
@Override
public MediaResource getAsMediaResource(OLATResourceable res, boolean backwardsCompatible) {
MediaResource mr = null;
EPFrontendManager ePFMgr = CoreSpringFactory.getImpl(EPFrontendManager.class);
PortfolioStructure structure = ePFMgr.loadPortfolioStructure(res);
try {
InputStream inOut = EPXStreamHandler.toStream(structure);
mr = new StreamedMediaResource(inOut, null, null, null);
} catch (IOException e) {
log.error("Cannot export this map: " + structure, e);
}
return mr;
}
use of org.olat.core.gui.media.StreamedMediaResource in project openolat by klemens.
the class PortfolioHandler method getAsMediaResource.
/**
* Transform the map in a XML file and zip it (Repository export want a zip)
* @see org.olat.repository.handlers.RepositoryHandler#getAsMediaResource(org.olat.core.id.OLATResourceable)
*/
@Override
public MediaResource getAsMediaResource(OLATResourceable res, boolean backwardsCompatible) {
MediaResource mr = null;
EPFrontendManager ePFMgr = CoreSpringFactory.getImpl(EPFrontendManager.class);
PortfolioStructure structure = ePFMgr.loadPortfolioStructure(res);
try {
InputStream inOut = EPXStreamHandler.toStream(structure);
mr = new StreamedMediaResource(inOut, null, null, null);
} catch (IOException e) {
log.error("Cannot export this map: " + structure, e);
}
return mr;
}
Aggregations