Author: jpepin Date: 2010-08-05 12:50:11 +0200 (Thu, 05 Aug 2010) New Revision: 2996 Url: http://chorem.org/repositories/revision/lima/2996 Log: Ajout choix de format sur la servlet : html ou pdf. Ajout d'une propertie de config vers l'adresse du server dans l'ui. Ajout dans l'ui appel des documents du serveur http. Modification d'icones. Added: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FormatsEnum.java trunk/lima-swing/src/main/resources/icons/action-documents.png Removed: trunk/lima-swing/src/main/resources/icons/action-print.png Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/HttpServerService.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java trunk/lima-business/src/main/java/org/chorem/lima/business/utils/DocumentsEnum.java trunk/lima-business/src/main/resources/lima.properties trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties trunk/lima-swing/src/main/resources/icons/action-export-element.png trunk/lima-swing/src/main/resources/icons/action-import-element.png trunk/lima-swing/src/main/resources/lima-config.properties trunk/pom.xml Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/LimaConfig.java 2010-08-05 10:50:11 UTC (rev 2996) @@ -119,7 +119,7 @@ } } instance.setOption("topia.persistence.classes", LimaCallaoDAOHelper.getImplementationClassesAsString()); - } + } /** * Lima option definition. Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/DocumentServiceImpl.java 2010-08-05 10:50:11 UTC (rev 2996) @@ -46,7 +46,9 @@ import org.chorem.lima.business.ejbinterface.FinancialStatementService; import org.chorem.lima.business.ejbinterface.IdentityService; import org.chorem.lima.business.ejbinterface.ReportService; +import org.chorem.lima.business.utils.DocumentsEnum; import org.chorem.lima.business.utils.EntryComparator; +import org.chorem.lima.business.utils.FormatsEnum; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.ClosedPeriodicEntryBook; import org.chorem.lima.entity.ClosedPeriodicEntryBookDAO; @@ -58,8 +60,6 @@ import org.chorem.lima.entity.FinancialTransaction; import org.chorem.lima.entity.Identity; import org.chorem.lima.entity.LimaCallaoDAOHelper; -import org.mortbay.jetty.Server; -import org.mortbay.jetty.handler.ResourceHandler; import org.nuiton.topia.TopiaContext; import org.nuiton.topia.TopiaContextFactory; import org.nuiton.topia.TopiaException; @@ -225,7 +225,7 @@ @Override - public void createFinancialStatementsDocuments(Date beginDate, Date endDate) throws LimaException { + public void createFinancialStatementsDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException { Document document = new Document(PageSize.A4, 8, 8, 8, 8); List<FinancialStatementAmounts> financialStatementAmounts = @@ -236,10 +236,16 @@ String dateS = dateFormat.format(newDate); String hourS = hourFormat.format(newDate); - PdfWriter pdfWriter = PdfWriter.getInstance(document, - new FileOutputStream(path+File.separator+"lima_financialstatements.pdf")); - HtmlWriter htmlWriter = HtmlWriter.getInstance(document, - new FileOutputStream(path+File.separator+"lima_financialstatements.html")); + String filePath = path+File.separator+DocumentsEnum.FINANCIALSTATEMENT.getFileName(); + FileOutputStream fileOut = new FileOutputStream(filePath+format.getExtension()); + switch (format) { + case HTML: + HtmlWriter htmlWriter = HtmlWriter.getInstance(document, fileOut); + break; + case PDF: + PdfWriter pdfWriter = PdfWriter.getInstance(document, fileOut); + break; + } document.open(); int nbpages = 1; @@ -270,11 +276,16 @@ for (List<FinancialStatementAmounts> list : listList) { String title = list.get(0).getLabel(); //list = list.subList(1, list.size()); - int i=0; - int n=list.size(); - while (i<n){ - int j=i+35; - if (j>n){ + int i = 0; + int n = list.size(); + int max = n; + // alloc nb rows max for pdf documents on one page + if (format == FormatsEnum.PDF){ + max = 35; + } + while (i < n){ + int j = i + max; + if (j > n){ j = n; } List <FinancialStatementAmounts> subFinancialStatementAmounts = @@ -300,7 +311,7 @@ chapter.add(paragraphTable); //add page document.add(chapter); - i=i+35; + i = i + max; nbpages++; } } @@ -444,12 +455,12 @@ @Override - public void createLedgerDocuments(Date beginDate, Date endDate) throws LimaException { + public void createLedgerDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException { Document document = new Document(PageSize.A4, 8, 8, 8, 8); List<Object> list = new ArrayList<Object>(); try { - BalanceTrial balanceTrial = reportService.generateLedger(beginDate, endDate, true); + BalanceTrial balanceTrial = reportService.generateLedger(beginDate, endDate, null, true); if (balanceTrial.getReportsDatas() != null){ for (ReportsDatas reportsDatas : balanceTrial.getReportsDatas()) { list.add(reportsDatas); @@ -469,22 +480,31 @@ Double currentAmountCredit = 0.0; String accountcarry =""; - PdfWriter pdfWriter = PdfWriter.getInstance(document, - new FileOutputStream(path+File.separator+"lima_ledger.pdf")); - HtmlWriter htmlWriter = HtmlWriter.getInstance(document, - new FileOutputStream(path+File.separator+"lima_ledger.html")); + String filePath = path+File.separator+DocumentsEnum.LEDGER.getFileName(); + FileOutputStream fileOut = new FileOutputStream(filePath+format.getExtension()); + switch (format) { + case HTML: + HtmlWriter htmlWriter = HtmlWriter.getInstance(document, fileOut); + break; + case PDF: + PdfWriter pdfWriter = PdfWriter.getInstance(document, fileOut); + break; + } document.open(); int nbpages = 1; Identity identity = identityService.getIdentity(); //create pages - String title = _("lima-business.document.ledger"); - int i=0; - int n=list.size(); - int max = 32; - while (i<n){ - int j = i+max; - if (j>n){ + int i = 0; + int n = list.size(); + int max = n; + // alloc nb rows max for pdf documents on one page + if (format == FormatsEnum.PDF){ + max = 32; + } + while (i < n){ + int j = i + max; + if (j > n){ j = n; } List <Object> subList = list.subList(i, j); @@ -493,7 +513,7 @@ //new page Chapter chapter = new Chapter(0); //headerPage - chapter.add(createHeaderPage(title, identity, + chapter.add(createHeaderPage(DocumentsEnum.LEDGER.getDescription(), identity, dateFormat.format(beginDate), dateFormat.format(endDate))); //n° page chapter.add(createNumberPage(nbpages, dateS, hourS)); @@ -530,7 +550,7 @@ } } //forward amounts - if (n>max && i<=n-max){ + if (n > max && i <= n-max){ Paragraph forwardParagraph = new Paragraph(); forwardParagraph.add(createLedgerAmountTable("", _("lima-business.document.carryforward"), @@ -538,7 +558,7 @@ chapter.add(forwardParagraph); } //final amounts - if (i>=n-max){ + if (i >= n-max){ Paragraph finalAmountParagraph = new Paragraph(); finalAmountParagraph.add(createLedgerAmountTable("", _("lima-business.document.amounts"), @@ -547,7 +567,7 @@ } //add page document.add(chapter); - i=i+max; + i = i + max; nbpages++; } document.close(); @@ -696,7 +716,7 @@ @Override - public void createEntryBooksDocuments(Date beginDate, Date endDate) throws LimaException { + public void createEntryBooksDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException { Document document = new Document(PageSize.A4, 8, 8, 8, 8); TopiaContext transaction = null; @@ -706,109 +726,117 @@ Date newDate = new Date(); String dateS = dateFormat.format(newDate); String hourS = hourFormat.format(newDate); - String fileDateS = filedateFormat.format(newDate); - log.debug(path); - PdfWriter pdfWriter = PdfWriter.getInstance(document, - new FileOutputStream(path+File.separator+"lima_entrybooks.pdf")); - HtmlWriter htmlWriter = HtmlWriter.getInstance(document, - new FileOutputStream(path+File.separator+"lima_entrybooks.html")); - document.open(); - int nbpages = 1; + String filePath = path+File.separator+DocumentsEnum.ENTRYBOOKS.getFileName(); + FileOutputStream fileOut = new FileOutputStream(filePath+format.getExtension()); + switch (format) { + case HTML: + HtmlWriter htmlWriter = HtmlWriter.getInstance(document, fileOut); + break; + case PDF: + PdfWriter pdfWriter = PdfWriter.getInstance(document, fileOut); + break; + } + document.open(); + int nbpages = 1; + + Identity identity = identityService.getIdentity(); + + ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = + LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(transaction); + EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(transaction); + //Split list by financialstatement type + List<ClosedPeriodicEntryBook> closedPeriodicEntryBookList = + closedPeriodicEntryBookDAO.findAllByDates(beginDate, endDate); + for (ClosedPeriodicEntryBook closedPeriodicEntryBook : closedPeriodicEntryBookList) { - Identity identity = identityService.getIdentity(); + TopiaQuery query = entryDAO.createQuery(); + String financialPeriodProperty = + TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, + FinancialTransaction.FINANCIAL_PERIOD); + String entryBookProperty = + TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, + FinancialTransaction.ENTRY_BOOK); + query.addWhere(financialPeriodProperty, Op.EQ, + closedPeriodicEntryBook.getFinancialPeriod()) + .addWhere(entryBookProperty, Op.EQ, + closedPeriodicEntryBook.getEntryBook()); - ClosedPeriodicEntryBookDAO closedPeriodicEntryBookDAO = - LimaCallaoDAOHelper.getClosedPeriodicEntryBookDAO(transaction); - EntryDAO entryDAO = LimaCallaoDAOHelper.getEntryDAO(transaction); - //Split list by financialstatement type - List<ClosedPeriodicEntryBook> closedPeriodicEntryBookList = - closedPeriodicEntryBookDAO.findAllByDates(beginDate, endDate); - for (ClosedPeriodicEntryBook closedPeriodicEntryBook : closedPeriodicEntryBookList) { - - TopiaQuery query = entryDAO.createQuery(); - String financialPeriodProperty = - TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, - FinancialTransaction.FINANCIAL_PERIOD); - String entryBookProperty = - TopiaQuery.getProperty(Entry.FINANCIAL_TRANSACTION, - FinancialTransaction.ENTRY_BOOK); - query.addWhere(financialPeriodProperty, Op.EQ, - closedPeriodicEntryBook.getFinancialPeriod()) - .addWhere(entryBookProperty, Op.EQ, - closedPeriodicEntryBook.getEntryBook()); - - List<Entry> entries = entryDAO.findAllByQuery(query); - - List<Object[]> results = new ArrayList<Object[]>(); - Double debit = 0.0; - Double credit = 0.0; - query.setSelect(Entry.DEBIT, "SUM("+Entry.AMOUNT+")"); - query.addGroup(Entry.DEBIT); - results = query.execute(transaction); - int nbAmount = results.size(); - if(nbAmount==2){ - debit = (Double)results.get(0)[1]; - credit = (Double)results.get(1)[1]; - } - if (nbAmount==1){ - if ((Boolean)results.get(0)[0]){ - debit = (Double)results.get(0)[1]; - } - else { - credit = (Double)results.get(0)[1]; - } - } - - //create pages - String title = closedPeriodicEntryBook.getEntryBook().getLabel() - + "\n" + monthYearFormat.format( - closedPeriodicEntryBook.getFinancialPeriod().getBeginDate()); - //list = list.subList(1, list.size()); - int i=0; - int n=entries.size(); - int max=35; - while (i<n){ - int j=i+max; - if (j>n){ - j = n; - } - List <Entry> subEntries = - entries.subList(i, j); - //create page : header + table + footer - Table headerTable = createEntryBooksHeaderTable(); - Table table = createEntryBooksTable(subEntries); - //new page - Chapter chapter = new Chapter(0); - //headerPage - chapter.add(createHeaderPage(title, identity, - dateFormat.format(beginDate), dateFormat.format(endDate))); - //n° page - chapter.add(createNumberPage(nbpages, dateS, hourS)); - //headerTable - Paragraph paragraphHeaderTable = new Paragraph(); - paragraphHeaderTable.add(headerTable); - chapter.add(paragraphHeaderTable); - //table - Paragraph paragraphTable = new Paragraph(); - paragraphTable.add(table); - chapter.add(paragraphTable); - //final amounts - if (i>=n-max){ - Paragraph finalAmountParagraph = new Paragraph(); - finalAmountParagraph.add(createEntryBooksAmountTable( - _("lima-business.document.amounts"), debit, credit)); - chapter.add(finalAmountParagraph); - } - //add page - document.add(chapter); - i=i+max; - nbpages++; + List<Entry> entries = entryDAO.findAllByQuery(query); + + List<Object[]> results = new ArrayList<Object[]>(); + Double debit = 0.0; + Double credit = 0.0; + query.setSelect(Entry.DEBIT, "SUM("+Entry.AMOUNT+")"); + query.addGroup(Entry.DEBIT); + results = query.execute(transaction); + int nbAmount = results.size(); + if(nbAmount==2){ + debit = (Double)results.get(0)[1]; + credit = (Double)results.get(1)[1]; + } + if (nbAmount==1){ + if ((Boolean)results.get(0)[0]){ + debit = (Double)results.get(0)[1]; + } + else { + credit = (Double)results.get(0)[1]; + } + } + + //create pages + String title = closedPeriodicEntryBook.getEntryBook().getLabel() + + "\n" + monthYearFormat.format( + closedPeriodicEntryBook.getFinancialPeriod().getBeginDate()); + //list = list.subList(1, list.size()); + int i = 0; + int n = entries.size(); + int max = n; + // alloc nb rows max for pdf documents on one page + if (format == FormatsEnum.PDF){ + max = 35; + } + while (i < n){ + int j = i + max; + if (j > n){ + j = n; } + List <Entry> subEntries = + entries.subList(i, j); + //create page : header + table + footer + Table headerTable = createEntryBooksHeaderTable(); + Table table = createEntryBooksTable(subEntries); + //new page + Chapter chapter = new Chapter(0); + //headerPage + chapter.add(createHeaderPage(title, identity, + dateFormat.format(beginDate), dateFormat.format(endDate))); + //n° page + chapter.add(createNumberPage(nbpages, dateS, hourS)); + //headerTable + Paragraph paragraphHeaderTable = new Paragraph(); + paragraphHeaderTable.add(headerTable); + chapter.add(paragraphHeaderTable); + //table + Paragraph paragraphTable = new Paragraph(); + paragraphTable.add(table); + chapter.add(paragraphTable); + //final amounts + if (i>=n-max){ + Paragraph finalAmountParagraph = new Paragraph(); + finalAmountParagraph.add(createEntryBooksAmountTable( + _("lima-business.document.amounts"), debit, credit)); + chapter.add(finalAmountParagraph); + } + //add page + document.add(chapter); + i = i + max; + nbpages++; } + } + + document.close(); - document.close(); - } catch (FileNotFoundException eeFNFE) { log.error("Can't create pdf file", eeFNFE); } catch (DocumentException eeDE) { @@ -912,7 +940,7 @@ //############## Balance ############## @Override - public void createBalanceDocuments(Date beginDate, Date endDate) throws LimaException { + public void createBalanceDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException { Document document = new Document(PageSize.A4, 8, 8, 8, 8); BalanceTrial balanceTrial = @@ -931,22 +959,31 @@ Double currentSoldeDebit = 0.0; Double currentSoldeCredit = 0.0; - PdfWriter pdfWriter = PdfWriter.getInstance(document, - new FileOutputStream(path+File.separator+"lima_balance.pdf")); - HtmlWriter htmlWriter = HtmlWriter.getInstance(document, - new FileOutputStream(path+File.separator+"lima_balance.html")); + String filePath = path+File.separator+DocumentsEnum.BALANCE.getFileName(); + FileOutputStream fileOut = new FileOutputStream(filePath+format.getExtension()); + switch (format) { + case HTML: + HtmlWriter htmlWriter = HtmlWriter.getInstance(document, fileOut); + break; + case PDF: + PdfWriter pdfWriter = PdfWriter.getInstance(document, fileOut); + break; + } document.open(); int nbpages = 1; Identity identity = identityService.getIdentity(); //create pages - String title = _("lima-business.document.balance"); - int i=0; - int n=list.size(); - int max = 26; - while (i<n){ - int j = i+max; - if (j>n){ + int i = 0; + int n = list.size(); + int max = n; + // alloc nb rows max for pdf documents on one page + if (format == FormatsEnum.PDF){ + max = 26; + } + while (i < n){ + int j = i + max; + if (j > n){ j = n; } List <ReportsDatas> subList = list.subList(i, j); @@ -955,7 +992,7 @@ //new page Chapter chapter = new Chapter(0); //headerPage - chapter.add(createHeaderPage(title, identity, dateFormat.format(beginDate), dateFormat.format(endDate))); + chapter.add(createHeaderPage(DocumentsEnum.BALANCE.getDescription(), identity, dateFormat.format(beginDate), dateFormat.format(endDate))); //n° page chapter.add(createNumberPage(nbpages, dateS, hourS)); //headerTable @@ -985,7 +1022,7 @@ reportsDatas.getSoldeDebit() ? 0 : reportsDatas.getAmountSolde(); } //forward amounts - if (n>max && i<=n-max){ + if (n > max && i <= n-max){ Paragraph forwardParagraph = new Paragraph(); forwardParagraph.add(createBalanceAmountTable( _("lima-business.document.carryforward"), @@ -994,7 +1031,7 @@ chapter.add(forwardParagraph); } //final amounts - if (i>=n-max){ + if (i >= n-max){ Paragraph finalAmountParagraph = new Paragraph(); finalAmountParagraph.add(createBalanceAmountTable( _("lima-business.document.amounts"), @@ -1004,7 +1041,7 @@ } //add page document.add(chapter); - i=i+max; + i = i + max; nbpages++; } document.close(); @@ -1111,7 +1148,7 @@ @Override - public void createGeneralEntryBooksDocuments(Date beginDate, Date endDate) throws LimaException { + public void createGeneralEntryBooksDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException { Document document = new Document(PageSize.A4, 8, 8, 8, 8); TopiaContext transaction = null; @@ -1121,10 +1158,17 @@ Date newDate = new Date(); String dateS = dateFormat.format(newDate); String hourS = hourFormat.format(newDate); - PdfWriter pdfWriter = PdfWriter.getInstance(document, - new FileOutputStream(path+File.separator+"lima_general_entybook.pdf")); - HtmlWriter htmlWriter = HtmlWriter.getInstance(document, - new FileOutputStream(path+File.separator+"lima_general_entybook.html")); + + String filePath = path+File.separator+DocumentsEnum.GENERAL_ENTRYBOOK.getFileName(); + FileOutputStream fileOut = new FileOutputStream(filePath+format.getExtension()); + switch (format) { + case HTML: + HtmlWriter htmlWriter = HtmlWriter.getInstance(document, fileOut); + break; + case PDF: + PdfWriter pdfWriter = PdfWriter.getInstance(document, fileOut); + break; + } document.open(); int nbpages = 1; @@ -1178,11 +1222,11 @@ results = query.execute(transaction); int nbAmount = results.size(); - if(nbAmount==2){ + if(nbAmount == 2){ debit = (Double)results.get(0)[1]; credit = (Double)results.get(1)[1]; } - if (nbAmount==1){ + if (nbAmount == 1){ if ((Boolean)results.get(0)[0]){ debit = (Double)results.get(0)[1]; } @@ -1224,12 +1268,16 @@ //create pages - int i=0; - int n=list.size(); - int max=35; - while (i<n){ - int j=i+max; - if (j>n){ + int i = 0; + int n = list.size(); + int max = n; + // alloc nb rows max for pdf documents on one page + if (format == FormatsEnum.PDF){ + max = 35; + } + while (i < n){ + int j = i + max; + if (j > n){ j = n; } List <GeneralEntryBooksDatas> subList = @@ -1241,7 +1289,7 @@ Chapter chapter = new Chapter(0); //headerPage chapter.add(createHeaderPage( - _("lima-business.document.generalentrybook"), + DocumentsEnum.GENERAL_ENTRYBOOK.getDescription(), identity, dateFormat.format(beginDate), dateFormat.format(endDate))); //n° page @@ -1256,7 +1304,7 @@ chapter.add(paragraphTable); //add page document.add(chapter); - i=i+max; + i = i + max; nbpages++; } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/HttpServerServiceImpl.java 2010-08-05 10:50:11 UTC (rev 2996) @@ -21,16 +21,9 @@ package org.chorem.lima.business.ejb; import static org.nuiton.i18n.I18n._; - -import java.awt.Image; -import java.awt.image.BufferedImage; -import java.io.BufferedInputStream; -import java.io.BufferedReader; import java.io.File; -import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; -import java.io.InputStreamReader; import java.io.OutputStream; import java.net.URL; import java.text.ParseException; @@ -39,13 +32,11 @@ import java.util.Date; import javax.ejb.EJB; import javax.ejb.Stateless; -import javax.imageio.ImageIO; import javax.servlet.Servlet; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; - import org.apache.commons.io.IOUtils; import org.apache.commons.lang.time.DateUtils; import org.apache.commons.logging.Log; @@ -56,13 +47,10 @@ import org.chorem.lima.business.ejbinterface.HttpServerService; import org.chorem.lima.business.ejbinterface.HttpServerServiceLocal; import org.chorem.lima.business.utils.DocumentsEnum; +import org.chorem.lima.business.utils.FormatsEnum; import org.mortbay.jetty.Server; -import org.mortbay.jetty.AbstractGenerator.Output; import org.mortbay.jetty.servlet.Context; import org.mortbay.jetty.servlet.ServletHolder; -import org.nuiton.topia.TopiaContext; -import org.nuiton.topia.TopiaContextFactory; -import org.nuiton.topia.TopiaNotFoundException; import org.nuiton.util.Resource; @@ -71,9 +59,7 @@ private static final Log log = LogFactory.getLog(HttpServerServiceImpl.class); - - private TopiaContext rootContext; - + @EJB DocumentService documentService; @@ -81,37 +67,30 @@ protected String path; + protected int port; + private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); public HttpServerServiceImpl() { - LimaConfig config = LimaConfig.getInstance(); - try { - rootContext = TopiaContextFactory.getContext(config.getOptions()); - } catch (TopiaNotFoundException ex) { - if (log.isErrorEnabled()) { - log.error("Can't init topia context", ex); - } - } path = LimaConfig.getInstance().getReportsDir(); - + port = LimaConfig.getInstance().getHttpPort(); } /** start the server */ + @Override public void start() { if (server == null) { - int port = LimaConfig.getInstance().getHttpPort(); new File(path).mkdir(); - String imagesPath = getClass().getResource("/images").toExternalForm(); try { server = new Server(port); Context root = new Context(server, "/", Context.NO_SESSIONS); root.addServlet(new ServletHolder((Servlet) new MainServlet()), "/"); - server.start(); + log.info("Web server are running on port: "+port); } catch (Exception eee) { @@ -121,18 +100,31 @@ } - /** this servlet send a static html page */ + + @Override + public int getHttpPort() { + return port; + } + + + /** this servlet send a static html page */ public class MainServlet extends HttpServlet { private static final long serialVersionUID = 1L; String serverAddressConfig = LimaConfig.getInstance().getAddressServer(); @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + + //get all params String imageParam = req.getParameter("img"); - log.info(imageParam); + String model = req.getParameter("model"); + String format = req.getParameter("format"); + String beginDate = req.getParameter("beginDate"); + String endDate = req.getParameter("endDate"); + + //if image if (imageParam != null){ URL image = Resource.getURLOrNull("images/"+imageParam); - log.info("image :"+image); if (image != null){ resp.setContentType("image/png"); InputStream in = image.openStream(); @@ -140,8 +132,51 @@ IOUtils.copy(in, out); } } + //if doc pdf or html + else if (model != null && format != null && beginDate != null && endDate != null){ + FormatsEnum formatsEnum = FormatsEnum.valueOfExtension(format); + URL doc = new URL("file:" + path + File.separator + + model +formatsEnum.getExtension()); + //create docs + try { + Date beginDateFormat = dateFormat.parse(beginDate); + Date endDateFormat = dateFormat.parse(endDate); + + switch (DocumentsEnum.valueOfLink(model)) { + case BALANCE: + documentService.createBalanceDocuments( + beginDateFormat, endDateFormat, formatsEnum); + break; + case ENTRYBOOKS: + documentService.createEntryBooksDocuments( + beginDateFormat, endDateFormat, formatsEnum); + break; + case FINANCIALSTATEMENT: + documentService.createFinancialStatementsDocuments( + beginDateFormat, endDateFormat, formatsEnum); + break; + case GENERAL_ENTRYBOOK: + documentService.createGeneralEntryBooksDocuments( + beginDateFormat, endDateFormat, formatsEnum); + break; + case LEDGER: + documentService.createLedgerDocuments( + beginDateFormat, endDateFormat, formatsEnum); + break; + } + } catch (LimaException eeeLE) { + log.error("Can't call document service for create html document", eeeLE); + } catch (ParseException eeePE) { + log.error("Can't parse date", eeePE); + } + resp.setContentType(formatsEnum.getMimeType()); + InputStream in = doc.openStream(); + OutputStream out = resp.getOutputStream(); + IOUtils.copy(in, out); + } + // else return home html else { - resp.setContentType("text/html"); + resp.setContentType(FormatsEnum.HTML.getMimeType()); String pageContent = ""; String serverAdress = "http://"; @@ -149,94 +184,73 @@ /** create server Address : static config if exist or dynamical adress */ if (serverAddressConfig.equals("")){ - serverAdress += req.getServerName() + ":" + req.getServerPort(); + serverAdress += req.getServerName() + + ":" + req.getServerPort(); } else { serverAdress += serverAddressConfig + ":" + LimaConfig.getInstance().getHttpPort(); } - - String link = req.getParameter("link"); - String beginDate = req.getParameter("beginDate"); - String endDate = req.getParameter("endDate"); - - if (link != null && beginDate != null && endDate != null){ - try { - Date beginDateFormat = dateFormat.parse(beginDate); - Date endDateFormat = dateFormat.parse(endDate); - switch (DocumentsEnum.valueOfLink(link)) { - case BALANCE: - documentService.createBalanceDocuments(beginDateFormat, endDateFormat); - break; - case ENTRYBOOKS: - documentService.createEntryBooksDocuments(beginDateFormat, endDateFormat); - break; - case FINANCIALSTATEMENT: - documentService.createFinancialStatementsDocuments(beginDateFormat, endDateFormat); - break; - case GENERAL_ENTRYBOOK: - documentService.createGeneralEntryBooksDocuments(beginDateFormat, endDateFormat); - break; - case LEDGER: - documentService.createLedgerDocuments(beginDateFormat, endDateFormat); - break; - } - } catch (LimaException eeeLE) { - log.error("Can't call document service for create html document", eeeLE); - } catch (ParseException eeePE) { - log.error("Can't parse date", eeePE); - } - pageContent = extractFile(path+File.separatorChar+link); - } - else { - - Calendar calendar = Calendar.getInstance(); - Date endDatePicker = calendar.getTime(); - Date beginDatePicker = calendar.getTime(); - beginDatePicker = DateUtils.truncate(beginDatePicker, Calendar.YEAR); - - pageContent = "<!DOCTYPE html>\n" - + "<html lang=\"fr\">\n" - + "<head>\n" - + "<title>LIMA Documents Report</title>\n" - + "<style type=\"text/css\">" - + "body { font: 14px sans-serif; }" - + "h1 { font: 20px sans-serif; text-align: center; }" - + "table.paddingleft td {padding-left:100px;}" - + ".tdright {text-align: right;}" - + "</style>" - + "</head>\n" - + "<body>\n" - + "<table class=\"paddingleft\">\n" - + "<tr><td colspan=2><h1>LIMA Documents Report</h1></td></tr>\n" - + "<tr><td><img src=\"?img=identity.png\"/></td>\n" - + "<td rowspan=3><form method=GET action=" + serverAdress + ">\n" - + _("lima-business.document.date.begin") + "<input value=\""+dateFormat.format(beginDatePicker) - + "\" type=\"date\" name=\"beginDate\">\n" - + _("lima-business.document.date.end") + "<input value=\""+dateFormat.format(endDatePicker) - + "\" type=\"date\" name=\"endDate\">\n<br/><br/>" - + "Documents : <select name=\"link\">"; - - for (DocumentsEnum documentsEnum : DocumentsEnum.values()) { - pageContent += "<option value=\""+documentsEnum.getLink()+"\">" - + documentsEnum.getDescription()+"</OPTION>\n"; - } - - pageContent += "<tr><td><img src=\"?img=entries.png\"/></td></tr>\n" - + "<tr><td><img src=\"?img=accounts.png\"/></td></tr>\n" - + "<tr><td><img src=\"?img=entrybooks.png\"/></td>\n" - + "</select>\n<br/><br/>" - + "<td class=\"tdright\"><input type=\"submit\"></td></tr>" - + "</form>\n" - + "<tr><td><img src=\"?img=fiscalperiods.png\"/></td></tr>\n" - + "</table>\n" - + "</body>\n" - + "</html>"; - } - - resp.getWriter().write(pageContent); + Calendar calendar = Calendar.getInstance(); + Date endDatePicker = calendar.getTime(); + Date beginDatePicker = calendar.getTime(); + beginDatePicker = + DateUtils.truncate(beginDatePicker, Calendar.YEAR); + + pageContent = "<!DOCTYPE html>\n" + + "<html lang=\"fr\">\n" + + "<head>\n" + + "<title>LIMA Documents Report</title>\n" + + "<style type=\"text/css\">" + + "body { font: 14px sans-serif; }" + + "h1 { font: 20px sans-serif; text-align: center; }" + + "table.paddingleft td {padding-left:100px;}" + + ".tdright {text-align: right;}" + + "</style>" + + "</head>\n" + + "<body>\n" + + "<table class=\"paddingleft\">\n" + + "<tr><td colspan=2><h1>LIMA Documents Report</h1></td></tr>\n" + + "<tr><td><img src=\"?img=identity.png\"/></td>\n" + + "<td rowspan=3><form method=GET action=" + + serverAdress + ">\n" + + _("lima-business.document.date.begin") + + "<input value=\""+dateFormat.format(beginDatePicker) + + "\" type=\"date\" name=\"beginDate\">\n" + + _("lima-business.document.date.end") + + "<input value=\""+dateFormat.format(endDatePicker) + + "\" type=\"date\" name=\"endDate\">\n<br/><br/>" + + "Format : <select name=\"format\">"; + + for (FormatsEnum formatsEnum : FormatsEnum.values()) { + pageContent += "<option value=\"" + + formatsEnum.getExtension()+"\">" + + formatsEnum.getDescription()+"</option>\n"; + } + + pageContent += "</select>\n" + + "Documents : <select name=\"model\">"; + + for (DocumentsEnum documentsEnum : DocumentsEnum.values()) { + pageContent += "<option value=\"" + + documentsEnum.getFileName()+"\">" + + documentsEnum.getDescription()+"</option>\n"; + } + + pageContent += "</select>\n" + + "<tr><td><img src=\"?img=entries.png\"/></td></tr>\n" + + "<tr><td><img src=\"?img=accounts.png\"/></td></tr>\n" + + "<tr><td><img src=\"?img=entrybooks.png\"/></td>\n" + + "<td class=\"tdright\"><input type=\"submit\"></td></tr>" + + "</form>\n" + + "<tr><td><img src=\"?img=fiscalperiods.png\"/></td></tr>\n" + + "</table>\n" + + "</body>\n" + + "</html>"; + resp.getWriter().write(pageContent); + } } @Override @@ -246,20 +260,5 @@ } } - - public String extractFile(String filePath){ - char[] datas = new char[(int) new File(filePath).length()]; - try { - BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(filePath))); - in.read(datas); - in.close(); - } - catch (IOException eee) { - if (log.isDebugEnabled()){ - log.debug("Can't read file "+filePath, eee); - } - } - return new String(datas); - } } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2010-08-05 10:50:11 UTC (rev 2996) @@ -492,8 +492,8 @@ * Get all entries */ @Override - public BalanceTrial generateLedger(Date beginDate, Date endDate, Boolean movementedFilter) throws LimaException { - return generateBalanceTrial(beginDate, endDate, null, true, movementedFilter); + public BalanceTrial generateLedger(Date beginDate, Date endDate, String selectedAccounts, Boolean movementedFilter) throws LimaException { + return generateBalanceTrial(beginDate, endDate, selectedAccounts, true, movementedFilter); } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/DocumentService.java 2010-08-05 10:50:11 UTC (rev 2996) @@ -20,9 +20,9 @@ package org.chorem.lima.business.ejbinterface; import java.util.Date; -import java.util.List; import javax.ejb.Remote; import org.chorem.lima.business.LimaException; +import org.chorem.lima.business.utils.FormatsEnum; /** * Interface to create pdf and html docs @@ -33,10 +33,10 @@ @Remote public interface DocumentService { - public void createFinancialStatementsDocuments(Date beginDate, Date endDate) throws LimaException; - public void createLedgerDocuments(Date beginDate, Date endDate) throws LimaException; - public void createEntryBooksDocuments(Date beginDate, Date endDate) throws LimaException; - public void createBalanceDocuments(Date beginDate, Date endDate) throws LimaException; - public void createGeneralEntryBooksDocuments(Date beginDate, Date endDate) throws LimaException; + public void createFinancialStatementsDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException; + public void createLedgerDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException; + public void createEntryBooksDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException; + public void createBalanceDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException; + public void createGeneralEntryBooksDocuments(Date beginDate, Date endDate, FormatsEnum format) throws LimaException; } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/HttpServerService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/HttpServerService.java 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/HttpServerService.java 2010-08-05 10:50:11 UTC (rev 2996) @@ -26,5 +26,6 @@ public interface HttpServerService { public void start(); + public int getHttpPort(); } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejbinterface/ReportService.java 2010-08-05 10:50:11 UTC (rev 2996) @@ -68,7 +68,7 @@ * * @throws LimaException */ - BalanceTrial generateLedger(Date beginDate, Date endDate, Boolean movementedFilter) throws LimaException; + BalanceTrial generateLedger(Date beginDate, Date endDate, String selectedAccounts, Boolean movementedFilter) throws LimaException; /** Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/DocumentsEnum.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/DocumentsEnum.java 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/DocumentsEnum.java 2010-08-05 10:50:11 UTC (rev 2996) @@ -1,3 +1,23 @@ +/* *##% Lima Business + * Copyright (C) 2008 - 2010 CodeLutin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + + package org.chorem.lima.business.utils; import static org.nuiton.i18n.I18n._; @@ -4,24 +24,24 @@ public enum DocumentsEnum { - - ENTRYBOOKS(_("lima-business.document.entrybook"),"lima_entrybooks.html"), - GENERAL_ENTRYBOOK(_("lima-business.document.generalentrybook"),"lima_general_entybook.html"), - FINANCIALSTATEMENT(_("lima-business.document.financialstatement"),"lima_financialstatements.html"), - BALANCE(_("lima-business.document.balance"),"lima_balance.html"), - LEDGER(_("lima-business.document.ledger"),"lima_ledger.html"); - private final String link; + GENERAL_ENTRYBOOK(_("lima-business.document.generalentrybook"),"lima_general_entybook"), + ENTRYBOOKS(_("lima-business.document.entrybook"),"lima_entrybooks"), + BALANCE(_("lima-business.document.balance"),"lima_balance"), + LEDGER(_("lima-business.document.ledger"),"lima_ledger"), + FINANCIALSTATEMENT(_("lima-business.document.financialstatement"),"lima_financialstatements"); + private final String fileName; + private final String description; - private DocumentsEnum(String description, String link) { + private DocumentsEnum(String description, String fileName) { this.description = description; - this.link = link; + this.fileName = fileName; } - public String getLink() { - return this.link; + public String getFileName() { + return this.fileName; } public String getDescription() { @@ -32,7 +52,7 @@ DocumentsEnum value = null; for (DocumentsEnum documentsEnum : DocumentsEnum.values()) { - if (label.equals(documentsEnum.link)){ + if (label.equals(documentsEnum.fileName)){ value = documentsEnum; break; } Added: trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FormatsEnum.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FormatsEnum.java (rev 0) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/utils/FormatsEnum.java 2010-08-05 10:50:11 UTC (rev 2996) @@ -0,0 +1,63 @@ +/* *##% Lima Business + * Copyright (C) 2008 - 2010 CodeLutin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ##%* + */ + + +package org.chorem.lima.business.utils; + +public enum FormatsEnum { + + HTML(".html","text/html", "Page Html"), + PDF(".pdf","application/pdf", "Document PDF"); + + private final String extension; + private final String mimeType; + private final String description; + + private FormatsEnum(String extension, String mimeType, String description) { + this.extension = extension; + this.mimeType = mimeType; + this.description = description; + } + + public String getExtension() { + return this.extension; + } + + public String getMimeType() { + return this.mimeType; + } + + public String getDescription(){ + return this.description; + } + + public static FormatsEnum valueOfExtension(String extension){ + FormatsEnum value = null; + + for (FormatsEnum formatsEnum : FormatsEnum.values()) { + if (extension.equals(formatsEnum.getExtension())){ + value = formatsEnum; + break; + } + } + return value; + } + + +} Modified: trunk/lima-business/src/main/resources/lima.properties =================================================================== --- trunk/lima-business/src/main/resources/lima.properties 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-business/src/main/resources/lima.properties 2010-08-05 10:50:11 UTC (rev 2996) @@ -1,6 +1,6 @@ #LIMA Defaults values # main directory -lima.dir=${user.home}/.lima/ +lima.dir=${user.home}/.lima # http port for reports lima.httpport=5462 # server address (optional for server behind proxy) Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java 2010-08-05 10:50:11 UTC (rev 2996) @@ -24,6 +24,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.actions.MiscAction; +import org.chorem.lima.entity.LimaCallaoDAOHelper; import org.nuiton.util.ApplicationConfig; import org.nuiton.util.ArgumentsParserException; import org.nuiton.util.Version; @@ -45,7 +46,11 @@ * to use log facility, just put in your code: log.info(\"...\"); */ static private Log log = LogFactory.getLog(LimaConfig.class); - + + protected static LimaConfig instance; + + private static final String configFile = "lima-config.properties"; + /** * La version du logiciel. */ @@ -99,9 +104,27 @@ //getLimaUserDirectory().mkdirs(); } - /* - * @see org.nuiton.util.ApplicationConfig#parse(java.lang.String[]) - */ + public static LimaConfig getInstance() { + if (instance == null) { + instance = new LimaConfig(); + instance.loadConfiguration(configFile); + } + return instance; + } + + protected void loadConfiguration(String configFileName){ + + instance.setConfigFileName(configFileName); + try { + instance.parse(new String[0]); + } catch (ArgumentsParserException ex) { + if (log.isErrorEnabled()) { + log.error("Can't read configuration", ex); + } + } + instance.setOption("topia.persistence.classes", LimaCallaoDAOHelper.getImplementationClassesAsString()); +} + @Override public void parse(String[] args) throws ArgumentsParserException { @@ -205,9 +228,8 @@ public String getHostAdress() { return getOption(Option.LIMA_HOST_ADDRESS.key); - } + } - /** * Used in ???? */ @@ -249,7 +271,7 @@ LAUNCH_UI("lima.ui.launchui", _("lima.config.ui.flaunchui.description"), "true", Boolean.class, true, true), SUPPORT_EMAIL("lima.misc.supportemail", _("lima.misc.supportemail.description"), "", String.class, false, false), OPENEJB_REMOTEMODE("lima.openejb.remotemode", _("lima.openejb.remotemode.description"), "false", String.class, false, false), - LIMA_HOST_ADDRESS("lima.host.address", _("lima.config.host.adress"), "", String.class, false, false); + LIMA_HOST_ADDRESS("lima.host.address", _("lima.config.host.adress"), "localhost", String.class, false, false); public final String key; public final String description; Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2010-08-05 10:50:11 UTC (rev 2996) @@ -21,29 +21,21 @@ import static org.nuiton.i18n.I18n._; import java.util.List; import java.util.Locale; -import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import jaxx.runtime.SwingUtil; -import org.apache.commons.beanutils.ConvertUtils; -import org.apache.commons.beanutils.Converter; -import org.apache.commons.beanutils.converters.DateConverter; -import org.apache.commons.collections.CollectionUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.business.AccountServiceMonitorable; import org.chorem.lima.business.HttpServerServiceMonitorable; import org.chorem.lima.business.ejbinterface.AccountService; -import org.chorem.lima.business.ejbinterface.HttpServerService; import org.chorem.lima.entity.Account; import org.chorem.lima.service.LimaServiceFactory; import org.chorem.lima.ui.MainView; import org.chorem.lima.ui.MainViewHandler; import org.chorem.lima.ui.opening.OpeningView; -import org.chorem.lima.ui.opening.OpeningViewHandler; import org.chorem.lima.util.ErrorHelper; import org.nuiton.i18n.I18n; import org.nuiton.util.StringUtil; -import org.nuiton.util.converter.ConverterUtil; /** * Lima main. @@ -175,7 +167,7 @@ // if not, call #loadDefaultAccount() splash.updateProgression(0.5, _("Loading accounting...")); - //start servlet + //start http server LimaServiceFactory.getInstance().getService(HttpServerServiceMonitorable.class).start(); AccountService accountService = Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2010-08-05 10:50:11 UTC (rev 2996) @@ -29,6 +29,8 @@ import org.chorem.lima.enums.ImportExportEnum; import java.net.URISyntaxException; import java.net.URI; + import org.chorem.lima.business.HttpServerServiceMonitorable; + import org.chorem.lima.service.LimaServiceFactory; public LimaConfig getConfig() { return getContextValue(LimaConfig.class); @@ -41,21 +43,19 @@ public boolean acceptLocale(Locale l, String expected) { return l != null && l.toString().equals(expected); } - - URI uri = null; - try { - uri = new URI("http://localhost:5462/"); - } catch (URISyntaxException e) { - e.printStackTrace(); - } - public void loadURI(){ - try { - desktop.browse(uri); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + public void loadURI(){ + try { + int port = LimaServiceFactory.getInstance().getService( + HttpServerServiceMonitorable.class).getHttpPort(); + String address = LimaConfig.getInstance().getHostAdress(); + String url = "http://"+address+":"+port+"/"; + desktop.browse(new URI(url)); + } catch (IOException e) { + log.error("Can't open browser",e); + } catch (URISyntaxException e) { + log.error("Can't create URI",e); + } } /** @@ -101,7 +101,7 @@ <JMenuBar> <JMenu text="lima.menu.file"> - <JMenu text="lima.importexport.lima"> + <JMenu text="lima.importexport.csv"> <JMenu text="lima.importexport.import" actionIcon='import-element'> <JMenuItem text="lima.importexport.all" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_ALL_IMPORT)'/> <JMenuItem text="lima.importexport.accountcharts" onActionPerformed='getHandler().showImportExportView(this, ImportExportEnum.CSV_ACCOUNTCHARTS_IMPORT)'/> @@ -126,7 +126,7 @@ </JMenu> </JMenu> <JSeparator/> - <JMenuItem text="lima.documents.html" + <JMenuItem actionIcon='documents' text="lima.documents" onActionPerformed="loadURI()"/> <JSeparator/> <JMenuItem text="lima.identity" Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceView.jaxx 2010-08-05 10:50:11 UTC (rev 2996) @@ -26,6 +26,8 @@ import org.apache.commons.lang.time.DateUtils; import java.util.Calendar; + getRootPane().setDefaultButton(filter); + // get begin date Calendar calendarBegin = Calendar.getInstance(); // set begindate to JAN 1 - 0:00.000 of this years @@ -67,16 +69,18 @@ <JTextField id="accountFilter"/> </cell> <cell anchor="west"> - <JButton text="lima.accountsreports.accountfilter" + <JButton id="filter" text="lima.accountsreports.accountfilter" onActionPerformed="getHandler().setAccountFilter(accountFilter.getText())"/> </cell> <cell anchor="center"> <JCheckBox id='movmentedFilter' text='lima.accountsreports.movmentedfilter' selected='false' onActionPerformed="getHandler().refresh()"/> </cell> - <cell> - <JButton text="lima.createPDF" onActionPerformed="getHandler().createPdf()"/> - </cell> + <cell> + <EnumEditor id='DocumentEditor' + constructorParams='org.chorem.lima.business.utils.FormatsEnum.class' + onActionPerformed="getHandler().createDocument()"/> + </cell> </row> <row> <cell fill="both" weightx="1" weighty="1" columns="8"> Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/balance/BalanceViewHandler.java 2010-08-05 10:50:11 UTC (rev 2996) @@ -19,16 +19,24 @@ package org.chorem.lima.ui.balance; import static org.nuiton.i18n.I18n._; +import java.awt.Desktop; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.text.SimpleDateFormat; import java.util.Date; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.lima.LimaConfig; import org.chorem.lima.beans.BalanceTrial; -import org.chorem.lima.business.DocumentServiceMonitorable; import org.chorem.lima.business.FinancialTransactionServiceMonitorable; +import org.chorem.lima.business.HttpServerServiceMonitorable; import org.chorem.lima.business.ImportServiceMonitorable; import org.chorem.lima.business.LimaException; import org.chorem.lima.business.ReportServiceMonitorable; import org.chorem.lima.business.ServiceListener; +import org.chorem.lima.business.utils.DocumentsEnum; +import org.chorem.lima.business.utils.FormatsEnum; import org.chorem.lima.service.LimaServiceFactory; import org.chorem.lima.util.ErrorHelper; @@ -46,7 +54,7 @@ /** Services. */ protected ReportServiceMonitorable reportService; - protected DocumentServiceMonitorable documentService; + protected HttpServerServiceMonitorable httpServerServiceMonitorable; /** DatePicker Begin Date. */ protected Date selectedBeginDate; @@ -58,16 +66,20 @@ protected String selectedAccounts; protected BalanceTableModel model; - + + private static SimpleDateFormat dateFormat = + new SimpleDateFormat("yyyy-MM-dd"); + + protected int port; + protected BalanceViewHandler(BalanceView view) { this.view = view; reportService = LimaServiceFactory.getInstance().getService( ReportServiceMonitorable.class); - documentService = - LimaServiceFactory.getInstance().getService( - DocumentServiceMonitorable.class); + port = LimaServiceFactory.getInstance().getService( + HttpServerServiceMonitorable.class).getHttpPort(); LimaServiceFactory.getInstance().getService( ImportServiceMonitorable.class).addListener(this); LimaServiceFactory.getInstance().getService( @@ -141,13 +153,20 @@ } } - public void createPdf() { + public void createDocument() { + + FormatsEnum selectedEnum = (FormatsEnum) view.getDocumentEditor().getSelectedItem(); + String address = LimaConfig.getInstance().getHostAdress(); + try { - documentService.createBalanceDocuments(selectedBeginDate, selectedEndDate); - } catch (LimaException eee) { - if(log.isDebugEnabled()){ - log.debug("Can't create PDF", eee); - } + String url = "http://"+address+":"+port+"/?beginDate="+dateFormat.format(selectedBeginDate) + +"&endDate="+dateFormat.format(selectedEndDate)+"&format="+selectedEnum.getExtension()+"&model=" + + DocumentsEnum.BALANCE.getFileName(); + Desktop.getDesktop().browse(new URI(url)); + } catch (IOException e) { + log.error("Can't open browser", e); + } catch (URISyntaxException e) { + log.error("Can't create news URI", e); } } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsView.jaxx 2010-08-05 10:50:11 UTC (rev 2996) @@ -75,7 +75,9 @@ /> </cell> <cell> - <JButton text="lima.createPDF" onActionPerformed="getHandler().createPdf()"/> + <EnumEditor id='DocumentEditor' + constructorParams='org.chorem.lima.business.utils.FormatsEnum.class' + onActionPerformed="getHandler().createDocument()"/> </cell> </row> <row> Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybooksreports/EntryBooksReportsViewHandler.java 2010-08-05 10:50:11 UTC (rev 2996) @@ -20,18 +20,27 @@ import static org.nuiton.i18n.I18n._; +import java.awt.Desktop; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.text.SimpleDateFormat; import java.util.Date; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.lima.LimaConfig; import org.chorem.lima.beans.ReportsDatas; import org.chorem.lima.beans.ReportsDatasImpl; import org.chorem.lima.business.DocumentServiceMonitorable; import org.chorem.lima.business.FinancialTransactionServiceMonitorable; +import org.chorem.lima.business.HttpServerServiceMonitorable; import org.chorem.lima.business.ImportServiceMonitorable; import org.chorem.lima.business.LimaException; import org.chorem.lima.business.ReportServiceMonitorable; import org.chorem.lima.business.ServiceListener; +import org.chorem.lima.business.utils.DocumentsEnum; +import org.chorem.lima.business.utils.FormatsEnum; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.service.LimaServiceFactory; import org.chorem.lima.ui.combobox.EntryBookComboBoxModel; @@ -67,6 +76,11 @@ /** EndDate. */ protected Date selectedEndDate; + + protected int port; + + private static SimpleDateFormat dateFormat = + new SimpleDateFormat("yyyy-MM-dd"); protected EntryBooksReportsViewHandler(EntryBooksReportsView view) { this.view = view; @@ -74,6 +88,8 @@ reportService = LimaServiceFactory.getInstance().getService( ReportServiceMonitorable.class); + port = LimaServiceFactory.getInstance().getService( + HttpServerServiceMonitorable.class).getHttpPort(); documentService = LimaServiceFactory.getInstance().getService( DocumentServiceMonitorable.class); @@ -148,14 +164,28 @@ } } - public void createPdf() { + + + public void createDocument() { + + FormatsEnum selectedEnum = (FormatsEnum) view.getDocumentEditor().getSelectedItem(); + String address = LimaConfig.getInstance().getHostAdress(); + try { - documentService.createEntryBooksDocuments(selectedBeginDate, selectedEndDate); - documentService.createGeneralEntryBooksDocuments(selectedBeginDate, selectedEndDate); - } catch (LimaException eee) { - if(log.isDebugEnabled()){ - log.debug("Can't create PDF", eee); - } + String url = "http://"+address+":"+port+"/?beginDate="+dateFormat.format(selectedBeginDate) + +"&endDate="+dateFormat.format(selectedEndDate)+"&format="+selectedEnum.getExtension()+"&model=" + + DocumentsEnum.ENTRYBOOKS.getFileName(); + Desktop.getDesktop().browse(new URI(url)); + + String url2 = "http://"+address+":"+port+"/?beginDate="+dateFormat.format(selectedBeginDate) + +"&endDate="+dateFormat.format(selectedEndDate)+"&format="+selectedEnum.getExtension()+"&model=" + + DocumentsEnum.GENERAL_ENTRYBOOK.getFileName(); + Desktop.getDesktop().browse(new URI(url2)); + + } catch (IOException e) { + log.error("Can't open browser", e); + } catch (URISyntaxException e) { + log.error("Can't create news URI", e); } } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTableModel.java 2010-08-05 10:50:11 UTC (rev 2996) @@ -20,18 +20,28 @@ package org.chorem.lima.ui.financialstatementreport; import static org.nuiton.i18n.I18n._; + +import java.awt.Desktop; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import javax.swing.table.AbstractTableModel; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.lima.LimaConfig; import org.chorem.lima.beans.FinancialStatementAmounts; import org.chorem.lima.business.DocumentServiceMonitorable; import org.chorem.lima.business.FinancialStatementServiceMonitorable; import org.chorem.lima.business.FinancialTransactionServiceMonitorable; +import org.chorem.lima.business.HttpServerServiceMonitorable; import org.chorem.lima.business.ImportServiceMonitorable; import org.chorem.lima.business.LimaException; import org.chorem.lima.business.ServiceListener; +import org.chorem.lima.business.utils.DocumentsEnum; +import org.chorem.lima.business.utils.FormatsEnum; import org.chorem.lima.service.LimaServiceFactory; import org.chorem.lima.util.ErrorHelper; @@ -63,6 +73,11 @@ /** DatePicker EndDate. */ protected Date selectedEndDate; + protected int port; + + private static SimpleDateFormat dateFormat = + new SimpleDateFormat("yyyy-MM-dd"); + /** data cache */ protected List<FinancialStatementAmounts> cacheDataList; @@ -73,7 +88,10 @@ financialStatementService = LimaServiceFactory.getInstance().getService( FinancialStatementServiceMonitorable.class); + financialStatementService.addListener(this); + port = LimaServiceFactory.getInstance().getService( + HttpServerServiceMonitorable.class).getHttpPort(); LimaServiceFactory.getInstance().getService( ImportServiceMonitorable.class).addListener(this); LimaServiceFactory.getInstance().getService( @@ -208,16 +226,23 @@ fireTableDataChanged(); } - public void createDocuments(){ + + public void createDocument(FormatsEnum formatsEnum) { + + String address = LimaConfig.getInstance().getHostAdress(); + try { - documentService.createFinancialStatementsDocuments(selectedBeginDate, selectedEndDate); - } catch (LimaException e) { - if (log.isDebugEnabled()){ - log.debug("Error on create document",e); - } + String url = "http://"+address+":"+port+"/?beginDate="+dateFormat.format(selectedBeginDate) + +"&endDate="+dateFormat.format(selectedEndDate)+"&format="+formatsEnum.getExtension()+"&model=" + + DocumentsEnum.FINANCIALSTATEMENT.getFileName(); + Desktop.getDesktop().browse(new URI(url)); + } catch (IOException e) { + log.error("Can't open browser", e); + } catch (URISyntaxException e) { + log.error("Can't create news URI", e); } } - + @Override public void notifyMethod(String serviceName, String methodeName) { if (serviceName.contains("FinancialTransaction") || methodeName.contains("FinancialStatement") || methodeName.contains("importAll")){ Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportView.jaxx 2010-08-05 10:50:11 UTC (rev 2996) @@ -66,7 +66,9 @@ getHandler().refresh()"/> </cell> <cell> - <JButton text="lima.createPDF" onActionPerformed="getHandler().createPdf()"/> + <EnumEditor id='DocumentEditor' + constructorParams='org.chorem.lima.business.utils.FormatsEnum.class' + onActionPerformed="getHandler().createDocument()"/> </cell> </row> <row> Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportViewHandler.java 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportViewHandler.java 2010-08-05 10:50:11 UTC (rev 2996) @@ -18,8 +18,17 @@ package org.chorem.lima.ui.financialstatementreport; +import java.awt.Desktop; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import org.chorem.lima.LimaConfig; +import org.chorem.lima.business.utils.DocumentsEnum; +import org.chorem.lima.business.utils.FormatsEnum; + + /** * Handler associated with accounts reports view. * @@ -48,7 +57,10 @@ return view; } - public void createPdf() { - model.createDocuments(); + public void createDocument() { + + FormatsEnum selectedEnum = (FormatsEnum) view.getDocumentEditor().getSelectedItem(); + model.createDocument(selectedEnum); + } } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerView.jaxx 2010-08-05 10:50:11 UTC (rev 2996) @@ -26,6 +26,8 @@ import org.apache.commons.lang.time.DateUtils; import java.util.Calendar; + getRootPane().setDefaultButton(filter); + // get begin date Calendar calendarBegin = Calendar.getInstance(); // set begindate to JAN 1 - 0:00.000 of this years @@ -62,13 +64,22 @@ <org.jdesktop.swingx.JXDatePicker id="endDatePicker" onActionPerformed="getHandler().setEndDate(endDatePicker.getDate())"/> </cell> - <cell> - <JButton text="lima.createPDF" onActionPerformed="getHandler().createPdf()"/> + <cell anchor="east"> + <JTextField id="accountFilter"/> </cell> + <cell anchor="west"> + <JButton id="filter" text="lima.accountsreports.accountfilter" + onActionPerformed="getHandler().setAccountFilter(accountFilter.getText())"/> + </cell> <cell anchor="center"> <JCheckBox id='movmentedFilter' text='lima.accountsreports.movmentedfilter' selected='false' onActionPerformed="getHandler().refresh()"/> </cell> + <cell> + <EnumEditor id='DocumentEditor' + constructorParams='org.chorem.lima.business.utils.FormatsEnum.class' + onActionPerformed="getHandler().createDocument()"/> + </cell> </row> <row> <cell fill="both" weightx="1" weighty="1" columns="8"> Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerViewHandler.java 2010-08-05 10:50:11 UTC (rev 2996) @@ -20,6 +20,11 @@ import static org.nuiton.i18n.I18n._; +import java.awt.Desktop; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collections; import java.util.Date; @@ -27,15 +32,19 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.lima.LimaConfig; import org.chorem.lima.beans.BalanceTrial; import org.chorem.lima.beans.ReportsDatas; import org.chorem.lima.business.DocumentServiceMonitorable; import org.chorem.lima.business.FinancialTransactionServiceMonitorable; +import org.chorem.lima.business.HttpServerServiceMonitorable; import org.chorem.lima.business.ImportServiceMonitorable; import org.chorem.lima.business.LimaException; import org.chorem.lima.business.ReportServiceMonitorable; import org.chorem.lima.business.ServiceListener; +import org.chorem.lima.business.utils.DocumentsEnum; import org.chorem.lima.business.utils.EntryComparator; +import org.chorem.lima.business.utils.FormatsEnum; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.service.LimaServiceFactory; @@ -68,8 +77,16 @@ /** EndDate. */ protected Date selectedEndDate; + /** Text field Accounts */ + protected String selectedAccounts; + protected BalanceTrial balanceTrialCache; + + private static SimpleDateFormat dateFormat = + new SimpleDateFormat("yyyy-MM-dd"); + protected int port; + protected List<Object> cachedatasList; protected LedgerViewHandler(LedgerView view) { @@ -79,6 +96,8 @@ LimaServiceFactory.getInstance().getService( ReportServiceMonitorable.class); reportService.addListener(this); + port = LimaServiceFactory.getInstance().getService( + HttpServerServiceMonitorable.class).getHttpPort(); documentService = LimaServiceFactory.getInstance().getService( DocumentServiceMonitorable.class); @@ -96,6 +115,11 @@ selectedEndDate = date; } + public void setAccountFilter(String accounts) { + selectedAccounts = accounts; + refresh(); + } + /** * get all account fot the selected period * @return @@ -103,7 +127,8 @@ public List<Object> getDataList(){ List<Object> results = new ArrayList<Object>(); try { - balanceTrialCache = reportService.generateLedger(selectedBeginDate, selectedEndDate, view.getMovmentedFilter().isSelected()); + balanceTrialCache = reportService.generateLedger(selectedBeginDate, + selectedEndDate, selectedAccounts, view.getMovmentedFilter().isSelected()); if (balanceTrialCache.getReportsDatas() != null){ for (ReportsDatas reportsDatas : balanceTrialCache.getReportsDatas()) { results.add(reportsDatas); @@ -158,13 +183,20 @@ } } - public void createPdf() { + public void createDocument() { + + FormatsEnum selectedEnum = (FormatsEnum) view.getDocumentEditor().getSelectedItem(); + String address = LimaConfig.getInstance().getHostAdress(); + try { - documentService.createLedgerDocuments(selectedBeginDate, selectedEndDate); - } catch (LimaException eee) { - if(log.isDebugEnabled()){ - log.debug("Can't create PDF", eee); - } + String url = "http://"+address+":"+port+"/?beginDate="+dateFormat.format(selectedBeginDate) + +"&endDate="+dateFormat.format(selectedEndDate)+"&format="+selectedEnum.getExtension()+"&model=" + + DocumentsEnum.LEDGER.getFileName(); + Desktop.getDesktop().browse(new URI(url)); + } catch (IOException e) { + log.error("Can't open browser", e); + } catch (URISyntaxException e) { + log.error("Can't create news URI", e); } } Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties =================================================================== --- trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-08-05 10:50:11 UTC (rev 2996) @@ -61,6 +61,7 @@ lima.config.category.other.description= lima.config.configFileName.description= lima.config.host.adress= +lima.config.host.httpport= lima.config.locale.description= lima.config.ui.flaunchui.description= lima.config.ui.fullscreen.description= @@ -71,6 +72,7 @@ lima.debit=Debit lima.description=Description lima.dialogreport= +lima.documents= lima.documents.html= lima.entries=Entries lima.entries.addtransaction= @@ -129,6 +131,7 @@ lima.importexport.accountcharts= lima.importexport.all= lima.importexport.choiceencoding= +lima.importexport.csv= lima.importexport.ebp= lima.importexport.entries= lima.importexport.entrybooks= Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties =================================================================== --- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-08-05 10:50:11 UTC (rev 2996) @@ -57,6 +57,7 @@ lima.config.category.other.description=Autre propri\u00E9t\u00E9s de configuration lima.config.configFileName.description= lima.config.host.adress= +lima.config.host.httpport= lima.config.locale.description=Locale utilis\u00E9e par l'application lima.config.ui.flaunchui.description= lima.config.ui.fullscreen.description= @@ -67,7 +68,7 @@ lima.debit=Debit lima.description=Description lima.dialogreport= -lima.documents.html= +lima.documents=Documents\u0085 lima.entries=Traitement lima.entries.addtransaction=Saisir des \u00E9critures lima.entries.lettering=Ajouter une lettre @@ -120,6 +121,7 @@ lima.importexport.accountcharts=Plan des comptes lima.importexport.all=Tout lima.importexport.choiceencoding=Choisir encodage \: +lima.importexport.csv=Import/Export CSV lima.importexport.ebp=Import/Export EBP lima.importexport.entries=\u00C9critures lima.importexport.entrybooks=Journaux @@ -129,7 +131,6 @@ lima.importexport.import.terminated=Import termin\u00E9 lima.importexport.importcsv=Import CSV lima.importexport.importebp=Import EBP -lima.importexport.lima=Import/Export Lima lima.importexport.wait=Traitement en cours \u2026 lima.init.closed=Lima ferm\u00E9 \u00E0 %1$s lima.init.errorclosing= Added: trunk/lima-swing/src/main/resources/icons/action-documents.png =================================================================== (Binary files differ) Property changes on: trunk/lima-swing/src/main/resources/icons/action-documents.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/lima-swing/src/main/resources/icons/action-export-element.png =================================================================== (Binary files differ) Modified: trunk/lima-swing/src/main/resources/icons/action-import-element.png =================================================================== (Binary files differ) Deleted: trunk/lima-swing/src/main/resources/icons/action-print.png =================================================================== (Binary files differ) Modified: trunk/lima-swing/src/main/resources/lima-config.properties =================================================================== --- trunk/lima-swing/src/main/resources/lima-config.properties 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/lima-swing/src/main/resources/lima-config.properties 2010-08-05 10:50:11 UTC (rev 2996) @@ -18,7 +18,7 @@ lima.openejb.remotemode=false java.naming.factory.initial=org.openejb.client.LocalInitialContextFactory -#Lima Accounting Host address +#Lima Accounting Host lima.host.address=localhost # Remote mode Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2010-08-04 17:59:27 UTC (rev 2995) +++ trunk/pom.xml 2010-08-05 10:50:11 UTC (rev 2996) @@ -253,6 +253,16 @@ <role>Développeur</role> </roles> </contributor> + <contributor> + <name>jpepin</name> + <email>pepin@codelutin.com</email> + <organization>Code Lutin</organization> + <organizationUrl>http://www.codelutin.com</organizationUrl> + <timezone>+2</timezone> + <roles> + <role>Développeur</role> + </roles> + </contributor> </contributors> <!-- ************************************************************* -->