package de.superx.servlet; import java.util.LinkedList; import java.util.List; public class CSVResultReport { private int rowCount = 1; private int errorCount = 0; private List messages = new LinkedList(); private String colnames=""; public String getColnames() { return colnames; } public void setColnames(String colnames) { this.colnames = colnames; } public int getRowCount() { return rowCount; } public List getMessages() { return messages; } public void incError(String error) { messages.add(error); errorCount++; } public void incRowCount() { rowCount++; } public int getErrorCount() { return errorCount; } public String resultToHtml() { StringBuffer buf = new StringBuffer( de.superx.servlet.SuperXManager.htmlPageHead("Erfolg")+"

Import erfolgreich

"); buf.append("

" + (getRowCount()-1)+" Datensätze importiert" + "

"); buf.append(""); return buf.toString(); } public String errorsToHtml() { StringBuffer buf = new StringBuffer( de.superx.servlet.SuperXManager.htmlPageHead("Fehler")+"Fehler

Es sind Probleme aufgetreten

"); for (int i = 0; i < getErrorCount() && i < 50; i++) { buf.append("

" + getMessages().get(i) + "

"); } buf.append(""); return buf.toString(); } }