Commit cdcde323 authored by rwm's avatar rwm

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

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