use of org.pentaho.platform.plugin.services.importexport.exportManifest.bindings.ExportManifestDto in project pentaho-platform by pentaho.
the class ExportManifest method getExportManifestDto.
ExportManifestDto getExportManifestDto() {
ExportManifestDto rawExportManifest = new ExportManifestDto();
List<ExportManifestEntityDto> rawEntityList = rawExportManifest.getExportManifestEntity();
rawExportManifest.setExportManifestInformation(manifestInformation);
TreeSet<String> ts = new TreeSet<String>(exportManifestEntities.keySet());
for (String path : ts) {
rawEntityList.add(exportManifestEntities.get(path).getExportManifestEntityDto());
}
rawExportManifest.getExportManifestMetadata().addAll(this.metadataList);
rawExportManifest.getExportManifestMondrian().addAll(this.mondrianList);
rawExportManifest.getExportManifestSchedule().addAll(this.scheduleList);
rawExportManifest.getExportManifestDatasource().addAll(this.datasourceList);
rawExportManifest.getExportManifestUser().addAll(this.getUserExports());
rawExportManifest.getExportManifestRole().addAll(this.getRoleExports());
rawExportManifest.setExportManifestMetaStore(this.getMetaStore());
rawExportManifest.getGlobalUserSettings().addAll(this.getGlobalUserSettings());
return rawExportManifest;
}
use of org.pentaho.platform.plugin.services.importexport.exportManifest.bindings.ExportManifestDto in project pentaho-platform by pentaho.
the class ExportManifest method fromXml.
public static ExportManifest fromXml(ByteArrayInputStream input) throws JAXBException {
SAXParserFactory secureSAXParserFactory;
try {
secureSAXParserFactory = XMLParserFactoryProducer.createSecureSAXParserFactory();
} catch (SAXNotSupportedException | SAXNotRecognizedException | ParserConfigurationException ex) {
throw new JAXBException(ex);
}
XMLReader xmlReader;
try {
xmlReader = secureSAXParserFactory.newSAXParser().getXMLReader();
xmlReader.setFeature("http://xml.org/sax/features/namespaces", true);
} catch (SAXException | ParserConfigurationException ex) {
throw new JAXBException(ex);
}
Source xmlSource = new SAXSource(xmlReader, new InputSource(input));
JAXBContext jc = JAXBContext.newInstance("org.pentaho.platform.plugin.services.importexport.exportManifest.bindings");
Unmarshaller u = jc.createUnmarshaller();
try {
JAXBElement<ExportManifestDto> o = (JAXBElement) (u.unmarshal(xmlSource));
ExportManifestDto exportManifestDto = o.getValue();
ExportManifest exportManifest = new ExportManifest(exportManifestDto);
return exportManifest;
} catch (Exception e) {
System.out.println(e.toString());
return null;
}
}
use of org.pentaho.platform.plugin.services.importexport.exportManifest.bindings.ExportManifestDto in project pentaho-platform by pentaho.
the class ExportManifest method toXmlString.
public String toXmlString() throws JAXBException {
StringWriter sw = new StringWriter();
Marshaller marshaller = getMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
marshaller.marshal(new JAXBElement<ExportManifestDto>(new QName("http://www.pentaho.com/schema/", "ExportManifest"), ExportManifestDto.class, getExportManifestDto()), sw);
return sw.toString();
}
use of org.pentaho.platform.plugin.services.importexport.exportManifest.bindings.ExportManifestDto in project pentaho-platform by pentaho.
the class ExportManifest method toXml.
/**
* Marshals the manifest object into xml on the given output stream
*
* @param outputStream
* @throws JAXBException
* @throws ExportManifestFormatException
*/
public void toXml(OutputStream outputStream) throws JAXBException, ExportManifestFormatException {
if (!isValid()) {
throw new ExportManifestFormatException("Invalid root Folder for manifest");
}
final JAXBContext jaxbContext = JAXBContext.newInstance(ExportManifestDto.class);
Marshaller marshaller = getMarshaller();
marshaller.marshal(new JAXBElement<ExportManifestDto>(new QName("http://www.pentaho.com/schema/", "ExportManifest"), ExportManifestDto.class, getExportManifestDto()), outputStream);
}
Aggregations