From 81af4449dcd5c2ee24e6456a72626de97a1bea67 Mon Sep 17 00:00:00 2001 From: Simon Ebner Date: Mon, 30 Sep 2013 08:38:12 +0200 Subject: [PATCH] FDA-81 Reverted change that filename inside xml always matches that actual filename. --- .../java/ch/psi/fda/model/ModelManager.java | 44 +++++++++---------- .../resources/home/scans/templates/scan1d.xml | 2 +- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/ch.psi.fda/src/main/java/ch/psi/fda/model/ModelManager.java b/ch.psi.fda/src/main/java/ch/psi/fda/model/ModelManager.java index aa1b6eb..1cd559f 100644 --- a/ch.psi.fda/src/main/java/ch/psi/fda/model/ModelManager.java +++ b/ch.psi.fda/src/main/java/ch/psi/fda/model/ModelManager.java @@ -47,7 +47,7 @@ import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; import ch.psi.fda.model.v1.Configuration; -import ch.psi.fda.model.v1.Data; +//import ch.psi.fda.model.v1.Data; /** * Manage the serialization and deserialization of the model @@ -113,13 +113,13 @@ public class ModelManager { try{ Configuration model = (Configuration) u.unmarshal(bsource, Configuration.class).getValue(); - // Ensure that the filename inside the xml file is always the file name - Data d = model.getData(); - if(d==null){ - d = new Data(); - model.setData(d); - } - d.setFileName(file.getName().replaceAll("\\.xml$", "")); +// // Ensure that the filename inside the xml file is always the file name +// Data d = model.getData(); +// if(d==null){ +// d = new Data(); +// model.setData(d); +// } +// d.setFileName(file.getName().replaceAll("\\.xml$", "")); return (model); } @@ -153,13 +153,13 @@ public class ModelManager { try{ Configuration model = (Configuration) u.unmarshal(new StreamSource(file), Configuration.class).getValue(); - // Ensure that the filename inside the xml file is always the file name - Data d = model.getData(); - if(d==null){ - d = new Data(); - model.setData(d); - } - d.setFileName(file.getName().replaceAll("\\.xml$", "")); +// // Ensure that the filename inside the xml file is always the file name +// Data d = model.getData(); +// if(d==null){ +// d = new Data(); +// model.setData(d); +// } +// d.setFileName(file.getName().replaceAll("\\.xml$", "")); return (model); } @@ -192,13 +192,13 @@ public class ModelManager { Schema schema = sf.newSchema(new Source[]{s}); // Use schema reference provided in XML m.setSchema(schema); - // Set scan name equal to file name - Data d = model.getData(); - if(d==null){ - d = new Data(); - model.setData(d); - } - d.setFileName(file.getName().replaceAll("\\.xml$", "")); +// // Set scan name equal to file name +// Data d = model.getData(); +// if(d==null){ +// d = new Data(); +// model.setData(d); +// } +// d.setFileName(file.getName().replaceAll("\\.xml$", "")); m.marshal( new JAXBElement(qname, Configuration.class, model ), file); } diff --git a/ch.psi.fda/src/test/resources/home/scans/templates/scan1d.xml b/ch.psi.fda/src/test/resources/home/scans/templates/scan1d.xml index c13cf86..a0e8b75 100644 --- a/ch.psi.fda/src/test/resources/home/scans/templates/scan1d.xml +++ b/ch.psi.fda/src/test/resources/home/scans/templates/scan1d.xml @@ -1,6 +1,6 @@ - +