return null;
}
private int importCsv(FileItem item) throws IOException, TranslatableException {
CSVReader csvReader = new CSVReader(new InputStreamReader(item.getInputStream()));
DataPointDao dataPointDao = new DataPointDao();
PointValueDao pointValueDao = Common.databaseProxy.newPointValueDao();
DateTimeFormatter dtf = DateTimeFormat.forPattern("yyyy/MM/dd HH:mm:ss");
// Basic validation
String[] nextLine = csvReader.readNext();
if (nextLine == null)
throw new TranslatableException(new TranslatableMessage("dataImport.import.noData"));
if (nextLine.length < 2)
throw new TranslatableException(new TranslatableMessage("dataImport.import.noPoints"));
// Find the points by XID
DataPointVO[] vos = new DataPointVO[nextLine.length - 1];
for (int i = 1; i < nextLine.length; i++) {
if (StringUtils.isBlank(nextLine[i]))
throw new TranslatableException(new TranslatableMessage("dataImport.import.badXid", i));
DataPointVO vo = dataPointDao.getDataPoint(nextLine[i]);
if (vo == null)
throw new TranslatableException(new TranslatableMessage("dataImport.import.xidNotFound", nextLine[i]));
vos[i - 1] = vo;
}