Author: dcosse Date: 2014-08-06 16:27:15 +0200 (Wed, 06 Aug 2014) New Revision: 3902 Url: http://forge.chorem.org/projects/lima/repository/revisions/3902 Log: refs #1054 d?\195?\169placement + correction du build Added: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AccountException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AfterLastFiscalPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistAccountException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistEntryBookException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistFinancialStatement.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistVatStatementException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyLockedFiscalPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/BeforeFirstFiscalPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/BeginAfterEndFiscalPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ClosedPeriodicEntryBookException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ClosedPeriodicEntryBooksException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/DateException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/EntriesException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/EntryBookException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FinancialPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FinancialTransactionsException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FiscalPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportBackupException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportEbpException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportFileException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/InvalidAccountNumberException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LastUnlockedFiscalPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LimaException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LockedEntryBookException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LockedFinancialPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/MoreOneUnlockFiscalPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoDataToImportException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoEmptyFiscalPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoFiscalPeriodFoundException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoFoundFinancialPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotAllowedLabelException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotBeginNextDayOfLastFiscalPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotLockedClosedPeriodicEntryBooksException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotNumberAccountNumberException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnbalancedEntriesException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnbalancedFinancialTransactionsException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnfilledEntriesException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UsedAccountException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UsedEntryBookException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/WithoutEntryBookFinancialTransactionsException.java Removed: trunk/lima-business-api/src/main/java/org/chorem/lima/ImportBackupException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/AccountException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/AfterLastFiscalPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistAccountException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistFinancialStatement.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistVatStatement.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyLockedFiscalPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeforeFirstFiscalPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeginAfterEndFiscalPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBookException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBooksException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/DateException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntriesException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntryBookException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialTransactionsException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/FiscalPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportEbpException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/InvalidAccountNumberException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/LastUnlockedFiscalPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/LimaException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedEntryBookException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedFinancialPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoDataToImportException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoEmptyFiscalPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFiscalPeriodFoundException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFoundFinancialPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotAllowedLabel.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotBeginNextDayOfLastFiscalPeriodException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotLockedClosedPeriodicEntryBooksException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotNumberAccountNumberException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedEntriesException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedFinancialTransactionsException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnfilledEntriesException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedAccountException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedEntryBookException.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/WithoutEntryBookFinancialTransactionsException.java Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java 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/ReportService.java trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementService.java trunk/lima-business/pom.xml trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java trunk/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java trunk/lima-business/src/test/java/org/chorem/lima/entity/FinancialTransactionDAOTest.java trunk/lima-swing/pom.xml trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialTransactionTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateFiscalPeriodPanel.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartTreeTableModel.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/pom.xml Modified: trunk/lima-business/pom.xml =================================================================== --- trunk/lima-business/pom.xml 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business/pom.xml 2014-08-06 14:27:15 UTC (rev 3902) @@ -34,10 +34,6 @@ <version>${project.version}</version> </dependency> <dependency> - <groupId>net.sf.opencsv</groupId> - <artifactId>opencsv</artifactId> - </dependency> - <dependency> <groupId>org.apache.pdfbox</groupId> <artifactId>pdfbox</artifactId> </dependency> Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/AccountingRules.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -25,6 +25,25 @@ package org.chorem.lima.business; +import org.chorem.lima.business.exceptions.AfterLastFiscalPeriodException; +import org.chorem.lima.business.exceptions.BeforeFirstFiscalPeriodException; +import org.chorem.lima.business.exceptions.BeginAfterEndFiscalPeriodException; +import org.chorem.lima.business.exceptions.InvalidAccountNumberException; +import org.chorem.lima.business.exceptions.LastUnlockedFiscalPeriodException; +import org.chorem.lima.business.exceptions.LockedEntryBookException; +import org.chorem.lima.business.exceptions.LockedFinancialPeriodException; +import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException; +import org.chorem.lima.business.exceptions.NoEmptyFiscalPeriodException; +import org.chorem.lima.business.exceptions.NotAllowedLabelException; +import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException; +import org.chorem.lima.business.exceptions.NotLockedClosedPeriodicEntryBooksException; +import org.chorem.lima.business.exceptions.NotNumberAccountNumberException; +import org.chorem.lima.business.exceptions.UnbalancedEntriesException; +import org.chorem.lima.business.exceptions.UnbalancedFinancialTransactionsException; +import org.chorem.lima.business.exceptions.UnfilledEntriesException; +import org.chorem.lima.business.exceptions.UsedAccountException; +import org.chorem.lima.business.exceptions.UsedEntryBookException; +import org.chorem.lima.business.exceptions.WithoutEntryBookFinancialTransactionsException; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.ClosedPeriodicEntryBook; import org.chorem.lima.entity.Entry; @@ -46,9 +65,9 @@ * Account rule : check create account. * * @param account new account - * @throws LimaException if rule validation fails + * @throws org.chorem.lima.business.exceptions.LimaException if rule validation fails */ - void createAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel; + void createAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException; void updateAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException; @@ -58,7 +77,7 @@ * Entrybook rules. * * @param entryBook - * @throws LimaException + * @throws org.chorem.lima.business.exceptions.LimaException */ void removeEntryBookRules(EntryBook entryBook) throws UsedEntryBookException; @@ -66,7 +85,7 @@ * Fiscal Period rules * * @param fiscalPeriod - * @throws LimaException + * @throws org.chorem.lima.business.exceptions.LimaException */ List<FinancialPeriod> createFiscalPeriodRules(FiscalPeriod fiscalPeriod) throws BeginAfterEndFiscalPeriodException, @@ -81,7 +100,7 @@ * Entry rules * * @param entry - * @throws LockedEntryBookException + * @throws org.chorem.lima.business.exceptions.LockedEntryBookException */ void updateEntryRules(Entry entry, Entry entryOld) throws LockedEntryBookException; @@ -100,7 +119,7 @@ * Check if a financial period can be closed. * * @param closedPeriodicEntryBook - * @throws UnfilledEntriesException, WithoutEntryBookFinancialTransactionsException, UnbalancedFinancialTransactionsException, NotLockedClosedPeriodicEntryBooksException + * @throws org.chorem.lima.business.exceptions.UnfilledEntriesException, WithoutEntryBookFinancialTransactionsException, UnbalancedFinancialTransactionsException, NotLockedClosedPeriodicEntryBooksException */ void blockClosedPeriodicEntryBookRules(ClosedPeriodicEntryBook closedPeriodicEntryBook) throws UnfilledEntriesException, Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/DefaultAccountingRules.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -29,26 +29,26 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.business.AccountingRules; -import org.chorem.lima.business.AfterLastFiscalPeriodException; -import org.chorem.lima.business.BeforeFirstFiscalPeriodException; -import org.chorem.lima.business.BeginAfterEndFiscalPeriodException; -import org.chorem.lima.business.InvalidAccountNumberException; -import org.chorem.lima.business.LastUnlockedFiscalPeriodException; import org.chorem.lima.business.LimaInterceptor; -import org.chorem.lima.business.LockedEntryBookException; -import org.chorem.lima.business.LockedFinancialPeriodException; -import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException; -import org.chorem.lima.business.NoEmptyFiscalPeriodException; -import org.chorem.lima.business.NotAllowedLabel; -import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException; -import org.chorem.lima.business.NotLockedClosedPeriodicEntryBooksException; -import org.chorem.lima.business.NotNumberAccountNumberException; -import org.chorem.lima.business.UnbalancedEntriesException; -import org.chorem.lima.business.UnbalancedFinancialTransactionsException; -import org.chorem.lima.business.UnfilledEntriesException; -import org.chorem.lima.business.UsedAccountException; -import org.chorem.lima.business.UsedEntryBookException; -import org.chorem.lima.business.WithoutEntryBookFinancialTransactionsException; +import org.chorem.lima.business.exceptions.AfterLastFiscalPeriodException; +import org.chorem.lima.business.exceptions.BeforeFirstFiscalPeriodException; +import org.chorem.lima.business.exceptions.BeginAfterEndFiscalPeriodException; +import org.chorem.lima.business.exceptions.InvalidAccountNumberException; +import org.chorem.lima.business.exceptions.LastUnlockedFiscalPeriodException; +import org.chorem.lima.business.exceptions.LockedEntryBookException; +import org.chorem.lima.business.exceptions.LockedFinancialPeriodException; +import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException; +import org.chorem.lima.business.exceptions.NoEmptyFiscalPeriodException; +import org.chorem.lima.business.exceptions.NotAllowedLabelException; +import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException; +import org.chorem.lima.business.exceptions.NotLockedClosedPeriodicEntryBooksException; +import org.chorem.lima.business.exceptions.NotNumberAccountNumberException; +import org.chorem.lima.business.exceptions.UnbalancedEntriesException; +import org.chorem.lima.business.exceptions.UnbalancedFinancialTransactionsException; +import org.chorem.lima.business.exceptions.UnfilledEntriesException; +import org.chorem.lima.business.exceptions.UsedAccountException; +import org.chorem.lima.business.exceptions.UsedEntryBookException; +import org.chorem.lima.business.exceptions.WithoutEntryBookFinancialTransactionsException; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.ClosedPeriodicEntryBook; import org.chorem.lima.entity.ClosedPeriodicEntryBookTopiaDao; @@ -96,13 +96,13 @@ * Rules to check before create accounts. */ @Override - public void createAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel { + public void createAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException { // Check if the numberaccount is not blank if (StringUtils.isBlank(account.getAccountNumber())) { throw new InvalidAccountNumberException(account.getAccountNumber()); } if (account.getAccountNumber().contains("\\")){ - throw new NotAllowedLabel(account.getAccountNumber()); + throw new NotAllowedLabelException(account.getAccountNumber()); } } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/accountingrules/FranceAccountingRules.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -29,18 +29,18 @@ import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.business.BeginAfterEndFiscalPeriodException; -import org.chorem.lima.business.InvalidAccountNumberException; -import org.chorem.lima.business.LastUnlockedFiscalPeriodException; -import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException; -import org.chorem.lima.business.NoEmptyFiscalPeriodException; -import org.chorem.lima.business.NotAllowedLabel; -import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException; -import org.chorem.lima.business.NotLockedClosedPeriodicEntryBooksException; -import org.chorem.lima.business.NotNumberAccountNumberException; -import org.chorem.lima.business.UnbalancedFinancialTransactionsException; -import org.chorem.lima.business.UnfilledEntriesException; -import org.chorem.lima.business.WithoutEntryBookFinancialTransactionsException; +import org.chorem.lima.business.exceptions.BeginAfterEndFiscalPeriodException; +import org.chorem.lima.business.exceptions.InvalidAccountNumberException; +import org.chorem.lima.business.exceptions.LastUnlockedFiscalPeriodException; +import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException; +import org.chorem.lima.business.exceptions.NoEmptyFiscalPeriodException; +import org.chorem.lima.business.exceptions.NotAllowedLabelException; +import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException; +import org.chorem.lima.business.exceptions.NotLockedClosedPeriodicEntryBooksException; +import org.chorem.lima.business.exceptions.NotNumberAccountNumberException; +import org.chorem.lima.business.exceptions.UnbalancedFinancialTransactionsException; +import org.chorem.lima.business.exceptions.UnfilledEntriesException; +import org.chorem.lima.business.exceptions.WithoutEntryBookFinancialTransactionsException; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.ClosedPeriodicEntryBook; import org.chorem.lima.entity.ClosedPeriodicEntryBookTopiaDao; @@ -69,7 +69,7 @@ * Règles de vérification de la création du PCG, appliquées à la comptabilité française. */ @Override - public void createAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel { + public void createAccountRules(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException { super.createAccountRules(account); validFranceAccountingRules(account); Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -27,14 +27,14 @@ import org.apache.commons.lang.StringUtils; import org.chorem.lima.business.AccountingRules; -import org.chorem.lima.business.AlreadyExistAccountException; -import org.chorem.lima.business.InvalidAccountNumberException; import org.chorem.lima.business.LimaConfig; -import org.chorem.lima.business.LimaException; -import org.chorem.lima.business.NotAllowedLabel; -import org.chorem.lima.business.NotNumberAccountNumberException; -import org.chorem.lima.business.UsedAccountException; import org.chorem.lima.business.api.AccountService; +import org.chorem.lima.business.exceptions.AlreadyExistAccountException; +import org.chorem.lima.business.exceptions.InvalidAccountNumberException; +import org.chorem.lima.business.exceptions.LimaException; +import org.chorem.lima.business.exceptions.NotAllowedLabelException; +import org.chorem.lima.business.exceptions.NotNumberAccountNumberException; +import org.chorem.lima.business.exceptions.UsedAccountException; import org.chorem.lima.business.utils.AccountComparator; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.AccountTopiaDao; @@ -72,7 +72,7 @@ } @Override - public boolean createOrUbdateAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel { + public boolean createOrUbdateAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException { // check if account number already exist AccountTopiaDao accountDao = getDaoHelper().getAccountDao(); @@ -94,7 +94,7 @@ * @throws LimaException */ @Override - public Account createAccount(Account account) throws AlreadyExistAccountException, InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel { + public Account createAccount(Account account) throws AlreadyExistAccountException, InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException { // check if account number already exist AccountTopiaDao accountDao = getDaoHelper().getAccountDao(); @@ -108,7 +108,7 @@ return result; } - protected Account createNewAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel { + protected Account createNewAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException { // check rules before create the account AccountingRules accountingRules = LimaConfig.getInstance().getAccountingRules(); accountingRules.createAccountRules(account); Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -27,8 +27,9 @@ import org.chorem.lima.business.AccountingRules; import org.chorem.lima.business.LimaConfig; -import org.chorem.lima.business.UsedEntryBookException; import org.chorem.lima.business.api.EntryBookService; +import org.chorem.lima.business.exceptions.AlreadyExistEntryBookException; +import org.chorem.lima.business.exceptions.UsedEntryBookException; import org.chorem.lima.entity.ClosedPeriodicEntryBook; import org.chorem.lima.entity.ClosedPeriodicEntryBookImpl; import org.chorem.lima.entity.ClosedPeriodicEntryBookTopiaDao; @@ -44,8 +45,6 @@ import javax.ejb.TransactionAttribute; import java.util.List; -import static org.nuiton.i18n.I18n.t; - /** * Implémente la fonction multi-EntryBook. Il est possible de créer ici le * EntryBook des ventes, le EntryBook des achats, etc. @@ -82,15 +81,13 @@ } @Override - public EntryBook createEntryBook(EntryBook entryBook) { - EntryBook result = null; + public EntryBook createEntryBook(EntryBook entryBook) throws AlreadyExistEntryBookException { + EntryBook result; // check if entrybook with is name already exist EntryBookTopiaDao entryBookTopiaDao = getDaoHelper().getEntryBookDao(); EntryBook alreadyExistingEntryBook = entryBookTopiaDao.forCodeEquals(entryBook.getCode()).findUniqueOrNull(); if (alreadyExistingEntryBook != null) { - log.error( - t("lima-business.entrybook.entrybookalreadyexist", - entryBook.getCode())); + throw new AlreadyExistEntryBookException(entryBook); } else { // creation du EntryBook result = createNewEntryBook(entryBook); Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -27,11 +27,11 @@ import org.chorem.lima.business.AccountingRules; import org.chorem.lima.business.LimaConfig; -import org.chorem.lima.business.NotLockedClosedPeriodicEntryBooksException; -import org.chorem.lima.business.UnbalancedFinancialTransactionsException; -import org.chorem.lima.business.UnfilledEntriesException; -import org.chorem.lima.business.WithoutEntryBookFinancialTransactionsException; import org.chorem.lima.business.api.FinancialPeriodService; +import org.chorem.lima.business.exceptions.NotLockedClosedPeriodicEntryBooksException; +import org.chorem.lima.business.exceptions.UnbalancedFinancialTransactionsException; +import org.chorem.lima.business.exceptions.UnfilledEntriesException; +import org.chorem.lima.business.exceptions.WithoutEntryBookFinancialTransactionsException; import org.chorem.lima.entity.ClosedPeriodicEntryBook; import org.chorem.lima.entity.ClosedPeriodicEntryBookTopiaDao; import org.chorem.lima.entity.EntryBook; Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialStatementServiceImpl.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -39,12 +39,12 @@ import org.chorem.lima.beans.FinancialStatementDatas; import org.chorem.lima.beans.FinancialStatementDatasImpl; import org.chorem.lima.beans.ReportsDatas; -import org.chorem.lima.business.AlreadyExistFinancialStatement; -import org.chorem.lima.business.LimaException; -import org.chorem.lima.business.NotAllowedLabel; import org.chorem.lima.business.api.AccountService; import org.chorem.lima.business.api.FinancialStatementService; import org.chorem.lima.business.api.ReportService; +import org.chorem.lima.business.exceptions.AlreadyExistFinancialStatement; +import org.chorem.lima.business.exceptions.LimaException; +import org.chorem.lima.business.exceptions.NotAllowedLabelException; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.AccountTopiaDao; import org.chorem.lima.entity.FinancialStatement; @@ -84,9 +84,9 @@ } }; - protected void validateNewFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws AlreadyExistFinancialStatement, NotAllowedLabel { + protected void validateNewFinancialStatement(FinancialStatement masterFinancialStatement, FinancialStatement financialStatement) throws AlreadyExistFinancialStatement, NotAllowedLabelException { if (financialStatement.getLabel().contains("/")) { - throw new NotAllowedLabel(financialStatement.getLabel()); + throw new NotAllowedLabelException(financialStatement.getLabel()); } if (masterFinancialStatement != null) { Collection<FinancialStatement> masterSubFinancialStatements = masterFinancialStatement.getSubFinancialStatements(); @@ -134,7 +134,7 @@ @Override public FinancialStatement createFinancialStatement(FinancialStatement masterFinancialStatement, - FinancialStatement financialStatement) throws AlreadyExistFinancialStatement, NotAllowedLabel { + FinancialStatement financialStatement) throws AlreadyExistFinancialStatement, NotAllowedLabelException { validateNewFinancialStatement(masterFinancialStatement, financialStatement); Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -34,15 +34,15 @@ import org.chorem.lima.beans.FinancialTransactionCondition; import org.chorem.lima.beans.LetteringFilter; import org.chorem.lima.business.AccountingRules; -import org.chorem.lima.business.AfterLastFiscalPeriodException; -import org.chorem.lima.business.BeforeFirstFiscalPeriodException; import org.chorem.lima.business.LimaConfig; -import org.chorem.lima.business.LimaException; -import org.chorem.lima.business.LockedEntryBookException; -import org.chorem.lima.business.LockedFinancialPeriodException; -import org.chorem.lima.business.UnbalancedEntriesException; import org.chorem.lima.business.api.AccountService; import org.chorem.lima.business.api.FinancialTransactionService; +import org.chorem.lima.business.exceptions.AfterLastFiscalPeriodException; +import org.chorem.lima.business.exceptions.BeforeFirstFiscalPeriodException; +import org.chorem.lima.business.exceptions.LimaException; +import org.chorem.lima.business.exceptions.LockedEntryBookException; +import org.chorem.lima.business.exceptions.LockedFinancialPeriodException; +import org.chorem.lima.business.exceptions.UnbalancedEntriesException; import org.chorem.lima.business.utils.LetteringComparator; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -30,26 +30,23 @@ import org.chorem.lima.beans.BalanceTrial; import org.chorem.lima.beans.ReportsDatas; import org.chorem.lima.business.AccountingRules; -import org.chorem.lima.business.AlreadyExistAccountException; -import org.chorem.lima.business.AlreadyLockedFiscalPeriodException; -import org.chorem.lima.business.BeginAfterEndFiscalPeriodException; -import org.chorem.lima.business.InvalidAccountNumberException; -import org.chorem.lima.business.LastUnlockedFiscalPeriodException; import org.chorem.lima.business.LimaConfig; -import org.chorem.lima.business.LockedEntryBookException; -import org.chorem.lima.business.LockedFinancialPeriodException; -import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException; -import org.chorem.lima.business.NoEmptyFiscalPeriodException; -import org.chorem.lima.business.NoFoundFinancialPeriodException; -import org.chorem.lima.business.NotAllowedLabel; -import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException; -import org.chorem.lima.business.NotNumberAccountNumberException; import org.chorem.lima.business.api.AccountService; import org.chorem.lima.business.api.EntryBookService; import org.chorem.lima.business.api.FinancialPeriodService; import org.chorem.lima.business.api.FinancialTransactionService; import org.chorem.lima.business.api.FiscalPeriodService; import org.chorem.lima.business.api.ReportService; +import org.chorem.lima.business.exceptions.AlreadyLockedFiscalPeriodException; +import org.chorem.lima.business.exceptions.BeginAfterEndFiscalPeriodException; +import org.chorem.lima.business.exceptions.LastUnlockedFiscalPeriodException; +import org.chorem.lima.business.exceptions.LimaException; +import org.chorem.lima.business.exceptions.LockedEntryBookException; +import org.chorem.lima.business.exceptions.LockedFinancialPeriodException; +import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException; +import org.chorem.lima.business.exceptions.NoEmptyFiscalPeriodException; +import org.chorem.lima.business.exceptions.NoFoundFinancialPeriodException; +import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.AccountImpl; import org.chorem.lima.entity.ClosedPeriodicEntryBook; @@ -290,13 +287,7 @@ @Override public FiscalPeriod retainedEarningsAndBlockFiscalPeriod(FiscalPeriod fiscalPeriod, EntryBook entryBook, boolean retainedEarnings) - throws LockedFinancialPeriodException, - LockedEntryBookException, - NoFoundFinancialPeriodException, - LastUnlockedFiscalPeriodException, - AlreadyLockedFiscalPeriodException, - AlreadyExistAccountException, - InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel { + throws LimaException { if (entryBook != null && retainedEarnings) { 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-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ImportServiceImpl.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -29,22 +29,8 @@ import org.chorem.lima.beans.EntryEBP; import org.chorem.lima.beans.FinancialStatementImport; import org.chorem.lima.beans.VatStatementImport; -import org.chorem.lima.business.AlreadyExistAccountException; -import org.chorem.lima.business.AlreadyExistFinancialStatement; -import org.chorem.lima.business.AlreadyExistVatStatement; -import org.chorem.lima.business.BeginAfterEndFiscalPeriodException; -import org.chorem.lima.business.ImportEbpException; import org.chorem.lima.business.ImportExportResults; import org.chorem.lima.business.ImportResult; -import org.chorem.lima.business.InvalidAccountNumberException; -import org.chorem.lima.business.LockedEntryBookException; -import org.chorem.lima.business.LockedFinancialPeriodException; -import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException; -import org.chorem.lima.business.NoDataToImportException; -import org.chorem.lima.business.NoFiscalPeriodFoundException; -import org.chorem.lima.business.NotAllowedLabel; -import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException; -import org.chorem.lima.business.NotNumberAccountNumberException; import org.chorem.lima.business.api.AccountService; import org.chorem.lima.business.api.EntryBookService; import org.chorem.lima.business.api.EntryService; @@ -65,6 +51,22 @@ import org.chorem.lima.business.ejb.ebp.AccountEBPModel; import org.chorem.lima.business.ejb.ebp.EntryBookEBPModel; import org.chorem.lima.business.ejb.ebp.EntryEBPModel; +import org.chorem.lima.business.exceptions.AlreadyExistAccountException; +import org.chorem.lima.business.exceptions.AlreadyExistEntryBookException; +import org.chorem.lima.business.exceptions.AlreadyExistFinancialStatement; +import org.chorem.lima.business.exceptions.AlreadyExistVatStatementException; +import org.chorem.lima.business.exceptions.BeginAfterEndFiscalPeriodException; +import org.chorem.lima.business.exceptions.ImportEbpException; +import org.chorem.lima.business.exceptions.ImportFileException; +import org.chorem.lima.business.exceptions.InvalidAccountNumberException; +import org.chorem.lima.business.exceptions.LockedEntryBookException; +import org.chorem.lima.business.exceptions.LockedFinancialPeriodException; +import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException; +import org.chorem.lima.business.exceptions.NoDataToImportException; +import org.chorem.lima.business.exceptions.NoFiscalPeriodFoundException; +import org.chorem.lima.business.exceptions.NotAllowedLabelException; +import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException; +import org.chorem.lima.business.exceptions.NotNumberAccountNumberException; import org.chorem.lima.business.utils.EntryEBPComparator; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.Entry; @@ -76,6 +78,7 @@ import org.chorem.lima.entity.VatStatement; import org.nuiton.csv.Import; import org.nuiton.csv.ImportModel; +import org.nuiton.csv.ImportRuntimeException; import org.nuiton.util.beans.Binder; import org.nuiton.util.beans.BinderFactory; @@ -144,13 +147,13 @@ @Override public ImportExportResults importAccountAsCSV(String contents) { - ImportExportResults result = new ImportExportResults(); - ImportResult importResult = result.createAddAndGetImportResult(Account.class); + ImportExportResults results = new ImportExportResults(); + ImportResult result = results.createAddAndGetImportResult(Account.class); + InputStream contentStream = IOUtils.toInputStream(contents); if (StringUtils.isBlank(contents)) { - importResult.addException(new NoDataToImportException()); + result.addException(new NoDataToImportException()); } else { - InputStream contentStream = IOUtils.toInputStream(contents); try { ImportModel<Account> model = new AccountModel(); Import<Account> accounts = Import.newImport(model, contentStream); @@ -160,20 +163,21 @@ try { updated = accountService.createOrUbdateAccount(account); if (updated) { - importResult.increaseUpdated(); + result.increaseUpdated(); } else { - importResult.increaseCreated(); + result.increaseCreated(); } - } catch (InvalidAccountNumberException | NotNumberAccountNumberException | NotAllowedLabel e) { - importResult.addException(e); + } catch (InvalidAccountNumberException | NotNumberAccountNumberException | NotAllowedLabelException e) { + result.addException(e); } } + } catch (ImportRuntimeException e) { + result.addInitException(new ImportFileException(e.getMessage())); } finally { IOUtils.closeQuietly(contentStream); } } - - return result; + return results; } @Override @@ -186,19 +190,22 @@ } else { InputStream contentStream = IOUtils.toInputStream(contents); - ImportModel<EntryBook> model = new EntryBookModel(); - - Import<EntryBook> entryBooks = Import.newImport(model, contentStream); - for (EntryBook entryBook : entryBooks) { - boolean updated = entryBookService.createOrUpdateEntryBook(entryBook); - if(updated) { - result.increaseUpdated(); - } else { - result.increaseCreated(); + try { + ImportModel<EntryBook> model = new EntryBookModel(); + Import<EntryBook> entryBooks = Import.newImport(model, contentStream); + for (EntryBook entryBook : entryBooks) { + boolean updated = entryBookService.createOrUpdateEntryBook(entryBook); + if(updated) { + result.increaseUpdated(); + } else { + result.increaseCreated(); + } } + } catch (ImportRuntimeException e) { + result.addInitException(new ImportFileException(e.getMessage())); + } finally { + IOUtils.closeQuietly(contentStream); } - - IOUtils.closeQuietly(contentStream); } return results; } @@ -225,6 +232,8 @@ } catch (MoreOneUnlockFiscalPeriodException | BeginAfterEndFiscalPeriodException | NotBeginNextDayOfLastFiscalPeriodException e) { result.addException(e); } + } catch (ImportRuntimeException e) { + result.addInitException(new ImportFileException(e.getMessage())); } finally { IOUtils.closeQuietly(contentStream); } @@ -256,6 +265,8 @@ } } + } catch (ImportRuntimeException e) { + result.addInitException(new ImportFileException(e.getMessage())); } finally { IOUtils.closeQuietly(contentStream); } @@ -273,13 +284,19 @@ } else { // import and save entries InputStream contentStream = IOUtils.toInputStream(contents); - ImportModel<Entry> model = new EntryModel(accountService, financialTransactionService, false); - Import<Entry> entries = Import.newImport(model, contentStream); - for (Entry entry : entries) { - entryService.createEntry(entry); - result.increaseCreated(); + try { + ImportModel<Entry> model = new EntryModel(accountService, financialTransactionService, false); + Import<Entry> entries = Import.newImport(model, contentStream); + for (Entry entry : entries) { + entryService.createEntry(entry); + result.increaseCreated(); + } + } catch (ImportRuntimeException e) { + result.addInitException(new ImportFileException(e.getMessage())); + } finally { + IOUtils.closeQuietly(contentStream); } - IOUtils.closeQuietly(contentStream); + } return results; } @@ -291,9 +308,9 @@ if (StringUtils.isBlank(contents)) { result.addException(new NoDataToImportException()); } else { + InputStream contentStream = null; // import and save identity - if (StringUtils.isNotBlank(contents)){ - InputStream contentStream = null; + try { contentStream = IOUtils.toInputStream(contents); ImportModel<Identity> model = new IdentityModel(); Import<Identity> identities = Import.newImport(model, contentStream); @@ -302,12 +319,16 @@ result.increaseCreated(); } IOUtils.closeQuietly(contentStream); + } catch (ImportRuntimeException e) { + result.addInitException(new ImportFileException(e.getMessage())); + } finally { + IOUtils.closeQuietly(contentStream); } } return results; } - protected FinancialStatement returnFinancialStatement (FinancialStatement rootFinancialStatement, String subFinancialStatementLabel) throws AlreadyExistFinancialStatement, NotAllowedLabel { + protected FinancialStatement returnFinancialStatement (FinancialStatement rootFinancialStatement, String subFinancialStatementLabel) throws AlreadyExistFinancialStatement, NotAllowedLabelException { Collection<FinancialStatement> subFinancialStatements = rootFinancialStatement.getSubFinancialStatements(); FinancialStatement targetedFinancialStatement = null; @@ -443,11 +464,13 @@ } result.increaseCreated(); - } catch (AlreadyExistFinancialStatement | NotAllowedLabel e) { + } catch (AlreadyExistFinancialStatement | NotAllowedLabelException e) { result.addException(e); } } + } catch (ImportRuntimeException e) { + result.addInitException(new ImportFileException(e.getMessage())); } finally { IOUtils.closeQuietly(contentStream); } @@ -456,7 +479,7 @@ return results; } - protected VatStatement returnVATStatement (VatStatement rootVATStatement, String subVATStatementLabel) throws AlreadyExistVatStatement, NotAllowedLabel { + protected VatStatement returnVATStatement (VatStatement rootVATStatement, String subVATStatementLabel) throws AlreadyExistVatStatementException, NotAllowedLabelException { Collection<VatStatement> subVatStatements = rootVATStatement.getSubVatStatements(); VatStatement targetedVATStatement = null; @@ -591,11 +614,13 @@ } result.increaseCreated(); - } catch (AlreadyExistVatStatement | NotAllowedLabel e) { + } catch (AlreadyExistVatStatementException | NotAllowedLabelException e) { result.addException(e); } } + } catch (ImportRuntimeException e) { + result.addInitException(new ImportFileException(e.getMessage())); } finally { IOUtils.closeQuietly(contentStream); } @@ -626,22 +651,29 @@ if (StringUtils.isBlank(contents)) { result.addException(new NoDataToImportException()); } else { - ImportModel<Account> model = new AccountEBPModel(); InputStream contentStream = IOUtils.toInputStream(contents); - Import<Account> accounts = Import.newImport(model, contentStream); + try { + ImportModel<Account> model = new AccountEBPModel(); + contentStream = IOUtils.toInputStream(contents); + Import<Account> accounts = Import.newImport(model, contentStream); - for (Account account : accounts) { - boolean updated = false; - try { - updated = accountService.createOrUbdateAccount(account); - } catch (InvalidAccountNumberException | NotNumberAccountNumberException | NotAllowedLabel e) { - result.addException(e); + for (Account account : accounts) { + boolean updated = false; + try { + updated = accountService.createOrUbdateAccount(account); + } catch (InvalidAccountNumberException | NotNumberAccountNumberException | NotAllowedLabelException e) { + result.addException(e); + } + if (updated) { + result.increaseUpdated(); + } else { + result.increaseCreated(); + } } - if (updated) { - result.increaseUpdated(); - } else { - result.increaseCreated(); - } + } catch (ImportRuntimeException e) { + result.addInitException(new ImportFileException(e.getMessage())); + } finally { + IOUtils.closeQuietly(contentStream); } } return results; @@ -656,16 +688,22 @@ result.addException(new NoDataToImportException()); } else { InputStream contentStream = IOUtils.toInputStream(contents); - ImportModel<EntryBook> model = new EntryBookEBPModel(); - Import<EntryBook> entryBooks = Import.newImport(model, contentStream); + try { + ImportModel<EntryBook> model = new EntryBookEBPModel(); + Import<EntryBook> entryBooks = Import.newImport(model, contentStream); - for (EntryBook entryEBP : entryBooks) { - boolean updated = entryBookService.createOrUpdateEntryBook(entryEBP); - if (updated) { - result.increaseUpdated(); - } else { - result.increaseCreated(); + for (EntryBook entryEBP : entryBooks) { + boolean updated = entryBookService.createOrUpdateEntryBook(entryEBP); + if (updated) { + result.increaseUpdated(); + } else { + result.increaseCreated(); + } } + } catch (ImportRuntimeException e) { + result.addInitException(new ImportFileException(e.getMessage())); + } finally { + IOUtils.closeQuietly(contentStream); } } @@ -682,20 +720,24 @@ } } - protected List<EntryEBP> loadDateOrderedEntryEBPbeans(String datas) { + protected List<EntryEBP> loadDateOrderedEntryEBPbeans(String datas) throws ImportFileException { List<EntryEBP> result = new ArrayList<>(); InputStream contentStream = null; // convert file to bean - contentStream = IOUtils.toInputStream(datas); - ImportModel<EntryEBP> model = new EntryEBPModel(); - Import<EntryEBP> importedEntryEBPs = Import.newImport(model, contentStream); - for (EntryEBP entryEBP : importedEntryEBPs) { - result.add(entryEBP); + try { + contentStream = IOUtils.toInputStream(datas); + ImportModel<EntryEBP> model = new EntryEBPModel(); + Import<EntryEBP> importedEntryEBPs = Import.newImport(model, contentStream); + for (EntryEBP entryEBP : importedEntryEBPs) { + result.add(entryEBP); + } + // sort been by date + Collections.sort(result, new EntryEBPComparator()); + } catch (RuntimeException e) { + throw new ImportFileException(e.getMessage()); + } finally { + IOUtils.closeQuietly(contentStream); } - // sort been by date - Collections.sort(result, new EntryEBPComparator()); - IOUtils.closeQuietly(contentStream); - return result; } @@ -734,59 +776,61 @@ result.addException(e); } - List<Account> accounts = accountService.getAllAccounts(); - accounts = accounts == null ? new ArrayList<Account>() : accounts; - Map<String, Account> indexedAccounts = Maps.newHashMap(Maps.uniqueIndex(accounts, GET_ACCOUNT_NUMBER)); + try { + List<Account> accounts = accountService.getAllAccounts(); + accounts = accounts == null ? new ArrayList<Account>() : accounts; + Map<String, Account> indexedAccounts = Maps.newHashMap(Maps.uniqueIndex(accounts, GET_ACCOUNT_NUMBER)); - List<EntryBook> entryBooks = entryBookService.getAllEntryBooks(); - entryBooks = entryBooks == null ? new ArrayList<EntryBook>() : entryBooks; - Map<String, EntryBook> indexedEntryBooks = Maps.newHashMap(Maps.uniqueIndex(entryBooks, GET_ENTRY_BOOK_CODE)); + List<EntryBook> entryBooks = entryBookService.getAllEntryBooks(); + entryBooks = entryBooks == null ? new ArrayList<EntryBook>() : entryBooks; + Map<String, EntryBook> indexedEntryBooks = Maps.newHashMap(Maps.uniqueIndex(entryBooks, GET_ENTRY_BOOK_CODE)); - List<EntryEBP> entryEBPs = loadDateOrderedEntryEBPbeans(contents); + List<EntryEBP> entryEBPs = loadDateOrderedEntryEBPbeans(contents); - // For all entries loaded from the file - // the entry is validate (checking for valide FiscalPeriod and existing Account associated to it) - // if valid entry - // the entry entity is created and the association with it's dependant entites (Account are FinancialTransaction) are created - Date fiscalPeriodsBiginDate = fiscalPeriods.get(0).getBeginDate(); - Date fiscalPeriodsEndingDate = fiscalPeriods.get(fiscalPeriods.size() - 1).getEndDate(); - Map<EntryBook, Map<Date, FinancialTransaction>> entryBookFinancialTransactionByDate = getEntryBookFinancialTransactionOrderedByDate(fiscalPeriodsBiginDate, fiscalPeriodsEndingDate); + // For all entries loaded from the file + // the entry is validate (checking for valide FiscalPeriod and existing Account associated to it) + // if valid entry + // the entry entity is created and the association with it's dependant entites (Account are FinancialTransaction) are created + Date fiscalPeriodsBiginDate = fiscalPeriods.get(0).getBeginDate(); + Date fiscalPeriodsEndingDate = fiscalPeriods.get(fiscalPeriods.size() - 1).getEndDate(); + Map<EntryBook, Map<Date, FinancialTransaction>> entryBookFinancialTransactionByDate = getEntryBookFinancialTransactionOrderedByDate(fiscalPeriodsBiginDate, fiscalPeriodsEndingDate); - for (EntryEBP entryEBP : entryEBPs) { - Date dateEcr = entryEBP.getDatEcr(); + for (EntryEBP entryEBP : entryEBPs) { + Date dateEcr = entryEBP.getDatEcr(); - // account loading - Account account = indexedAccounts.get(entryEBP.getCompte()); + // account loading + Account account = indexedAccounts.get(entryEBP.getCompte()); - if (!validEntry(result, dateEcr, fiscalPeriodsBiginDate, fiscalPeriodsEndingDate, account, entryEBP.getCompte())) { - continue; - } - // create entry - else { - // creation of the entry - // initialisation of this attributs - Entry entry = createEntry(entryEBP, account); + if (!validEntry(result, dateEcr, fiscalPeriodsBiginDate, fiscalPeriodsEndingDate, account, entryEBP.getCompte())) { + continue; + } + // create entry + else { + // creation of the entry + // initialisation of this attributs + Entry entry = createEntry(entryEBP, account); - try { - // find financial transactions for entry period and entrybook - addEntryToFinancialTransaction(entry, entryEBP.getJournal(), indexedEntryBooks, entryBookFinancialTransactionByDate, dateEcr); + try { + // find financial transactions for entry period and entrybook + addEntryToFinancialTransaction(entry, entryEBP.getJournal(), indexedEntryBooks, entryBookFinancialTransactionByDate, dateEcr); - } catch (LockedFinancialPeriodException | LockedEntryBookException e) { - result.addException(e); - continue; + } catch (LockedFinancialPeriodException | LockedEntryBookException | AlreadyExistEntryBookException e) { + result.addException(e); + continue; + } + } - + result.increaseCreated(); } - result.increaseCreated(); + if (log.isInfoEnabled()) { + long after = System.currentTimeMillis(); + log.info("Imported form EBP : " + entryEBPs.size() + " entries in " + + (after - before) + " ms"); + } + } catch(ImportFileException e) { + result.addException(e); } - - if (log.isInfoEnabled()) { - long after = System.currentTimeMillis(); - log.info("Imported form EBP : " + entryEBPs.size() + " entries in " - + (after - before) + " ms"); - } } - return results; } @@ -812,7 +856,7 @@ return entry; } - protected void addEntryToFinancialTransaction(Entry entry, String entryBookCode, Map<String, EntryBook> indexedEntryBooks, Map<EntryBook, Map<Date, FinancialTransaction>> entryBookFinancialTransactionByDate, Date dateEcr) throws LockedFinancialPeriodException, LockedEntryBookException { + protected void addEntryToFinancialTransaction(Entry entry, String entryBookCode, Map<String, EntryBook> indexedEntryBooks, Map<EntryBook, Map<Date, FinancialTransaction>> entryBookFinancialTransactionByDate, Date dateEcr) throws LockedFinancialPeriodException, LockedEntryBookException, AlreadyExistEntryBookException { EntryBook entryBook = getEntryBook(indexedEntryBooks, entryBookCode); Map<Date, FinancialTransaction> financialTransactionsByDate = entryBookFinancialTransactionByDate.get(entryBook); @@ -840,7 +884,7 @@ financialTransactionService.createEntry(entry); } - protected EntryBook getEntryBook(Map<String, EntryBook> indexedEntryBooks, String entryBookCode) { + protected EntryBook getEntryBook(Map<String, EntryBook> indexedEntryBooks, String entryBookCode) throws AlreadyExistEntryBookException { EntryBook entryBook; // entryBook loading entryBook = indexedEntryBooks.get(entryBookCode); 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 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/ReportServiceImpl.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -32,10 +32,10 @@ import org.chorem.lima.beans.BalanceTrialImpl; import org.chorem.lima.beans.ReportsDatas; import org.chorem.lima.beans.ReportsDatasImpl; -import org.chorem.lima.business.LimaException; import org.chorem.lima.business.api.AccountService; import org.chorem.lima.business.api.FinancialPeriodService; import org.chorem.lima.business.api.ReportService; +import org.chorem.lima.business.exceptions.LimaException; import org.chorem.lima.business.utils.AccountComparator; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.AccountTopiaDao; Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/ejb/VatStatementServiceImpl.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -32,12 +32,12 @@ import org.chorem.lima.beans.VatStatementAmountsImpl; import org.chorem.lima.beans.VatStatementDatas; import org.chorem.lima.beans.VatStatementDatasImpl; -import org.chorem.lima.business.AlreadyExistVatStatement; -import org.chorem.lima.business.LimaException; -import org.chorem.lima.business.NotAllowedLabel; import org.chorem.lima.business.api.AccountService; import org.chorem.lima.business.api.ReportService; import org.chorem.lima.business.api.VatStatementService; +import org.chorem.lima.business.exceptions.AlreadyExistVatStatementException; +import org.chorem.lima.business.exceptions.LimaException; +import org.chorem.lima.business.exceptions.NotAllowedLabelException; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.VatStatement; import org.chorem.lima.entity.VatStatementTopiaDao; @@ -78,9 +78,9 @@ } }; - protected void validateNewVATStatement(VatStatement masterVatStatement, VatStatement vatStatement) throws AlreadyExistVatStatement, NotAllowedLabel { + protected void validateNewVATStatement(VatStatement masterVatStatement, VatStatement vatStatement) throws AlreadyExistVatStatementException, NotAllowedLabelException { if (vatStatement.getLabel().contains("/")) { - throw new NotAllowedLabel(vatStatement.getLabel()); + throw new NotAllowedLabelException(vatStatement.getLabel()); } if (masterVatStatement != null) { Collection<VatStatement> masterSubVatStatements = masterVatStatement.getSubVatStatements(); @@ -89,7 +89,7 @@ } Map indexedSubVatStatements = Maps.uniqueIndex(masterSubVatStatements, GET_LABEL); if (indexedSubVatStatements.get(vatStatement.getLabel()) != null){ - throw new AlreadyExistVatStatement(vatStatement.getLabel(), masterVatStatement.getLabel()); + throw new AlreadyExistVatStatementException(vatStatement.getLabel(), masterVatStatement.getLabel()); } } } @@ -117,7 +117,7 @@ @Override public VatStatement createVatStatement(VatStatement masterVatStatement, - VatStatement vatStatement) throws AlreadyExistVatStatement, NotAllowedLabel { + VatStatement vatStatement) throws AlreadyExistVatStatementException, NotAllowedLabelException { validateNewVATStatement(masterVatStatement, vatStatement); Modified: trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties =================================================================== --- trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business/src/main/resources/i18n/lima-business_fr_FR.properties 2014-08-06 14:27:15 UTC (rev 3902) @@ -88,7 +88,6 @@ lima-business.import.account.InvalidAccountNumber=Le numéro de compt %1$s n'est pas valide\n lima-business.import.account.added=Succès \: Compte %s - %s ajouté\n lima-business.import.account.alreadyExist=Le compte %1$s - existe déjà \n -lima-business.import.account.alreadyexist= lima-business.import.accountadded=Succès \: Compte %s - %s ajouté\n lima-business.import.accountalreadyexist=Échec \: Le compte %s existe déjà \n lima-business.import.closedPeriodicEntryBook.error.NotLockedPreviousEntryBook=Les périodes financières précédentes pour ce journal doivent être bloquées avant Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -206,7 +206,7 @@ * Not called by default (<code>@Before</code>) to allow init test with * CSV or EBP import. * - * @throws org.chorem.lima.business.LimaException + * @throws org.chorem.lima.business.exceptions.LimaException * @throws java.text.ParseException */ protected void initTestDatabase() throws Exception { @@ -218,7 +218,7 @@ /** * Create a basic account plan. * - * @throws LimaException + * @throws org.chorem.lima.business.exceptions.LimaException * @throws java.text.ParseException */ protected void initTestWithAccounts() throws Exception { @@ -263,7 +263,7 @@ /** * Create some EntryBooks. * - * @throws org.chorem.lima.business.LimaException + * @throws org.chorem.lima.business.exceptions.LimaException * @throws java.text.ParseException */ protected void initTestWithEntryBooks() throws Exception { @@ -288,7 +288,7 @@ /** * Create a FiscalPeriod with an EntryBook. * - * @throws org.chorem.lima.business.LimaException + * @throws org.chorem.lima.business.exceptions.LimaException * @throws java.text.ParseException */ protected void initTestWithFiscalPeriod() throws Exception { Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/AccountServiceImplTest.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -25,6 +25,8 @@ package org.chorem.lima.business; +import org.chorem.lima.business.exceptions.LimaException; +import org.chorem.lima.business.exceptions.UsedAccountException; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.AccountImpl; import org.junit.Assert; @@ -52,7 +54,7 @@ /** * Création d'un compte dans le plan comptable. - * @throws LimaException + * @throws org.chorem.lima.business.exceptions.LimaException */ @Test public void createAccountTest() throws LimaException { Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/EntryBookServiceImplTest.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -25,6 +25,8 @@ package org.chorem.lima.business; +import org.chorem.lima.business.exceptions.LimaException; +import org.chorem.lima.business.exceptions.UsedEntryBookException; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.EntryBookImpl; import org.chorem.lima.entity.FinancialTransaction; @@ -57,7 +59,7 @@ /** * Permet de tester la modification d'un journal suivant son préfixe. * - * @throws LimaException + * @throws org.chorem.lima.business.exceptions.LimaException */ @Test public void modifyJournalTest() throws LimaException { Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/FinancialTransactionServiceImplTest.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -24,6 +24,7 @@ package org.chorem.lima.business; import org.chorem.lima.business.ejb.FinancialTransactionServiceImpl; +import org.chorem.lima.business.exceptions.LimaException; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; @@ -62,7 +63,7 @@ * Nothing wrong here. * * @throws ParseException - * @throws LimaException + * @throws org.chorem.lima.business.exceptions.LimaException */ @Test public void testGetInexactTransactionAllGood() throws ParseException, LimaException { Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -26,6 +26,13 @@ import org.apache.commons.codec.binary.Base64; import org.apache.commons.io.IOUtils; import org.chorem.lima.LimaTechnicalException; +import org.chorem.lima.business.exceptions.AlreadyExistEntryBookException; +import org.chorem.lima.business.exceptions.BeginAfterEndFiscalPeriodException; +import org.chorem.lima.business.exceptions.ImportEbpException; +import org.chorem.lima.business.exceptions.ImportFileException; +import org.chorem.lima.business.exceptions.LimaException; +import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException; +import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.AccountImpl; import org.chorem.lima.entity.Entry; @@ -48,6 +55,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; +import java.util.Map; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; @@ -96,6 +104,19 @@ } @Test + public void testExportImportAccountsException() throws Exception { + String inportStream = IOUtils.toString(ImportExportServiceTest.class.getResourceAsStream("/import/bcr_developed.csv")); + ImportExportResults result = importService.importAccountAsCSV(inportStream); + Assert.assertNotNull(result); + Map<Integer, LimaException> exceptionMap = result.getImportResults().get(0).getAllExceptionsByLine(); + Assert.assertNotNull(exceptionMap); + Collection<LimaException> exceptions = exceptionMap.values(); + Assert.assertEquals(1, exceptions.size()); + ImportFileException exception = (ImportFileException) exceptions.iterator().next(); + Assert.assertNotNull(exception); + } + + @Test public void testExportImportEntryBooks() throws Exception { initTestWithEntryBooks(); @@ -435,7 +456,7 @@ } @Test - public void testImportEntryBooksFromEBP() throws IOException { + public void testImportEntryBooksFromEBP() throws IOException, AlreadyExistEntryBookException { InputStream entryBookStream = ImportExportServiceTest.class.getResourceAsStream("/ebp/journaux.txt"); String entryBookData = IOUtils.toString(entryBookStream, "ISO-8859-1"); entryBookStream.close(); Modified: trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business/src/test/java/org/chorem/lima/business/accountingrules/TestAccountingRules.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -24,9 +24,9 @@ package org.chorem.lima.business.accountingrules; import org.apache.commons.lang3.time.DateUtils; -import org.chorem.lima.business.BeginAfterEndFiscalPeriodException; -import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException; -import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException; +import org.chorem.lima.business.exceptions.BeginAfterEndFiscalPeriodException; +import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException; +import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException; import org.chorem.lima.entity.FinancialPeriod; import org.chorem.lima.entity.FinancialPeriodImpl; import org.chorem.lima.entity.FiscalPeriod; Modified: trunk/lima-business/src/test/java/org/chorem/lima/entity/FinancialTransactionDAOTest.java =================================================================== --- trunk/lima-business/src/test/java/org/chorem/lima/entity/FinancialTransactionDAOTest.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business/src/test/java/org/chorem/lima/entity/FinancialTransactionDAOTest.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -24,7 +24,7 @@ package org.chorem.lima.entity; import org.chorem.lima.business.AbstractLimaTest; -import org.chorem.lima.business.LimaException; +import org.chorem.lima.business.exceptions.LimaException; import org.junit.Assert; import org.junit.Before; import org.junit.Test; Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/ImportBackupException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/ImportBackupException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/ImportBackupException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,13 +0,0 @@ -package org.chorem.lima; - -import org.chorem.lima.business.LimaException; - -/** - * Created by davidcosse on 31/07/14. - */ -public class ImportBackupException extends LimaException { - - public ImportBackupException(String message, Throwable cause) { - super(message, cause); - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AccountException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/AccountException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AccountException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,54 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public abstract class AccountException extends LimaException { - - protected String accountNumber; - - public AccountException(String accountNumber) { - this.accountNumber = accountNumber; - } - - public AccountException(String accountNumber, Throwable cause) { - super(cause); - this.accountNumber = accountNumber; - } - - public AccountException(String accountNumber, String message) { - super(message); - this.accountNumber = accountNumber; - } - - public AccountException(String accountNumber, String message, Throwable cause) { - super(message, cause); - this.accountNumber = accountNumber; - } - - public String getAccountNumber() { - return accountNumber; - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AfterLastFiscalPeriodException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/AfterLastFiscalPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AfterLastFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,39 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import java.util.Date; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public class AfterLastFiscalPeriodException extends DateException { - - public AfterLastFiscalPeriodException(Date date) { - super(date); - } - - public AfterLastFiscalPeriodException(Date date, Throwable cause) { - super(date, cause); - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistAccountException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistAccountException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistAccountException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,37 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public class AlreadyExistAccountException extends AccountException { - - public AlreadyExistAccountException(String accountNumber) { - super(accountNumber); - } - - public AlreadyExistAccountException(String accountNumber, Throwable cause) { - super(accountNumber, cause); - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistFinancialStatement.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistFinancialStatement.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistFinancialStatement.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,46 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -/** - * Created by davidcosse on 28/07/14. - */ -public class AlreadyExistFinancialStatement extends LimaException { - private static final long serialVersionUID = 4816249386192290272L; - - protected String financialStatementLabel; - protected String masterLabel; - - public AlreadyExistFinancialStatement(String label, String masterLabel) { - this.financialStatementLabel = label; - this.masterLabel = masterLabel; - } - - public String getFinancialStatementLabel() { - return financialStatementLabel; - } - - public String getMasterLabel() { - return masterLabel; - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistVatStatement.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistVatStatement.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistVatStatement.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,49 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import static org.nuiton.i18n.I18n.t; - -/** - * Created by davidcosse on 28/07/14. - */ -public class AlreadyExistVatStatement extends LimaException { - private static final long serialVersionUID = 4816249386192290272L; - - protected String vatStatementLabel; - protected String masterLabel; - - public AlreadyExistVatStatement(String label, String masterLabel) { - super(t("lima.importexport.import.alreadyExistFinancialStatement",label, masterLabel)); - this.vatStatementLabel = label; - this.masterLabel = masterLabel; - } - - public String getVatStatementLabel() { - return vatStatementLabel; - } - - public String getMasterLabel() { - return masterLabel; - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyLockedFiscalPeriodException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyLockedFiscalPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyLockedFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,39 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import org.chorem.lima.entity.FiscalPeriod; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public class AlreadyLockedFiscalPeriodException extends FiscalPeriodException { - - public AlreadyLockedFiscalPeriodException(FiscalPeriod fiscalPeriod) { - super(fiscalPeriod); - } - - public AlreadyLockedFiscalPeriodException(FiscalPeriod fiscalPeriod, Throwable cause) { - super(fiscalPeriod, cause); - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeforeFirstFiscalPeriodException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeforeFirstFiscalPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeforeFirstFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,39 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import java.util.Date; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public class BeforeFirstFiscalPeriodException extends DateException { - - public BeforeFirstFiscalPeriodException(Date date) { - super(date); - } - - public BeforeFirstFiscalPeriodException(Date date, Throwable cause) { - super(date, cause); - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeginAfterEndFiscalPeriodException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeginAfterEndFiscalPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeginAfterEndFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,39 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import org.chorem.lima.entity.FiscalPeriod; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public class BeginAfterEndFiscalPeriodException extends FiscalPeriodException { - - public BeginAfterEndFiscalPeriodException(FiscalPeriod fiscalPeriod) { - super(fiscalPeriod); - } - - public BeginAfterEndFiscalPeriodException(FiscalPeriod fiscalPeriod, Throwable cause) { - super(fiscalPeriod, cause); - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBookException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBookException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBookException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,56 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import org.chorem.lima.entity.ClosedPeriodicEntryBook; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public abstract class ClosedPeriodicEntryBookException extends LimaException { - - protected ClosedPeriodicEntryBook closedPeriodicEntryBook; - - public ClosedPeriodicEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook) { - this.closedPeriodicEntryBook = closedPeriodicEntryBook; - } - - public ClosedPeriodicEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook, String message) { - super(message); - this.closedPeriodicEntryBook = closedPeriodicEntryBook; - } - - public ClosedPeriodicEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook, Throwable cause) { - super(cause); - this.closedPeriodicEntryBook = closedPeriodicEntryBook; - } - - public ClosedPeriodicEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook, String message, Throwable cause) { - super(message, cause); - this.closedPeriodicEntryBook = closedPeriodicEntryBook; - } - - public ClosedPeriodicEntryBook getClosedPeriodicEntryBook() { - return closedPeriodicEntryBook; - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBooksException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBooksException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBooksException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,48 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import org.chorem.lima.entity.ClosedPeriodicEntryBook; - -import java.util.Collection; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public abstract class ClosedPeriodicEntryBooksException extends LimaException { - - protected Collection<ClosedPeriodicEntryBook> closedPeriodicEntryBooks; - - public ClosedPeriodicEntryBooksException(Collection<ClosedPeriodicEntryBook> closedPeriodicEntryBooks) { - this.closedPeriodicEntryBooks = closedPeriodicEntryBooks; - } - - public ClosedPeriodicEntryBooksException(Collection<ClosedPeriodicEntryBook> closedPeriodicEntryBooks, Throwable cause) { - super(cause); - this.closedPeriodicEntryBooks = closedPeriodicEntryBooks; - } - - public Collection<ClosedPeriodicEntryBook> getClosedPeriodicEntryBooks() { - return closedPeriodicEntryBooks; - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/DateException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/DateException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/DateException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,46 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import java.util.Date; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public abstract class DateException extends LimaException { - - protected Date date; - - public DateException(Date date) { - this.date = date; - } - - public DateException(Date date, Throwable cause) { - super(cause); - this.date = date; - } - - public Date getDate() { - return date; - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntriesException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntriesException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntriesException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,48 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import org.chorem.lima.entity.Entry; - -import java.util.Collection; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public abstract class EntriesException extends LimaException { - - protected Collection<Entry> entries; - - public EntriesException(Collection<Entry> entries) { - this.entries = entries; - } - - public EntriesException(Collection<Entry> entries, Throwable cause) { - super(cause); - this.entries = entries; - } - - public Collection<Entry> getEntries() { - return entries; - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntryBookException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntryBookException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntryBookException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,46 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import org.chorem.lima.entity.EntryBook; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public abstract class EntryBookException extends LimaException { - - protected EntryBook entryBook; - - public EntryBookException(EntryBook entryBook) { - this.entryBook = entryBook; - } - - public EntryBookException(EntryBook entryBook, Throwable cause) { - super(cause); - this.entryBook = entryBook; - } - - public EntryBook getEntryBook() { - return entryBook; - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialPeriodException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,51 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import org.chorem.lima.entity.FinancialPeriod; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public abstract class FinancialPeriodException extends LimaException { - - protected FinancialPeriod financialPeriod; - - public FinancialPeriodException(FinancialPeriod financialPeriod) { - this.financialPeriod = financialPeriod; - } - - public FinancialPeriodException(FinancialPeriod financialPeriod, String message) { - super(message); - this.financialPeriod = financialPeriod; - } - - public FinancialPeriodException(FinancialPeriod financialPeriod, Throwable cause) { - super(cause); - this.financialPeriod = financialPeriod; - } - - public FinancialPeriod getFinancialPeriod() { - return financialPeriod; - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialTransactionsException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialTransactionsException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialTransactionsException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,48 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import org.chorem.lima.entity.FinancialTransaction; - -import java.util.Collection; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public abstract class FinancialTransactionsException extends LimaException { - - protected Collection<FinancialTransaction> financialTransactions; - - public FinancialTransactionsException(Collection<FinancialTransaction> financialTransactions) { - this.financialTransactions = financialTransactions; - } - - public FinancialTransactionsException(Collection<FinancialTransaction> financialTransactions, Throwable cause) { - super(cause); - this.financialTransactions = financialTransactions; - } - - public Collection<FinancialTransaction> getFinancialTransactions() { - return financialTransactions; - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/FiscalPeriodException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/FiscalPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/FiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,46 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import org.chorem.lima.entity.FiscalPeriod; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public abstract class FiscalPeriodException extends LimaException { - - protected FiscalPeriod fiscalPeriod; - - public FiscalPeriodException(FiscalPeriod fiscalPeriod) { - this.fiscalPeriod = fiscalPeriod; - } - - public FiscalPeriodException(FiscalPeriod fiscalPeriod, Throwable cause) { - super(cause); - this.fiscalPeriod = fiscalPeriod; - } - - public FiscalPeriod getFiscalPeriod() { - return fiscalPeriod; - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportEbpException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportEbpException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportEbpException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,37 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public class ImportEbpException extends LimaException { - - public ImportEbpException(String message) { - super(message); - } - - public ImportEbpException(String message, Throwable cause) { - super(message, cause); - } -} Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportResult.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -22,6 +22,8 @@ * #L% */ +import org.chorem.lima.business.exceptions.LimaException; + import java.io.Serializable; import java.util.HashMap; import java.util.Map; @@ -84,6 +86,12 @@ lineIndex++; } + public void addInitException(LimaException e) { + allExceptions = allExceptions == null ? new HashMap<Integer, LimaException>() : allExceptions; + allExceptions.put(1, e); + lineIndex++; + } + public Map<Integer, LimaException> getAllExceptionsByLine() { return allExceptions; } Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/InvalidAccountNumberException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/InvalidAccountNumberException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/InvalidAccountNumberException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,41 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public class InvalidAccountNumberException extends AccountException { - - public InvalidAccountNumberException(String accountNumber) { - super(accountNumber); - } - - public InvalidAccountNumberException(String accountNumber, String message) { - super(accountNumber, message); - } - - public InvalidAccountNumberException(String accountNumber, Throwable cause) { - super(accountNumber, cause); - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/LastUnlockedFiscalPeriodException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/LastUnlockedFiscalPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/LastUnlockedFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,39 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import org.chorem.lima.entity.FiscalPeriod; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public class LastUnlockedFiscalPeriodException extends FiscalPeriodException { - - public LastUnlockedFiscalPeriodException(FiscalPeriod fiscalPeriod) { - super(fiscalPeriod); - } - - public LastUnlockedFiscalPeriodException(FiscalPeriod fiscalPeriod, Throwable cause) { - super(fiscalPeriod, cause); - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/LimaException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/LimaException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/LimaException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,80 +0,0 @@ -/* - * #%L - * Lima business - * - * $Id$ - * $HeadURL$ - * %% - * 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -package org.chorem.lima.business; - -import javax.ejb.ApplicationException; - -/** - * Lima exception. - * - * @author chatellier - * @version $Revision$ - * <p/> - * Last update : $Date$ - * By : $Author$ - */ -@ApplicationException -public abstract class LimaException extends Exception { - - /** - * serialVersionUID. - */ - private static final long serialVersionUID = -6876236663940184462L; - - /** - * Constructs a new exception - * - */ - public LimaException() { - super(); - } - - /** - * Constructs a new exception with specified message. - * - */ - public LimaException(String message) { - super(message); - } - - /** - * Constructs a new exception with specified message and cause. - * @param message - * @param cause - */ - public LimaException(String message, Throwable cause) { - super(message, cause); - } - - /** - * Constructs a new exception with the specified cause. - * - * @param cause cause - */ - public LimaException(Throwable cause) { - super(cause); - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedEntryBookException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedEntryBookException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedEntryBookException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,49 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import org.chorem.lima.entity.ClosedPeriodicEntryBook; - -import static org.nuiton.i18n.I18n.t; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public class LockedEntryBookException extends ClosedPeriodicEntryBookException { - - public LockedEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook) { - super(closedPeriodicEntryBook, t("lima.ui.lettering.roundAndCreateEntry.error.lockedEntryBook", - closedPeriodicEntryBook.getEntryBook().getCode(), - closedPeriodicEntryBook.getEntryBook().getLabel(), - closedPeriodicEntryBook.getFinancialPeriod().getBeginDate(), - closedPeriodicEntryBook.getFinancialPeriod().getEndDate())); - } - - public LockedEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook, String message) { - super(closedPeriodicEntryBook, message); - } - - public LockedEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook, Throwable cause) { - super(closedPeriodicEntryBook, cause); - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedFinancialPeriodException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedFinancialPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedFinancialPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,45 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import org.chorem.lima.entity.FinancialPeriod; - -import static org.nuiton.i18n.I18n.t; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public class LockedFinancialPeriodException extends FinancialPeriodException{ - - public LockedFinancialPeriodException(FinancialPeriod financialPeriod) { - super(financialPeriod, t("lima.ui.fiscalPeriod.block.error.lockedFinancialPeriod",financialPeriod.getBeginDate(), financialPeriod.getEndDate())); - } - - public LockedFinancialPeriodException(FinancialPeriod financialPeriod, String message) { - super(financialPeriod, message); - } - - public LockedFinancialPeriodException(FinancialPeriod financialPeriod, Throwable cause) { - super(financialPeriod, cause); - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,60 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import java.util.Date; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public class MoreOneUnlockFiscalPeriodException extends LimaException { - - Date beginDate; - Date endDate; - Boolean isLocked; - long countUnlockFiscalPeriod; - - public MoreOneUnlockFiscalPeriodException(Date beginDate, Date endDate, Boolean isLocked, long countUnlockFiscalPeriod) { - this.beginDate = beginDate; - this.endDate = endDate; - this.isLocked = isLocked; - this.countUnlockFiscalPeriod = countUnlockFiscalPeriod; - - } - - public Date getBeginDate() { - return beginDate; - } - - public Date getEndDate() { - return endDate; - } - - public Boolean getIsLocked() { - return isLocked; - } - - public long getCountUnlockFiscalPeriod() { - return countUnlockFiscalPeriod; - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoDataToImportException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoDataToImportException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoDataToImportException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,7 +0,0 @@ -package org.chorem.lima.business; - -/** - * Created by davidcosse on 06/08/14. - */ -public class NoDataToImportException extends LimaException { -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoEmptyFiscalPeriodException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoEmptyFiscalPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoEmptyFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,41 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import org.chorem.lima.entity.FinancialTransaction; - -import java.util.Collection; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public class NoEmptyFiscalPeriodException extends FinancialTransactionsException { - - public NoEmptyFiscalPeriodException(Collection<FinancialTransaction> financialTransactions) { - super(financialTransactions); - } - - public NoEmptyFiscalPeriodException(Collection<FinancialTransaction> financialTransactions, Throwable cause) { - super(financialTransactions, cause); - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFiscalPeriodFoundException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFiscalPeriodFoundException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFiscalPeriodFoundException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,7 +0,0 @@ -package org.chorem.lima.business; - -/** - * Created by davidcosse on 06/08/14. - */ -public class NoFiscalPeriodFoundException extends LimaException { -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFoundFinancialPeriodException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFoundFinancialPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFoundFinancialPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,39 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import java.util.Date; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public class NoFoundFinancialPeriodException extends DateException { - - public NoFoundFinancialPeriodException(Date date) { - super(date); - } - - public NoFoundFinancialPeriodException(Date date, Throwable cause) { - super(date, cause); - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotAllowedLabel.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotAllowedLabel.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotAllowedLabel.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,42 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import static org.nuiton.i18n.I18n.t; - -/** - * Created by davidcosse on 31/07/14. - */ -public class NotAllowedLabel extends LimaException { - - protected String label; - - public NotAllowedLabel(String label) { - super(t("lima.importexport.import.notAllowedLabel",label)); - this.label = label; - } - - public String getLabel() { - return label; - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotBeginNextDayOfLastFiscalPeriodException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotBeginNextDayOfLastFiscalPeriodException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotBeginNextDayOfLastFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,39 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import org.chorem.lima.entity.FiscalPeriod; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public class NotBeginNextDayOfLastFiscalPeriodException extends FiscalPeriodException { - - public NotBeginNextDayOfLastFiscalPeriodException(FiscalPeriod fiscalPeriod) { - super(fiscalPeriod); - } - - public NotBeginNextDayOfLastFiscalPeriodException(FiscalPeriod fiscalPeriod, Throwable cause) { - super(fiscalPeriod, cause); - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotLockedClosedPeriodicEntryBooksException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotLockedClosedPeriodicEntryBooksException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotLockedClosedPeriodicEntryBooksException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,41 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import org.chorem.lima.entity.ClosedPeriodicEntryBook; - -import java.util.Collection; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public class NotLockedClosedPeriodicEntryBooksException extends ClosedPeriodicEntryBooksException { - - public NotLockedClosedPeriodicEntryBooksException(Collection<ClosedPeriodicEntryBook> closedPeriodicEntryBooks) { - super(closedPeriodicEntryBooks); - } - - public NotLockedClosedPeriodicEntryBooksException(Collection<ClosedPeriodicEntryBook> closedPeriodicEntryBooks, Throwable cause) { - super(closedPeriodicEntryBooks, cause); - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotNumberAccountNumberException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotNumberAccountNumberException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotNumberAccountNumberException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,19 +0,0 @@ -package org.chorem.lima.business; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public class NotNumberAccountNumberException extends AccountException { - - public NotNumberAccountNumberException(String accountNumber) { - super(accountNumber); - } - - public NotNumberAccountNumberException(String accountNumber, String message) { - super(accountNumber, message); - } - - public NotNumberAccountNumberException(String accountNumber, Throwable cause) { - super(accountNumber, cause); - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedEntriesException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedEntriesException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedEntriesException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,41 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import org.chorem.lima.entity.Entry; - -import java.util.Collection; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public class UnbalancedEntriesException extends EntriesException { - - public UnbalancedEntriesException(Collection<Entry> entries) { - super(entries); - } - - public UnbalancedEntriesException(Collection<Entry> entries, Throwable cause) { - super(entries, cause); - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedFinancialTransactionsException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedFinancialTransactionsException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedFinancialTransactionsException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,41 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import org.chorem.lima.entity.FinancialTransaction; - -import java.util.Collection; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public class UnbalancedFinancialTransactionsException extends FinancialTransactionsException { - - public UnbalancedFinancialTransactionsException(Collection<FinancialTransaction> financialTransactions) { - super(financialTransactions); - } - - public UnbalancedFinancialTransactionsException(Collection<FinancialTransaction> financialTransactions, Throwable cause) { - super(financialTransactions, cause); - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnfilledEntriesException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnfilledEntriesException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnfilledEntriesException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,41 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import org.chorem.lima.entity.Entry; - -import java.util.Collection; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public class UnfilledEntriesException extends EntriesException { - - public UnfilledEntriesException(Collection<Entry> entries) { - super(entries); - } - - public UnfilledEntriesException(Collection<Entry> entries, Throwable cause) { - super(entries, cause); - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedAccountException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedAccountException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedAccountException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,37 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public class UsedAccountException extends AccountException { - - public UsedAccountException(String accountNumber) { - super(accountNumber); - } - - public UsedAccountException(String accountNumber, Throwable cause) { - super(accountNumber, cause); - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedEntryBookException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedEntryBookException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedEntryBookException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,39 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import org.chorem.lima.entity.EntryBook; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public class UsedEntryBookException extends EntryBookException { - - public UsedEntryBookException(EntryBook entryBook) { - super(entryBook); - } - - public UsedEntryBookException(EntryBook entryBook, Throwable cause) { - super(entryBook, cause); - } -} Deleted: trunk/lima-business-api/src/main/java/org/chorem/lima/business/WithoutEntryBookFinancialTransactionsException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/WithoutEntryBookFinancialTransactionsException.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/WithoutEntryBookFinancialTransactionsException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -1,41 +0,0 @@ -package org.chorem.lima.business; - -/* - * #%L - * Lima :: business API - * %% - * Copyright (C) 2008 - 2014 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 3 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, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import org.chorem.lima.entity.FinancialTransaction; - -import java.util.Collection; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public class WithoutEntryBookFinancialTransactionsException extends FinancialTransactionsException { - - public WithoutEntryBookFinancialTransactionsException(Collection<FinancialTransaction> financialTransactions) { - super(financialTransactions); - } - - public WithoutEntryBookFinancialTransactionsException(Collection<FinancialTransaction> financialTransactions, Throwable cause) { - super(financialTransactions, cause); - } -} Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/AccountService.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -25,12 +25,12 @@ package org.chorem.lima.business.api; -import org.chorem.lima.business.AlreadyExistAccountException; -import org.chorem.lima.business.InvalidAccountNumberException; -import org.chorem.lima.business.LimaException; -import org.chorem.lima.business.NotAllowedLabel; -import org.chorem.lima.business.NotNumberAccountNumberException; -import org.chorem.lima.business.UsedAccountException; +import org.chorem.lima.business.exceptions.AlreadyExistAccountException; +import org.chorem.lima.business.exceptions.InvalidAccountNumberException; +import org.chorem.lima.business.exceptions.LimaException; +import org.chorem.lima.business.exceptions.NotAllowedLabelException; +import org.chorem.lima.business.exceptions.NotNumberAccountNumberException; +import org.chorem.lima.business.exceptions.UsedAccountException; import org.chorem.lima.entity.Account; import java.util.List; @@ -94,7 +94,7 @@ * @return true if updated or false if created * @throws InvalidAccountNumberException */ - boolean createOrUbdateAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel; + boolean createOrUbdateAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException; /** * Create new account. If {@code masterAccount} is not null, {@code account} @@ -103,7 +103,7 @@ * @param account account * @throws LimaException */ - Account createAccount(Account account) throws AlreadyExistAccountException, InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel; + Account createAccount(Account account) throws AlreadyExistAccountException, InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException; Account updateAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException; Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/EntryBookService.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -25,8 +25,9 @@ package org.chorem.lima.business.api; -import org.chorem.lima.business.LimaException; -import org.chorem.lima.business.UsedEntryBookException; +import org.chorem.lima.business.exceptions.AlreadyExistEntryBookException; +import org.chorem.lima.business.exceptions.LimaException; +import org.chorem.lima.business.exceptions.UsedEntryBookException; import org.chorem.lima.entity.EntryBook; import java.util.List; @@ -78,7 +79,7 @@ * @param entryBook * @throws LimaException */ - EntryBook createEntryBook(EntryBook entryBook); + EntryBook createEntryBook(EntryBook entryBook) throws AlreadyExistEntryBookException; /** * Permet de modifier un journal. @@ -95,7 +96,7 @@ * impossible de supprimer celui-ci. * * @param entryBook - * @throws org.chorem.lima.business.UsedEntryBookException + * @throws org.chorem.lima.business.exceptions.UsedEntryBookException */ void removeEntryBook(EntryBook entryBook) throws UsedEntryBookException; } Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialPeriodService.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -25,10 +25,10 @@ package org.chorem.lima.business.api; -import org.chorem.lima.business.NotLockedClosedPeriodicEntryBooksException; -import org.chorem.lima.business.UnbalancedFinancialTransactionsException; -import org.chorem.lima.business.UnfilledEntriesException; -import org.chorem.lima.business.WithoutEntryBookFinancialTransactionsException; +import org.chorem.lima.business.exceptions.NotLockedClosedPeriodicEntryBooksException; +import org.chorem.lima.business.exceptions.UnbalancedFinancialTransactionsException; +import org.chorem.lima.business.exceptions.UnfilledEntriesException; +import org.chorem.lima.business.exceptions.WithoutEntryBookFinancialTransactionsException; import org.chorem.lima.entity.ClosedPeriodicEntryBook; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.FinancialPeriod; Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialStatementService.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -26,9 +26,9 @@ package org.chorem.lima.business.api; import org.chorem.lima.beans.FinancialStatementAmounts; -import org.chorem.lima.business.AlreadyExistFinancialStatement; -import org.chorem.lima.business.LimaException; -import org.chorem.lima.business.NotAllowedLabel; +import org.chorem.lima.business.exceptions.AlreadyExistFinancialStatement; +import org.chorem.lima.business.exceptions.LimaException; +import org.chorem.lima.business.exceptions.NotAllowedLabelException; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.FinancialStatement; @@ -46,7 +46,7 @@ void createMasterFinacialStatements(FinancialStatement masterFinancialStatements); FinancialStatement createFinancialStatement(FinancialStatement masterFinancialStatement, - FinancialStatement financialStatement) throws AlreadyExistFinancialStatement, NotAllowedLabel; + FinancialStatement financialStatement) throws AlreadyExistFinancialStatement, NotAllowedLabelException; void updateFinancialStatement(FinancialStatement financialStatement); Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FinancialTransactionService.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -27,11 +27,11 @@ import org.chorem.lima.beans.FinancialTransactionCondition; import org.chorem.lima.beans.LetteringFilter; -import org.chorem.lima.business.AfterLastFiscalPeriodException; -import org.chorem.lima.business.BeforeFirstFiscalPeriodException; -import org.chorem.lima.business.LockedEntryBookException; -import org.chorem.lima.business.LockedFinancialPeriodException; -import org.chorem.lima.business.UnbalancedEntriesException; +import org.chorem.lima.business.exceptions.AfterLastFiscalPeriodException; +import org.chorem.lima.business.exceptions.BeforeFirstFiscalPeriodException; +import org.chorem.lima.business.exceptions.LockedEntryBookException; +import org.chorem.lima.business.exceptions.LockedFinancialPeriodException; +import org.chorem.lima.business.exceptions.UnbalancedEntriesException; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.FinancialPeriod; Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/FiscalPeriodService.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -25,19 +25,21 @@ package org.chorem.lima.business.api; -import org.chorem.lima.business.AlreadyExistAccountException; -import org.chorem.lima.business.AlreadyLockedFiscalPeriodException; -import org.chorem.lima.business.BeginAfterEndFiscalPeriodException; -import org.chorem.lima.business.InvalidAccountNumberException; -import org.chorem.lima.business.LastUnlockedFiscalPeriodException; -import org.chorem.lima.business.LockedEntryBookException; -import org.chorem.lima.business.LockedFinancialPeriodException; -import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException; -import org.chorem.lima.business.NoEmptyFiscalPeriodException; -import org.chorem.lima.business.NoFoundFinancialPeriodException; -import org.chorem.lima.business.NotAllowedLabel; -import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException; -import org.chorem.lima.business.NotNumberAccountNumberException; +import org.chorem.lima.business.exceptions.AlreadyExistAccountException; +import org.chorem.lima.business.exceptions.AlreadyExistEntryBookException; +import org.chorem.lima.business.exceptions.AlreadyLockedFiscalPeriodException; +import org.chorem.lima.business.exceptions.BeginAfterEndFiscalPeriodException; +import org.chorem.lima.business.exceptions.InvalidAccountNumberException; +import org.chorem.lima.business.exceptions.LastUnlockedFiscalPeriodException; +import org.chorem.lima.business.exceptions.LimaException; +import org.chorem.lima.business.exceptions.LockedEntryBookException; +import org.chorem.lima.business.exceptions.LockedFinancialPeriodException; +import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException; +import org.chorem.lima.business.exceptions.NoEmptyFiscalPeriodException; +import org.chorem.lima.business.exceptions.NoFoundFinancialPeriodException; +import org.chorem.lima.business.exceptions.NotAllowedLabelException; +import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException; +import org.chorem.lima.business.exceptions.NotNumberAccountNumberException; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.FiscalPeriod; @@ -90,7 +92,7 @@ LastUnlockedFiscalPeriodException, AlreadyLockedFiscalPeriodException, AlreadyExistAccountException, - InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabel; + InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException, AlreadyExistEntryBookException, LimaException; /** * Test if we have retained earnings on a fiscal period 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-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ImportService.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -22,9 +22,9 @@ * #L% */ -import org.chorem.lima.business.AlreadyExistAccountException; import org.chorem.lima.business.ImportExportResults; -import org.chorem.lima.business.InvalidAccountNumberException; +import org.chorem.lima.business.exceptions.AlreadyExistAccountException; +import org.chorem.lima.business.exceptions.InvalidAccountNumberException; /** * Created by davidcosse on 03/06/14. Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ReportService.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ReportService.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/ReportService.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -27,7 +27,7 @@ import org.chorem.lima.beans.BalanceTrial; import org.chorem.lima.beans.ReportsDatas; -import org.chorem.lima.business.LimaException; +import org.chorem.lima.business.exceptions.LimaException; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.FiscalPeriod; Modified: trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementService.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementService.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/api/VatStatementService.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -25,9 +25,9 @@ package org.chorem.lima.business.api; import org.chorem.lima.beans.VatStatementAmounts; -import org.chorem.lima.business.AlreadyExistVatStatement; -import org.chorem.lima.business.LimaException; -import org.chorem.lima.business.NotAllowedLabel; +import org.chorem.lima.business.exceptions.AlreadyExistVatStatementException; +import org.chorem.lima.business.exceptions.LimaException; +import org.chorem.lima.business.exceptions.NotAllowedLabelException; import org.chorem.lima.entity.VatStatement; import java.util.Date; @@ -36,7 +36,7 @@ public interface VatStatementService { VatStatement createVatStatement(VatStatement masterVatStatement, - VatStatement vatStatement) throws AlreadyExistVatStatement, NotAllowedLabel; + VatStatement vatStatement) throws AlreadyExistVatStatementException, NotAllowedLabelException; List<VatStatement> getAllVatStatements(); Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AccountException.java (from rev 3897, trunk/lima-business-api/src/main/java/org/chorem/lima/business/AccountException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AccountException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AccountException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,54 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public abstract class AccountException extends LimaException { + + protected String accountNumber; + + public AccountException(String accountNumber) { + this.accountNumber = accountNumber; + } + + public AccountException(String accountNumber, Throwable cause) { + super(cause); + this.accountNumber = accountNumber; + } + + public AccountException(String accountNumber, String message) { + super(message); + this.accountNumber = accountNumber; + } + + public AccountException(String accountNumber, String message, Throwable cause) { + super(message, cause); + this.accountNumber = accountNumber; + } + + public String getAccountNumber() { + return accountNumber; + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AfterLastFiscalPeriodException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/AfterLastFiscalPeriodException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AfterLastFiscalPeriodException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AfterLastFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,38 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import java.util.Date; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public class AfterLastFiscalPeriodException extends DateException { + + private static final long serialVersionUID = -5954308076408483211L; + + public AfterLastFiscalPeriodException(Date date) { + super(date); + } + +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistAccountException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistAccountException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistAccountException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistAccountException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,36 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public class AlreadyExistAccountException extends AccountException { + + private static final long serialVersionUID = 1638306756613187054L; + + public AlreadyExistAccountException(String accountNumber) { + super(accountNumber); + } + +} Added: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistEntryBookException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistEntryBookException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistEntryBookException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,16 @@ +package org.chorem.lima.business.exceptions; + +import org.chorem.lima.entity.EntryBook; + +/** + * Created by davidcosse on 06/08/14. + */ +public class AlreadyExistEntryBookException extends EntryBookException{ + + private static final long serialVersionUID = 4214476295563684773L; + + public AlreadyExistEntryBookException(EntryBook entryBook) { + super(entryBook); + } + +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistFinancialStatement.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistFinancialStatement.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistFinancialStatement.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistFinancialStatement.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,46 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +/** + * Created by davidcosse on 28/07/14. + */ +public class AlreadyExistFinancialStatement extends LimaException { + private static final long serialVersionUID = 4816249386192290272L; + + protected String financialStatementLabel; + protected String masterLabel; + + public AlreadyExistFinancialStatement(String label, String masterLabel) { + this.financialStatementLabel = label; + this.masterLabel = masterLabel; + } + + public String getFinancialStatementLabel() { + return financialStatementLabel; + } + + public String getMasterLabel() { + return masterLabel; + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistVatStatementException.java (from rev 3897, trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyExistVatStatement.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistVatStatementException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyExistVatStatementException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,46 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +/** + * Created by davidcosse on 28/07/14. + */ +public class AlreadyExistVatStatementException extends LimaException { + private static final long serialVersionUID = 4816249386192290272L; + + protected String vatStatementLabel; + protected String masterLabel; + + public AlreadyExistVatStatementException(String label, String masterLabel) { + this.vatStatementLabel = label; + this.masterLabel = masterLabel; + } + + public String getVatStatementLabel() { + return vatStatementLabel; + } + + public String getMasterLabel() { + return masterLabel; + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyLockedFiscalPeriodException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/AlreadyLockedFiscalPeriodException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyLockedFiscalPeriodException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/AlreadyLockedFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,38 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.chorem.lima.entity.FiscalPeriod; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public class AlreadyLockedFiscalPeriodException extends FiscalPeriodException { + + private static final long serialVersionUID = -5813400095403966650L; + + public AlreadyLockedFiscalPeriodException(FiscalPeriod fiscalPeriod) { + super(fiscalPeriod); + } + +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/BeforeFirstFiscalPeriodException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeforeFirstFiscalPeriodException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/BeforeFirstFiscalPeriodException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/BeforeFirstFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,37 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import java.util.Date; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public class BeforeFirstFiscalPeriodException extends DateException { + + private static final long serialVersionUID = 2489087570900540310L; + + public BeforeFirstFiscalPeriodException(Date date) { + super(date); + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/BeginAfterEndFiscalPeriodException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/BeginAfterEndFiscalPeriodException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/BeginAfterEndFiscalPeriodException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/BeginAfterEndFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,41 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.chorem.lima.entity.FiscalPeriod; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public class BeginAfterEndFiscalPeriodException extends FiscalPeriodException { + + private static final long serialVersionUID = 2264156150001260558L; + + public BeginAfterEndFiscalPeriodException(FiscalPeriod fiscalPeriod) { + super(fiscalPeriod); + } + + public BeginAfterEndFiscalPeriodException(FiscalPeriod fiscalPeriod, Throwable cause) { + super(fiscalPeriod, cause); + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ClosedPeriodicEntryBookException.java (from rev 3897, trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBookException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ClosedPeriodicEntryBookException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ClosedPeriodicEntryBookException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,46 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.chorem.lima.entity.ClosedPeriodicEntryBook; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public abstract class ClosedPeriodicEntryBookException extends LimaException { + + protected ClosedPeriodicEntryBook closedPeriodicEntryBook; + + public ClosedPeriodicEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook) { + this.closedPeriodicEntryBook = closedPeriodicEntryBook; + } + + public ClosedPeriodicEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook, Throwable cause) { + super(cause); + this.closedPeriodicEntryBook = closedPeriodicEntryBook; + } + + public ClosedPeriodicEntryBook getClosedPeriodicEntryBook() { + return closedPeriodicEntryBook; + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ClosedPeriodicEntryBooksException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/ClosedPeriodicEntryBooksException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ClosedPeriodicEntryBooksException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ClosedPeriodicEntryBooksException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,48 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.chorem.lima.entity.ClosedPeriodicEntryBook; + +import java.util.Collection; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public abstract class ClosedPeriodicEntryBooksException extends LimaException { + + protected Collection<ClosedPeriodicEntryBook> closedPeriodicEntryBooks; + + public ClosedPeriodicEntryBooksException(Collection<ClosedPeriodicEntryBook> closedPeriodicEntryBooks) { + this.closedPeriodicEntryBooks = closedPeriodicEntryBooks; + } + + public ClosedPeriodicEntryBooksException(Collection<ClosedPeriodicEntryBook> closedPeriodicEntryBooks, Throwable cause) { + super(cause); + this.closedPeriodicEntryBooks = closedPeriodicEntryBooks; + } + + public Collection<ClosedPeriodicEntryBook> getClosedPeriodicEntryBooks() { + return closedPeriodicEntryBooks; + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/DateException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/DateException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/DateException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/DateException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,46 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import java.util.Date; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public abstract class DateException extends LimaException { + + protected Date date; + + public DateException(Date date) { + this.date = date; + } + + public DateException(Date date, Throwable cause) { + super(cause); + this.date = date; + } + + public Date getDate() { + return date; + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/EntriesException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntriesException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/EntriesException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/EntriesException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,48 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.chorem.lima.entity.Entry; + +import java.util.Collection; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public abstract class EntriesException extends LimaException { + + protected Collection<Entry> entries; + + public EntriesException(Collection<Entry> entries) { + this.entries = entries; + } + + public EntriesException(Collection<Entry> entries, Throwable cause) { + super(cause); + this.entries = entries; + } + + public Collection<Entry> getEntries() { + return entries; + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/EntryBookException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/EntryBookException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/EntryBookException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/EntryBookException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,47 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.chorem.lima.entity.EntryBook; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public abstract class EntryBookException extends LimaException { + + private static final long serialVersionUID = 7340316212015035903L; + protected EntryBook entryBook; + + public EntryBookException(EntryBook entryBook) { + this.entryBook = entryBook; + } + + public EntryBookException(EntryBook entryBook, Throwable cause) { + super(cause); + this.entryBook = entryBook; + } + + public EntryBook getEntryBook() { + return entryBook; + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FinancialPeriodException.java (from rev 3897, trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialPeriodException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FinancialPeriodException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FinancialPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,47 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.chorem.lima.entity.FinancialPeriod; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public abstract class FinancialPeriodException extends LimaException { + + private static final long serialVersionUID = 1641125531069733891L; + protected FinancialPeriod financialPeriod; + + public FinancialPeriodException(FinancialPeriod financialPeriod) { + this.financialPeriod = financialPeriod; + } + + public FinancialPeriodException(FinancialPeriod financialPeriod, Throwable cause) { + super(cause); + this.financialPeriod = financialPeriod; + } + + public FinancialPeriod getFinancialPeriod() { + return financialPeriod; + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FinancialTransactionsException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/FinancialTransactionsException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FinancialTransactionsException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FinancialTransactionsException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,48 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.chorem.lima.entity.FinancialTransaction; + +import java.util.Collection; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public abstract class FinancialTransactionsException extends LimaException { + + protected Collection<FinancialTransaction> financialTransactions; + + public FinancialTransactionsException(Collection<FinancialTransaction> financialTransactions) { + this.financialTransactions = financialTransactions; + } + + public FinancialTransactionsException(Collection<FinancialTransaction> financialTransactions, Throwable cause) { + super(cause); + this.financialTransactions = financialTransactions; + } + + public Collection<FinancialTransaction> getFinancialTransactions() { + return financialTransactions; + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FiscalPeriodException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/FiscalPeriodException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FiscalPeriodException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/FiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,46 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.chorem.lima.entity.FiscalPeriod; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public abstract class FiscalPeriodException extends LimaException { + + protected FiscalPeriod fiscalPeriod; + + public FiscalPeriodException(FiscalPeriod fiscalPeriod) { + this.fiscalPeriod = fiscalPeriod; + } + + public FiscalPeriodException(FiscalPeriod fiscalPeriod, Throwable cause) { + super(cause); + this.fiscalPeriod = fiscalPeriod; + } + + public FiscalPeriod getFiscalPeriod() { + return fiscalPeriod; + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportBackupException.java (from rev 3895, trunk/lima-business-api/src/main/java/org/chorem/lima/ImportBackupException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportBackupException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportBackupException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,13 @@ +package org.chorem.lima.business.exceptions; + +/** + * Created by davidcosse on 31/07/14. + */ +public class ImportBackupException extends LimaException { + + private static final long serialVersionUID = -2513856570463105751L; + + public ImportBackupException(String message, Throwable cause) { + super(message, cause); + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportEbpException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/ImportEbpException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportEbpException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportEbpException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,33 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public class ImportEbpException extends LimaException { + + public ImportEbpException(String message) { + super(message); + } +} Added: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportFileException.java =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportFileException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/ImportFileException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,18 @@ +package org.chorem.lima.business.exceptions; + +/** + * Created by davidcosse on 06/08/14. + */ +public class ImportFileException extends LimaException { + + private static final long serialVersionUID = 3498049458931759768L; + protected String detailMessage; + + public ImportFileException(String detailMessage) { + this.detailMessage = detailMessage; + } + + public String getDetailMessage() { + return detailMessage; + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/InvalidAccountNumberException.java (from rev 3897, trunk/lima-business-api/src/main/java/org/chorem/lima/business/InvalidAccountNumberException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/InvalidAccountNumberException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/InvalidAccountNumberException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,43 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public class InvalidAccountNumberException extends AccountException { + + private static final long serialVersionUID = 3561173000370832538L; + + public InvalidAccountNumberException(String accountNumber) { + super(accountNumber); + } + + public InvalidAccountNumberException(String accountNumber, String message) { + super(accountNumber, message); + } + + public InvalidAccountNumberException(String accountNumber, Throwable cause) { + super(accountNumber, cause); + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LastUnlockedFiscalPeriodException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/LastUnlockedFiscalPeriodException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LastUnlockedFiscalPeriodException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LastUnlockedFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,35 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.chorem.lima.entity.FiscalPeriod; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public class LastUnlockedFiscalPeriodException extends FiscalPeriodException { + + public LastUnlockedFiscalPeriodException(FiscalPeriod fiscalPeriod) { + super(fiscalPeriod); + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LimaException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/LimaException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LimaException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LimaException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,80 @@ +/* + * #%L + * Lima business + * + * $Id$ + * $HeadURL$ + * %% + * 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +package org.chorem.lima.business.exceptions; + +import javax.ejb.ApplicationException; + +/** + * Lima exception. + * + * @author chatellier + * @version $Revision$ + * <p/> + * Last update : $Date$ + * By : $Author$ + */ +@ApplicationException +public abstract class LimaException extends Exception { + + /** + * serialVersionUID. + */ + private static final long serialVersionUID = -6876236663940184462L; + + /** + * Constructs a new exception + * + */ + public LimaException() { + super(); + } + + /** + * Constructs a new exception with specified message. + * + */ + public LimaException(String message) { + super(message); + } + + /** + * Constructs a new exception with specified message and cause. + * @param message + * @param cause + */ + public LimaException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Constructs a new exception with the specified cause. + * + * @param cause cause + */ + public LimaException(Throwable cause) { + super(cause); + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LockedEntryBookException.java (from rev 3897, trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedEntryBookException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LockedEntryBookException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LockedEntryBookException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,41 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.chorem.lima.entity.ClosedPeriodicEntryBook; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public class LockedEntryBookException extends ClosedPeriodicEntryBookException { + + private static final long serialVersionUID = -1215196268732515909L; + + public LockedEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook) { + super(closedPeriodicEntryBook); + } + + public LockedEntryBookException(ClosedPeriodicEntryBook closedPeriodicEntryBook, Throwable cause) { + super(closedPeriodicEntryBook, cause); + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LockedFinancialPeriodException.java (from rev 3897, trunk/lima-business-api/src/main/java/org/chorem/lima/business/LockedFinancialPeriodException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LockedFinancialPeriodException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/LockedFinancialPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,41 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.chorem.lima.entity.FinancialPeriod; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public class LockedFinancialPeriodException extends FinancialPeriodException { + + private static final long serialVersionUID = -4319832479131451016L; + + public LockedFinancialPeriodException(FinancialPeriod financialPeriod) { + super(financialPeriod); + } + + public LockedFinancialPeriodException(FinancialPeriod financialPeriod, Throwable cause) { + super(financialPeriod, cause); + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/MoreOneUnlockFiscalPeriodException.java (from rev 3900, trunk/lima-business-api/src/main/java/org/chorem/lima/business/MoreOneUnlockFiscalPeriodException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/MoreOneUnlockFiscalPeriodException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/MoreOneUnlockFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,61 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import java.util.Date; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public class MoreOneUnlockFiscalPeriodException extends LimaException { + + private static final long serialVersionUID = -9215191603583397411L; + Date beginDate; + Date endDate; + Boolean isLocked; + long countUnlockFiscalPeriod; + + public MoreOneUnlockFiscalPeriodException(Date beginDate, Date endDate, Boolean isLocked, long countUnlockFiscalPeriod) { + this.beginDate = beginDate; + this.endDate = endDate; + this.isLocked = isLocked; + this.countUnlockFiscalPeriod = countUnlockFiscalPeriod; + + } + + public Date getBeginDate() { + return beginDate; + } + + public Date getEndDate() { + return endDate; + } + + public Boolean getIsLocked() { + return isLocked; + } + + public long getCountUnlockFiscalPeriod() { + return countUnlockFiscalPeriod; + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoDataToImportException.java (from rev 3900, trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoDataToImportException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoDataToImportException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoDataToImportException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,8 @@ +package org.chorem.lima.business.exceptions; + +/** + * Created by davidcosse on 06/08/14. + */ +public class NoDataToImportException extends LimaException { + private static final long serialVersionUID = -2919766360401345410L; +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoEmptyFiscalPeriodException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoEmptyFiscalPeriodException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoEmptyFiscalPeriodException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoEmptyFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,39 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.chorem.lima.entity.FinancialTransaction; + +import java.util.Collection; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public class NoEmptyFiscalPeriodException extends FinancialTransactionsException { + + private static final long serialVersionUID = -7254330675145732125L; + + public NoEmptyFiscalPeriodException(Collection<FinancialTransaction> financialTransactions) { + super(financialTransactions); + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoFiscalPeriodFoundException.java (from rev 3900, trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFiscalPeriodFoundException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoFiscalPeriodFoundException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoFiscalPeriodFoundException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,8 @@ +package org.chorem.lima.business.exceptions; + +/** + * Created by davidcosse on 06/08/14. + */ +public class NoFiscalPeriodFoundException extends LimaException { + private static final long serialVersionUID = 8983518025656738319L; +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoFoundFinancialPeriodException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/NoFoundFinancialPeriodException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoFoundFinancialPeriodException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NoFoundFinancialPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,38 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + + +import java.util.Date; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public class NoFoundFinancialPeriodException extends DateException { + + private static final long serialVersionUID = 18792078050537481L; + + public NoFoundFinancialPeriodException(Date date, Throwable cause) { + super(date, cause); + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotAllowedLabelException.java (from rev 3897, trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotAllowedLabel.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotAllowedLabelException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotAllowedLabelException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,40 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +/** + * Created by davidcosse on 31/07/14. + */ +public class NotAllowedLabelException extends LimaException { + + private static final long serialVersionUID = -4092985460788892883L; + protected String label; + + public NotAllowedLabelException(String label) { + this.label = label; + } + + public String getLabel() { + return label; + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotBeginNextDayOfLastFiscalPeriodException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotBeginNextDayOfLastFiscalPeriodException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotBeginNextDayOfLastFiscalPeriodException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotBeginNextDayOfLastFiscalPeriodException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,41 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.chorem.lima.entity.FiscalPeriod; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public class NotBeginNextDayOfLastFiscalPeriodException extends FiscalPeriodException { + + private static final long serialVersionUID = 8176413878471871539L; + + public NotBeginNextDayOfLastFiscalPeriodException(FiscalPeriod fiscalPeriod) { + super(fiscalPeriod); + } + + public NotBeginNextDayOfLastFiscalPeriodException(FiscalPeriod fiscalPeriod, Throwable cause) { + super(fiscalPeriod, cause); + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotLockedClosedPeriodicEntryBooksException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotLockedClosedPeriodicEntryBooksException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotLockedClosedPeriodicEntryBooksException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotLockedClosedPeriodicEntryBooksException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,37 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.chorem.lima.entity.ClosedPeriodicEntryBook; + +import java.util.Collection; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public class NotLockedClosedPeriodicEntryBooksException extends ClosedPeriodicEntryBooksException { + + public NotLockedClosedPeriodicEntryBooksException(Collection<ClosedPeriodicEntryBook> closedPeriodicEntryBooks) { + super(closedPeriodicEntryBooks); + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotNumberAccountNumberException.java (from rev 3900, trunk/lima-business-api/src/main/java/org/chorem/lima/business/NotNumberAccountNumberException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotNumberAccountNumberException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/NotNumberAccountNumberException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,21 @@ +package org.chorem.lima.business.exceptions; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public class NotNumberAccountNumberException extends AccountException { + + private static final long serialVersionUID = 8846998707851534785L; + + public NotNumberAccountNumberException(String accountNumber) { + super(accountNumber); + } + + public NotNumberAccountNumberException(String accountNumber, String message) { + super(accountNumber, message); + } + + public NotNumberAccountNumberException(String accountNumber, Throwable cause) { + super(accountNumber, cause); + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnbalancedEntriesException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedEntriesException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnbalancedEntriesException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnbalancedEntriesException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,37 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.chorem.lima.entity.Entry; + +import java.util.Collection; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public class UnbalancedEntriesException extends EntriesException { + + public UnbalancedEntriesException(Collection<Entry> entries) { + super(entries); + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnbalancedFinancialTransactionsException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnbalancedFinancialTransactionsException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnbalancedFinancialTransactionsException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnbalancedFinancialTransactionsException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,43 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.chorem.lima.entity.FinancialTransaction; + +import java.util.Collection; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public class UnbalancedFinancialTransactionsException extends FinancialTransactionsException { + + private static final long serialVersionUID = -5798716883893821461L; + + public UnbalancedFinancialTransactionsException(Collection<FinancialTransaction> financialTransactions) { + super(financialTransactions); + } + + public UnbalancedFinancialTransactionsException(Collection<FinancialTransaction> financialTransactions, Throwable cause) { + super(financialTransactions, cause); + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnfilledEntriesException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/UnfilledEntriesException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnfilledEntriesException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UnfilledEntriesException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,37 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.chorem.lima.entity.Entry; + +import java.util.Collection; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public class UnfilledEntriesException extends EntriesException { + + public UnfilledEntriesException(Collection<Entry> entries) { + super(entries); + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UsedAccountException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedAccountException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UsedAccountException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UsedAccountException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,35 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public class UsedAccountException extends AccountException { + + private static final long serialVersionUID = 6259523100387108392L; + + public UsedAccountException(String accountNumber) { + super(accountNumber); + } +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UsedEntryBookException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/UsedEntryBookException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UsedEntryBookException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/UsedEntryBookException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,36 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.chorem.lima.entity.EntryBook; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public class UsedEntryBookException extends EntryBookException { + + public UsedEntryBookException(EntryBook entryBook) { + super(entryBook); + } + +} Copied: trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/WithoutEntryBookFinancialTransactionsException.java (from rev 3894, trunk/lima-business-api/src/main/java/org/chorem/lima/business/WithoutEntryBookFinancialTransactionsException.java) =================================================================== --- trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/WithoutEntryBookFinancialTransactionsException.java (rev 0) +++ trunk/lima-business-api/src/main/java/org/chorem/lima/business/exceptions/WithoutEntryBookFinancialTransactionsException.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -0,0 +1,40 @@ +package org.chorem.lima.business.exceptions; + +/* + * #%L + * Lima :: business API + * %% + * Copyright (C) 2008 - 2014 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 3 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, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import org.chorem.lima.entity.FinancialTransaction; + +import java.util.Collection; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public class WithoutEntryBookFinancialTransactionsException extends FinancialTransactionsException { + + private static final long serialVersionUID = -7367418086461765300L; + + public WithoutEntryBookFinancialTransactionsException(Collection<FinancialTransaction> financialTransactions) { + super(financialTransactions); + } + +} Modified: trunk/lima-swing/pom.xml =================================================================== --- trunk/lima-swing/pom.xml 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-swing/pom.xml 2014-08-06 14:27:15 UTC (rev 3902) @@ -169,11 +169,6 @@ <artifactId>commons-lang</artifactId> </dependency> - <dependency> - <groupId>commons-codec</groupId> - <artifactId>commons-codec</artifactId> - </dependency> - </dependencies> <build> Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -28,14 +28,14 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.LimaConfig; -import org.chorem.lima.business.AlreadyExistAccountException; -import org.chorem.lima.business.InvalidAccountNumberException; -import org.chorem.lima.business.NotAllowedLabel; -import org.chorem.lima.business.NotNumberAccountNumberException; import org.chorem.lima.business.ServiceListener; -import org.chorem.lima.business.UsedAccountException; import org.chorem.lima.business.api.AccountService; import org.chorem.lima.business.api.ImportService; +import org.chorem.lima.business.exceptions.AlreadyExistAccountException; +import org.chorem.lima.business.exceptions.InvalidAccountNumberException; +import org.chorem.lima.business.exceptions.NotAllowedLabelException; +import org.chorem.lima.business.exceptions.NotNumberAccountNumberException; +import org.chorem.lima.business.exceptions.UsedAccountException; import org.chorem.lima.entity.Account; import org.chorem.lima.enums.AccountsChartEnum; import org.chorem.lima.enums.ImportExportEnum; @@ -279,7 +279,7 @@ errorHelper.showErrorMessage(t("lima.ui.account.add.error.InvalidAccountNumber", e.getAccountNumber())); } catch (NotNumberAccountNumberException e) { errorHelper.showErrorMessage(t("lima.fiscalPeriod.franceAccountingRules.notNumberAccountNumberException", e.getAccountNumber())); - } catch (NotAllowedLabel e) { + } catch (NotAllowedLabelException e) { errorHelper.showErrorMessage(t("lima.all.notAllowedLabel", e.getLabel())); } finally { dialog.dispose(); Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialTransactionTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialTransactionTableModel.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/FinancialTransactionTableModel.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -26,11 +26,11 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.business.AfterLastFiscalPeriodException; -import org.chorem.lima.business.BeforeFirstFiscalPeriodException; -import org.chorem.lima.business.LockedEntryBookException; -import org.chorem.lima.business.LockedFinancialPeriodException; import org.chorem.lima.business.api.FinancialTransactionService; +import org.chorem.lima.business.exceptions.AfterLastFiscalPeriodException; +import org.chorem.lima.business.exceptions.BeforeFirstFiscalPeriodException; +import org.chorem.lima.business.exceptions.LockedEntryBookException; +import org.chorem.lima.business.exceptions.LockedFinancialPeriodException; import org.chorem.lima.business.utils.EntryComparator; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryImpl; Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -29,9 +29,10 @@ import org.apache.commons.logging.LogFactory; import org.chorem.lima.LimaConfig; import org.chorem.lima.business.ServiceListener; -import org.chorem.lima.business.UsedEntryBookException; import org.chorem.lima.business.api.EntryBookService; import org.chorem.lima.business.api.ImportService; +import org.chorem.lima.business.exceptions.AlreadyExistEntryBookException; +import org.chorem.lima.business.exceptions.UsedEntryBookException; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.EntryBookImpl; import org.chorem.lima.enums.EntryBooksChartEnum; @@ -167,8 +168,12 @@ if (newEntryBook != null) { // service call - newEntryBook = entryBookService.createEntryBook(newEntryBook); - + try { + newEntryBook = entryBookService.createEntryBook(newEntryBook); + } catch (AlreadyExistEntryBookException e) { + errorHelper.showErrorMessage(t("lima.entryBook.alreadyExistEntryBookException", e.getEntryBook().getCode())); + } + // ui refresh EntryBookTableModel model = view.getEntryBookTableModel(); model.addValue(newEntryBook); Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -29,14 +29,14 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.LimaConfig; -import org.chorem.lima.business.NotLockedClosedPeriodicEntryBooksException; import org.chorem.lima.business.ServiceListener; -import org.chorem.lima.business.UnbalancedFinancialTransactionsException; -import org.chorem.lima.business.UnfilledEntriesException; -import org.chorem.lima.business.WithoutEntryBookFinancialTransactionsException; import org.chorem.lima.business.api.FinancialPeriodService; import org.chorem.lima.business.api.FiscalPeriodService; import org.chorem.lima.business.api.ImportService; +import org.chorem.lima.business.exceptions.NotLockedClosedPeriodicEntryBooksException; +import org.chorem.lima.business.exceptions.UnbalancedFinancialTransactionsException; +import org.chorem.lima.business.exceptions.UnfilledEntriesException; +import org.chorem.lima.business.exceptions.WithoutEntryBookFinancialTransactionsException; import org.chorem.lima.business.utils.FinancialPeriodComparator; import org.chorem.lima.entity.ClosedPeriodicEntryBook; import org.chorem.lima.entity.Entry; Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTableModel.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTableModel.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -29,9 +29,9 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.LimaConfig; -import org.chorem.lima.business.AlreadyExistFinancialStatement; -import org.chorem.lima.business.NotAllowedLabel; import org.chorem.lima.business.api.FinancialStatementService; +import org.chorem.lima.business.exceptions.AlreadyExistFinancialStatement; +import org.chorem.lima.business.exceptions.NotAllowedLabelException; import org.chorem.lima.entity.FinancialStatement; import org.chorem.lima.entity.FinancialStatementImpl; import org.chorem.lima.service.LimaServiceFactory; @@ -216,7 +216,7 @@ } catch (AlreadyExistFinancialStatement alreadyExistFinancialStatement) { errorHelper.showErrorMessage(t("lima.importexport.import.alreadyExistFinancialStatement", alreadyExistFinancialStatement.getFinancialStatementLabel(), alreadyExistFinancialStatement.getMasterLabel())); - } catch (NotAllowedLabel notAllowedLabel) { + } catch (NotAllowedLabelException notAllowedLabel) { errorHelper.showErrorMessage(t("lima.financialstatement.notAllowedLabel", notAllowedLabel.getLabel())); } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -30,16 +30,16 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.LimaConfig; -import org.chorem.lima.business.AfterLastFiscalPeriodException; -import org.chorem.lima.business.BeforeFirstFiscalPeriodException; -import org.chorem.lima.business.LockedEntryBookException; -import org.chorem.lima.business.LockedFinancialPeriodException; import org.chorem.lima.business.ServiceListener; import org.chorem.lima.business.api.EntryBookService; import org.chorem.lima.business.api.FinancialPeriodService; import org.chorem.lima.business.api.FinancialTransactionService; import org.chorem.lima.business.api.FiscalPeriodService; import org.chorem.lima.business.api.ImportService; +import org.chorem.lima.business.exceptions.AfterLastFiscalPeriodException; +import org.chorem.lima.business.exceptions.BeforeFirstFiscalPeriodException; +import org.chorem.lima.business.exceptions.LockedEntryBookException; +import org.chorem.lima.business.exceptions.LockedFinancialPeriodException; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.EntryImpl; Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedViewHandler.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedViewHandler.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -28,10 +28,10 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.LimaConfig; -import org.chorem.lima.business.AfterLastFiscalPeriodException; -import org.chorem.lima.business.BeforeFirstFiscalPeriodException; -import org.chorem.lima.business.LockedEntryBookException; -import org.chorem.lima.business.LockedFinancialPeriodException; +import org.chorem.lima.business.exceptions.AfterLastFiscalPeriodException; +import org.chorem.lima.business.exceptions.BeforeFirstFiscalPeriodException; +import org.chorem.lima.business.exceptions.LockedEntryBookException; +import org.chorem.lima.business.exceptions.LockedFinancialPeriodException; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryImpl; import org.chorem.lima.entity.FinancialTransaction; @@ -39,13 +39,7 @@ import org.chorem.lima.ui.financialtransaction.FinancialTransactionDefaultTable; import org.chorem.lima.util.ErrorHelper; -import javax.swing.AbstractAction; -import javax.swing.ActionMap; -import javax.swing.InputMap; -import javax.swing.JComponent; -import javax.swing.JOptionPane; -import javax.swing.KeyStroke; -import javax.swing.ListSelectionModel; +import javax.swing.*; import javax.swing.table.TableCellEditor; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -30,15 +30,15 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.LimaConfig; -import org.chorem.lima.business.AlreadyLockedFiscalPeriodException; -import org.chorem.lima.business.BeginAfterEndFiscalPeriodException; -import org.chorem.lima.business.LastUnlockedFiscalPeriodException; -import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException; -import org.chorem.lima.business.NoEmptyFiscalPeriodException; -import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException; import org.chorem.lima.business.ServiceListener; import org.chorem.lima.business.api.FinancialTransactionService; import org.chorem.lima.business.api.FiscalPeriodService; +import org.chorem.lima.business.exceptions.AlreadyLockedFiscalPeriodException; +import org.chorem.lima.business.exceptions.BeginAfterEndFiscalPeriodException; +import org.chorem.lima.business.exceptions.LastUnlockedFiscalPeriodException; +import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException; +import org.chorem.lima.business.exceptions.NoEmptyFiscalPeriodException; +import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.EntryBookImpl; import org.chorem.lima.entity.FinancialTransaction; @@ -48,14 +48,7 @@ import org.chorem.lima.util.ErrorHelper; import org.nuiton.util.DateUtil; -import javax.swing.AbstractAction; -import javax.swing.ActionMap; -import javax.swing.DefaultListSelectionModel; -import javax.swing.InputMap; -import javax.swing.JComponent; -import javax.swing.JOptionPane; -import javax.swing.KeyStroke; -import javax.swing.SwingWorker; +import javax.swing.*; import javax.swing.event.ListSelectionEvent; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; 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-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -31,26 +31,27 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.ImportBackupException; import org.chorem.lima.LimaTechnicalException; -import org.chorem.lima.business.AlreadyExistFinancialStatement; -import org.chorem.lima.business.AlreadyExistVatStatement; -import org.chorem.lima.business.BeginAfterEndFiscalPeriodException; import org.chorem.lima.business.ExportResult; import org.chorem.lima.business.ImportExportResults; import org.chorem.lima.business.ImportResult; -import org.chorem.lima.business.InvalidAccountNumberException; -import org.chorem.lima.business.LimaException; -import org.chorem.lima.business.LockedEntryBookException; -import org.chorem.lima.business.LockedFinancialPeriodException; -import org.chorem.lima.business.MoreOneUnlockFiscalPeriodException; -import org.chorem.lima.business.NoDataToImportException; -import org.chorem.lima.business.NoFiscalPeriodFoundException; -import org.chorem.lima.business.NotAllowedLabel; -import org.chorem.lima.business.NotBeginNextDayOfLastFiscalPeriodException; -import org.chorem.lima.business.NotNumberAccountNumberException; import org.chorem.lima.business.api.ExportService; import org.chorem.lima.business.api.ImportService; +import org.chorem.lima.business.exceptions.AlreadyExistFinancialStatement; +import org.chorem.lima.business.exceptions.AlreadyExistVatStatementException; +import org.chorem.lima.business.exceptions.BeginAfterEndFiscalPeriodException; +import org.chorem.lima.business.exceptions.ImportBackupException; +import org.chorem.lima.business.exceptions.ImportFileException; +import org.chorem.lima.business.exceptions.InvalidAccountNumberException; +import org.chorem.lima.business.exceptions.LimaException; +import org.chorem.lima.business.exceptions.LockedEntryBookException; +import org.chorem.lima.business.exceptions.LockedFinancialPeriodException; +import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException; +import org.chorem.lima.business.exceptions.NoDataToImportException; +import org.chorem.lima.business.exceptions.NoFiscalPeriodFoundException; +import org.chorem.lima.business.exceptions.NotAllowedLabelException; +import org.chorem.lima.business.exceptions.NotBeginNextDayOfLastFiscalPeriodException; +import org.chorem.lima.business.exceptions.NotNumberAccountNumberException; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.EntryBook; @@ -102,11 +103,6 @@ /** Parent view. */ protected Component viewComponent; - /** - * @deprecated etat de la classe, non multi thread, gerer ca différement. - */ - protected EncodingEnum encodingEnum; - protected ImportService importService; protected ExportService exportService; @@ -358,13 +354,13 @@ Set<Integer> lines = exceptionsByLine.keySet(); for (Integer line : lines) { LimaException importException = exceptionsByLine.get(line); - message += t("lima.ui.importexport.import.ligne", line); + message += t("lima.ui.importexport.import.line", line); if (importException instanceof InvalidAccountNumberException) { message += t("lima.fiscalPeriod.franceAccountingRules.invalidAccountNumberException", ((InvalidAccountNumberException) importException).getAccountNumber())+"\n"; } else if (importException instanceof NotNumberAccountNumberException) { message += t("lima.fiscalPeriod.franceAccountingRules.notNumberAccountNumberException", ((NotNumberAccountNumberException) importException).getAccountNumber())+"\n"; - } else if (importException instanceof NotAllowedLabel) { - message += t("lima.all.NotAllowedLabel", ((NotAllowedLabel) importException).getLabel())+"\n"; + } else if (importException instanceof NotAllowedLabelException) { + message += t("lima.all.NotAllowedLabel", ((NotAllowedLabelException) importException).getLabel())+"\n"; } else if (importException instanceof MoreOneUnlockFiscalPeriodException) { message += t("lima.fiscalPeriod.franceAccountingRules.moreOneUnlockFiscalPeriodException", ((MoreOneUnlockFiscalPeriodException) importException).getBeginDate(), ((MoreOneUnlockFiscalPeriodException) importException).getEndDate())+"\n"; } else if (importException instanceof BeginAfterEndFiscalPeriodException) { @@ -377,14 +373,16 @@ message += t("lima.financialTransaction.lockedEntryBookException", ((LockedEntryBookException) importException).getClosedPeriodicEntryBook().getFinancialPeriod().getBeginDate(), ((LockedEntryBookException) importException).getClosedPeriodicEntryBook().getFinancialPeriod().getEndDate())+"\n"; } else if (importException instanceof AlreadyExistFinancialStatement) { message += t("lima.financialStatement.alreadyExistFinancialStatement", ((AlreadyExistFinancialStatement) importException).getFinancialStatementLabel())+"\n"; - } else if (importException instanceof AlreadyExistVatStatement) { - message += t("lima.vatStatement.alreadyExistVatStatement", ((AlreadyExistVatStatement) importException).getVatStatementLabel())+"\n"; + } else if (importException instanceof AlreadyExistVatStatementException) { + message += t("lima.vatStatement.alreadyExistVatStatement", ((AlreadyExistVatStatementException) importException).getVatStatementLabel())+"\n"; } else if (importException instanceof NoFiscalPeriodFoundException) { message += t("lima.import.entries.noFiscalPeriodFoundException")+"\n"; } else if (importException instanceof NoDataToImportException) { message += t("lima.import.noDataToImportException")+"\n"; + } else if (importException instanceof ImportFileException){ + message += ((ImportFileException) importException).getDetailMessage(); } else { - + message +=t("lima.import.unknownError"); } //message += t("lima.ui.importexport.import.exceptions", (line))+"\n"; if (log.isErrorEnabled()) { @@ -397,7 +395,9 @@ private String getFromSourceMessage(Class fromSource) { String message; - if (fromSource.equals(Account.class)){ + if (fromSource == null) { + message = ""; + } else if (fromSource.equals(Account.class)){ message = t("lima.ui.importexport.account")+"\n"; } else if (fromSource.equals(EntryBook.class)) { message = t("lima.ui.importexport.entrybook")+"\n"; @@ -462,10 +462,6 @@ } if (chooser.showOpenDialog(viewComponent) == JFileChooser.APPROVE_OPTION) { filePath = chooser.getSelectedFile().getAbsolutePath(); - - if (importExportMethode.getEncodingOption()) { - encodingEnum = EncodingEnum.valueOfDescription((String) comboBox.getSelectedItem()); - } } return filePath; @@ -555,6 +551,9 @@ } protected ImportExportResults importAllFromZipFile(String filePath) { + ImportExportResults results = new ImportExportResults(); + ImportResult result = results.createAddAndGetImportResult(null); + ZipInputStream zipInputStream = null; String tmpDir = System.getProperty("java.io.tmpdir")+"/"; FileInputStream inputStream = null; @@ -578,48 +577,47 @@ zipInputStream.closeEntry(); } } catch (Exception e) { - throw new LimaTechnicalException("could not extract zip file", e); + result.addInitException(new ImportFileException(t("lima.ui.importexport.import.extractFileError"))); } finally { IOUtils.closeQuietly(zipInputStream); IOUtils.closeQuietly(inputStream); } InputStream transactionsStream, entryBooksStream, fiscalPeriodsStream, entriesStream, accountsStream, identityStream; - ImportExportResults results = null; - try { - entryBooksStream = new FileInputStream(tmpDir + EntryBook.class.getSimpleName() +".csv"); - String entryBooksStreamString = IOUtils.toString(entryBooksStream); - IOUtils.closeQuietly(entryBooksStream); - // import - transactionsStream = new FileInputStream(tmpDir + FinancialTransaction.class.getSimpleName() +".csv"); - String transactionsStreamString = IOUtils.toString(transactionsStream); - IOUtils.closeQuietly(transactionsStream); + if (result.getAllExceptionsByLine().isEmpty()) { + try { + entryBooksStream = new FileInputStream(tmpDir + EntryBook.class.getSimpleName() +".csv"); + String entryBooksStreamString = IOUtils.toString(entryBooksStream); + IOUtils.closeQuietly(entryBooksStream); - fiscalPeriodsStream = new FileInputStream(tmpDir + FiscalPeriod.class.getSimpleName() +".csv"); - String fiscalPeriodsStreamString = IOUtils.toString(fiscalPeriodsStream); - IOUtils.closeQuietly(fiscalPeriodsStream); + // import + transactionsStream = new FileInputStream(tmpDir + FinancialTransaction.class.getSimpleName() +".csv"); + String transactionsStreamString = IOUtils.toString(transactionsStream); + IOUtils.closeQuietly(transactionsStream); - accountsStream = new FileInputStream(tmpDir + Account.class.getSimpleName() +".csv"); - String accountsStreamString = IOUtils.toString(accountsStream); - IOUtils.closeQuietly(accountsStream); + fiscalPeriodsStream = new FileInputStream(tmpDir + FiscalPeriod.class.getSimpleName() +".csv"); + String fiscalPeriodsStreamString = IOUtils.toString(fiscalPeriodsStream); + IOUtils.closeQuietly(fiscalPeriodsStream); - entriesStream = new FileInputStream(tmpDir + Entry.class.getSimpleName() +".csv"); - String entriesStreamString = IOUtils.toString(entriesStream); - IOUtils.closeQuietly(entriesStream); + accountsStream = new FileInputStream(tmpDir + Account.class.getSimpleName() +".csv"); + String accountsStreamString = IOUtils.toString(accountsStream); + IOUtils.closeQuietly(accountsStream); - identityStream = new FileInputStream(tmpDir + Identity.class.getSimpleName() + ".csv"); - String identityStreamString = IOUtils.toString(identityStream); - IOUtils.closeQuietly(identityStream); + entriesStream = new FileInputStream(tmpDir + Entry.class.getSimpleName() +".csv"); + String entriesStreamString = IOUtils.toString(entriesStream); + IOUtils.closeQuietly(entriesStream); - results = importService.importBackup(entryBooksStreamString, transactionsStreamString, fiscalPeriodsStreamString, accountsStreamString, entriesStreamString, identityStreamString); + identityStream = new FileInputStream(tmpDir + Identity.class.getSimpleName() + ".csv"); + String identityStreamString = IOUtils.toString(identityStream); + IOUtils.closeQuietly(identityStream); - } catch (Exception ex) { - if(log.isInfoEnabled()) { - log.info(ex); + results= importService.importBackup(entryBooksStreamString, transactionsStreamString, fiscalPeriodsStreamString, accountsStreamString, entriesStreamString, identityStreamString); + } catch (Exception ex) { + if(log.isInfoEnabled()) { + log.info(ex); + } + result.addException(new ImportBackupException(t("lima.ui.importexport.import.backupException"),ex)); } - results = new ImportExportResults(); - ImportResult result = results.createAddAndGetImportResult(Account.class); - result.addException(new ImportBackupException("could not import files", ex)); } return results; } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -33,14 +33,14 @@ import org.apache.commons.logging.LogFactory; import org.chorem.lima.LimaConfig; import org.chorem.lima.beans.LetteringFilterImpl; -import org.chorem.lima.business.LockedEntryBookException; -import org.chorem.lima.business.LockedFinancialPeriodException; -import org.chorem.lima.business.UnbalancedEntriesException; import org.chorem.lima.business.api.AccountService; import org.chorem.lima.business.api.EntryBookService; import org.chorem.lima.business.api.FinancialPeriodService; import org.chorem.lima.business.api.FinancialTransactionService; import org.chorem.lima.business.api.FiscalPeriodService; +import org.chorem.lima.business.exceptions.LockedEntryBookException; +import org.chorem.lima.business.exceptions.LockedFinancialPeriodException; +import org.chorem.lima.business.exceptions.UnbalancedEntriesException; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.AccountImpl; import org.chorem.lima.entity.Entry; @@ -48,12 +48,7 @@ import org.chorem.lima.service.LimaServiceFactory; import org.chorem.lima.util.ErrorHelper; -import javax.swing.AbstractAction; -import javax.swing.ActionMap; -import javax.swing.InputMap; -import javax.swing.JComboBox; -import javax.swing.JComponent; -import javax.swing.KeyStroke; +import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateFiscalPeriodPanel.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateFiscalPeriodPanel.jaxx 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/CreateFiscalPeriodPanel.jaxx 2014-08-06 14:27:15 UTC (rev 3902) @@ -30,7 +30,7 @@ org.jdesktop.swingx.JXDatePicker org.chorem.lima.entity.FiscalPeriod org.chorem.lima.business.api.FiscalPeriodService - org.chorem.lima.business.LimaException + org.chorem.lima.business.exceptions.LimaException org.chorem.lima.service.LimaServiceFactory </import> <script> Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/opening/OpeningViewHandler.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -27,8 +27,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.business.LimaException; import org.chorem.lima.business.api.FiscalPeriodService; +import org.chorem.lima.business.exceptions.LimaException; import org.chorem.lima.entity.FiscalPeriod; import org.chorem.lima.entity.FiscalPeriodImpl; import org.chorem.lima.enums.AccountsChartEnum; @@ -39,11 +39,10 @@ import org.chorem.lima.service.LimaServiceFactory; import org.chorem.lima.ui.importexport.ImportExport; -import javax.swing.BorderFactory; -import javax.swing.JPanel; +import javax.swing.*; import javax.swing.border.Border; import javax.swing.border.EmptyBorder; -import java.awt.Color; +import java.awt.*; import static org.nuiton.i18n.I18n.t; Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartTreeTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartTreeTableModel.java 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartTreeTableModel.java 2014-08-06 14:27:15 UTC (rev 3902) @@ -26,9 +26,9 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.business.AlreadyExistVatStatement; -import org.chorem.lima.business.NotAllowedLabel; import org.chorem.lima.business.api.VatStatementService; +import org.chorem.lima.business.exceptions.AlreadyExistVatStatementException; +import org.chorem.lima.business.exceptions.NotAllowedLabelException; import org.chorem.lima.entity.VatStatement; import org.chorem.lima.entity.VatStatementImpl; import org.chorem.lima.service.LimaServiceFactory; @@ -180,10 +180,10 @@ try { vatStatementService.createVatStatement( parentVatStatementHeader, vatStatement); - } catch (AlreadyExistVatStatement alreadyExistVatStatement) { + } catch (AlreadyExistVatStatementException alreadyExistVatStatement) { errorHelper.showErrorMessage(t("lima.importexport.import.alreadyExistFinancialStatement", alreadyExistVatStatement.getVatStatementLabel(), alreadyExistVatStatement.getMasterLabel())); - } catch (NotAllowedLabel notAllowedLabel) { + } catch (NotAllowedLabelException notAllowedLabel) { errorHelper.showErrorMessage(t("lima.importexport.import.alreadyExistFinancialStatement", notAllowedLabel.getLabel())); } 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 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2014-08-06 14:27:15 UTC (rev 3902) @@ -208,6 +208,7 @@ lima.entries.searchunbalancedtransaction=Incorrect transactions lima.entries.unbalanced= lima.entries.writetransaction=Write entries +lima.entryBook.alreadyExistEntryBookException=An entry book with code %s already exists. lima.entryBooks= lima.entrybooksreports.documentcreationerror=Enable to create document lima.entrybooksreports.documentcreationfiscalerror=Can't create document on an open fiscal year @@ -615,7 +616,9 @@ lima.ui.importexport.fiscalPeriod=Fiscal periods import completed. lima.ui.importexport.identity=Identity import completed. lima.ui.importexport.import= -lima.ui.importexport.import.ligne=Line %d +lima.ui.importexport.import.backupException=could not import backup. +lima.ui.importexport.import.extractFileError=Could not extract file. +lima.ui.importexport.import.line=Line %d\: lima.ui.importexport.import.nbCreated=%d created lima.ui.importexport.import.nbIgnored=%d ignored lima.ui.importexport.import.nbUpdated=%d updated 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 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-08-06 14:27:15 UTC (rev 3902) @@ -189,6 +189,7 @@ lima.entries.searchunbalancedtransaction= lima.entries.unbalanced=Entrées incorrectes lima.entries.writetransaction= +lima.entryBook.alreadyExistEntryBookException=Un journal avec comme code % existe déjà. lima.entryBooks=Journaux lima.entrybooksreports.documentcreationerror=Erreur lors de la création du document lima.entrybooksreports.documentcreationfiscalerror=Impossible de créer un document quand la période fiscale est ouverte @@ -534,7 +535,9 @@ lima.ui.importexport.identity=de l'identité terminé. lima.ui.importexport.import=Importer lima.ui.importexport.import.action=Import -lima.ui.importexport.import.ligne=Ligne %d +lima.ui.importexport.import.backupException=Echec de l'import du backup. +lima.ui.importexport.import.extractFileError=Le fichier n'est correct +lima.ui.importexport.import.line=Ligne %d\: lima.ui.importexport.import.nbCreated=%d créés lima.ui.importexport.import.nbIgnored=%d ignorés lima.ui.importexport.import.nbUpdated=%d mis à jours Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2014-08-06 12:04:19 UTC (rev 3901) +++ trunk/pom.xml 2014-08-06 14:27:15 UTC (rev 3902) @@ -188,11 +188,10 @@ <openejbJavaeeApiVersion>6.0-6</openejbJavaeeApiVersion> <dom4jVersion>1.6.1</dom4jVersion> <jdomVersion>2.0.5</jdomVersion> - <openCsvVersion>2.3</openCsvVersion> <itextVersion>4.2.1</itextVersion> <nuitonWidgetsVersion>1.1.1</nuitonWidgetsVersion> - <jaxxVersion>2.8.8-SNAPSHOT</jaxxVersion> + <jaxxVersion>2.9</jaxxVersion> <openEjbVersion>4.6.0.2</openEjbVersion> <slf4jVersion>1.7.7</slf4jVersion> <swingxVersion>1.6.5-1</swingxVersion> @@ -432,13 +431,6 @@ <scope>compile</scope> </dependency> - <dependency> - <groupId>net.sf.opencsv</groupId> - <artifactId>opencsv</artifactId> - <version>${openCsvVersion}</version> - <scope>compile</scope> - </dependency> - <!-- itext pdf to create document --> <dependency>