branch develop updated (546b909 -> 4a70606)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository lima. See http://git.chorem.org/lima.git from 546b909 correction sur scope de la dépendance 'jasperreports-fonts' new d5b2b30 refs #1190 some fixes, work in progress new 0dd23ac refs #1190 Refactoring déplacement de LimaServer sur la partie business, correction sur les POMs, ajout de paramètres à openEjb. La partie serveur démarre et la partie client essaie de s'y connecter mais elle ne semble pas y parvenir, elle démarre toujours sur une base locale. new 30ac42d refs #1190 uncomment necessary code new 32911a4 refs #1190 Le mode client serveur est fonctionnel new 139b85e refs #1190 Revue de code : -renommage LimaServiceConfig en LimaBusinessConfig ; -correction des Lima*Config pour la définition du nom de la propriété de conf, ainsi que le nom du fichier de conf par défaut (lima-config.properties) new 4a70606 Merge branch 'feature/1190-encodage-path' into develop The 6 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 4a70606d65e1411384fa450d7e2812e990708c8f Merge: 546b909 139b85e Author: Arnaud Thimel <thimel@codelutin.com> Date: Thu Mar 12 14:17:18 2015 +0100 Merge branch 'feature/1190-encodage-path' into develop commit 139b85e31afa3e25e5e1427be7469df2013a6dc8 Author: Arnaud Thimel <thimel@codelutin.com> Date: Thu Mar 12 14:08:27 2015 +0100 refs #1190 Revue de code : -renommage LimaServiceConfig en LimaBusinessConfig ; -correction des Lima*Config pour la définition du nom de la propriété de conf, ainsi que le nom du fichier de conf par défaut (lima-config.properties) commit 32911a4b3050cde9d5f7a76b4a9cbf6f17f6ca20 Author: dcosse <cosse@codelutin.com> Date: Mon Mar 9 17:55:57 2015 +0100 refs #1190 Le mode client serveur est fonctionnel commit 30ac42d3b006117d6f2310c7fc16b6dd30818556 Author: dcosse <cosse@codelutin.com> Date: Fri Mar 6 19:04:15 2015 +0100 refs #1190 uncomment necessary code commit 0dd23ace0d79bc3b70e709f9e93e4fbaf15509d5 Author: dcosse <cosse@codelutin.com> Date: Fri Mar 6 18:31:06 2015 +0100 refs #1190 Refactoring déplacement de LimaServer sur la partie business, correction sur les POMs, ajout de paramètres à openEjb. La partie serveur démarre et la partie client essaie de s'y connecter mais elle ne semble pas y parvenir, elle démarre toujours sur une base locale. commit d5b2b30760928174a3c23218647ec0f2d5c95d34 Author: dcosse <cosse@codelutin.com> Date: Thu Mar 5 08:08:09 2015 +0100 refs #1190 some fixes, work in progress Summary of changes: lima-business/README.txt | 9 +++- lima-business/pom.xml | 36 ++++++++++++- .../src/main/assembly/bin.xml | 42 --------------- .../src/main/assembly/lima-server | 0 .../src/main/java/org/chorem/lima/LimaServer.java | 11 +++- ...aServiceConfig.java => LimaBusinessConfig.java} | 33 +++++++----- .../org/chorem/lima/business/LimaInterceptor.java | 2 +- .../lima/business/ejb/AccountServiceImpl.java | 8 +-- .../lima/business/ejb/EntryBookServiceImpl.java | 7 ++- .../business/ejb/FinancialPeriodServiceImpl.java | 4 +- .../ejb/FinancialTransactionServiceImpl.java | 20 ++++---- .../lima/business/ejb/FiscalPeriodServiceImpl.java | 8 +-- .../lima/business/ejb/OptionsServiceImpl.java | 40 +++++++-------- .../lima/business/utils/BigDecimalToString.java | 4 +- .../chorem/lima/service/LimaServiceFactory.java | 23 +++++++-- .../src/{test => main}/resources/log4j.properties | 4 +- .../org/chorem/lima/business/AbstractLimaTest.java | 6 +-- .../org/chorem/lima/business/LimaMiscTest.java | 4 +- .../org/chorem/lima/business/LimaTestsConfig.java | 4 +- .../accountingrules/AccountServiceRuleFrTest.java | 8 +-- .../EntryBookServiceRuleFrTest.java | 8 +-- .../FinancialPeriodServiceRuleFrTest.java | 8 +-- .../FinancialTransactionServiceRuleFrTest.java | 8 +-- .../FiscalPeriodServiceRuleFrTest.java | 8 +-- .../accountingrules/ImportServiceRuleFrTest.java | 8 +-- .../accountingrules/ReportServiceRuleFrTest.java | 8 +-- lima-business/src/test/resources/log4j.properties | 4 +- lima-swing/pom.xml | 12 ++--- .../src/main/java/org/chorem/lima/LimaMain.java | 4 +- .../chorem/lima/LimaSwingApplicationContext.java | 4 +- .../main/java/org/chorem/lima/LimaSwingConfig.java | 12 +++-- .../chorem/lima/ui/account/AccountViewHandler.java | 44 ++++++++-------- .../src/main/resources/META-INF/ejb-jar.xml | 0 .../src/main/resources/lima-config.properties | 3 ++ lima-swing/src/main/resources/log4j.properties | 57 ++++++++++---------- .../java/org/chorem/lima/ui/AbstractLimaTest.java | 9 ++-- .../java/org/chorem/lima/ui/LimaTestsConfig.java | 6 +-- lima-web/pom.xml | 60 ++-------------------- .../org/chorem/lima/web/action/ReportBuilder.java | 4 +- .../chorem/lima/web/service/DocumentService.java | 4 +- .../chorem/lima/web/service/HttpServerService.java | 14 ++--- .../src/main}/resources/log4j.properties | 0 pom.xml | 3 +- 43 files changed, 270 insertions(+), 291 deletions(-) rename {lima-web => lima-business}/src/main/assembly/bin.xml (59%) rename {lima-web => lima-business}/src/main/assembly/lima-server (100%) rename {lima-web => lima-business}/src/main/java/org/chorem/lima/LimaServer.java (88%) rename lima-business/src/main/java/org/chorem/lima/business/{LimaServiceConfig.java => LimaBusinessConfig.java} (95%) copy lima-business/src/{test => main}/resources/log4j.properties (90%) copy {lima-business => lima-swing}/src/main/resources/META-INF/ejb-jar.xml (100%) copy {lima-business/src/test => lima-web/src/main}/resources/log4j.properties (100%) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository lima. See http://git.chorem.org/lima.git commit d5b2b30760928174a3c23218647ec0f2d5c95d34 Author: dcosse <cosse@codelutin.com> Date: Thu Mar 5 08:08:09 2015 +0100 refs #1190 some fixes, work in progress --- .../java/org/chorem/lima/business/LimaServiceConfig.java | 15 ++++++++++++--- .../java/org/chorem/lima/service/LimaServiceFactory.java | 1 + .../src/main/java/org/chorem/lima/LimaSwingConfig.java | 11 ++++++++--- lima-swing/src/main/resources/lima-config.properties | 3 +++ lima-swing/src/main/resources/log4j.properties | 9 +++++---- 5 files changed, 29 insertions(+), 10 deletions(-) diff --git a/lima-business/src/main/java/org/chorem/lima/business/LimaServiceConfig.java b/lima-business/src/main/java/org/chorem/lima/business/LimaServiceConfig.java index b71cb65..bca00dd 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/LimaServiceConfig.java +++ b/lima-business/src/main/java/org/chorem/lima/business/LimaServiceConfig.java @@ -63,7 +63,7 @@ public class LimaServiceConfig { protected static AccountingRules accountingRules; - protected static final String LIMA_DEFAULT_CONF_FILENAME = "lima.properties"; + protected static final String CONFIG_FILE_NAME = "lima.properties"; protected ApplicationConfig config; @@ -73,7 +73,7 @@ public class LimaServiceConfig { private LimaServiceConfig(String configFileName) { try { - ApplicationConfig defaultConfig = new ApplicationConfig(LIMA_DEFAULT_CONF_FILENAME); + ApplicationConfig defaultConfig = new ApplicationConfig(ServiceConfigOption.CONFIG_FILE.defaultValue); defaultConfig.loadDefaultOptions(ServiceConfigOption.values()); defaultConfig.parse(); @@ -182,6 +182,14 @@ public class LimaServiceConfig { return config.getFlatOptions(); } + public String getConfigFile() { + return config.getOption(ServiceConfigOption.CONFIG_FILE.key); + } + + public void setConfigFile(String configFile) { + LimaServiceConfig.getInstance().config.setOption(ServiceConfigOption.CONFIG_FILE.key, configFile); + } + public String getApplicationVersion() { return config.getOption(ServiceConfigOption.APPLICATION_VERSION.key); } @@ -497,7 +505,8 @@ public class LimaServiceConfig { */ public enum ServiceConfigOption implements ConfigOptionDef { -// CONFIG_FILE(CONFIG_FILE_NAME, n("lima.configFileName.description"), "lima.properties", String.class, true, true), + CONFIG_FILE(CONFIG_FILE_NAME, n("lima.configFileName.description"), "lima.properties", String.class, true, true), + APPLICATION_VERSION("application.version", n("application.version"), null, String.class, false, false), DATA_DIR("lima.data.dir", n("lima.config.data.dir.description"), "${user.home}/.lima", File.class, false, false), RULES_NATIONALTY("lima.rules", n("lima.config.rulesnationality.description"), FranceAccountingRules.class.getName(), String.class, false, false), diff --git a/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java b/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java index 147db08..c16e2c5 100644 --- a/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java +++ b/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java @@ -71,6 +71,7 @@ public class LimaServiceFactory { // introducing strange behaviour in AppConfig loading // only copy necessary options props.putAll(config.getOptionStartsWith("java.naming")); + props.putAll(config.getOptionStartsWith("openejb")); // transmission des options de logging a openejb // sinon, il utilise son propre pattern interne diff --git a/lima-swing/src/main/java/org/chorem/lima/LimaSwingConfig.java b/lima-swing/src/main/java/org/chorem/lima/LimaSwingConfig.java index 7ef0476..befba4e 100644 --- a/lima-swing/src/main/java/org/chorem/lima/LimaSwingConfig.java +++ b/lima-swing/src/main/java/org/chorem/lima/LimaSwingConfig.java @@ -68,7 +68,7 @@ public class LimaSwingConfig extends ApplicationConfig { private static LimaSwingConfig instance; - private static final String configFile = "lima-config.properties"; + private static final String CONFIG_FILE_NAME = "lima-config"; protected OptionsService optionsService; @@ -117,7 +117,7 @@ public class LimaSwingConfig extends ApplicationConfig { public synchronized static LimaSwingConfig getInstance() { if (instance == null) { instance = new LimaSwingConfig(); - instance.loadConfiguration(configFile); + instance.loadConfiguration(Option.CONFIG_FILE.getDefaultValue()); } return instance; } @@ -447,7 +447,7 @@ public class LimaSwingConfig extends ApplicationConfig { CONFIG_FILE(CONFIG_FILE_NAME, t("lima.config.configFileName.label"), n("lima.config.configFileName.description"), - "lima-config.properties", + "lima.properties", String.class, true, true), DATA_DIR("lima.data.dir", @@ -515,6 +515,11 @@ public class LimaSwingConfig extends ApplicationConfig { "false", String.class, false, false), + OPENEJB_EXCLUDE_INCLUDE("openejb.exclude-include.order", "open_EJB_include-exclude_order","open_EJB_include-exclude_order", "include-exclude", String.class, false, false), + OPENEJB_INCLUDE("openejb.deployments.classpath.include", "open_EJB_include","open_EJB_include", "", String.class, false, false), + OPENEJB_EXCLUDE("openejb.deployments.classpath.exclude", "open_EJB_exclude","open_EJB_exclude", ".*", String.class, false, false), + OPENEJB_LOCAL_INITIAL_CONTEXT_FACTORY("java.naming.factory.initial", "java.naming.factory.initial", "java.naming.factory.initial", "org.apache.openejb.core.LocalInitialContextFactory", String.class, false, false), + LIMA_HOST_ADDRESS("lima.host.address", t("lima.config.host.address.label"), n("lima.config.host.address.description"), diff --git a/lima-swing/src/main/resources/lima-config.properties b/lima-swing/src/main/resources/lima-config.properties index 849faf6..a317c16 100644 --- a/lima-swing/src/main/resources/lima-config.properties +++ b/lima-swing/src/main/resources/lima-config.properties @@ -44,6 +44,9 @@ application.organisation.url=${project.organization.url} # Embedded mode #lima.openejb.remotemode=false java.naming.factory.initial=org.apache.openejb.core.LocalInitialContextFactory +openejb.exclude-include.order=include-exclude +openejb.deployments.classpath.include="" +openejb.deployments.classpath.exclude=".*" #Lima Accounting Host #lima.host.address=localhost diff --git a/lima-swing/src/main/resources/log4j.properties b/lima-swing/src/main/resources/log4j.properties index 1a127e2..804ff5b 100644 --- a/lima-swing/src/main/resources/log4j.properties +++ b/lima-swing/src/main/resources/log4j.properties @@ -35,12 +35,13 @@ log4j.appender.file.layout.ConversionPattern=%5p [%t] (%F:%L) %M - %m%n #oepnEjb openejb.logger.external=true +log4j.category.OpenEJB.options=warn log4j.category.OpenEJB=warn -log4j.category.OpenEJB.server=info -log4j.category.OpenEJB.startup=info +log4j.category.OpenEJB.server=warn +log4j.category.OpenEJB.startup=warn log4j.category.OpenEJB.startup.service=warn -log4j.category.OpenEJB.startup.config=info -log4j.category.OpenEJB.hsql=info +log4j.category.OpenEJB.startup.config=warn +log4j.category.OpenEJB.hsql=error log4j.category.CORBA-Adapter=info log4j.category.Transaction=warn log4j.category.org.apache.activemq=error -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository lima. See http://git.chorem.org/lima.git commit 0dd23ace0d79bc3b70e709f9e93e4fbaf15509d5 Author: dcosse <cosse@codelutin.com> Date: Fri Mar 6 18:31:06 2015 +0100 refs #1190 Refactoring déplacement de LimaServer sur la partie business, correction sur les POMs, ajout de paramètres à openEjb. La partie serveur démarre et la partie client essaie de s'y connecter mais elle ne semble pas y parvenir, elle démarre toujours sur une base locale. --- lima-business/README.txt | 7 ++- lima-business/pom.xml | 36 +++++++++++++- .../src/main/assembly/bin.xml | 42 ---------------- .../src/main/assembly/lima-server | 0 .../src/main/java/org/chorem/lima/LimaServer.java | 4 +- .../ejb/FinancialTransactionServiceImpl.java | 4 +- .../chorem/lima/service/LimaServiceFactory.java | 4 +- .../src/{test => main}/resources/log4j.properties | 4 +- lima-business/src/test/resources/log4j.properties | 4 +- lima-swing/pom.xml | 6 +++ .../main/java/org/chorem/lima/LimaSwingConfig.java | 3 +- lima-swing/src/main/resources/META-INF/ejb-jar.xml | 41 +++++++++++++++ .../src/main/resources/lima-config.properties | 4 +- lima-swing/src/main/resources/log4j.properties | 58 +++++++++++----------- lima-web/pom.xml | 32 +++--------- lima-web/src/main/assembly/bin.xml | 52 ++++--------------- .../src/main}/resources/log4j.properties | 0 pom.xml | 2 +- 18 files changed, 147 insertions(+), 156 deletions(-) diff --git a/lima-business/README.txt b/lima-business/README.txt index 30404ce..5971651 100644 --- a/lima-business/README.txt +++ b/lima-business/README.txt @@ -1 +1,6 @@ -TODO \ No newline at end of file +Configurer le client pour se connecter au serveur via le fichier de configuration : +UNIX LIKE:$HOME/.config/lima.properties +7 et +: C:\Users\USER_NAME\AppData\Roaming\lima.properties + +java.naming.factory.initial=org.apache.openejb.client.RemoteInitialContextFactory +java.naming.provider.url=ejbd://192.168.99.9:4201 \ No newline at end of file diff --git a/lima-business/pom.xml b/lima-business/pom.xml index 36844a0..d84e624 100644 --- a/lima-business/pom.xml +++ b/lima-business/pom.xml @@ -82,12 +82,12 @@ <dependency> <groupId>org.apache.openejb</groupId> <artifactId>javaee-api</artifactId> - <scope>provided</scope> + <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.openejb</groupId> <artifactId>openejb-core</artifactId> - <scope>runtime</scope> + <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.openejb</groupId> @@ -132,6 +132,7 @@ <manifest> <addClasspath>true</addClasspath> <classpathPrefix>./lib/</classpathPrefix> + <mainClass>org.chorem.lima.LimaServer</mainClass> </manifest> </archive> </configuration> @@ -169,6 +170,37 @@ </build> <profiles> + <profile> + <id>assembly-profile</id> + <activation> + <property> + <name>performRelease</name> + <value>true</value> + </property> + </activation> + <build> + <plugins> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <configuration> + <finalName>lima-server-${project.version}</finalName> + <descriptors> + <descriptor>src/main/assembly/bin.xml</descriptor> + </descriptors> + <attach>false</attach> + </configuration> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> <profile> <id>reporting</id> diff --git a/lima-web/src/main/assembly/bin.xml b/lima-business/src/main/assembly/bin.xml similarity index 59% copy from lima-web/src/main/assembly/bin.xml copy to lima-business/src/main/assembly/bin.xml index 9baff9f..671d1d1 100644 --- a/lima-web/src/main/assembly/bin.xml +++ b/lima-business/src/main/assembly/bin.xml @@ -56,47 +56,5 @@ <include>LICENSE*</include> </includes> </fileSet> - <fileSet> - <directory>src/main/resources/reports</directory> - <outputDirectory>reports</outputDirectory> - <includes> - <include>*.pdf</include> - </includes> - </fileSet> - <fileSet> - <directory>src/main/jasperreports/accounts</directory> - <outputDirectory>jasperreports</outputDirectory> - <includes> - <include>*.jrxml</include> - </includes> - </fileSet> - <fileSet> - <directory>src/main/jasperreports/balance</directory> - <outputDirectory>jasperreports</outputDirectory> - <includes> - <include>*.jrxml</include> - </includes> - </fileSet> - <fileSet> - <directory>src/main/jasperreports/entryBook</directory> - <outputDirectory>jasperreports</outputDirectory> - <includes> - <include>*.jrxml</include> - </includes> - </fileSet> - <fileSet> - <directory>src/main/jasperreports/generalEntryBook</directory> - <outputDirectory>jasperreports</outputDirectory> - <includes> - <include>*.jrxml</include> - </includes> - </fileSet> - <fileSet> - <directory>src/main/jasperreports/ledger</directory> - <outputDirectory>jasperreports</outputDirectory> - <includes> - <include>*.jrxml</include> - </includes> - </fileSet> </fileSets> </assembly> diff --git a/lima-web/src/main/assembly/lima-server b/lima-business/src/main/assembly/lima-server similarity index 100% rename from lima-web/src/main/assembly/lima-server rename to lima-business/src/main/assembly/lima-server diff --git a/lima-web/src/main/java/org/chorem/lima/LimaServer.java b/lima-business/src/main/java/org/chorem/lima/LimaServer.java similarity index 95% rename from lima-web/src/main/java/org/chorem/lima/LimaServer.java rename to lima-business/src/main/java/org/chorem/lima/LimaServer.java index 77c24b9..bf1d6dd 100644 --- a/lima-web/src/main/java/org/chorem/lima/LimaServer.java +++ b/lima-business/src/main/java/org/chorem/lima/LimaServer.java @@ -46,12 +46,14 @@ public class LimaServer { * Lima server. * * @param args - * @throws javax.naming.NamingException + * @throws NamingException */ public static void main(String... args) throws NamingException { + Properties properties = new Properties(); properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, LocalInitialContextFactory.class.getName()); properties.setProperty("openejb.embedded.remotable", "true"); + properties.setProperty("openejb.deployments.classpath.ear", "false"); // Uncomment these properties to change the defaults //properties.setProperty("ejbd.port", "4202"); properties.setProperty("ejbd.bind", "0.0.0.0"); diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java index 970212f..9e82fb4 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java @@ -466,8 +466,8 @@ public class FinancialTransactionServiceImpl extends AbstractLimaService impleme EntryTopiaDao entryTopiaDao = getDaoHelper().getEntryDao(); List<Entry> entries = entryTopiaDao.findAllEntryByFilter(filter); - if (log.isInfoEnabled()) { - log.info("Entries size : " + entries.size()); + if (log.isDebugEnabled()) { + log.debug("Entries size : " + entries.size()); } return entries; diff --git a/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java b/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java index c16e2c5..9fa26eb 100644 --- a/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java +++ b/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java @@ -91,11 +91,11 @@ public class LimaServiceFactory { // as of openejb 4.6, bean-finder-shaded 3.15 doesn't scan full classpath anymore by default // see http://list.chorem.org/pipermail/lima-devel/2014-May/000154.html for more details - System.setProperty("xbean.finder.use.get-resources", "true"); + //System.setProperty("xbean.finder.use.get-resources", "true"); // see http://openejb.apache.org/embedded-configuration.html // http://openejb.apache.org/properties-listing.html - // for embedded configuration + // for embedded configuration. container = EJBContainer.createEJBContainer(props); } diff --git a/lima-business/src/test/resources/log4j.properties b/lima-business/src/main/resources/log4j.properties similarity index 90% copy from lima-business/src/test/resources/log4j.properties copy to lima-business/src/main/resources/log4j.properties index e4875ad..2a75c2e 100644 --- a/lima-business/src/test/resources/log4j.properties +++ b/lima-business/src/main/resources/log4j.properties @@ -28,6 +28,4 @@ log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) %M - %m%n # package level -log4j.logger.org.chorem.lima=DEBUG - -log4j.logger.org.chorem.lima.business.ejb.FinancialTransactionServiceImpl=DEBUG +log4j.logger.org.chorem.lima=DEBUG \ No newline at end of file diff --git a/lima-business/src/test/resources/log4j.properties b/lima-business/src/test/resources/log4j.properties index e4875ad..2a75c2e 100644 --- a/lima-business/src/test/resources/log4j.properties +++ b/lima-business/src/test/resources/log4j.properties @@ -28,6 +28,4 @@ log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) %M - %m%n # package level -log4j.logger.org.chorem.lima=DEBUG - -log4j.logger.org.chorem.lima.business.ejb.FinancialTransactionServiceImpl=DEBUG +log4j.logger.org.chorem.lima=DEBUG \ No newline at end of file diff --git a/lima-swing/pom.xml b/lima-swing/pom.xml index 0c50419..d3e2180 100644 --- a/lima-swing/pom.xml +++ b/lima-swing/pom.xml @@ -162,6 +162,12 @@ </dependency> <dependency> + <groupId>org.apache.openejb</groupId> + <artifactId>javaee-api</artifactId> + <scope>runtime</scope> + </dependency> + + <dependency> <groupId>org.nuiton</groupId> <artifactId>nuiton-widgets</artifactId> </dependency> diff --git a/lima-swing/src/main/java/org/chorem/lima/LimaSwingConfig.java b/lima-swing/src/main/java/org/chorem/lima/LimaSwingConfig.java index befba4e..02e64da 100644 --- a/lima-swing/src/main/java/org/chorem/lima/LimaSwingConfig.java +++ b/lima-swing/src/main/java/org/chorem/lima/LimaSwingConfig.java @@ -518,7 +518,8 @@ public class LimaSwingConfig extends ApplicationConfig { OPENEJB_EXCLUDE_INCLUDE("openejb.exclude-include.order", "open_EJB_include-exclude_order","open_EJB_include-exclude_order", "include-exclude", String.class, false, false), OPENEJB_INCLUDE("openejb.deployments.classpath.include", "open_EJB_include","open_EJB_include", "", String.class, false, false), OPENEJB_EXCLUDE("openejb.deployments.classpath.exclude", "open_EJB_exclude","open_EJB_exclude", ".*", String.class, false, false), - OPENEJB_LOCAL_INITIAL_CONTEXT_FACTORY("java.naming.factory.initial", "java.naming.factory.initial", "java.naming.factory.initial", "org.apache.openejb.core.LocalInitialContextFactory", String.class, false, false), + OPENEJB_DEPLOYMENTS_CLASSPATH_EAR("openejb.deployments.classpath.ear", "openejb.deployments.classpath.ear", "openejb.deployments.classpath.ear", "false", String.class, false, false), + INITIAL_CONTEXT_FACTORY("java.naming.factory.initial", "java.naming.factory.initial", "java.naming.factory.initial", "org.apache.openejb.core.LocalInitialContextFactory", String.class, false, false), LIMA_HOST_ADDRESS("lima.host.address", t("lima.config.host.address.label"), diff --git a/lima-swing/src/main/resources/META-INF/ejb-jar.xml b/lima-swing/src/main/resources/META-INF/ejb-jar.xml new file mode 100644 index 0000000..38b4710 --- /dev/null +++ b/lima-swing/src/main/resources/META-INF/ejb-jar.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + Lima :: business + %% + Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric + %% + 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% + --> +<!-- + Empty configuration file based on + http://openejb.apache.org/application-discovery-via-the-classpath.html + + Interceptor based on : http://openejb.apache.org/examples-trunk/alternate-descriptors/ +--> +<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd" + version="3.1"> + <!-- Le nom est a fixer sinon, il est généré et contient la version --> + <module-name>lima</module-name> + <assembly-descriptor> + <interceptor-binding> + <ejb-name>*</ejb-name> + <interceptor-class>org.chorem.lima.business.LimaInterceptor</interceptor-class> + </interceptor-binding> + </assembly-descriptor> +</ejb-jar> diff --git a/lima-swing/src/main/resources/lima-config.properties b/lima-swing/src/main/resources/lima-config.properties index a317c16..6c6155f 100644 --- a/lima-swing/src/main/resources/lima-config.properties +++ b/lima-swing/src/main/resources/lima-config.properties @@ -45,8 +45,8 @@ application.organisation.url=${project.organization.url} #lima.openejb.remotemode=false java.naming.factory.initial=org.apache.openejb.core.LocalInitialContextFactory openejb.exclude-include.order=include-exclude -openejb.deployments.classpath.include="" -openejb.deployments.classpath.exclude=".*" +openejb.deployments.classpath.include= +openejb.deployments.classpath.exclude=.* #Lima Accounting Host #lima.host.address=localhost diff --git a/lima-swing/src/main/resources/log4j.properties b/lima-swing/src/main/resources/log4j.properties index 804ff5b..0037d9a 100644 --- a/lima-swing/src/main/resources/log4j.properties +++ b/lima-swing/src/main/resources/log4j.properties @@ -37,45 +37,45 @@ log4j.appender.file.layout.ConversionPattern=%5p [%t] (%F:%L) %M - %m%n openejb.logger.external=true log4j.category.OpenEJB.options=warn log4j.category.OpenEJB=warn -log4j.category.OpenEJB.server=warn +log4j.category.OpenEJB.server=info log4j.category.OpenEJB.startup=warn log4j.category.OpenEJB.startup.service=warn log4j.category.OpenEJB.startup.config=warn -log4j.category.OpenEJB.hsql=error +log4j.category.OpenEJB.hsql=info log4j.category.CORBA-Adapter=info log4j.category.Transaction=warn log4j.category.org.apache.activemq=error log4j.category.org.apache.geronimo=error -log4j.category.openjpa=error +log4j.category.openjpa=info log4j.appender.C=org.apache.log4j.ConsoleAppender log4j.appender.C.layout=org.apache.log4j.SimpleLayout # package level log4j.logger.org.chorem.lima=INFO -log4j.logger.org.chorem.lima.ui.financialtransaction.FinancialTransactionTable=DEBUG -log4j.logger.org.chorem.lima.ui.lettering.LetteringViewHandler=DEBUG -log4j.logger.org.chorem.lima.ui.lettering.LettringSelectionModel=DEBUG -log4j.logger.org.chorem.lima.ui.lettering.LetteringEditModel=DEBUG -log4j.logger.org.chorem.lima.ui.common.FinancialTransactionTableModel=DEBUG -log4j.logger.org.chorem.lima.ui.celleditor.BigDecimalTableCellEditor=DEBUG -log4j.logger.org.chorem.lima.business.accountingrules.DefaultAccountingRules=DEBUG -log4j.logger.org.chorem.lima.business.ejb.FinancialTransactionServiceImpl=DEBUG -log4j.logger.org.chorem.lima.business.ui.celleditor.BigDecimalTableCellEditor=DEBUG -log4j.logger.org.chorem.lima.business.ui.financialtransaction.FinancialTransactionTableModel=DEBUG -log4j.logger.org.chorem.lima.entity.EntryDAOImpl=DEBUG -log4j.logger.org.chorem.lima.ui.financialtransaction.FinancialTransactionViewHandler=DEBUG -log4j.logger.org.chorem.lima.entity.AbstractFinancialTransactionTopiaDao=DEBUG -log4j.logger.org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel=DEBUG -log4j.logger.org.chorem.lima.ui.financialtransactionsearch.FinancialTransactionPeriodSearchPanel=DEBUG -log4j.logger.org.chorem.lima.ui.financialtransactionsearch.FinancialTransactionSearchViewHandler=DEBUG -log4j.logger.org.chorem.lima.ui.fiscalperiod.FiscalPeriodViewHandler=DEBUG -log4j.logger.org.chorem.lima.ui.fiscalperiod.FiscalPeriodTableModel=DEBUG -log4j.logger.org.chorem.lima.business.ejb.DocumentServiceImpl=DEBUG -log4j.logger.org.chorem.lima.business.ejb.HttpServerServiceImpl=DEBUG -log4j.logger.org.chorem.lima.ui.accountsreports.AccountsReportsViewHandler=DEBUG -log4j.logger.org.chorem.lima.business.ejb.ReportServiceImpl=DEBUG -log4j.logger.org.chorem.lima.ui.MainViewHandler=DEBUG -log4j.logger.org.chorem.lima.business.ejb.FinancialStatementServiceImpl=DEBUG -log4j.logger.org.chorem.lima.ui.importexport.ImportExport=DEBUG -log4j.logger.org.chorem.lima.ui.celleditor.DateTableCellEditor=DEBUG +log4j.logger.org.chorem.lima.ui.financialtransaction.FinancialTransactionTable=INFO +log4j.logger.org.chorem.lima.ui.lettering.LetteringViewHandler=INFO +log4j.logger.org.chorem.lima.ui.lettering.LettringSelectionModel=INFO +log4j.logger.org.chorem.lima.ui.lettering.LetteringEditModel=INFO +log4j.logger.org.chorem.lima.ui.common.FinancialTransactionTableModel=INFO +log4j.logger.org.chorem.lima.ui.celleditor.BigDecimalTableCellEditor=INFO +log4j.logger.org.chorem.lima.business.accountingrules.DefaultAccountingRules=INFO +log4j.logger.org.chorem.lima.business.ejb.FinancialTransactionServiceImpl=INFO +log4j.logger.org.chorem.lima.business.ui.celleditor.BigDecimalTableCellEditor=INFO +log4j.logger.org.chorem.lima.business.ui.financialtransaction.FinancialTransactionTableModel=INFO +log4j.logger.org.chorem.lima.entity.EntryDAOImpl=INFO +log4j.logger.org.chorem.lima.ui.financialtransaction.FinancialTransactionViewHandler=INFO +log4j.logger.org.chorem.lima.entity.AbstractFinancialTransactionTopiaDao=INFO +log4j.logger.org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel=INFO +log4j.logger.org.chorem.lima.ui.financialtransactionsearch.FinancialTransactionPeriodSearchPanel=INFO +log4j.logger.org.chorem.lima.ui.financialtransactionsearch.FinancialTransactionSearchViewHandler=INFO +log4j.logger.org.chorem.lima.ui.fiscalperiod.FiscalPeriodViewHandler=INFO +log4j.logger.org.chorem.lima.ui.fiscalperiod.FiscalPeriodTableModel=INFO +log4j.logger.org.chorem.lima.business.ejb.DocumentServiceImpl=INFO +log4j.logger.org.chorem.lima.business.ejb.HttpServerServiceImpl=INFO +log4j.logger.org.chorem.lima.ui.accountsreports.AccountsReportsViewHandler=INFO +log4j.logger.org.chorem.lima.business.ejb.ReportServiceImpl=INFO +log4j.logger.org.chorem.lima.ui.MainViewHandler=INFO +log4j.logger.org.chorem.lima.business.ejb.FinancialStatementServiceImpl=INFO +log4j.logger.org.chorem.lima.ui.importexport.ImportExport=INFO +log4j.logger.org.chorem.lima.ui.celleditor.DateTableCellEditor=INFO diff --git a/lima-web/pom.xml b/lima-web/pom.xml index 62e5957..847663a 100644 --- a/lima-web/pom.xml +++ b/lima-web/pom.xml @@ -14,16 +14,6 @@ <name>Lima :: web</name> <description>Lima Web Module</description> - <properties> - <!--Main class in JAR --> - <maven.jar.main.class>org.chorem.lima.LimaServer</maven.jar.main.class> - - <redmine.releaseFiles> - target/lima-server-${project.version}-bin.zip - </redmine.releaseFiles> - - </properties> - <dependencies> <dependency> <groupId>${project.groupId}</groupId> @@ -97,16 +87,6 @@ <scope>compile</scope> </dependency> <dependency> - <groupId>org.apache.openejb</groupId> - <artifactId>openejb-core</artifactId> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.apache.openejb</groupId> - <artifactId>javaee-api</artifactId> - <scope>runtime</scope> - </dependency> - <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <scope>compile</scope> @@ -116,7 +96,11 @@ <artifactId>javax.servlet-api</artifactId> <scope>provided</scope> </dependency> - + <dependency> + <groupId>org.apache.openejb</groupId> + <artifactId>javaee-api</artifactId> + <scope>runtime</scope> + </dependency> </dependencies> <build> @@ -160,7 +144,6 @@ <manifest> <addClasspath>true</addClasspath> <classpathPrefix>./lib/</classpathPrefix> - <mainClass>org.chorem.lima.LimaServer</mainClass> </manifest> </archive> </configuration> @@ -211,9 +194,9 @@ <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> - <finalName>lima-server-${project.version}</finalName> + <finalName>lima-web-${project.version}</finalName> <descriptors> - <descriptor>src/main/assembly/bin.xml</descriptor> + <descriptor>../lima-web/src/main/assembly/bin.xml</descriptor> </descriptors> <attach>false</attach> </configuration> @@ -267,5 +250,4 @@ </profile> </profiles> - </project> diff --git a/lima-web/src/main/assembly/bin.xml b/lima-web/src/main/assembly/bin.xml index 9baff9f..4091fad 100644 --- a/lima-web/src/main/assembly/bin.xml +++ b/lima-web/src/main/assembly/bin.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- #%L - Lima :: business + Lima :: Swing %% Copyright (C) 2008 - 2010 CodeLutin %% @@ -22,8 +22,8 @@ --> <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> <id>bin</id> <formats> <format>zip</format> @@ -32,11 +32,7 @@ <files> <file> <source>target/${project.build.finalName}.${project.packaging}</source> - <destName>lima-server.${project.packaging}</destName> - </file> - <file> - <source>src/main/assembly/lima-server</source> - <fileMode>0755</fileMode> + <destName>lima.${project.packaging}</destName> </file> </files> <fileSets> @@ -57,45 +53,17 @@ </includes> </fileSet> <fileSet> - <directory>src/main/resources/reports</directory> - <outputDirectory>reports</outputDirectory> + <directory>src/main/resources/i18n</directory> + <outputDirectory>i18n</outputDirectory> <includes> - <include>*.pdf</include> + <include>*.properties</include> </includes> </fileSet> <fileSet> - <directory>src/main/jasperreports/accounts</directory> - <outputDirectory>jasperreports</outputDirectory> - <includes> - <include>*.jrxml</include> - </includes> - </fileSet> - <fileSet> - <directory>src/main/jasperreports/balance</directory> - <outputDirectory>jasperreports</outputDirectory> - <includes> - <include>*.jrxml</include> - </includes> - </fileSet> - <fileSet> - <directory>src/main/jasperreports/entryBook</directory> - <outputDirectory>jasperreports</outputDirectory> - <includes> - <include>*.jrxml</include> - </includes> - </fileSet> - <fileSet> - <directory>src/main/jasperreports/generalEntryBook</directory> - <outputDirectory>jasperreports</outputDirectory> - <includes> - <include>*.jrxml</include> - </includes> - </fileSet> - <fileSet> - <directory>src/main/jasperreports/ledger</directory> - <outputDirectory>jasperreports</outputDirectory> + <directory>target</directory> + <outputDirectory>i18n</outputDirectory> <includes> - <include>*.jrxml</include> + <include>lima-i18n.csv</include> </includes> </fileSet> </fileSets> diff --git a/lima-business/src/test/resources/log4j.properties b/lima-web/src/main/resources/log4j.properties similarity index 100% copy from lima-business/src/test/resources/log4j.properties copy to lima-web/src/main/resources/log4j.properties diff --git a/pom.xml b/pom.xml index 1b8ffd5..9ad8490 100644 --- a/pom.xml +++ b/pom.xml @@ -392,7 +392,7 @@ <groupId>org.apache.openejb</groupId> <artifactId>javaee-api</artifactId> <version>${openejbJavaeeApiVersion}</version> - <scope>runtime</scope> + <scope>provided</scope> </dependency> <dependency> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository lima. See http://git.chorem.org/lima.git commit 30ac42d3b006117d6f2310c7fc16b6dd30818556 Author: dcosse <cosse@codelutin.com> Date: Fri Mar 6 19:04:15 2015 +0100 refs #1190 uncomment necessary code --- .../src/main/java/org/chorem/lima/service/LimaServiceFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java b/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java index 9fa26eb..5fcaa30 100644 --- a/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java +++ b/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java @@ -91,7 +91,7 @@ public class LimaServiceFactory { // as of openejb 4.6, bean-finder-shaded 3.15 doesn't scan full classpath anymore by default // see http://list.chorem.org/pipermail/lima-devel/2014-May/000154.html for more details - //System.setProperty("xbean.finder.use.get-resources", "true"); + System.setProperty("xbean.finder.use.get-resources", "true"); // see http://openejb.apache.org/embedded-configuration.html // http://openejb.apache.org/properties-listing.html -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository lima. See http://git.chorem.org/lima.git commit 32911a4b3050cde9d5f7a76b4a9cbf6f17f6ca20 Author: dcosse <cosse@codelutin.com> Date: Mon Mar 9 17:55:57 2015 +0100 refs #1190 Le mode client serveur est fonctionnel --- .../src/main/java/org/chorem/lima/LimaServer.java | 1 - .../chorem/lima/service/LimaServiceFactory.java | 20 +++++-- lima-swing/pom.xml | 6 -- .../chorem/lima/ui/account/AccountViewHandler.java | 44 +++++++------- lima-swing/src/main/resources/log4j.properties | 6 +- .../java/org/chorem/lima/ui/AbstractLimaTest.java | 1 - lima-web/pom.xml | 32 ---------- lima-web/src/main/assembly/bin.xml | 70 ---------------------- pom.xml | 1 + 9 files changed, 43 insertions(+), 138 deletions(-) diff --git a/lima-business/src/main/java/org/chorem/lima/LimaServer.java b/lima-business/src/main/java/org/chorem/lima/LimaServer.java index bf1d6dd..3df474e 100644 --- a/lima-business/src/main/java/org/chorem/lima/LimaServer.java +++ b/lima-business/src/main/java/org/chorem/lima/LimaServer.java @@ -53,7 +53,6 @@ public class LimaServer { Properties properties = new Properties(); properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, LocalInitialContextFactory.class.getName()); properties.setProperty("openejb.embedded.remotable", "true"); - properties.setProperty("openejb.deployments.classpath.ear", "false"); // Uncomment these properties to change the defaults //properties.setProperty("ejbd.port", "4202"); properties.setProperty("ejbd.bind", "0.0.0.0"); diff --git a/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java b/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java index 5fcaa30..b012514 100644 --- a/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java +++ b/lima-business/src/main/java/org/chorem/lima/service/LimaServiceFactory.java @@ -30,6 +30,8 @@ import org.chorem.lima.business.ServiceMonitorable; import org.nuiton.config.ApplicationConfig; import javax.ejb.embeddable.EJBContainer; +import javax.naming.Context; +import javax.naming.InitialContext; import javax.naming.NamingException; import java.io.IOException; import java.io.InputStream; @@ -54,8 +56,11 @@ public class LimaServiceFactory { /** EJB container. */ protected static EJBContainer container; - /** EJB service namespace. */ - protected static final String NAMESPACE = "java:global/lima/"; + /** Context where to look for bean*/ + protected static Context context; + + /** Suffix to add to interface class name to be able to find out bean. */ + protected static final String EJB_SUFFIX = "Remote"; /** * Init openejb container. @@ -96,7 +101,13 @@ public class LimaServiceFactory { // see http://openejb.apache.org/embedded-configuration.html // http://openejb.apache.org/properties-listing.html // for embedded configuration. - container = EJBContainer.createEJBContainer(props); + try { + context = new InitialContext(props); + } catch (NamingException e) { + if (log.isErrorEnabled()) { + log.error("Can't get context", e); + } + } } public static <M> M getService(Class<M> serviceMonitorableClass) { @@ -164,7 +175,8 @@ public class LimaServiceFactory { serviceName += "Impl"; } try { - ejbHome = container.getContext().lookup(NAMESPACE + serviceName); + // TODO DCossé 09/03/15 necessary as it is done as now but not sure it's good practice. + ejbHome = context.lookup(serviceName + EJB_SUFFIX); } catch (NamingException eee) { throw new RuntimeException( "Can't lookup for service : " + serviceName, eee); diff --git a/lima-swing/pom.xml b/lima-swing/pom.xml index d3e2180..328678a 100644 --- a/lima-swing/pom.xml +++ b/lima-swing/pom.xml @@ -52,12 +52,6 @@ </dependency> <dependency> <groupId>${project.groupId}</groupId> - <artifactId>lima-business</artifactId> - <version>${project.version}</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> <artifactId>lima-web</artifactId> <version>${project.version}</version> <scope>compile</scope> diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java index 54e3122..1ab2851 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java @@ -347,29 +347,31 @@ public class AccountViewHandler implements ServiceListener { // get selected account int selectedRow = treeTable.getSelectedRow(); TreePath treePath = treeTable.getPathForRow(selectedRow); - TreeTableNode lastPathComponent = (TreeTableNode) treePath.getLastPathComponent(); - Account selectedAccount = (Account)lastPathComponent.getUserObject(); - - // display edit form - final UpdateAccountForm accountForm = new UpdateAccountForm(view); - - InputMap inputMap = accountForm.getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); - ActionMap actionMap = accountForm.getRootPane().getActionMap(); - String binding = "dispose"; - inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), binding); - actionMap.put(binding, new AbstractAction() { - private static final long serialVersionUID = -2123621815991309210L; - - @Override - public void actionPerformed(ActionEvent e) { - accountForm.dispose(); - } - }); + if (treePath != null) { + TreeTableNode lastPathComponent = (TreeTableNode) treePath.getLastPathComponent(); + Account selectedAccount = (Account)lastPathComponent.getUserObject(); + + // display edit form + final UpdateAccountForm accountForm = new UpdateAccountForm(view); + + InputMap inputMap = accountForm.getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); + ActionMap actionMap = accountForm.getRootPane().getActionMap(); + String binding = "dispose"; + inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), binding); + actionMap.put(binding, new AbstractAction() { + private static final long serialVersionUID = -2123621815991309210L; + + @Override + public void actionPerformed(ActionEvent e) { + accountForm.dispose(); + } + }); - accountForm.setAccount(selectedAccount); - accountForm.setLocationRelativeTo(view); - accountForm.setVisible(true); + accountForm.setAccount(selectedAccount); + accountForm.setLocationRelativeTo(view); + accountForm.setVisible(true); + } } /** diff --git a/lima-swing/src/main/resources/log4j.properties b/lima-swing/src/main/resources/log4j.properties index 0037d9a..4581abe 100644 --- a/lima-swing/src/main/resources/log4j.properties +++ b/lima-swing/src/main/resources/log4j.properties @@ -38,9 +38,9 @@ openejb.logger.external=true log4j.category.OpenEJB.options=warn log4j.category.OpenEJB=warn log4j.category.OpenEJB.server=info -log4j.category.OpenEJB.startup=warn -log4j.category.OpenEJB.startup.service=warn -log4j.category.OpenEJB.startup.config=warn +log4j.category.OpenEJB.startup=info +log4j.category.OpenEJB.startup.service=info +log4j.category.OpenEJB.startup.config=info log4j.category.OpenEJB.hsql=info log4j.category.CORBA-Adapter=info log4j.category.Transaction=warn diff --git a/lima-swing/src/test/java/org/chorem/lima/ui/AbstractLimaTest.java b/lima-swing/src/test/java/org/chorem/lima/ui/AbstractLimaTest.java index 5aef5a8..8a57215 100644 --- a/lima-swing/src/test/java/org/chorem/lima/ui/AbstractLimaTest.java +++ b/lima-swing/src/test/java/org/chorem/lima/ui/AbstractLimaTest.java @@ -1,7 +1,6 @@ /* * #%L * $Id: AbstractLimaTest.java 3929 2014-09-29 16:26:31Z dcosse $ - * $HeadURL: http://svn.chorem.org/lima/trunk/lima-business/src/test/java/org/chorem/lima... $ * %% * Copyright (C) 2011 - 2012 Codelutin, Chatellier Eric * %% diff --git a/lima-web/pom.xml b/lima-web/pom.xml index 847663a..75df248 100644 --- a/lima-web/pom.xml +++ b/lima-web/pom.xml @@ -182,38 +182,6 @@ <profiles> <profile> - <id>assembly-profile</id> - <activation> - <property> - <name>performRelease</name> - <value>true</value> - </property> - </activation> - <build> - <plugins> - <plugin> - <artifactId>maven-assembly-plugin</artifactId> - <configuration> - <finalName>lima-web-${project.version}</finalName> - <descriptors> - <descriptor>../lima-web/src/main/assembly/bin.xml</descriptor> - </descriptors> - <attach>false</attach> - </configuration> - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>single</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - - <profile> <id>reporting</id> <activation> <property> diff --git a/lima-web/src/main/assembly/bin.xml b/lima-web/src/main/assembly/bin.xml deleted file mode 100644 index 4091fad..0000000 --- a/lima-web/src/main/assembly/bin.xml +++ /dev/null @@ -1,70 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - #%L - Lima :: Swing - %% - 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% - --> - -<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> - <id>bin</id> - <formats> - <format>zip</format> - </formats> - - <files> - <file> - <source>target/${project.build.finalName}.${project.packaging}</source> - <destName>lima.${project.packaging}</destName> - </file> - </files> - <fileSets> - <fileSet> - <directory>target/lib</directory> - <outputDirectory>lib</outputDirectory> - <includes> - <include>*.jar</include> - </includes> - <excludes> - <exclude>junit-*.jar</exclude> - </excludes> - </fileSet> - <fileSet> - <includes> - <include>README*</include> - <include>LICENSE*</include> - </includes> - </fileSet> - <fileSet> - <directory>src/main/resources/i18n</directory> - <outputDirectory>i18n</outputDirectory> - <includes> - <include>*.properties</include> - </includes> - </fileSet> - <fileSet> - <directory>target</directory> - <outputDirectory>i18n</outputDirectory> - <includes> - <include>lima-i18n.csv</include> - </includes> - </fileSet> - </fileSets> -</assembly> diff --git a/pom.xml b/pom.xml index 9ad8490..ba7966d 100644 --- a/pom.xml +++ b/pom.xml @@ -163,6 +163,7 @@ <!-- compiler configuration --> <javaVersion>1.7</javaVersion> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <!--TODO remove this when IDEA won't ask to change jdk level at each pom modification--> <maven.compiler.source>${javaVersion}</maven.compiler.source> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository lima. See http://git.chorem.org/lima.git commit 139b85e31afa3e25e5e1427be7469df2013a6dc8 Author: Arnaud Thimel <thimel@codelutin.com> Date: Thu Mar 12 14:08:27 2015 +0100 refs #1190 Revue de code : -renommage LimaServiceConfig en LimaBusinessConfig ; -correction des Lima*Config pour la définition du nom de la propriété de conf, ainsi que le nom du fichier de conf par défaut (lima-config.properties) --- lima-business/README.txt | 12 ++++--- .../src/main/java/org/chorem/lima/LimaServer.java | 8 ++++- ...aServiceConfig.java => LimaBusinessConfig.java} | 26 +++++++------- .../org/chorem/lima/business/LimaInterceptor.java | 2 +- .../lima/business/ejb/AccountServiceImpl.java | 8 ++--- .../lima/business/ejb/EntryBookServiceImpl.java | 7 ++-- .../business/ejb/FinancialPeriodServiceImpl.java | 4 +-- .../ejb/FinancialTransactionServiceImpl.java | 16 ++++----- .../lima/business/ejb/FiscalPeriodServiceImpl.java | 8 ++--- .../lima/business/ejb/OptionsServiceImpl.java | 40 +++++++++++----------- .../lima/business/utils/BigDecimalToString.java | 4 +-- .../org/chorem/lima/business/AbstractLimaTest.java | 6 ++-- .../org/chorem/lima/business/LimaMiscTest.java | 4 +-- .../org/chorem/lima/business/LimaTestsConfig.java | 4 +-- .../accountingrules/AccountServiceRuleFrTest.java | 8 ++--- .../EntryBookServiceRuleFrTest.java | 8 ++--- .../FinancialPeriodServiceRuleFrTest.java | 8 ++--- .../FinancialTransactionServiceRuleFrTest.java | 8 ++--- .../FiscalPeriodServiceRuleFrTest.java | 8 ++--- .../accountingrules/ImportServiceRuleFrTest.java | 8 ++--- .../accountingrules/ReportServiceRuleFrTest.java | 8 ++--- .../src/main/java/org/chorem/lima/LimaMain.java | 4 +-- .../chorem/lima/LimaSwingApplicationContext.java | 4 +-- .../main/java/org/chorem/lima/LimaSwingConfig.java | 6 ++-- .../java/org/chorem/lima/ui/AbstractLimaTest.java | 8 ++--- .../java/org/chorem/lima/ui/LimaTestsConfig.java | 6 ++-- .../org/chorem/lima/web/action/ReportBuilder.java | 4 +-- .../chorem/lima/web/service/DocumentService.java | 4 +-- .../chorem/lima/web/service/HttpServerService.java | 14 ++++---- 29 files changed, 129 insertions(+), 126 deletions(-) diff --git a/lima-business/README.txt b/lima-business/README.txt index 5971651..ea7d020 100644 --- a/lima-business/README.txt +++ b/lima-business/README.txt @@ -1,6 +1,8 @@ -Configurer le client pour se connecter au serveur via le fichier de configuration : -UNIX LIKE:$HOME/.config/lima.properties -7 et +: C:\Users\USER_NAME\AppData\Roaming\lima.properties +Pour configurer le client pour se connecter au serveur, éditez le fichier de configuration (lima-config.properties) qui se trouve ici : +Unix-like : $HOME/.config/lima-config.properties +Windows 7 et + : C:\Users\USER_NAME\AppData\Roaming\lima-config.properties +Mac OS : $HOME/Library/Application Support/lima-config.properties -java.naming.factory.initial=org.apache.openejb.client.RemoteInitialContextFactory -java.naming.provider.url=ejbd://192.168.99.9:4201 \ No newline at end of file +Ajoutez les 2 lignes suivantes en remplaçant l'IP par celle du serveur : + java.naming.factory.initial=org.apache.openejb.client.RemoteInitialContextFactory + java.naming.provider.url=ejbd://192.168.99.9:4201 diff --git a/lima-business/src/main/java/org/chorem/lima/LimaServer.java b/lima-business/src/main/java/org/chorem/lima/LimaServer.java index 3df474e..ed07e6f 100644 --- a/lima-business/src/main/java/org/chorem/lima/LimaServer.java +++ b/lima-business/src/main/java/org/chorem/lima/LimaServer.java @@ -22,6 +22,8 @@ package org.chorem.lima; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.openejb.core.LocalInitialContextFactory; import javax.naming.Context; @@ -42,6 +44,8 @@ import java.util.Properties; */ public class LimaServer { + private static final Log log = LogFactory.getLog(LimaServer.class); + /** * Lima server. * @@ -71,6 +75,8 @@ public class LimaServer { } } - System.out.println("Server shutdown"); + if (log.isInfoEnabled()) { + log.info("LimaServer shutdown"); + } } } diff --git a/lima-business/src/main/java/org/chorem/lima/business/LimaServiceConfig.java b/lima-business/src/main/java/org/chorem/lima/business/LimaBusinessConfig.java similarity index 96% rename from lima-business/src/main/java/org/chorem/lima/business/LimaServiceConfig.java rename to lima-business/src/main/java/org/chorem/lima/business/LimaBusinessConfig.java index bca00dd..f255180 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/LimaServiceConfig.java +++ b/lima-business/src/main/java/org/chorem/lima/business/LimaBusinessConfig.java @@ -57,23 +57,21 @@ import static org.nuiton.i18n.I18n.t; * Last update : $Date$ * By : $Author$ */ -public class LimaServiceConfig { +public class LimaBusinessConfig { - protected static final Log log = LogFactory.getLog(LimaServiceConfig.class); + protected static final Log log = LogFactory.getLog(LimaBusinessConfig.class); protected static AccountingRules accountingRules; - protected static final String CONFIG_FILE_NAME = "lima.properties"; - protected ApplicationConfig config; protected Properties rootContextProperties; - protected static volatile LimaServiceConfig instance; + protected static volatile LimaBusinessConfig instance; - private LimaServiceConfig(String configFileName) { + private LimaBusinessConfig(String configFileName) { try { - ApplicationConfig defaultConfig = new ApplicationConfig(ServiceConfigOption.CONFIG_FILE.defaultValue); + ApplicationConfig defaultConfig = new ApplicationConfig(ServiceConfigOption.CONFIG_FILE.getDefaultValue()); defaultConfig.loadDefaultOptions(ServiceConfigOption.values()); defaultConfig.parse(); @@ -121,16 +119,16 @@ public class LimaServiceConfig { this.rootContextProperties = rootContextProperties; } - public synchronized static LimaServiceConfig getInstance(String configFileName) { + public synchronized static LimaBusinessConfig getInstance(String configFileName) { if (instance == null) { - instance= new LimaServiceConfig(configFileName); + instance= new LimaBusinessConfig(configFileName); } return instance; } - public static LimaServiceConfig getInstance() { + public static LimaBusinessConfig getInstance() { if (instance == null) { - instance= new LimaServiceConfig(null); + instance= new LimaBusinessConfig(null); } return instance; } @@ -187,7 +185,7 @@ public class LimaServiceConfig { } public void setConfigFile(String configFile) { - LimaServiceConfig.getInstance().config.setOption(ServiceConfigOption.CONFIG_FILE.key, configFile); + LimaBusinessConfig.getInstance().config.setOption(ServiceConfigOption.CONFIG_FILE.key, configFile); } public String getApplicationVersion() { @@ -195,7 +193,7 @@ public class LimaServiceConfig { } public void setAccountingRule(String accountingRule) { - LimaServiceConfig.getInstance().config.setOption(ServiceConfigOption.RULES_NATIONALTY.key, accountingRule); + LimaBusinessConfig.getInstance().config.setOption(ServiceConfigOption.RULES_NATIONALTY.key, accountingRule); // clear cache loadAccountingRules(); } @@ -505,7 +503,7 @@ public class LimaServiceConfig { */ public enum ServiceConfigOption implements ConfigOptionDef { - CONFIG_FILE(CONFIG_FILE_NAME, n("lima.configFileName.description"), "lima.properties", String.class, true, true), + CONFIG_FILE(ApplicationConfig.CONFIG_FILE_NAME, n("lima.configFileName.description"), "lima-config.properties", String.class, true, true), APPLICATION_VERSION("application.version", n("application.version"), null, String.class, false, false), DATA_DIR("lima.data.dir", n("lima.config.data.dir.description"), "${user.home}/.lima", File.class, false, false), diff --git a/lima-business/src/main/java/org/chorem/lima/business/LimaInterceptor.java b/lima-business/src/main/java/org/chorem/lima/business/LimaInterceptor.java index 2060b46..8681c41 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/LimaInterceptor.java +++ b/lima-business/src/main/java/org/chorem/lima/business/LimaInterceptor.java @@ -80,7 +80,7 @@ public class LimaInterceptor { } LimaCallaoTopiaApplicationContext rootContext = TopiaApplicationContextCache.getContext( - LimaServiceConfig.getRootContextProperties(), + LimaBusinessConfig.getRootContextProperties(), LimaConfigurationHelper.getCreateTopiaContextFunction()); LimaCallaoTopiaPersistenceContext tx = rootContext.newPersistenceContext(); diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java index f31c240..fa33638 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/AccountServiceImpl.java @@ -24,7 +24,7 @@ package org.chorem.lima.business.ejb; import org.apache.commons.lang.StringUtils; import org.chorem.lima.business.AccountingRules; -import org.chorem.lima.business.LimaServiceConfig; +import org.chorem.lima.business.LimaBusinessConfig; import org.chorem.lima.business.api.AccountService; import org.chorem.lima.business.exceptions.AlreadyExistAccountException; import org.chorem.lima.business.exceptions.InvalidAccountNumberException; @@ -107,7 +107,7 @@ public class AccountServiceImpl extends AbstractLimaService implements AccountSe protected Account createNewAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException, NotAllowedLabelException { // check rules before create the account - AccountingRules accountingRules = LimaServiceConfig.getInstance().getAccountingRules(); + AccountingRules accountingRules = LimaBusinessConfig.getInstance().getAccountingRules(); accountingRules.createAccountRules(account); // force uppercase account number @@ -191,7 +191,7 @@ public class AccountServiceImpl extends AbstractLimaService implements AccountSe @Override public void removeAccount(Account account) throws UsedAccountException { - AccountingRules accountingRules = LimaServiceConfig.getInstance().getAccountingRules(); + AccountingRules accountingRules = LimaBusinessConfig.getInstance().getAccountingRules(); // Check rules for account if have entries accountingRules.removeAccountRules(account); @@ -214,7 +214,7 @@ public class AccountServiceImpl extends AbstractLimaService implements AccountSe @Override public Account updateAccount(Account account) throws InvalidAccountNumberException, NotNumberAccountNumberException { - AccountingRules accountingRules = LimaServiceConfig.getInstance().getAccountingRules(); + AccountingRules accountingRules = LimaBusinessConfig.getInstance().getAccountingRules(); // DAO AccountTopiaDao accountDao = getDaoHelper().getAccountDao(); diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java index 048ffa7..fbdff26 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/EntryBookServiceImpl.java @@ -23,9 +23,9 @@ package org.chorem.lima.business.ejb; import com.google.common.collect.Lists; -import org.apache.commons.lang3.StringUtils; + import org.chorem.lima.business.AccountingRules; -import org.chorem.lima.business.LimaServiceConfig; +import org.chorem.lima.business.LimaBusinessConfig; import org.chorem.lima.business.api.EntryBookService; import org.chorem.lima.business.exceptions.AlreadyExistEntryBookException; import org.chorem.lima.business.exceptions.UsedEntryBookException; @@ -34,7 +34,6 @@ import org.chorem.lima.entity.ClosedPeriodicEntryBookImpl; import org.chorem.lima.entity.ClosedPeriodicEntryBookTopiaDao; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.EntryBookTopiaDao; -import org.chorem.lima.entity.EntryTopiaDao; import org.chorem.lima.entity.FinancialPeriod; import org.chorem.lima.entity.FinancialPeriodTopiaDao; import org.nuiton.util.beans.Binder; @@ -149,7 +148,7 @@ public class EntryBookServiceImpl extends AbstractLimaService implements EntryBo public void removeEntryBook(EntryBook entryBook) throws UsedEntryBookException { // check rule - AccountingRules accountingRules = LimaServiceConfig.getInstance().getAccountingRules(); + AccountingRules accountingRules = LimaBusinessConfig.getInstance().getAccountingRules(); accountingRules.removeEntryBookRules(entryBook); // re-attach to current transaction diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java index 6767275..8e62747 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialPeriodServiceImpl.java @@ -23,7 +23,7 @@ package org.chorem.lima.business.ejb; import org.chorem.lima.business.AccountingRules; -import org.chorem.lima.business.LimaServiceConfig; +import org.chorem.lima.business.LimaBusinessConfig; import org.chorem.lima.business.api.FinancialPeriodService; import org.chorem.lima.business.exceptions.NotLockedClosedPeriodicEntryBooksException; import org.chorem.lima.business.exceptions.UnbalancedFinancialTransactionsException; @@ -92,7 +92,7 @@ public class FinancialPeriodServiceImpl extends AbstractLimaService implements F @Override public ClosedPeriodicEntryBook blockClosedPeriodicEntryBook(ClosedPeriodicEntryBook closedPeriodicEntryBook) throws UnbalancedFinancialTransactionsException, UnfilledEntriesException, WithoutEntryBookFinancialTransactionsException, NotLockedClosedPeriodicEntryBooksException { - AccountingRules accountingRules = LimaServiceConfig.getInstance().getAccountingRules(); + AccountingRules accountingRules = LimaBusinessConfig.getInstance().getAccountingRules(); ClosedPeriodicEntryBook result; // check rules before create the account diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java index 9e82fb4..73a5959 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/FinancialTransactionServiceImpl.java @@ -31,7 +31,7 @@ import org.apache.commons.logging.LogFactory; import org.chorem.lima.beans.FinancialTransactionCondition; import org.chorem.lima.beans.LetteringFilter; import org.chorem.lima.business.AccountingRules; -import org.chorem.lima.business.LimaServiceConfig; +import org.chorem.lima.business.LimaBusinessConfig; import org.chorem.lima.business.api.AccountService; import org.chorem.lima.business.api.FinancialTransactionService; import org.chorem.lima.business.exceptions.AfterLastFiscalPeriodException; @@ -111,7 +111,7 @@ public class FinancialTransactionServiceImpl extends AbstractLimaService impleme public FinancialTransaction createFinancialTransaction(FinancialTransaction financialtransaction, Boolean validAccountingRules) throws LockedFinancialPeriodException, LockedEntryBookException { - AccountingRules accountingRules = LimaServiceConfig.getInstance().getAccountingRules(); + AccountingRules accountingRules = LimaBusinessConfig.getInstance().getAccountingRules(); if (validAccountingRules) { //check if the financial period is blocked @@ -321,7 +321,7 @@ public class FinancialTransactionServiceImpl extends AbstractLimaService impleme } - AccountingRules accountingRules = LimaServiceConfig.getInstance().getAccountingRules(); + AccountingRules accountingRules = LimaBusinessConfig.getInstance().getAccountingRules(); //check rules accountingRules.addLetter(oldEntries); @@ -489,7 +489,7 @@ public class FinancialTransactionServiceImpl extends AbstractLimaService impleme public void updateFinancialTransaction(FinancialTransaction financialTransaction) throws AfterLastFiscalPeriodException, BeforeFirstFiscalPeriodException, LockedFinancialPeriodException, LockedEntryBookException { - AccountingRules accountingRules = LimaServiceConfig.getInstance().getAccountingRules(); + AccountingRules accountingRules = LimaBusinessConfig.getInstance().getAccountingRules(); FinancialTransactionTopiaDao transactionTopiaDao = getDaoHelper().getFinancialTransactionDao(); FinancialTransaction financialTransactionOld = transactionTopiaDao.forTopiaIdEquals(financialTransaction.getTopiaId()).findUnique(); @@ -510,7 +510,7 @@ public class FinancialTransactionServiceImpl extends AbstractLimaService impleme throws LockedFinancialPeriodException, LockedEntryBookException { // check if the financial period is blocked - AccountingRules accountingRules = LimaServiceConfig.getInstance().getAccountingRules(); + AccountingRules accountingRules = LimaBusinessConfig.getInstance().getAccountingRules(); accountingRules.checkFinancialPeriodBlockedWithFinancialTransaction(financialTransaction); FinancialTransactionTopiaDao transactionTopiaDao = getDaoHelper().getFinancialTransactionDao(); @@ -527,7 +527,7 @@ public class FinancialTransactionServiceImpl extends AbstractLimaService impleme @Override public Entry createEntry(Entry entry) throws LockedFinancialPeriodException, LockedEntryBookException { - AccountingRules accountingRules = LimaServiceConfig.getInstance().getAccountingRules(); + AccountingRules accountingRules = LimaBusinessConfig.getInstance().getAccountingRules(); //check if the financial period is blocked accountingRules.checkFinancialPeriodBlockedWithFinancialTransaction( @@ -545,7 +545,7 @@ public class FinancialTransactionServiceImpl extends AbstractLimaService impleme @Override public void updateEntry(Entry entry) throws LockedEntryBookException { - AccountingRules accountingRules = LimaServiceConfig.getInstance().getAccountingRules(); + AccountingRules accountingRules = LimaBusinessConfig.getInstance().getAccountingRules(); EntryTopiaDao entryTopiaDao = getDaoHelper().getEntryDao(); @@ -567,7 +567,7 @@ public class FinancialTransactionServiceImpl extends AbstractLimaService impleme @Override public void removeEntry(Entry entry) throws LockedFinancialPeriodException, LockedEntryBookException { - AccountingRules accountingRules = LimaServiceConfig.getInstance().getAccountingRules(); + AccountingRules accountingRules = LimaBusinessConfig.getInstance().getAccountingRules(); FinancialTransaction financialTransaction = entry.getFinancialTransaction(); diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java index 5699b98..840ff7d 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/FiscalPeriodServiceImpl.java @@ -27,7 +27,7 @@ import org.apache.commons.lang3.time.DateUtils; import org.chorem.lima.beans.BalanceTrial; import org.chorem.lima.beans.ReportsDatas; import org.chorem.lima.business.AccountingRules; -import org.chorem.lima.business.LimaServiceConfig; +import org.chorem.lima.business.LimaBusinessConfig; import org.chorem.lima.business.api.AccountService; import org.chorem.lima.business.api.EntryBookService; import org.chorem.lima.business.api.FinancialPeriodService; @@ -112,7 +112,7 @@ public class FiscalPeriodServiceImpl extends AbstractLimaService implements Fisc FiscalPeriodTopiaDao fiscalPeriodTopiaDao = getDaoHelper().getFiscalPeriodDao(); - AccountingRules accountingRules = LimaServiceConfig.getInstance().getAccountingRules(); + AccountingRules accountingRules = LimaBusinessConfig.getInstance().getAccountingRules(); // fix begin date at midnight and end date at 23:59:59.999 Date beginDate = fiscalPeriod.getBeginDate(); @@ -233,7 +233,7 @@ public class FiscalPeriodServiceImpl extends AbstractLimaService implements Fisc public FiscalPeriod blockFiscalPeriod(FiscalPeriod fiscalPeriod) throws AlreadyLockedFiscalPeriodException, LastUnlockedFiscalPeriodException { - AccountingRules accountingRules = LimaServiceConfig.getInstance().getAccountingRules(); + AccountingRules accountingRules = LimaBusinessConfig.getInstance().getAccountingRules(); if (fiscalPeriod.isLocked()) { throw new AlreadyLockedFiscalPeriodException(fiscalPeriod); @@ -494,7 +494,7 @@ public class FiscalPeriodServiceImpl extends AbstractLimaService implements Fisc @Override public void deleteFiscalPeriod(FiscalPeriod fiscalPeriod) throws NoEmptyFiscalPeriodException { - AccountingRules accountingRules = LimaServiceConfig.getInstance().getAccountingRules(); + AccountingRules accountingRules = LimaBusinessConfig.getInstance().getAccountingRules(); //get entities with TopiaDao FiscalPeriodTopiaDao fiscalPeriodTopiaDao = getDaoHelper().getFiscalPeriodDao(); diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/OptionsServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/OptionsServiceImpl.java index f29706a..00e4204 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/OptionsServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/OptionsServiceImpl.java @@ -21,7 +21,7 @@ */ package org.chorem.lima.business.ejb; -import org.chorem.lima.business.LimaServiceConfig; +import org.chorem.lima.business.LimaBusinessConfig; import org.chorem.lima.business.api.OptionsService; import org.chorem.lima.business.utils.BigDecimalToString; @@ -37,8 +37,8 @@ public class OptionsServiceImpl extends AbstractLimaService implements OptionsSe protected String vatPDFUrl; public OptionsServiceImpl() { - scale = LimaServiceConfig.getInstance().getScale(); - vatPDFUrl = LimaServiceConfig.getInstance().getVatPDFUrl(); + scale = LimaBusinessConfig.getInstance().getScale(); + vatPDFUrl = LimaBusinessConfig.getInstance().getVatPDFUrl(); BigDecimalToString.generateDecimalFormat(); } @@ -49,86 +49,86 @@ public class OptionsServiceImpl extends AbstractLimaService implements OptionsSe @Override public void setScale(String scale) { - LimaServiceConfig.getInstance().setScale(scale); + LimaBusinessConfig.getInstance().setScale(scale); BigDecimalToString.generateDecimalFormat(); } @Override public void setThousandSeparator(String thousandSeparator) { - LimaServiceConfig.getInstance().setThousandSeparator(thousandSeparator); + LimaBusinessConfig.getInstance().setThousandSeparator(thousandSeparator); BigDecimalToString.generateDecimalFormat(); } @Override public void setCurrency(boolean currency) { - LimaServiceConfig.getInstance().setCurrency(Boolean.toString(currency)); + LimaBusinessConfig.getInstance().setCurrency(Boolean.toString(currency)); BigDecimalToString.generateDecimalFormat(); } @Override public void setDecimalSeparator(String decimalSeparator) { - LimaServiceConfig.getInstance().setDecimalSeparator(decimalSeparator); + LimaBusinessConfig.getInstance().setDecimalSeparator(decimalSeparator); BigDecimalToString.generateDecimalFormat(); } @Override public void setReportsDir(String path) { - LimaServiceConfig.getInstance().setReportsModelDir(path); + LimaBusinessConfig.getInstance().setReportsModelDir(path); } @Override public void setAccountReportPath(String path) { - LimaServiceConfig.getInstance().setAccountReportModelPath(path); + LimaBusinessConfig.getInstance().setAccountReportModelPath(path); } @Override public void setBalanceReportPath(String path) { - LimaServiceConfig.getInstance().setBalanceDocumentReportModelPath(path); + LimaBusinessConfig.getInstance().setBalanceDocumentReportModelPath(path); } @Override public void setBalanceReportAccountReportPath(String path) { - LimaServiceConfig.getInstance().setBalanceAccountReportModelPath(path); + LimaBusinessConfig.getInstance().setBalanceAccountReportModelPath(path); } @Override public void setBalanceSubAccountReportPath(String path) { - LimaServiceConfig.getInstance().setBalanceSubAccountReportModelPath(path); + LimaBusinessConfig.getInstance().setBalanceSubAccountReportModelPath(path); } @Override public void setGeneralEntryBookEntryBookMainReportPath(String path) { - LimaServiceConfig.getInstance().setGeneralEntryBookDocumentReportModelPath(path); + LimaBusinessConfig.getInstance().setGeneralEntryBookDocumentReportModelPath(path); } @Override public void setGeneralEntryBookPeriodReportPath(String path) { - LimaServiceConfig.getInstance().setGeneralEntryBookReportModelPath(path); + LimaBusinessConfig.getInstance().setGeneralEntryBookReportModelPath(path); } @Override public void setGeneralEntryBookGeneralEntryBookReportPath(String path) { - LimaServiceConfig.getInstance().setGeneralEntryBookEntryReportModelPath(path); + LimaBusinessConfig.getInstance().setGeneralEntryBookEntryReportModelPath(path); } @Override public void setProvisionalEntryBookEntryBookMainReportPath(String path) { - LimaServiceConfig.getInstance().setEntryBookDocumentReportModelPath(path); + LimaBusinessConfig.getInstance().setEntryBookDocumentReportModelPath(path); } @Override public void setProvisionalEntryBookEntryBookReportPath(String path) { - LimaServiceConfig.getInstance().setEntryBookEntryBookReportModelPath(path); + LimaBusinessConfig.getInstance().setEntryBookEntryBookReportModelPath(path); } @Override public void setProvisionalEntryBookFinancialPeriodReportPath(String path) { - LimaServiceConfig.getInstance().setEntryBookFinancialPeriodReportModelPath(path); + LimaBusinessConfig.getInstance().setEntryBookFinancialPeriodReportModelPath(path); } @Override public void setProvisionalEntryBookTransactionReportPath(String path) { - LimaServiceConfig.getInstance().setEntryBookTransactionReportModelPath(path); + LimaBusinessConfig.getInstance().setEntryBookTransactionReportModelPath(path); } public String getVatPDFUrl() { @@ -136,7 +136,7 @@ public class OptionsServiceImpl extends AbstractLimaService implements OptionsSe } public void setVatPDFUrl(String url) { - LimaServiceConfig.getInstance().setVatPDFUrl(url); + LimaBusinessConfig.getInstance().setVatPDFUrl(url); } } diff --git a/lima-business/src/main/java/org/chorem/lima/business/utils/BigDecimalToString.java b/lima-business/src/main/java/org/chorem/lima/business/utils/BigDecimalToString.java index 76f20c3..bf9ede1 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/utils/BigDecimalToString.java +++ b/lima-business/src/main/java/org/chorem/lima/business/utils/BigDecimalToString.java @@ -22,7 +22,7 @@ package org.chorem.lima.business.utils; * #L% */ -import org.chorem.lima.business.LimaServiceConfig; +import org.chorem.lima.business.LimaBusinessConfig; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; @@ -35,7 +35,7 @@ public class BigDecimalToString { protected static DecimalFormat decimalFormat; public static void generateDecimalFormat() { - LimaServiceConfig config = LimaServiceConfig.getInstance(); + LimaBusinessConfig config = LimaBusinessConfig.getInstance(); StringBuilder scale = new StringBuilder(); for (int i = 0; i < config.getScale(); i++) { scale.append("0"); diff --git a/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java b/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java index dab04ce..0578446 100644 --- a/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java +++ b/lima-business/src/test/java/org/chorem/lima/business/AbstractLimaTest.java @@ -130,7 +130,7 @@ public abstract class AbstractLimaTest { */ protected void initServices() throws IOException { if(accountService == null) { - LimaServiceFactory.initFactory(LimaServiceConfig.getInstance().getConfig()); + LimaServiceFactory.initFactory(LimaBusinessConfig.getInstance().getConfig()); accountService = LimaServiceFactory.getService(AccountService.class); entryBookService = LimaServiceFactory.getService(EntryBookService.class); financialPeriodService = LimaServiceFactory.getService(FinancialPeriodService.class); @@ -160,7 +160,7 @@ public abstract class AbstractLimaTest { Properties testProperties = new Properties(); // override somes String testDir = System.getProperty("java.io.tmpdir") + File.separator + "lima-business-" + UUID.randomUUID().toString(); - testProperties.setProperty(LimaServiceConfig.ServiceConfigOption.DATA_DIR.getKey(), testDir); + testProperties.setProperty(LimaBusinessConfig.ServiceConfigOption.DATA_DIR.getKey(), testDir); testProperties.setProperty(Environment.URL, "jdbc:h2:file:" + testDir + File.separator + "data"); testProperties.setProperty(Environment.CURRENT_SESSION_CONTEXT_CLASS, "thread"); testProperties.setProperty("topia.persistence.classes", LimaCallaoEntityEnum.getImplementationClassesAsString()); @@ -187,7 +187,7 @@ public abstract class AbstractLimaTest { } protected LimaCallaoTopiaApplicationContext createNewTestApplicationContext() { - Properties options = LimaServiceConfig.getInstance().getFlatOptions(); + Properties options = LimaBusinessConfig.getInstance().getFlatOptions(); LimaCallaoTopiaApplicationContext result = getTestApplicationContext(options); return result; } diff --git a/lima-business/src/test/java/org/chorem/lima/business/LimaMiscTest.java b/lima-business/src/test/java/org/chorem/lima/business/LimaMiscTest.java index 7f0b310..27ef0d5 100644 --- a/lima-business/src/test/java/org/chorem/lima/business/LimaMiscTest.java +++ b/lima-business/src/test/java/org/chorem/lima/business/LimaMiscTest.java @@ -41,7 +41,7 @@ public class LimaMiscTest extends AbstractLimaTest { protected Properties getTestConfiguration() { Properties config = super.getTestConfiguration(); - config.setProperty(LimaServiceConfig.ServiceConfigOption.RULES_NATIONALTY.getKey(), DefaultAccountingRules.class.getName()); + config.setProperty(LimaBusinessConfig.ServiceConfigOption.RULES_NATIONALTY.getKey(), DefaultAccountingRules.class.getName()); return config; } /** @@ -50,7 +50,7 @@ public class LimaMiscTest extends AbstractLimaTest { */ @Test public void testDefaultRule() { - Assert.assertTrue(LimaServiceConfig.getInstance().getAccountingRules() + Assert.assertTrue(LimaBusinessConfig.getInstance().getAccountingRules() instanceof DefaultAccountingRules); } diff --git a/lima-business/src/test/java/org/chorem/lima/business/LimaTestsConfig.java b/lima-business/src/test/java/org/chorem/lima/business/LimaTestsConfig.java index 9a78cef..a7f3277 100644 --- a/lima-business/src/test/java/org/chorem/lima/business/LimaTestsConfig.java +++ b/lima-business/src/test/java/org/chorem/lima/business/LimaTestsConfig.java @@ -38,7 +38,7 @@ import java.util.Properties; public class LimaTestsConfig { public LimaTestsConfig(String configFileName, Properties limaTestConfig) { - LimaServiceConfig instance = LimaServiceConfig.getInstance(configFileName); + LimaBusinessConfig instance = LimaBusinessConfig.getInstance(configFileName); Properties standardLimaConfig = instance.getConfig().getFlatOptions(); for (Map.Entry<Object, Object> entry : limaTestConfig.entrySet()) { @@ -49,7 +49,7 @@ public class LimaTestsConfig { setRootContextProperties(instance); } - protected void setRootContextProperties(LimaServiceConfig instance) { + protected void setRootContextProperties(LimaBusinessConfig instance) { Properties result = instance.getFlatOptions(); // add persistence classes from generated code result.setProperty(TopiaConfigurationConstants.CONFIG_PERSISTENCE_CLASSES, LimaCallaoEntityEnum.getImplementationClassesAsString()); diff --git a/lima-business/src/test/java/org/chorem/lima/business/accountingrules/AccountServiceRuleFrTest.java b/lima-business/src/test/java/org/chorem/lima/business/accountingrules/AccountServiceRuleFrTest.java index d39ef27..0364afa 100644 --- a/lima-business/src/test/java/org/chorem/lima/business/accountingrules/AccountServiceRuleFrTest.java +++ b/lima-business/src/test/java/org/chorem/lima/business/accountingrules/AccountServiceRuleFrTest.java @@ -23,7 +23,7 @@ package org.chorem.lima.business.accountingrules; import org.chorem.lima.business.AccountServiceImplTest; -import org.chorem.lima.business.LimaServiceConfig; +import org.chorem.lima.business.LimaBusinessConfig; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -45,16 +45,16 @@ public class AccountServiceRuleFrTest extends AccountServiceImplTest { @Before public void installFrenchRule() throws Exception { - LimaServiceConfig.getInstance().setAccountingRule(FranceAccountingRules.class.getName()); + LimaBusinessConfig.getInstance().setAccountingRule(FranceAccountingRules.class.getName()); } /** * Test une fois que la regles est correctement instanciée car - * elle peut être mise en cache dans {@link org.chorem.lima.business.LimaServiceConfig}. + * elle peut être mise en cache dans {@link org.chorem.lima.business.LimaBusinessConfig}. */ @Test public void testRuleInstance() { - Assert.assertTrue(LimaServiceConfig.getInstance().getAccountingRules() instanceof FranceAccountingRules); + Assert.assertTrue(LimaBusinessConfig.getInstance().getAccountingRules() instanceof FranceAccountingRules); } } diff --git a/lima-business/src/test/java/org/chorem/lima/business/accountingrules/EntryBookServiceRuleFrTest.java b/lima-business/src/test/java/org/chorem/lima/business/accountingrules/EntryBookServiceRuleFrTest.java index 495a3f6..00c87f1 100644 --- a/lima-business/src/test/java/org/chorem/lima/business/accountingrules/EntryBookServiceRuleFrTest.java +++ b/lima-business/src/test/java/org/chorem/lima/business/accountingrules/EntryBookServiceRuleFrTest.java @@ -23,7 +23,7 @@ package org.chorem.lima.business.accountingrules; import org.chorem.lima.business.EntryBookServiceImplTest; -import org.chorem.lima.business.LimaServiceConfig; +import org.chorem.lima.business.LimaBusinessConfig; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -45,15 +45,15 @@ public class EntryBookServiceRuleFrTest extends EntryBookServiceImplTest { @Before public void installFrenchRule() throws Exception { - LimaServiceConfig.getInstance().setAccountingRule(FranceAccountingRules.class.getName()); + LimaBusinessConfig.getInstance().setAccountingRule(FranceAccountingRules.class.getName()); } /** * Test une fois que la regles est correctement instanciée car - * elle peut être mise en cache dans {@link org.chorem.lima.business.LimaServiceConfig}. + * elle peut être mise en cache dans {@link org.chorem.lima.business.LimaBusinessConfig}. */ @Test public void testRuleInstance() { - Assert.assertTrue(LimaServiceConfig.getInstance().getAccountingRules() instanceof FranceAccountingRules); + Assert.assertTrue(LimaBusinessConfig.getInstance().getAccountingRules() instanceof FranceAccountingRules); } } diff --git a/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialPeriodServiceRuleFrTest.java b/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialPeriodServiceRuleFrTest.java index 8dd980e..af39338 100644 --- a/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialPeriodServiceRuleFrTest.java +++ b/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialPeriodServiceRuleFrTest.java @@ -23,7 +23,7 @@ package org.chorem.lima.business.accountingrules; import org.chorem.lima.business.EntryBookServiceImplTest; -import org.chorem.lima.business.LimaServiceConfig; +import org.chorem.lima.business.LimaBusinessConfig; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -45,15 +45,15 @@ public class FinancialPeriodServiceRuleFrTest extends EntryBookServiceImplTest { @Before public void installFrenchRule() throws Exception { - LimaServiceConfig.getInstance().setAccountingRule(FranceAccountingRules.class.getName()); + LimaBusinessConfig.getInstance().setAccountingRule(FranceAccountingRules.class.getName()); } /** * Test une fois que la regles est correctement instanciée car - * elle peut être mise en cache dans {@link org.chorem.lima.business.LimaServiceConfig}. + * elle peut être mise en cache dans {@link org.chorem.lima.business.LimaBusinessConfig}. */ @Test public void testRuleInstance() { - Assert.assertTrue(LimaServiceConfig.getInstance().getAccountingRules() instanceof FranceAccountingRules); + Assert.assertTrue(LimaBusinessConfig.getInstance().getAccountingRules() instanceof FranceAccountingRules); } } diff --git a/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialTransactionServiceRuleFrTest.java b/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialTransactionServiceRuleFrTest.java index 66372b5..01ef657 100644 --- a/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialTransactionServiceRuleFrTest.java +++ b/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FinancialTransactionServiceRuleFrTest.java @@ -23,7 +23,7 @@ package org.chorem.lima.business.accountingrules; import org.chorem.lima.business.FinancialTransactionServiceImplTest; -import org.chorem.lima.business.LimaServiceConfig; +import org.chorem.lima.business.LimaBusinessConfig; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -45,15 +45,15 @@ public class FinancialTransactionServiceRuleFrTest extends FinancialTransactionS @Before public void installFrenchRule() throws Exception { - LimaServiceConfig.getInstance().setAccountingRule(FranceAccountingRules.class.getName()); + LimaBusinessConfig.getInstance().setAccountingRule(FranceAccountingRules.class.getName()); } /** * Test une fois que la regles est correctement instanciée car - * elle peut être mise en cache dans {@link org.chorem.lima.business.LimaServiceConfig}. + * elle peut être mise en cache dans {@link org.chorem.lima.business.LimaBusinessConfig}. */ @Test public void testRuleInstance() { - Assert.assertTrue(LimaServiceConfig.getInstance().getAccountingRules() instanceof FranceAccountingRules); + Assert.assertTrue(LimaBusinessConfig.getInstance().getAccountingRules() instanceof FranceAccountingRules); } } diff --git a/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FiscalPeriodServiceRuleFrTest.java b/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FiscalPeriodServiceRuleFrTest.java index 9d1eccf..995b57f 100644 --- a/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FiscalPeriodServiceRuleFrTest.java +++ b/lima-business/src/test/java/org/chorem/lima/business/accountingrules/FiscalPeriodServiceRuleFrTest.java @@ -23,7 +23,7 @@ package org.chorem.lima.business.accountingrules; import org.chorem.lima.business.FiscalPeriodServiceImplTest; -import org.chorem.lima.business.LimaServiceConfig; +import org.chorem.lima.business.LimaBusinessConfig; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -45,15 +45,15 @@ public class FiscalPeriodServiceRuleFrTest extends FiscalPeriodServiceImplTest { @Before public void installFrenchRule() throws Exception { - LimaServiceConfig.getInstance().setAccountingRule(FranceAccountingRules.class.getName()); + LimaBusinessConfig.getInstance().setAccountingRule(FranceAccountingRules.class.getName()); } /** * Test une fois que la regles est correctement instanciée car - * elle peut être mise en cache dans {@link org.chorem.lima.business.LimaServiceConfig}. + * elle peut être mise en cache dans {@link org.chorem.lima.business.LimaBusinessConfig}. */ @Test public void testRuleInstance() { - Assert.assertTrue(LimaServiceConfig.getInstance().getAccountingRules() instanceof FranceAccountingRules); + Assert.assertTrue(LimaBusinessConfig.getInstance().getAccountingRules() instanceof FranceAccountingRules); } } diff --git a/lima-business/src/test/java/org/chorem/lima/business/accountingrules/ImportServiceRuleFrTest.java b/lima-business/src/test/java/org/chorem/lima/business/accountingrules/ImportServiceRuleFrTest.java index 3933dba..8ad9ecf 100644 --- a/lima-business/src/test/java/org/chorem/lima/business/accountingrules/ImportServiceRuleFrTest.java +++ b/lima-business/src/test/java/org/chorem/lima/business/accountingrules/ImportServiceRuleFrTest.java @@ -24,7 +24,7 @@ package org.chorem.lima.business.accountingrules; import org.chorem.lima.business.AbstractLimaTest; import org.chorem.lima.business.AccountingRules; -import org.chorem.lima.business.LimaServiceConfig; +import org.chorem.lima.business.LimaBusinessConfig; import org.junit.Assert; import org.junit.Test; @@ -47,17 +47,17 @@ public class ImportServiceRuleFrTest extends AbstractLimaTest { protected Properties getTestConfiguration() { Properties config = super.getTestConfiguration(); - config.setProperty(LimaServiceConfig.ServiceConfigOption.RULES_NATIONALTY.getKey(), FranceAccountingRules.class.getName()); + config.setProperty(LimaBusinessConfig.ServiceConfigOption.RULES_NATIONALTY.getKey(), FranceAccountingRules.class.getName()); return config; } /** * Test une fois que la regles est correctement instanciée car - * elle peut être mise en cache dans {@link org.chorem.lima.business.LimaServiceConfig}. + * elle peut être mise en cache dans {@link org.chorem.lima.business.LimaBusinessConfig}. */ @Test public void testRuleInstance() throws Exception { - AccountingRules accountingRules = LimaServiceConfig.getInstance().getAccountingRules(); + AccountingRules accountingRules = LimaBusinessConfig.getInstance().getAccountingRules(); Assert.assertTrue("accountingRules:" + accountingRules,accountingRules instanceof FranceAccountingRules); } } diff --git a/lima-business/src/test/java/org/chorem/lima/business/accountingrules/ReportServiceRuleFrTest.java b/lima-business/src/test/java/org/chorem/lima/business/accountingrules/ReportServiceRuleFrTest.java index 941082e..aca54ef 100644 --- a/lima-business/src/test/java/org/chorem/lima/business/accountingrules/ReportServiceRuleFrTest.java +++ b/lima-business/src/test/java/org/chorem/lima/business/accountingrules/ReportServiceRuleFrTest.java @@ -22,7 +22,7 @@ package org.chorem.lima.business.accountingrules; -import org.chorem.lima.business.LimaServiceConfig; +import org.chorem.lima.business.LimaBusinessConfig; import org.chorem.lima.business.ReportServiceImplTest; import org.junit.Assert; import org.junit.BeforeClass; @@ -49,15 +49,15 @@ public class ReportServiceRuleFrTest extends ReportServiceImplTest { @BeforeClass public static void installFrenchRule() throws Exception { - LimaServiceConfig.getInstance().setAccountingRule(FranceAccountingRules.class.getName()); + LimaBusinessConfig.getInstance().setAccountingRule(FranceAccountingRules.class.getName()); } /** * Test une fois que la regles est correctement instanciée car - * elle peut être mise en cache dans {@link org.chorem.lima.business.LimaServiceConfig}. + * elle peut être mise en cache dans {@link org.chorem.lima.business.LimaBusinessConfig}. */ @Test public void testRuleInstance() { - Assert.assertTrue(LimaServiceConfig.getInstance().getAccountingRules() instanceof FranceAccountingRules); + Assert.assertTrue(LimaBusinessConfig.getInstance().getAccountingRules() instanceof FranceAccountingRules); } } diff --git a/lima-swing/src/main/java/org/chorem/lima/LimaMain.java b/lima-swing/src/main/java/org/chorem/lima/LimaMain.java index 42a1c2a..00cf568 100644 --- a/lima-swing/src/main/java/org/chorem/lima/LimaMain.java +++ b/lima-swing/src/main/java/org/chorem/lima/LimaMain.java @@ -25,7 +25,7 @@ package org.chorem.lima; import jaxx.runtime.SwingUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.business.LimaServiceConfig; +import org.chorem.lima.business.LimaBusinessConfig; import org.chorem.lima.business.api.AccountService; import org.chorem.lima.service.LimaServiceFactory; import org.chorem.lima.ui.MainView; @@ -203,7 +203,7 @@ public class LimaMain { public static HttpServerService getHttpServerService() { if (httpServerService == null) { - LimaServiceConfig serviceConfig = LimaServiceConfig.getInstance(); + LimaBusinessConfig serviceConfig = LimaBusinessConfig.getInstance(); LimaSwingConfig swingConfig = LimaSwingConfig.getInstance(); // TODO DCossé 02/03/15 Ceci ne devrait pas être fait ainsi diff --git a/lima-swing/src/main/java/org/chorem/lima/LimaSwingApplicationContext.java b/lima-swing/src/main/java/org/chorem/lima/LimaSwingApplicationContext.java index 4334b8d..2c17b11 100644 --- a/lima-swing/src/main/java/org/chorem/lima/LimaSwingApplicationContext.java +++ b/lima-swing/src/main/java/org/chorem/lima/LimaSwingApplicationContext.java @@ -27,7 +27,7 @@ import jaxx.runtime.context.DefaultApplicationContext; import jaxx.runtime.context.JAXXContextEntryDef; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.business.LimaServiceConfig; +import org.chorem.lima.business.LimaBusinessConfig; import org.chorem.lima.ui.LimaDecoratorProvider; import org.chorem.lima.ui.MainView; import org.chorem.lima.ui.MainViewHandler; @@ -87,7 +87,7 @@ public class LimaSwingApplicationContext extends DefaultApplicationContext { } protected static void initApplicationContext() { - LimaServiceConfig.getInstance(); + LimaBusinessConfig.getInstance(); } /** diff --git a/lima-swing/src/main/java/org/chorem/lima/LimaSwingConfig.java b/lima-swing/src/main/java/org/chorem/lima/LimaSwingConfig.java index 02e64da..e29b80d 100644 --- a/lima-swing/src/main/java/org/chorem/lima/LimaSwingConfig.java +++ b/lima-swing/src/main/java/org/chorem/lima/LimaSwingConfig.java @@ -68,8 +68,6 @@ public class LimaSwingConfig extends ApplicationConfig { private static LimaSwingConfig instance; - private static final String CONFIG_FILE_NAME = "lima-config"; - protected OptionsService optionsService; /** La version du logiciel. */ @@ -444,10 +442,10 @@ public class LimaSwingConfig extends ApplicationConfig { */ public enum Option implements ConfigOptionDef { - CONFIG_FILE(CONFIG_FILE_NAME, + CONFIG_FILE(ApplicationConfig.CONFIG_FILE_NAME, t("lima.config.configFileName.label"), n("lima.config.configFileName.description"), - "lima.properties", + "lima-config.properties", String.class, true, true), DATA_DIR("lima.data.dir", diff --git a/lima-swing/src/test/java/org/chorem/lima/ui/AbstractLimaTest.java b/lima-swing/src/test/java/org/chorem/lima/ui/AbstractLimaTest.java index 8a57215..eba32f9 100644 --- a/lima-swing/src/test/java/org/chorem/lima/ui/AbstractLimaTest.java +++ b/lima-swing/src/test/java/org/chorem/lima/ui/AbstractLimaTest.java @@ -25,7 +25,7 @@ package org.chorem.lima.ui; import com.google.common.base.Function; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.business.LimaServiceConfig; +import org.chorem.lima.business.LimaBusinessConfig; import org.chorem.lima.business.api.AccountService; import org.chorem.lima.business.api.EntryBookService; import org.chorem.lima.business.api.EntryService; @@ -119,7 +119,7 @@ public abstract class AbstractLimaTest { */ protected void initServices() throws IOException { if(accountService == null) { - LimaServiceFactory.initFactory(LimaServiceConfig.getInstance().getConfig()); + LimaServiceFactory.initFactory(LimaBusinessConfig.getInstance().getConfig()); accountService = LimaServiceFactory.getService(AccountService.class); entryBookService = LimaServiceFactory.getService(EntryBookService.class); financialPeriodService = LimaServiceFactory.getService(FinancialPeriodService.class); @@ -149,7 +149,7 @@ public abstract class AbstractLimaTest { Properties testProperties = new Properties(); // override somes String testDir = System.getProperty("java.io.tmpdir") + File.separator + "lima-business-" + UUID.randomUUID().toString(); - testProperties.setProperty(LimaServiceConfig.ServiceConfigOption.DATA_DIR.getKey(), testDir); + testProperties.setProperty(LimaBusinessConfig.ServiceConfigOption.DATA_DIR.getKey(), testDir); testProperties.setProperty(Environment.URL, "jdbc:h2:file:" + testDir + File.separator + "data"); testProperties.setProperty(Environment.CURRENT_SESSION_CONTEXT_CLASS, "thread"); testProperties.setProperty("topia.persistence.classes", LimaCallaoEntityEnum.getImplementationClassesAsString()); @@ -170,7 +170,7 @@ public abstract class AbstractLimaTest { } protected LimaCallaoTopiaApplicationContext createNewTestApplicationContext() { - Properties options = LimaServiceConfig.getInstance().getFlatOptions(); + Properties options = LimaBusinessConfig.getInstance().getFlatOptions(); LimaCallaoTopiaApplicationContext result = getTestApplicationContext(options); return result; } diff --git a/lima-swing/src/test/java/org/chorem/lima/ui/LimaTestsConfig.java b/lima-swing/src/test/java/org/chorem/lima/ui/LimaTestsConfig.java index 15c942a..2f6ab45 100644 --- a/lima-swing/src/test/java/org/chorem/lima/ui/LimaTestsConfig.java +++ b/lima-swing/src/test/java/org/chorem/lima/ui/LimaTestsConfig.java @@ -23,7 +23,7 @@ package org.chorem.lima.ui; */ import com.google.common.collect.Maps; -import org.chorem.lima.business.LimaServiceConfig; +import org.chorem.lima.business.LimaBusinessConfig; import org.chorem.lima.entity.LimaCallaoEntityEnum; import org.nuiton.config.ApplicationConfig; import org.nuiton.topia.flyway.TopiaFlywayService; @@ -39,7 +39,7 @@ import java.util.Properties; public class LimaTestsConfig { public LimaTestsConfig(String configFileName, Properties limaTestConfig) { - LimaServiceConfig instance = LimaServiceConfig.getInstance(configFileName); + LimaBusinessConfig instance = LimaBusinessConfig.getInstance(configFileName); Properties standardLimaConfig = instance.getConfig().getFlatOptions(); for (Map.Entry<Object, Object> entry : limaTestConfig.entrySet()) { @@ -50,7 +50,7 @@ public class LimaTestsConfig { setRootContextProperties(instance); } - protected void setRootContextProperties(LimaServiceConfig instance) { + protected void setRootContextProperties(LimaBusinessConfig instance) { Properties result = instance.getFlatOptions(); // add persistence classes from generated code result.setProperty(TopiaConfigurationConstants.CONFIG_PERSISTENCE_CLASSES, LimaCallaoEntityEnum.getImplementationClassesAsString()); diff --git a/lima-web/src/main/java/org/chorem/lima/web/action/ReportBuilder.java b/lima-web/src/main/java/org/chorem/lima/web/action/ReportBuilder.java index 2a2ee93..75423d1 100644 --- a/lima-web/src/main/java/org/chorem/lima/web/action/ReportBuilder.java +++ b/lima-web/src/main/java/org/chorem/lima/web/action/ReportBuilder.java @@ -34,7 +34,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.LimaTechnicalException; import org.chorem.lima.beans.DocumentReport; -import org.chorem.lima.business.LimaServiceConfig; +import org.chorem.lima.business.LimaBusinessConfig; import org.chorem.lima.business.utils.DocumentReportTypes; import org.chorem.lima.business.utils.DocumentsEnum; @@ -80,7 +80,7 @@ public class ReportBuilder { */ public ReportBuilder() { - LimaServiceConfig config = LimaServiceConfig.getInstance(); + LimaBusinessConfig config = LimaBusinessConfig.getInstance(); // compile phase balanceDocumentReport = createReport(config.getReportModelUrl(DocumentReportTypes.BALANCE)); diff --git a/lima-web/src/main/java/org/chorem/lima/web/service/DocumentService.java b/lima-web/src/main/java/org/chorem/lima/web/service/DocumentService.java index d7aef7f..f8c8cd1 100644 --- a/lima-web/src/main/java/org/chorem/lima/web/service/DocumentService.java +++ b/lima-web/src/main/java/org/chorem/lima/web/service/DocumentService.java @@ -31,7 +31,7 @@ import org.chorem.lima.LimaTechnicalException; import org.chorem.lima.beans.DocumentReport; import org.chorem.lima.beans.FinancialStatementAmounts; import org.chorem.lima.beans.ReportsDatas; -import org.chorem.lima.business.LimaServiceConfig; +import org.chorem.lima.business.LimaBusinessConfig; import org.chorem.lima.business.api.AccountService; import org.chorem.lima.business.api.ClosedPeriodicEntryBookService; import org.chorem.lima.business.api.EntryService; @@ -93,7 +93,7 @@ public class DocumentService { protected AccountService accountService; - protected String path = LimaServiceConfig.getInstance().getReportsModelDir().getAbsolutePath(); + protected String path = LimaBusinessConfig.getInstance().getReportsModelDir().getAbsolutePath(); protected final String BALANCE_FILE_PATH = path + File.separator + DocumentsEnum.BALANCE.getFileName() + ".pdf"; protected final String GENERAL_ENTRY_BOOK_REPORT_PDF_FILE_PATH = path + File.separator + DocumentsEnum.GENERAL_ENTRY_BOOK.getFileName() + ".pdf"; diff --git a/lima-web/src/main/java/org/chorem/lima/web/service/HttpServerService.java b/lima-web/src/main/java/org/chorem/lima/web/service/HttpServerService.java index e4831ac..3f0e3f5 100644 --- a/lima-web/src/main/java/org/chorem/lima/web/service/HttpServerService.java +++ b/lima-web/src/main/java/org/chorem/lima/web/service/HttpServerService.java @@ -28,7 +28,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.business.LimaServiceConfig; +import org.chorem.lima.business.LimaBusinessConfig; import org.chorem.lima.business.api.AccountService; import org.chorem.lima.business.utils.DocumentsEnum; import org.chorem.lima.business.utils.FormatsEnum; @@ -81,7 +81,7 @@ public class HttpServerService { public HttpServerService() { //File reportDir = (File) props.get("REPORTS_MODEL_DIR"); //path = reportDir.getAbsolutePath(); - port = LimaServiceConfig.getInstance().getHttpPort(); + port = LimaBusinessConfig.getInstance().getHttpPort(); accountService = LimaServiceFactory.getService(AccountService.class); documentService = new DocumentService(); reportBuilder = new ReportBuilder(); @@ -91,7 +91,7 @@ public class HttpServerService { public void start() { if (server == null) { try { - LimaServiceConfig config = LimaServiceConfig.getInstance(); + LimaBusinessConfig config = LimaBusinessConfig.getInstance(); File reportDir = config.getReportsModelDir(); FileUtil.createDirectoryIfNecessary(reportDir); @@ -105,7 +105,7 @@ public class HttpServerService { server.start(); if (log.isInfoEnabled()) { - log.info("Web server are running on port: " + port); + log.info("Web server running on port: " + port); } } catch (Exception eee) { @@ -124,7 +124,7 @@ public class HttpServerService { public class MainServlet extends HttpServlet { private static final long serialVersionUID = 1L; - private String serverAddressConfig = LimaServiceConfig.getInstance().getAddressServer(); + private String serverAddressConfig = LimaBusinessConfig.getInstance().getAddressServer(); @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { @@ -198,7 +198,7 @@ public class HttpServerService { } IOUtils.write(report, out, Charsets.UTF_8); } else { - LimaServiceConfig config = LimaServiceConfig.getInstance(); + LimaBusinessConfig config = LimaBusinessConfig.getInstance(); File reportDir = config.getReportsModelDir(); String path = reportDir.getAbsolutePath(); URL doc = new URL("file:" + path + File.separator + model + ".pdf"); @@ -230,7 +230,7 @@ public class HttpServerService { + ":" + req.getServerPort(); } else { serverAddress += serverAddressConfig + ":" - + LimaServiceConfig.getInstance().getHttpPort(); + + LimaBusinessConfig.getInstance().getHttpPort(); } Calendar calendar = Calendar.getInstance(); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository lima. See http://git.chorem.org/lima.git commit 4a70606d65e1411384fa450d7e2812e990708c8f Merge: 546b909 139b85e Author: Arnaud Thimel <thimel@codelutin.com> Date: Thu Mar 12 14:17:18 2015 +0100 Merge branch 'feature/1190-encodage-path' into develop lima-business/README.txt | 9 +++- lima-business/pom.xml | 36 ++++++++++++- .../src/main/assembly/bin.xml | 42 --------------- .../src/main/assembly/lima-server | 0 .../src/main/java/org/chorem/lima/LimaServer.java | 11 +++- ...aServiceConfig.java => LimaBusinessConfig.java} | 33 +++++++----- .../org/chorem/lima/business/LimaInterceptor.java | 2 +- .../lima/business/ejb/AccountServiceImpl.java | 8 +-- .../lima/business/ejb/EntryBookServiceImpl.java | 7 ++- .../business/ejb/FinancialPeriodServiceImpl.java | 4 +- .../ejb/FinancialTransactionServiceImpl.java | 20 ++++---- .../lima/business/ejb/FiscalPeriodServiceImpl.java | 8 +-- .../lima/business/ejb/OptionsServiceImpl.java | 40 +++++++-------- .../lima/business/utils/BigDecimalToString.java | 4 +- .../chorem/lima/service/LimaServiceFactory.java | 23 +++++++-- .../src/{test => main}/resources/log4j.properties | 4 +- .../org/chorem/lima/business/AbstractLimaTest.java | 6 +-- .../org/chorem/lima/business/LimaMiscTest.java | 4 +- .../org/chorem/lima/business/LimaTestsConfig.java | 4 +- .../accountingrules/AccountServiceRuleFrTest.java | 8 +-- .../EntryBookServiceRuleFrTest.java | 8 +-- .../FinancialPeriodServiceRuleFrTest.java | 8 +-- .../FinancialTransactionServiceRuleFrTest.java | 8 +-- .../FiscalPeriodServiceRuleFrTest.java | 8 +-- .../accountingrules/ImportServiceRuleFrTest.java | 8 +-- .../accountingrules/ReportServiceRuleFrTest.java | 8 +-- lima-business/src/test/resources/log4j.properties | 4 +- lima-swing/pom.xml | 12 ++--- .../src/main/java/org/chorem/lima/LimaMain.java | 4 +- .../chorem/lima/LimaSwingApplicationContext.java | 4 +- .../main/java/org/chorem/lima/LimaSwingConfig.java | 12 +++-- .../chorem/lima/ui/account/AccountViewHandler.java | 44 ++++++++-------- lima-swing/src/main/resources/META-INF/ejb-jar.xml | 41 +++++++++++++++ .../src/main/resources/lima-config.properties | 3 ++ lima-swing/src/main/resources/log4j.properties | 57 ++++++++++---------- .../java/org/chorem/lima/ui/AbstractLimaTest.java | 9 ++-- .../java/org/chorem/lima/ui/LimaTestsConfig.java | 6 +-- lima-web/pom.xml | 60 ++-------------------- .../org/chorem/lima/web/action/ReportBuilder.java | 4 +- .../chorem/lima/web/service/DocumentService.java | 4 +- .../chorem/lima/web/service/HttpServerService.java | 14 ++--- .../src/main}/resources/log4j.properties | 0 pom.xml | 3 +- 43 files changed, 311 insertions(+), 291 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm