Split backend to backend api.
This commit is contained in:
parent
4bd244f4e5
commit
a13719f008
116 changed files with 1029 additions and 815 deletions
|
|
@ -27,6 +27,7 @@ import java.io.OutputStream;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.forwardfire.vasc.backend.VascBackendException;
|
||||
import net.forwardfire.vasc.core.VascEntry;
|
||||
import net.forwardfire.vasc.core.VascEntryField;
|
||||
import net.forwardfire.vasc.core.entry.VascEntryExport;
|
||||
|
|
@ -67,7 +68,11 @@ abstract public class AbstractVascEntryExportWriter implements VascEntryExportWr
|
|||
for (int dataIndex=0;dataIndex<dataSize;dataIndex++) {
|
||||
Object o = entry.getVascFrontendController().getVascEntryState().getEntryDataList().get(dataIndex);
|
||||
doExportRowStart(o);
|
||||
doExportRowFields(o);
|
||||
try {
|
||||
doExportRowFields(o);
|
||||
} catch (VascBackendException e) {
|
||||
throw new VascException(e);
|
||||
}
|
||||
doExportRowEnd(o,(dataIndex==dataSize-1));
|
||||
}
|
||||
}
|
||||
|
|
@ -94,7 +99,7 @@ abstract public class AbstractVascEntryExportWriter implements VascEntryExportWr
|
|||
abstract protected void doExportRowStart(Object row) throws IOException;
|
||||
abstract protected void doExportRowEnd(Object row,boolean isLast) throws IOException;
|
||||
|
||||
protected void doExportRowFields(Object row) throws IOException,VascException {
|
||||
protected void doExportRowFields(Object row) throws IOException,VascBackendException {
|
||||
// todo: rm me and use data selector
|
||||
List<VascEntryField> fieldList = new ArrayList<VascEntryField>(getVascEntry().getVascEntryFields());
|
||||
int fields = fieldList.size();
|
||||
|
|
@ -104,5 +109,5 @@ abstract public class AbstractVascEntryExportWriter implements VascEntryExportWr
|
|||
}
|
||||
}
|
||||
|
||||
abstract protected void doExportRowField(Object row,VascEntryField field,boolean isLast) throws IOException,VascException;
|
||||
abstract protected void doExportRowField(Object row,VascEntryField field,boolean isLast) throws IOException,VascBackendException;
|
||||
}
|
||||
|
|
@ -25,8 +25,8 @@ package net.forwardfire.vasc.export.generic;
|
|||
import java.io.OutputStream;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
import net.forwardfire.vasc.backend.VascBackendException;
|
||||
import net.forwardfire.vasc.core.VascEntryField;
|
||||
import net.forwardfire.vasc.core.VascException;
|
||||
|
||||
/**
|
||||
* VascEntryExporterCsv writes data to csv output format.
|
||||
|
|
@ -132,9 +132,9 @@ public class VascEntryExportWriterCsv extends AbstractVascEntryExportWriter {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void doExportRowField(Object o, VascEntryField c,boolean isLast) throws VascException {
|
||||
protected void doExportRowField(Object o, VascEntryField c,boolean isLast) throws VascBackendException {
|
||||
p.write(quoteChar.toCharType());
|
||||
p.write(c.getVascEntryFieldValue().getDisplayValue(c, o));
|
||||
p.write(c.getVascEntryFieldValue().getDisplayValue(c.getBackendName(), o));
|
||||
p.write(quoteChar.toCharType());
|
||||
if (isLast==false) {
|
||||
p.write(separatorChar.toCharType());
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ package net.forwardfire.vasc.export.generic;
|
|||
import java.io.OutputStream;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
import net.forwardfire.vasc.backend.VascBackendException;
|
||||
import net.forwardfire.vasc.core.VascEntryField;
|
||||
import net.forwardfire.vasc.core.VascException;
|
||||
|
||||
/**
|
||||
* VascEntryExportWriterXml writes entry data to xml format.
|
||||
|
|
@ -74,14 +74,14 @@ public class VascEntryExportWriterXml extends AbstractVascEntryExportWriter {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void doExportRowField(Object o, VascEntryField c,boolean isLast) throws VascException {
|
||||
protected void doExportRowField(Object o, VascEntryField c,boolean isLast) throws VascBackendException {
|
||||
if (xmlTree) {
|
||||
p.write("\t\t<"+c.getId()+"><![CDATA[");
|
||||
p.write(""+c.getVascEntryFieldValue().getDisplayValue(c, o));
|
||||
p.write(""+c.getVascEntryFieldValue().getDisplayValue(c.getBackendName(), o));
|
||||
p.write("]]></"+c.getId()+">\n");
|
||||
} else {
|
||||
p.write("\t\t<column name=\""+c.getId()+"\"><![CDATA[");
|
||||
p.write(""+c.getVascEntryFieldValue().getDisplayValue(c, o));
|
||||
p.write(""+c.getVascEntryFieldValue().getDisplayValue(c.getBackendName(), o));
|
||||
p.write("]]></column>\n");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue