Commit cdcde323 authored by rwm's avatar rwm
Browse files

renamed 'plain-file' to 'csv-file' in configuration and source

parent 620068d9
...@@ -21,8 +21,8 @@ import de.sekmi.histream.etl.RowSupplier; ...@@ -21,8 +21,8 @@ import de.sekmi.histream.etl.RowSupplier;
* *
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name="plain-file") @XmlType(name="csv-file")
public class FileSource extends TableSource{ public class CsvFile extends TableSource{
/** /**
* Location of the table file. * Location of the table file.
* A relative location might be specified which * A relative location might be specified which
...@@ -50,9 +50,9 @@ public class FileSource extends TableSource{ ...@@ -50,9 +50,9 @@ public class FileSource extends TableSource{
@XmlElement @XmlElement
char escape; char escape;
private FileSource(){ private CsvFile(){
} }
public FileSource(String urlSpec, String separator) throws MalformedURLException{ public CsvFile(String urlSpec, String separator) throws MalformedURLException{
this(); this();
this.url = urlSpec; this.url = urlSpec;
this.separator = separator; this.separator = separator;
......
...@@ -13,7 +13,7 @@ import de.sekmi.histream.etl.RowSupplier; ...@@ -13,7 +13,7 @@ import de.sekmi.histream.etl.RowSupplier;
@XmlTransient @XmlTransient
@XmlAccessorType(XmlAccessType.NONE) @XmlAccessorType(XmlAccessType.NONE)
@XmlSeeAlso({FileSource.class, SQLSource.class}) @XmlSeeAlso({CsvFile.class, SQLSource.class})
public abstract class TableSource{ public abstract class TableSource{
/** /**
* Open a row supplier which provides rows. * Open a row supplier which provides rows.
......
...@@ -25,7 +25,7 @@ public class TestMarshall { ...@@ -25,7 +25,7 @@ public class TestMarshall {
// patient table // patient table
Assert.assertNotNull(ds.patientTable); Assert.assertNotNull(ds.patientTable);
Assert.assertNotNull(ds.patientTable.source); Assert.assertNotNull(ds.patientTable.source);
Assert.assertEquals("\\t", ((FileSource)ds.patientTable.source).separator); Assert.assertEquals("\\t", ((CsvFile)ds.patientTable.source).separator);
Assert.assertNotNull(ds.patientTable.idat); Assert.assertNotNull(ds.patientTable.idat);
Assert.assertEquals("patid",ds.patientTable.idat.patientId.column); Assert.assertEquals("patid",ds.patientTable.idat.patientId.column);
Assert.assertEquals("geburtsdatum",ds.patientTable.idat.birthdate.column); Assert.assertEquals("geburtsdatum",ds.patientTable.idat.birthdate.column);
...@@ -76,13 +76,13 @@ public class TestMarshall { ...@@ -76,13 +76,13 @@ public class TestMarshall {
s.xmlSources[0].transform = new XmlSource.Transform[1]; s.xmlSources[0].transform = new XmlSource.Transform[1];
s.xmlSources[0].transform[0] = new XmlSource.Transform("file:my.xsl","c:/to/file"); s.xmlSources[0].transform[0] = new XmlSource.Transform("file:my.xsl","c:/to/file");
s.patientTable = new PatientTable(); s.patientTable = new PatientTable();
FileSource fs = new FileSource("file:patient.source","text/csv"); CsvFile fs = new CsvFile("file:patient.source","text/csv");
fs.separator = "\\t"; fs.separator = "\\t";
s.patientTable.source = fs; s.patientTable.source = fs;
s.patientTable.idat = new PatientTable.IDAT(); s.patientTable.idat = new PatientTable.IDAT();
s.patientTable.idat.patientId = new StringColumn("patid"); s.patientTable.idat.patientId = new StringColumn("patid");
s.visitTable = new VisitTable(); s.visitTable = new VisitTable();
s.visitTable.source = new FileSource("file:lala.txt", "text/plain"); s.visitTable.source = new CsvFile("file:lala.txt", "text/plain");
s.visitTable.idat = new VisitTable.IDAT(); s.visitTable.idat = new VisitTable.IDAT();
s.visitTable.idat.patientId = new StringColumn("patid"); s.visitTable.idat.patientId = new StringColumn("patid");
s.visitTable.idat.visitId = new StringColumn("visit"); s.visitTable.idat.visitId = new StringColumn("visit");
...@@ -101,7 +101,7 @@ public class TestMarshall { ...@@ -101,7 +101,7 @@ public class TestMarshall {
s.eavTables = new EavTable[1]; s.eavTables = new EavTable[1];
s.eavTables[0] = new EavTable(); s.eavTables[0] = new EavTable();
s.eavTables[0].source = new FileSource("asdf.txt", "\\t"); s.eavTables[0].source = new CsvFile("asdf.txt", "\\t");
JAXB.marshal(s, System.out); JAXB.marshal(s, System.out);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
</meta> </meta>
<patient-table> <patient-table>
<source xsi:type="plain-file"> <source xsi:type="csv-file">
<url>test-1-patients.txt</url> <url>test-1-patients.txt</url>
<separator>\t</separator> <separator>\t</separator>
</source> </source>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</patient-table> </patient-table>
<!-- optional --> <!-- optional -->
<visit-table> <visit-table>
<source xsi:type="plain-file"> <source xsi:type="csv-file">
<url>test-1-visits.txt</url> <url>test-1-visits.txt</url>
<type>text/csv</type> <type>text/csv</type>
<separator>\t</separator> <separator>\t</separator>
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</mdat> </mdat>
</visit-table> </visit-table>
<wide-table> <wide-table>
<source xsi:type="plain-file"> <source xsi:type="csv-file">
<url>test-1-widetable.txt</url> <url>test-1-widetable.txt</url>
<separator>\t</separator> <separator>\t</separator>
</source> </source>
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
</wide-table> </wide-table>
<eav-table> <eav-table>
<source xsi:type="plain-file"> <source xsi:type="csv-file">
<url>test-1-eavtable.txt</url> <url>test-1-eavtable.txt</url>
<separator>\t</separator> <separator>\t</separator>
</source> </source>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
</meta> </meta>
<patient-table> <patient-table>
<source xsi:type="plain-file"> <source xsi:type="csv-file">
<url>test-2-patients-duplicate.txt</url> <url>test-2-patients-duplicate.txt</url>
<separator>\t</separator> <separator>\t</separator>
</source> </source>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</patient-table> </patient-table>
<!-- optional --> <!-- optional -->
<visit-table> <visit-table>
<source xsi:type="plain-file"> <source xsi:type="csv-file">
<url>test-2-visits-duplicate.txt</url> <url>test-2-visits-duplicate.txt</url>
<type>text/csv</type> <type>text/csv</type>
<separator>\t</separator> <separator>\t</separator>
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</mdat> </mdat>
</visit-table> </visit-table>
<wide-table> <wide-table>
<source xsi:type="plain-file"> <source xsi:type="csv-file">
<url>test-1-widetable.txt</url> <url>test-1-widetable.txt</url>
<separator>\t</separator> <separator>\t</separator>
</source> </source>
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
</wide-table> </wide-table>
<eav-table> <eav-table>
<source xsi:type="plain-file"> <source xsi:type="csv-file">
<url>test-1-eavtable.txt</url> <url>test-1-eavtable.txt</url>
<separator>\t</separator> <separator>\t</separator>
</source> </source>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
</meta> </meta>
<patient-table> <patient-table>
<source xsi:type="plain-file"> <source xsi:type="csv-file">
<url>test-3-patients-empty.txt</url> <url>test-3-patients-empty.txt</url>
<separator>\t</separator> <separator>\t</separator>
</source> </source>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</patient-table> </patient-table>
<!-- optional --> <!-- optional -->
<visit-table> <visit-table>
<source xsi:type="plain-file"> <source xsi:type="csv-file">
<url>test-3-visits-empty.txt</url> <url>test-3-visits-empty.txt</url>
<type>text/csv</type> <type>text/csv</type>
<separator>\t</separator> <separator>\t</separator>
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</mdat> </mdat>
</visit-table> </visit-table>
<wide-table> <wide-table>
<source xsi:type="plain-file"> <source xsi:type="csv-file">
<url>test-1-widetable.txt</url> <url>test-1-widetable.txt</url>
<separator>\t</separator> <separator>\t</separator>
</source> </source>
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
</wide-table> </wide-table>
<eav-table> <eav-table>
<source xsi:type="plain-file"> <source xsi:type="csv-file">
<url>test-1-eavtable.txt</url> <url>test-1-eavtable.txt</url>
<separator>\t</separator> <separator>\t</separator>
</source> </source>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment