use of com.axelor.apps.bankpayment.xsd.sepa.pain_001_001_03.Document in project goobi-workflow by intranda.
the class XsltPreparatorDocket method startExport.
/**
* This method exports the production metadata for a list of processes as a single file to a given stream.
*
* @param processList
* @param outputStream
* @param xslt
*/
public void startExport(List<Process> processList, OutputStream outputStream, String xslt) {
Document answer = new Document();
Element root = new Element("processes");
answer.setRootElement(root);
Namespace xmlns = Namespace.getNamespace("http://www.goobi.io/logfile");
Namespace xsi = Namespace.getNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
root.addNamespaceDeclaration(xsi);
root.setNamespace(xmlns);
Attribute attSchema = new Attribute("schemaLocation", "http://www.goobi.io/logfile" + " XML-logfile.xsd", xsi);
root.setAttribute(attSchema);
for (Process p : processList) {
Document doc = createDocument(p, false, true);
Element processRoot = doc.getRootElement();
processRoot.detach();
root.addContent(processRoot);
}
XMLOutputter outp = new XMLOutputter();
outp.setFormat(Format.getPrettyFormat());
try {
outp.output(answer, outputStream);
} catch (IOException e) {
} finally {
if (outputStream != null) {
try {
outputStream.close();
} catch (IOException e) {
outputStream = null;
}
}
}
}
use of com.axelor.apps.bankpayment.xsd.sepa.pain_001_001_03.Document in project goobi-workflow by intranda.
the class XsltPreparatorDocket method startTransformation.
public void startTransformation(Process p, OutputStream out, String filename) throws ConfigurationException, XSLTransformException, IOException {
Document doc = createDocument(p, true, true);
XmlTransformation(out, doc, filename);
}
use of com.axelor.apps.bankpayment.xsd.sepa.pain_001_001_03.Document in project goobi-workflow by intranda.
the class XsltPreparatorDocket method createExtendedDocument.
/**
* Creates a new xml document containing all relevant process data. It can be used to import the process into another system.
*
* @param process the process to export
* @return a new xml document
* @throws ConfigurationException
*/
public Document createExtendedDocument(Process process) {
Element rootElement = new Element("process", xmlns);
Document doc = new Document(rootElement);
getProcessData(process, rootElement);
// prozesse.batchID
if (process.getBatch() != null) {
rootElement.addContent(getBatchData(process));
}
// prozesse.docketID
if (process.getDocket() != null) {
rootElement.addContent(getDocketData(process));
// getDocketData(process, rootElement);
}
// ProjekteID
rootElement.addContent(getProjectData(process));
// process log
if (process.getProcessLog() != null && !process.getProcessLog().isEmpty()) {
rootElement.addContent(getProcessLogData(process));
}
// process properties
if (!process.getEigenschaften().isEmpty()) {
rootElement.addContent(getProcessPropertyData(process));
}
// template properties
if (!process.getVorlagenList().isEmpty()) {
rootElement.addContent(getTemplatePropertyData(process));
}
// workpiece properties
if (!process.getWerkstueckeList().isEmpty()) {
rootElement.addContent(getWorkpiecePropertyData(process));
}
// tasks
Element tasks = new Element("tasks", xmlns);
rootElement.addContent(tasks);
for (Step step : process.getSchritte()) {
tasks.addContent(getTaskData(step));
}
return doc;
}
use of com.axelor.apps.bankpayment.xsd.sepa.pain_001_001_03.Document in project goobi-workflow by intranda.
the class XsltPreparatorMetadata method startExport.
/**
* This method exports the production metadata for a list of processes as a single file to a given stream.
*
* @param processList
* @param outputStream
* @param xslt
*/
public void startExport(List<Process> processList, OutputStream outputStream, String xslt) {
Document answer = new Document();
Element root = new Element("processes");
answer.setRootElement(root);
Namespace xmlns = Namespace.getNamespace("http://www.goobi.io/logfile");
Namespace xsi = Namespace.getNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
root.addNamespaceDeclaration(xsi);
root.setNamespace(xmlns);
Attribute attSchema = new Attribute("schemaLocation", "http://www.goobi.io/logfile" + " XML-logfile.xsd", xsi);
root.setAttribute(attSchema);
for (Process p : processList) {
Document doc = createDocument(p, false);
Element processRoot = doc.getRootElement();
processRoot.detach();
root.addContent(processRoot);
}
XMLOutputter outp = new XMLOutputter();
outp.setFormat(Format.getPrettyFormat());
try {
outp.output(answer, outputStream);
} catch (IOException e) {
} finally {
if (outputStream != null) {
try {
outputStream.close();
} catch (IOException e) {
outputStream = null;
}
}
}
}
use of com.axelor.apps.bankpayment.xsd.sepa.pain_001_001_03.Document in project goobi-workflow by intranda.
the class XsltPreparatorMetadata method startExport.
/**
* This method exports the METS metadata as xml to a given stream.
*
* @param process the process to export
* @param os the OutputStream to write the contents to
* @throws IOException
* @throws ExportFileException
*/
@Override
public void startExport(Process process, OutputStream os, String xslt) throws IOException {
try {
this.prefs = process.getRegelsatz().getPreferences();
Fileformat ff = process.readMetadataFile();
DigitalDocument document = ff.getDigitalDocument();
this.metahelper = new MetadatenHelper(prefs, document);
Document doc = createDocument(process, true);
XMLOutputter outp = new XMLOutputter();
outp.setFormat(Format.getPrettyFormat());
outp.output(doc, os);
os.close();
} catch (Exception e) {
throw new IOException(e);
}
}
Aggregations