use of org.springframework.oxm.XmlMappingException in project uPortal by Jasig.
the class JaxbPortalDataHandlerService method exportData.
@Override
public String exportData(String typeId, String dataId, Result result) {
final IDataExporter<Object> portalDataExporter = this.getPortalDataExporter(typeId);
final Object data = portalDataExporter.exportData(dataId);
if (data == null) {
return null;
}
final Marshaller marshaller = portalDataExporter.getMarshaller();
try {
marshaller.marshal(data, result);
return portalDataExporter.getFileName(data);
} catch (XmlMappingException e) {
throw new RuntimeException("Failed to map provided portal data to XML", e);
} catch (IOException e) {
throw new RuntimeException("Failed to write the provided XML data", e);
}
}
Aggregations