Search in sources :

Example 1 with XmlMappingException

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);
    }
}
Also used : Marshaller(org.springframework.oxm.Marshaller) IOException(java.io.IOException) XmlMappingException(org.springframework.oxm.XmlMappingException)

Aggregations

IOException (java.io.IOException)1 Marshaller (org.springframework.oxm.Marshaller)1 XmlMappingException (org.springframework.oxm.XmlMappingException)1