r3886 - in trunk: lima-business/src/main/java/org/chorem/lima/business/ejb lima-business-api/src/main/java/org/chorem/lima/business/api lima-swing/src/main/java/org/chorem/lima/ui/importexport
Author: dcosse Date: 2014-07-31 18:45:29 +0200 (Thu, 31 Jul 2014) New Revision: 3886 Url: http://forge.chorem.org/projects/lima/repository/revisions/3886 Log: refs #1032 corrections sur import journaux Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2014-07-31 16:36:13 UTC (rev 3885) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2014-07-31 16:45:29 UTC (rev 3886) @@ -34,8 +34,6 @@ import org.apache.pdfbox.exceptions.COSVisitorException; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.interactive.form.PDField; -import org.chorem.lima.beans.EntryImport; -import org.chorem.lima.beans.FinancialTransactionImport; import org.chorem.lima.business.AlreadyExistAccountException; import org.chorem.lima.business.ImportEbpException; import org.chorem.lima.business.InvalidAccountNumberException; @@ -210,59 +208,7 @@ // ################ IMPORT ################ - /** - * Remote methode to call entity import from UI - * This methode let import just on type of entity - */ @Override - public String importAsCSV(String datas, - ImportExportEntityEnum importExportEntityEnum) throws ImportEbpException { - StringBuilder result = new StringBuilder(); - - // Transactions and entries - Map<Integer, FinancialTransactionImport> financialTransactions = null; - Map<Integer, List<EntryImport>> entries = null; - - - switch (importExportEntityEnum) { - case FINANCIALTRANSACTION: - } - CSVReader csvReader = null; - try { - - String[] nextLine; - csvReader = new CSVReader(new StringReader(datas), ';'); - - while ((nextLine = csvReader.readNext()) != null) { - if (ImportExportEntityEnum.valueOfLabel(nextLine[0]) == importExportEntityEnum - || importExportEntityEnum == ImportExportEntityEnum.FINANCIALTRANSACTION - || importExportEntityEnum == ImportExportEntityEnum.ENTRY) { - switch (importExportEntityEnum) { - case FINANCIALTRANSACTION: - } - } - } - - //create entity - switch (importExportEntityEnum) { - case FINANCIALTRANSACTION: - } - - } catch (IOException e) { - throw new ImportEbpException("Can't import", e); - } finally { - if (csvReader != null) { - try { - csvReader.close(); - } catch (IOException e) { - // on fait rien - } - } - } - return result.toString(); - } - - @Override public String importAsPDF(String datas, ImportExportEntityEnum importExportEntityEnum, boolean setMode) { Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportService.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportService.java 2014-07-31 16:36:13 UTC (rev 3885) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportService.java 2014-07-31 16:45:29 UTC (rev 3886) @@ -45,17 +45,6 @@ String importAccountsChartFromEbp(String data) throws ImportEbpException; /** - * Import content as CSV depending on import type. - * - * @param data import file content as string (remote service can't take File) - * @param importExportEntityEnum import type - * @return result log - * @throws LimaException - */ - String importAsCSV(String data, - ImportExportEntityEnum importExportEntityEnum) throws ImportEbpException; - - /** * @deprecated import file (local, can't be used in remote mode) * and wrong place for this method */ Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-07-31 16:36:13 UTC (rev 3885) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-07-31 16:45:29 UTC (rev 3886) @@ -240,7 +240,9 @@ break; case EBP_ENTRYBOOKS_IMPORT: datas = extractFile(filePath, EncodingEnum.ISOLATIN1.getEncoding()); - result = importService.importEntryBookFromEbp(datas); + importResult = newImportService.importEntryBookFromEbp(datas); + // TODO DCossé 24/07/14 change result + result = "SUCCESS"; break; case EBP_ENTRYBOOKS_EXPORT: datas = exportService.exportEntryBooksAsEBP();
participants (1)
-
dcosse@users.chorem.org