Wao-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- 2352 discussions
Author: maven-release
Date: 2012-08-28 12:09:15 +0200 (Tue, 28 Aug 2012)
New Revision: 1619
Url: http://forge.codelutin.com/repositories/revision/wao/1619
Log:
update mavenpom + use new way of demo deploy
Modified:
trunk/pom.xml
trunk/wao-ui/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-08-27 17:06:29 UTC (rev 1618)
+++ trunk/pom.xml 2012-08-28 10:09:15 UTC (rev 1619)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmine</artifactId>
- <version>3.2.1</version>
+ <version>3.3.6</version>
</parent>
<groupId>fr.ifremer</groupId>
Modified: trunk/wao-ui/pom.xml
===================================================================
--- trunk/wao-ui/pom.xml 2012-08-27 17:06:29 UTC (rev 1618)
+++ trunk/wao-ui/pom.xml 2012-08-28 10:09:15 UTC (rev 1619)
@@ -165,6 +165,11 @@
<!-- ************************************************************* -->
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
+
+ <properties>
+ <deployFiles>target/${project.build.finalName}.war</deployFiles>
+ </properties>
+
<build>
<plugins>
<plugin>
1
0
r1618 - in trunk/wao-business/src/main: java/fr/ifremer/wao/service resources/i18n
by bleny@users.forge.codelutin.com 27 Aug '12
by bleny@users.forge.codelutin.com 27 Aug '12
27 Aug '12
Author: bleny
Date: 2012-08-27 19:06:29 +0200 (Mon, 27 Aug 2012)
New Revision: 1618
Url: http://forge.codelutin.com/repositories/revision/wao/1618
Log:
fixes #1423 Ajouter le code 'FIF' au r?\195?\169f?\195?\169rentiel des esp?\195?\168ces cibles
Modified:
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceReferentialImpl.java
trunk/wao-business/src/main/resources/i18n/wao-business_en_GB.properties
trunk/wao-business/src/main/resources/i18n/wao-business_fr_FR.properties
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceReferentialImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceReferentialImpl.java 2012-08-27 17:04:59 UTC (rev 1617)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceReferentialImpl.java 2012-08-27 17:06:29 UTC (rev 1618)
@@ -690,7 +690,7 @@
"TBB", "TBN", "TBS", "TMS"};
final String[] speciesCodesBase = {"ALG", "ANA", "CAT", "CRU",
- "DEF", "DWS", "LPF", "MOL", "SPF"};
+ "DEF", "DWS", "LPF", "MOL", "SPF", "FIF"};
long nbCodes = fishingGearDCFDAO.count() + targetSpeciesDCFDAO.count();
Modified: trunk/wao-business/src/main/resources/i18n/wao-business_en_GB.properties
===================================================================
--- trunk/wao-business/src/main/resources/i18n/wao-business_en_GB.properties 2012-08-27 17:04:59 UTC (rev 1617)
+++ trunk/wao-business/src/main/resources/i18n/wao-business_en_GB.properties 2012-08-27 17:06:29 UTC (rev 1618)
@@ -132,6 +132,7 @@
fr.ifremer.wao.entity.TargetSpeciesDCF.CSJ=Scallop
fr.ifremer.wao.entity.TargetSpeciesDCF.DEF=Demersal species
fr.ifremer.wao.entity.TargetSpeciesDCF.DWS=Deep water species
+fr.ifremer.wao.entity.TargetSpeciesDCF.FIF=Finfish
fr.ifremer.wao.entity.TargetSpeciesDCF.FIN=Flatfishes
fr.ifremer.wao.entity.TargetSpeciesDCF.LP=Tall pelagic
fr.ifremer.wao.entity.TargetSpeciesDCF.LPF=Tall pelagic
Modified: trunk/wao-business/src/main/resources/i18n/wao-business_fr_FR.properties
===================================================================
--- trunk/wao-business/src/main/resources/i18n/wao-business_fr_FR.properties 2012-08-27 17:04:59 UTC (rev 1617)
+++ trunk/wao-business/src/main/resources/i18n/wao-business_fr_FR.properties 2012-08-27 17:06:29 UTC (rev 1618)
@@ -133,6 +133,7 @@
fr.ifremer.wao.entity.TargetSpeciesDCF.CSJ=Coquilles Saint-Jacques
fr.ifremer.wao.entity.TargetSpeciesDCF.DEF=Espèces démersales
fr.ifremer.wao.entity.TargetSpeciesDCF.DWS=Espèces d'eaux profondes
+fr.ifremer.wao.entity.TargetSpeciesDCF.FIF=Poissons
fr.ifremer.wao.entity.TargetSpeciesDCF.FIN=Poisson plats
fr.ifremer.wao.entity.TargetSpeciesDCF.LPF=Grands pélagiques
fr.ifremer.wao.entity.TargetSpeciesDCF.MOL=Mollusques
1
0
Author: bleny
Date: 2012-08-27 19:04:59 +0200 (Mon, 27 Aug 2012)
New Revision: 1617
Url: http://forge.codelutin.com/repositories/revision/wao/1617
Log:
move repositories declaration in parent pom ; change version com.orientimport:t5-easy-fckeditor to 1.0.4, repository seems corrupted and 1.0.5 is missing
Modified:
trunk/pom.xml
trunk/wao-ui/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-06-04 16:25:41 UTC (rev 1616)
+++ trunk/pom.xml 2012-08-27 17:04:59 UTC (rev 1617)
@@ -109,7 +109,7 @@
<dependency>
<groupId>com.orientimport</groupId>
<artifactId>t5-easy-fckeditor</artifactId>
- <version>1.0.5</version>
+ <version>1.0.4</version>
</dependency>
<dependency>
<groupId>org.chenillekit</groupId>
@@ -438,4 +438,14 @@
</archive>
</mailingList>
</mailingLists>
+
+ <repositories>
+
+ <repository>
+ <id>wao-group</id>
+ <name>Wao dependencies</name>
+ <url>http://nexus.nuiton.org/nexus/content/groups/wao-group/</url>
+ </repository>
+
+ </repositories>
</project>
Modified: trunk/wao-ui/pom.xml
===================================================================
--- trunk/wao-ui/pom.xml 2012-06-04 16:25:41 UTC (rev 1616)
+++ trunk/wao-ui/pom.xml 2012-08-27 17:04:59 UTC (rev 1617)
@@ -240,14 +240,4 @@
</plugins>
</build>
- <repositories>
-
- <repository>
- <id>wao-group</id>
- <name>Wao dependencies</name>
- <url>http://nexus.nuiton.org/nexus/content/groups/wao-group/</url>
- </repository>
-
- </repositories>
-
</project>
\ No newline at end of file
1
0
Author: bleny
Date: 2012-06-04 18:25:41 +0200 (Mon, 04 Jun 2012)
New Revision: 1616
Url: http://forge.codelutin.com/repositories/revision/wao/1616
Log:
non-utilisation de ServiceTransformer en vue de la migration vers ToPIA 3.x
Modified:
trunk/wao-business/pom.xml
Modified: trunk/wao-business/pom.xml
===================================================================
--- trunk/wao-business/pom.xml 2012-06-04 16:25:02 UTC (rev 1615)
+++ trunk/wao-business/pom.xml 2012-06-04 16:25:41 UTC (rev 1616)
@@ -174,7 +174,6 @@
<templates>
org.nuiton.topia.generator.TopiaMetaTransformer,
org.nuiton.eugene.java.JavaBeanTransformer,
- org.nuiton.topia.generator.ServiceTransformer,
org.nuiton.eugene.java.JavaInterfaceTransformer,
org.nuiton.topia.generator.BinderHelperTransformer,
org.nuiton.topia.generator.QueryHelperTransformer
1
0
r1615 - trunk/wao-business/src/main/java/fr/ifremer/wao/service
by bleny@users.forge.codelutin.com 04 Jun '12
by bleny@users.forge.codelutin.com 04 Jun '12
04 Jun '12
Author: bleny
Date: 2012-06-04 18:25:02 +0200 (Mon, 04 Jun 2012)
New Revision: 1615
Url: http://forge.codelutin.com/repositories/revision/wao/1615
Log:
non-utilisation de ServiceTransformer en vue de la migration vers ToPIA 3.x
Added:
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceBoat.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceBoatAbstract.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceCartography.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceCartographyAbstract.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceChart.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContact.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactAbstract.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceNews.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceNewsAbstract.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceReferential.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceReferentialAbstract.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSampling.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingAbstract.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSynthesis.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSynthesisAbstract.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceUser.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceUserAbstract.java
Added: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceBoat.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceBoat.java (rev 0)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceBoat.java 2012-06-04 16:25:02 UTC (rev 1615)
@@ -0,0 +1,47 @@
+package fr.ifremer.wao.service;
+
+import fr.ifremer.wao.WaoBusinessException;
+import fr.ifremer.wao.WaoException;
+import fr.ifremer.wao.bean.BoatFilter;
+import fr.ifremer.wao.bean.BoatFilterValues;
+import fr.ifremer.wao.bean.CompanyBoatInfos;
+import fr.ifremer.wao.bean.ConnectedUser;
+import fr.ifremer.wao.bean.ObsProgram;
+import fr.ifremer.wao.entity.Boat;
+import fr.ifremer.wao.entity.Company;
+import fr.ifremer.wao.io.ImportResults;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+
+public interface ServiceBoat {
+
+ Map<Integer, Boat> getBoatsByFilter(BoatFilter filter) throws WaoException;
+
+ ImportResults importBoatCsv(InputStream input) throws WaoException, WaoBusinessException;
+
+ List<Boat> getBoatsByImmatriculations(String immatriculations) throws WaoException, WaoBusinessException;
+
+ CompanyBoatInfos getCompanyBoatInfos(ObsProgram obsProgram, int boatImmatriculation, Company company) throws WaoException;
+
+ Boat getBoat(Integer boatImmatriculation) throws WaoException, WaoBusinessException;
+
+ void createUpdateCompanyBoatInfos(CompanyBoatInfos companyBoatInfos) throws WaoException;
+
+ List<String> getBoatNamesStartWith(String input) throws WaoException;
+
+ int getNbBoatsByFilter(BoatFilter filter) throws WaoException;
+
+ InputStream exportBoatCsv(BoatFilter filter) throws WaoException;
+
+ List<String> getShipOwnerNamesContains(String name) throws WaoException;
+
+ BoatFilter newBoatFilter(ConnectedUser connectedUser) throws WaoException;
+
+ BoatFilterValues getPossibleValuesForFilter(BoatFilter filter) throws WaoException;
+
+ List<Boat> getAllActiveBoats() throws WaoException;
+
+ ImportResults importBoatGroups(InputStream input) throws WaoException;
+
+} //ServiceBoat
Added: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceBoatAbstract.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceBoatAbstract.java (rev 0)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceBoatAbstract.java 2012-06-04 16:25:02 UTC (rev 1615)
@@ -0,0 +1,343 @@
+package fr.ifremer.wao.service;
+
+import fr.ifremer.wao.WaoBusinessException;
+import fr.ifremer.wao.WaoException;
+import fr.ifremer.wao.bean.BoatFilter;
+import fr.ifremer.wao.bean.BoatFilterValues;
+import fr.ifremer.wao.bean.CompanyBoatInfos;
+import fr.ifremer.wao.bean.ConnectedUser;
+import fr.ifremer.wao.bean.ObsProgram;
+import fr.ifremer.wao.entity.Boat;
+import fr.ifremer.wao.entity.Company;
+import fr.ifremer.wao.io.ImportResults;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import org.nuiton.i18n.I18n;
+import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.TopiaException;
+
+public abstract class ServiceBoatAbstract implements ServiceBoat {
+
+ protected abstract TopiaContext beginTransaction() throws TopiaException;
+
+ protected void commitTransaction(TopiaContext transaction) throws TopiaException {
+ transaction.commitTransaction();
+}
+
+ protected abstract void closeTransaction(TopiaContext transaction) throws TopiaException;
+
+ protected abstract void treateError(TopiaContext transaction, Exception eee, String message, Object... args) throws WaoException;
+
+ protected void treateError(Exception eee, String message, Object... args) throws WaoException {
+ treateError(null, eee, message, args);
+ }
+
+ protected abstract Map<Integer, Boat> executeGetBoatsByFilter(TopiaContext transaction, BoatFilter filter) throws Exception;
+
+ protected abstract ImportResults executeImportBoatCsv(TopiaContext transaction, InputStream input) throws Exception;
+
+ protected abstract List<Boat> executeGetBoatsByImmatriculations(TopiaContext transaction, String immatriculations) throws Exception;
+
+ protected abstract CompanyBoatInfos executeGetCompanyBoatInfos(TopiaContext transaction, List<Object> errorArgs, ObsProgram obsProgram, int boatImmatriculation, Company company) throws Exception;
+
+ protected abstract Boat executeGetBoat(TopiaContext transaction, Integer boatImmatriculation) throws Exception;
+
+ protected abstract void executeCreateUpdateCompanyBoatInfos(TopiaContext transaction, List<Object> errorArgs, CompanyBoatInfos companyBoatInfos) throws Exception;
+
+ protected abstract List<String> executeGetBoatNamesStartWith(TopiaContext transaction, List<Object> errorArgs, String input) throws Exception;
+
+ protected abstract int executeGetNbBoatsByFilter(TopiaContext transaction, BoatFilter filter) throws Exception;
+
+ protected abstract InputStream executeExportBoatCsv(TopiaContext transaction, BoatFilter filter) throws Exception;
+
+ protected abstract List<String> executeGetShipOwnerNamesContains(TopiaContext transaction, String name) throws Exception;
+
+ protected abstract BoatFilter executeNewBoatFilter(TopiaContext transaction, ConnectedUser connectedUser) throws Exception;
+
+ protected abstract BoatFilterValues executeGetPossibleValuesForFilter(TopiaContext transaction, BoatFilter filter) throws Exception;
+
+ protected abstract List<Boat> executeGetAllActiveBoats(TopiaContext transaction) throws Exception;
+
+ protected abstract ImportResults executeImportBoatGroups(TopiaContext transaction, InputStream input) throws Exception;
+
+ @Override
+ public Map<Integer, Boat> getBoatsByFilter(BoatFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ Map<Integer, Boat> result = executeGetBoatsByFilter(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceBoat.getBoatsByFilter"));
+ }
+ return null;
+ }
+
+ @Override
+ public ImportResults importBoatCsv(InputStream input) throws WaoException, WaoBusinessException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ ImportResults result = executeImportBoatCsv(transaction, input);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (WaoBusinessException eee) {
+ throw eee;
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceBoat.importBoatCsv"));
+ }
+ return null;
+ }
+
+ @Override
+ public List<Boat> getBoatsByImmatriculations(String immatriculations) throws WaoException, WaoBusinessException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<Boat> result = executeGetBoatsByImmatriculations(transaction, immatriculations);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (WaoBusinessException eee) {
+ throw eee;
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceBoat.getBoatsByImmatriculations"));
+ }
+ return null;
+ }
+
+ @Override
+ public CompanyBoatInfos getCompanyBoatInfos(ObsProgram obsProgram, int boatImmatriculation, Company company) throws WaoException {
+ List<Object> errorArgs = new ArrayList<Object>();
+
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ CompanyBoatInfos result = executeGetCompanyBoatInfos(transaction, errorArgs, obsProgram, boatImmatriculation, company);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceBoat.getCompanyBoatInfos"), errorArgs.toArray());
+ }
+ return null;
+ }
+
+ @Override
+ public Boat getBoat(Integer boatImmatriculation) throws WaoException, WaoBusinessException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ Boat result = executeGetBoat(transaction, boatImmatriculation);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (WaoBusinessException eee) {
+ throw eee;
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceBoat.getBoat"));
+ }
+ return null;
+ }
+
+ @Override
+ public void createUpdateCompanyBoatInfos(CompanyBoatInfos companyBoatInfos) throws WaoException {
+ List<Object> errorArgs = new ArrayList<Object>();
+
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ executeCreateUpdateCompanyBoatInfos(transaction, errorArgs, companyBoatInfos);
+
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceBoat.createUpdateCompanyBoatInfos"), errorArgs.toArray());
+ }
+
+ }
+
+ @Override
+ public List<String> getBoatNamesStartWith(String input) throws WaoException {
+ List<Object> errorArgs = new ArrayList<Object>();
+
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<String> result = executeGetBoatNamesStartWith(transaction, errorArgs, input);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceBoat.getBoatNamesStartWith"), errorArgs.toArray());
+ }
+ return null;
+ }
+
+ @Override
+ public int getNbBoatsByFilter(BoatFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ int result = executeGetNbBoatsByFilter(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceBoat.getNbBoatsByFilter"));
+ }
+ return 0;
+ }
+
+ @Override
+ public InputStream exportBoatCsv(BoatFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ InputStream result = executeExportBoatCsv(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceBoat.exportBoatCsv"));
+ }
+ return null;
+ }
+
+ @Override
+ public List<String> getShipOwnerNamesContains(String name) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<String> result = executeGetShipOwnerNamesContains(transaction, name);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceBoat.getShipOwnerNamesContains"));
+ }
+ return null;
+ }
+
+ @Override
+ public BoatFilter newBoatFilter(ConnectedUser connectedUser) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ BoatFilter result = executeNewBoatFilter(transaction, connectedUser);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceBoat.newBoatFilter"));
+ }
+ return null;
+ }
+
+ @Override
+ public BoatFilterValues getPossibleValuesForFilter(BoatFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ BoatFilterValues result = executeGetPossibleValuesForFilter(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceBoat.getPossibleValuesForFilter"));
+ }
+ return null;
+ }
+
+ @Override
+ public List<Boat> getAllActiveBoats() throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<Boat> result = executeGetAllActiveBoats(transaction);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceBoat.getAllActiveBoats"));
+ }
+ return null;
+ }
+
+ @Override
+ public ImportResults importBoatGroups(InputStream input) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ ImportResults result = executeImportBoatGroups(transaction, input);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceBoat.importBoatGroups"));
+ }
+ return null;
+ }
+
+} //ServiceBoatAbstract
Added: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceCartography.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceCartography.java (rev 0)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceCartography.java 2012-06-04 16:25:02 UTC (rev 1615)
@@ -0,0 +1,18 @@
+package fr.ifremer.wao.service;
+
+import fr.ifremer.wao.WaoException;
+import fr.ifremer.wao.bean.ContactFilter;
+import fr.ifremer.wao.io.ImportResults;
+import java.io.InputStream;
+
+public interface ServiceCartography {
+
+ ImportResults importBoatDistrictKml(InputStream input) throws WaoException;
+
+ InputStream exportContactStatisticsKml(ContactFilter filter) throws WaoException;
+
+ InputStream exportContactMotifsStatisticsKml(ContactFilter filter) throws WaoException;
+
+ InputStream exportContactStatisticsBySeaboardKml(ContactFilter filter) throws WaoException;
+
+} //ServiceCartography
Added: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceCartographyAbstract.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceCartographyAbstract.java (rev 0)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceCartographyAbstract.java 2012-06-04 16:25:02 UTC (rev 1615)
@@ -0,0 +1,111 @@
+package fr.ifremer.wao.service;
+
+import fr.ifremer.wao.WaoException;
+import fr.ifremer.wao.bean.ContactFilter;
+import fr.ifremer.wao.io.ImportResults;
+import java.io.InputStream;
+import org.nuiton.i18n.I18n;
+import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.TopiaException;
+
+public abstract class ServiceCartographyAbstract implements ServiceCartography {
+
+ protected abstract TopiaContext beginTransaction() throws TopiaException;
+
+ protected void commitTransaction(TopiaContext transaction) throws TopiaException {
+ transaction.commitTransaction();
+}
+
+ protected abstract void closeTransaction(TopiaContext transaction) throws TopiaException;
+
+ protected abstract void treateError(TopiaContext transaction, Exception eee, String message, Object... args) throws WaoException;
+
+ protected void treateError(Exception eee, String message, Object... args) throws WaoException {
+ treateError(null, eee, message, args);
+ }
+
+ protected abstract ImportResults executeImportBoatDistrictKml(TopiaContext transaction, InputStream input) throws Exception;
+
+ protected abstract InputStream executeExportContactStatisticsKml(TopiaContext transaction, ContactFilter filter) throws Exception;
+
+ protected abstract InputStream executeExportContactMotifsStatisticsKml(TopiaContext transaction, ContactFilter filter) throws Exception;
+
+ protected abstract InputStream executeExportContactStatisticsBySeaboardKml(TopiaContext transaction, ContactFilter filter) throws Exception;
+
+ @Override
+ public ImportResults importBoatDistrictKml(InputStream input) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ ImportResults result = executeImportBoatDistrictKml(transaction, input);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceCartography.importBoatDistrictKml"));
+ }
+ return null;
+ }
+
+ @Override
+ public InputStream exportContactStatisticsKml(ContactFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ InputStream result = executeExportContactStatisticsKml(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceCartography.exportContactStatisticsKml"));
+ }
+ return null;
+ }
+
+ @Override
+ public InputStream exportContactMotifsStatisticsKml(ContactFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ InputStream result = executeExportContactMotifsStatisticsKml(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceCartography.exportContactMotifsStatisticsKml"));
+ }
+ return null;
+ }
+
+ @Override
+ public InputStream exportContactStatisticsBySeaboardKml(ContactFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ InputStream result = executeExportContactStatisticsBySeaboardKml(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceCartography.exportContactStatisticsBySeaboardKml"));
+ }
+ return null;
+ }
+
+} //ServiceCartographyAbstract
Added: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceChart.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceChart.java (rev 0)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceChart.java 2012-06-04 16:25:02 UTC (rev 1615)
@@ -0,0 +1,11 @@
+package fr.ifremer.wao.service;
+
+import fr.ifremer.wao.bean.PieChartData;
+
+public interface ServiceChart {
+
+ String getPieChartUrl(PieChartData data, int size, boolean thumb);
+
+ String getHtmlImgTag(PieChartData data, String text, boolean thumb);
+
+} //ServiceChart
Added: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContact.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContact.java (rev 0)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContact.java 2012-06-04 16:25:02 UTC (rev 1615)
@@ -0,0 +1,52 @@
+package fr.ifremer.wao.service;
+
+import fr.ifremer.wao.WaoBusinessException;
+import fr.ifremer.wao.WaoException;
+import fr.ifremer.wao.bean.ConnectedUser;
+import fr.ifremer.wao.bean.ContactFilter;
+import fr.ifremer.wao.bean.ContactFilterValues;
+import fr.ifremer.wao.bean.ValidationResult;
+import fr.ifremer.wao.entity.Boat;
+import fr.ifremer.wao.entity.Contact;
+import fr.ifremer.wao.entity.ObsDebCode;
+import fr.ifremer.wao.entity.SampleRow;
+import fr.ifremer.wao.entity.TerrestrialLocation;
+import fr.ifremer.wao.io.ImportResults;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+public interface ServiceContact {
+
+ Map<String, Contact> getContacts(ContactFilter filter) throws WaoException;
+
+ Contact newContact(ConnectedUser connectedUser, SampleRow row, Boat boat) throws WaoException;
+
+ void saveContact(ConnectedUser connectedUser, Contact contact, boolean delete) throws WaoException;
+
+ InputStream exportContactCsv(ContactFilter filter) throws WaoException;
+
+ ImportResults importContactCsv(ConnectedUser user, InputStream input) throws WaoException, WaoBusinessException;
+
+ int getNbContacts(ContactFilter filter) throws WaoException;
+
+ boolean sendContactDoneEmail(Contact contact) throws WaoException, WaoBusinessException;
+
+ Contact getContact(String contactId) throws WaoException;
+
+ ValidationResult validateContact(Contact contact) throws WaoException;
+
+ ContactFilter newContactFilter(ConnectedUser connectedUser) throws WaoException;
+
+ ContactFilterValues getPossibleValuesForFilter(ContactFilter filter) throws WaoException;
+
+ Set<Boat> getSubstitutesForBoat(Boat boat) throws WaoException;
+
+ List<ObsDebCode> getPossibleObsDebCodes(Contact contact) throws WaoException;
+
+ List<TerrestrialLocation> getPossibleTerrestrialLocations(Contact contact) throws WaoException;
+
+ boolean isBoatSampled(Boat boat, SampleRow sampleRow) throws WaoException;
+
+} //ServiceContact
Added: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactAbstract.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactAbstract.java (rev 0)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactAbstract.java 2012-06-04 16:25:02 UTC (rev 1615)
@@ -0,0 +1,358 @@
+package fr.ifremer.wao.service;
+
+import fr.ifremer.wao.WaoBusinessException;
+import fr.ifremer.wao.WaoException;
+import fr.ifremer.wao.bean.ConnectedUser;
+import fr.ifremer.wao.bean.ContactFilter;
+import fr.ifremer.wao.bean.ContactFilterValues;
+import fr.ifremer.wao.bean.ValidationResult;
+import fr.ifremer.wao.entity.Boat;
+import fr.ifremer.wao.entity.Contact;
+import fr.ifremer.wao.entity.ObsDebCode;
+import fr.ifremer.wao.entity.SampleRow;
+import fr.ifremer.wao.entity.TerrestrialLocation;
+import fr.ifremer.wao.io.ImportResults;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.nuiton.i18n.I18n;
+import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.TopiaException;
+
+public abstract class ServiceContactAbstract implements ServiceContact {
+
+ protected abstract TopiaContext beginTransaction() throws TopiaException;
+
+ protected void commitTransaction(TopiaContext transaction) throws TopiaException {
+ transaction.commitTransaction();
+}
+
+ protected abstract void closeTransaction(TopiaContext transaction) throws TopiaException;
+
+ protected abstract void treateError(TopiaContext transaction, Exception eee, String message, Object... args) throws WaoException;
+
+ protected void treateError(Exception eee, String message, Object... args) throws WaoException {
+ treateError(null, eee, message, args);
+ }
+
+ protected abstract Map<String, Contact> executeGetContacts(TopiaContext transaction, ContactFilter filter) throws Exception;
+
+ protected abstract Contact executeNewContact(TopiaContext transaction, ConnectedUser connectedUser, SampleRow row, Boat boat) throws Exception;
+
+ protected abstract void executeSaveContact(TopiaContext transaction, ConnectedUser connectedUser, Contact contact, boolean delete) throws Exception;
+
+ protected abstract InputStream executeExportContactCsv(TopiaContext transaction, ContactFilter filter) throws Exception;
+
+ protected abstract ImportResults executeImportContactCsv(TopiaContext transaction, ConnectedUser user, InputStream input) throws Exception;
+
+ protected abstract int executeGetNbContacts(TopiaContext transaction, ContactFilter filter) throws Exception;
+
+ protected abstract boolean executeSendContactDoneEmail(TopiaContext transaction, Contact contact) throws Exception;
+
+ protected abstract Contact executeGetContact(TopiaContext transaction, String contactId) throws Exception;
+
+ protected abstract ValidationResult executeValidateContact(TopiaContext transaction, Contact contact) throws Exception;
+
+ protected abstract ContactFilter executeNewContactFilter(TopiaContext transaction, ConnectedUser connectedUser) throws Exception;
+
+ protected abstract ContactFilterValues executeGetPossibleValuesForFilter(TopiaContext transaction, ContactFilter filter) throws Exception;
+
+ protected abstract Set<Boat> executeGetSubstitutesForBoat(TopiaContext transaction, Boat boat) throws Exception;
+
+ protected abstract List<ObsDebCode> executeGetPossibleObsDebCodes(TopiaContext transaction, Contact contact) throws Exception;
+
+ protected abstract List<TerrestrialLocation> executeGetPossibleTerrestrialLocations(TopiaContext transaction, Contact contact) throws Exception;
+
+ protected abstract boolean executeIsBoatSampled(TopiaContext transaction, Boat boat, SampleRow sampleRow) throws Exception;
+
+ @Override
+ public Map<String, Contact> getContacts(ContactFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ Map<String, Contact> result = executeGetContacts(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceContact.getContacts"));
+ }
+ return null;
+ }
+
+ @Override
+ public Contact newContact(ConnectedUser connectedUser, SampleRow row, Boat boat) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ Contact result = executeNewContact(transaction, connectedUser, row, boat);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceContact.newContact"));
+ }
+ return null;
+ }
+
+ @Override
+ public void saveContact(ConnectedUser connectedUser, Contact contact, boolean delete) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ executeSaveContact(transaction, connectedUser, contact, delete);
+
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceContact.saveContact"));
+ }
+
+ }
+
+ @Override
+ public InputStream exportContactCsv(ContactFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ InputStream result = executeExportContactCsv(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceContact.exportContactCsv"));
+ }
+ return null;
+ }
+
+ @Override
+ public ImportResults importContactCsv(ConnectedUser user, InputStream input) throws WaoException, WaoBusinessException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ ImportResults result = executeImportContactCsv(transaction, user, input);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (WaoBusinessException eee) {
+ throw eee;
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceContact.importContactCsv"));
+ }
+ return null;
+ }
+
+ @Override
+ public int getNbContacts(ContactFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ int result = executeGetNbContacts(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceContact.getNbContacts"));
+ }
+ return 0;
+ }
+
+ @Override
+ public boolean sendContactDoneEmail(Contact contact) throws WaoException, WaoBusinessException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ boolean result = executeSendContactDoneEmail(transaction, contact);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (WaoBusinessException eee) {
+ throw eee;
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceContact.sendContactDoneEmail"));
+ }
+ return false;
+ }
+
+ @Override
+ public Contact getContact(String contactId) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ Contact result = executeGetContact(transaction, contactId);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceContact.getContact"));
+ }
+ return null;
+ }
+
+ @Override
+ public ValidationResult validateContact(Contact contact) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ ValidationResult result = executeValidateContact(transaction, contact);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceContact.validateContact"));
+ }
+ return null;
+ }
+
+ @Override
+ public ContactFilter newContactFilter(ConnectedUser connectedUser) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ ContactFilter result = executeNewContactFilter(transaction, connectedUser);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceContact.newContactFilter"));
+ }
+ return null;
+ }
+
+ @Override
+ public ContactFilterValues getPossibleValuesForFilter(ContactFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ ContactFilterValues result = executeGetPossibleValuesForFilter(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceContact.getPossibleValuesForFilter"));
+ }
+ return null;
+ }
+
+ @Override
+ public Set<Boat> getSubstitutesForBoat(Boat boat) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ Set<Boat> result = executeGetSubstitutesForBoat(transaction, boat);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceContact.getSubstitutesForBoat"));
+ }
+ return null;
+ }
+
+ @Override
+ public List<ObsDebCode> getPossibleObsDebCodes(Contact contact) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<ObsDebCode> result = executeGetPossibleObsDebCodes(transaction, contact);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceContact.getPossibleObsDebCodes"));
+ }
+ return null;
+ }
+
+ @Override
+ public List<TerrestrialLocation> getPossibleTerrestrialLocations(Contact contact) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<TerrestrialLocation> result = executeGetPossibleTerrestrialLocations(transaction, contact);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceContact.getPossibleTerrestrialLocations"));
+ }
+ return null;
+ }
+
+ @Override
+ public boolean isBoatSampled(Boat boat, SampleRow sampleRow) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ boolean result = executeIsBoatSampled(transaction, boat, sampleRow);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceContact.isBoatSampled"));
+ }
+ return false;
+ }
+
+} //ServiceContactAbstract
Added: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceNews.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceNews.java (rev 0)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceNews.java 2012-06-04 16:25:02 UTC (rev 1615)
@@ -0,0 +1,16 @@
+package fr.ifremer.wao.service;
+
+import fr.ifremer.wao.WaoException;
+import fr.ifremer.wao.bean.ConnectedUser;
+import fr.ifremer.wao.entity.News;
+import java.util.List;
+
+public interface ServiceNews {
+
+ void saveNews(News news, boolean delete) throws WaoException;
+
+ List<News> getNews(ConnectedUser user) throws WaoException;
+
+ News newNews(ConnectedUser user) throws WaoException;
+
+} //ServiceNews
Added: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceNewsAbstract.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceNewsAbstract.java (rev 0)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceNewsAbstract.java 2012-06-04 16:25:02 UTC (rev 1615)
@@ -0,0 +1,86 @@
+package fr.ifremer.wao.service;
+
+import fr.ifremer.wao.WaoException;
+import fr.ifremer.wao.bean.ConnectedUser;
+import fr.ifremer.wao.entity.News;
+import java.util.ArrayList;
+import java.util.List;
+import org.nuiton.i18n.I18n;
+import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.TopiaException;
+
+public abstract class ServiceNewsAbstract implements ServiceNews {
+
+ protected abstract TopiaContext beginTransaction() throws TopiaException;
+
+ protected void commitTransaction(TopiaContext transaction) throws TopiaException {
+ transaction.commitTransaction();
+}
+
+ protected abstract void closeTransaction(TopiaContext transaction) throws TopiaException;
+
+ protected abstract void treateError(TopiaContext transaction, Exception eee, String message, Object... args) throws WaoException;
+
+ protected void treateError(Exception eee, String message, Object... args) throws WaoException {
+ treateError(null, eee, message, args);
+ }
+
+ protected abstract void executeSaveNews(TopiaContext transaction, List<Object> errorArgs, News news, boolean delete) throws Exception;
+
+ protected abstract List<News> executeGetNews(TopiaContext transaction, ConnectedUser user) throws Exception;
+
+ protected abstract News executeNewNews(ConnectedUser user) throws Exception;
+
+ @Override
+ public void saveNews(News news, boolean delete) throws WaoException {
+ List<Object> errorArgs = new ArrayList<Object>();
+
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ executeSaveNews(transaction, errorArgs, news, delete);
+
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceNews.saveNews"), errorArgs.toArray());
+ }
+
+ }
+
+ @Override
+ public List<News> getNews(ConnectedUser user) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<News> result = executeGetNews(transaction, user);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceNews.getNews"));
+ }
+ return null;
+ }
+
+ @Override
+ public News newNews(ConnectedUser user) throws WaoException {
+ try {
+
+ News result = executeNewNews(user);
+ return result;
+ } catch (Exception eee) {
+ treateError(eee, I18n.n_("wao.error.serviceNews.newNews"));
+ }
+ return null;
+ }
+
+} //ServiceNewsAbstract
Added: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceReferential.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceReferential.java (rev 0)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceReferential.java 2012-06-04 16:25:02 UTC (rev 1615)
@@ -0,0 +1,50 @@
+package fr.ifremer.wao.service;
+
+import fr.ifremer.wao.WaoException;
+import fr.ifremer.wao.bean.ContactState;
+import fr.ifremer.wao.bean.ObsProgram;
+import fr.ifremer.wao.bean.ReferentialState;
+import fr.ifremer.wao.bean.SamplingFilter;
+import fr.ifremer.wao.entity.ContactStateMotif;
+import fr.ifremer.wao.entity.FishingZone;
+import fr.ifremer.wao.entity.TerrestrialDivision;
+import fr.ifremer.wao.entity.TerrestrialLocation;
+import fr.ifremer.wao.io.ImportResults;
+import java.io.InputStream;
+import java.util.List;
+
+public interface ServiceReferential {
+
+ List<FishingZone> getFishingZones() throws WaoException;
+
+ int importFishingZoneCsv(InputStream input) throws WaoException;
+
+ ImportResults importTerrestrialLocations(InputStream input) throws WaoException;
+
+ List<TerrestrialLocation> getAllTerrestrialDistricts(SamplingFilter filter) throws WaoException;
+
+ List<TerrestrialLocation> getAllPortsAndAuctions(TerrestrialLocation district) throws WaoException;
+
+ TerrestrialLocation getTerrestrialDistrict(String districtCode) throws WaoException;
+
+ List<ContactStateMotif> getAllContactStateMotifs(ContactState contactState) throws WaoException;
+
+ ImportResults importTerrestrialDivisions(InputStream input) throws WaoException;
+
+ List<TerrestrialDivision> getAllObservationUnits() throws WaoException;
+
+ List<TerrestrialLocation> getAllPorts(TerrestrialLocation region) throws WaoException;
+
+ void initialImport() throws WaoException;
+
+ ImportResults importObsDebCodes(InputStream input) throws WaoException;
+
+ List<TerrestrialLocation> getAllRegionIfremers() throws WaoException;
+
+ ImportResults importContactStateMotives(InputStream input) throws WaoException;
+
+ List<ReferentialState> getReferentialStates(ObsProgram obsProgram) throws WaoException;
+
+ void updateReferentialMeta(String entityClassFqn) throws WaoException;
+
+} //ServiceReferential
Added: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceReferentialAbstract.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceReferentialAbstract.java (rev 0)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceReferentialAbstract.java 2012-06-04 16:25:02 UTC (rev 1615)
@@ -0,0 +1,371 @@
+package fr.ifremer.wao.service;
+
+import fr.ifremer.wao.WaoException;
+import fr.ifremer.wao.bean.ContactState;
+import fr.ifremer.wao.bean.ObsProgram;
+import fr.ifremer.wao.bean.ReferentialState;
+import fr.ifremer.wao.bean.SamplingFilter;
+import fr.ifremer.wao.entity.ContactStateMotif;
+import fr.ifremer.wao.entity.FishingZone;
+import fr.ifremer.wao.entity.TerrestrialDivision;
+import fr.ifremer.wao.entity.TerrestrialLocation;
+import fr.ifremer.wao.io.ImportResults;
+import java.io.InputStream;
+import java.util.List;
+import org.nuiton.i18n.I18n;
+import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.TopiaException;
+
+public abstract class ServiceReferentialAbstract implements ServiceReferential {
+
+ protected abstract TopiaContext beginTransaction() throws TopiaException;
+
+ protected void commitTransaction(TopiaContext transaction) throws TopiaException {
+ transaction.commitTransaction();
+}
+
+ protected abstract void closeTransaction(TopiaContext transaction) throws TopiaException;
+
+ protected abstract void treateError(TopiaContext transaction, Exception eee, String message, Object... args) throws WaoException;
+
+ protected void treateError(Exception eee, String message, Object... args) throws WaoException {
+ treateError(null, eee, message, args);
+ }
+
+ protected abstract List<FishingZone> executeGetFishingZones(TopiaContext transaction) throws Exception;
+
+ protected abstract int executeImportFishingZoneCsv(TopiaContext transaction, InputStream input) throws Exception;
+
+ protected abstract ImportResults executeImportTerrestrialLocations(TopiaContext transaction, InputStream input) throws Exception;
+
+ protected abstract List<TerrestrialLocation> executeGetAllTerrestrialDistricts(TopiaContext transaction, SamplingFilter filter) throws Exception;
+
+ protected abstract List<TerrestrialLocation> executeGetAllPortsAndAuctions(TopiaContext transaction, TerrestrialLocation district) throws Exception;
+
+ protected abstract TerrestrialLocation executeGetTerrestrialDistrict(TopiaContext transaction, String districtCode) throws Exception;
+
+ protected abstract List<ContactStateMotif> executeGetAllContactStateMotifs(TopiaContext transaction, ContactState contactState) throws Exception;
+
+ protected abstract ImportResults executeImportTerrestrialDivisions(TopiaContext transaction, InputStream input) throws Exception;
+
+ protected abstract List<TerrestrialDivision> executeGetAllObservationUnits(TopiaContext transaction) throws Exception;
+
+ protected abstract List<TerrestrialLocation> executeGetAllPorts(TopiaContext transaction, TerrestrialLocation region) throws Exception;
+
+ protected abstract void executeInitialImport(TopiaContext transaction) throws Exception;
+
+ protected abstract ImportResults executeImportObsDebCodes(TopiaContext transaction, InputStream input) throws Exception;
+
+ protected abstract List<TerrestrialLocation> executeGetAllRegionIfremers(TopiaContext transaction) throws Exception;
+
+ protected abstract ImportResults executeImportContactStateMotives(TopiaContext transaction, InputStream input) throws Exception;
+
+ protected abstract List<ReferentialState> executeGetReferentialStates(TopiaContext transaction, ObsProgram obsProgram) throws Exception;
+
+ protected abstract void executeUpdateReferentialMeta(TopiaContext transaction, String entityClassFqn) throws Exception;
+
+ @Override
+ public List<FishingZone> getFishingZones() throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<FishingZone> result = executeGetFishingZones(transaction);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceReferential.getFishingZones"));
+ }
+ return null;
+ }
+
+ @Override
+ public int importFishingZoneCsv(InputStream input) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ int result = executeImportFishingZoneCsv(transaction, input);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceReferential.importFishingZoneCsv"));
+ }
+ return 0;
+ }
+
+ @Override
+ public ImportResults importTerrestrialLocations(InputStream input) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ ImportResults result = executeImportTerrestrialLocations(transaction, input);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceReferential.importTerrestrialLocations"));
+ }
+ return null;
+ }
+
+ @Override
+ public List<TerrestrialLocation> getAllTerrestrialDistricts(SamplingFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<TerrestrialLocation> result = executeGetAllTerrestrialDistricts(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceReferential.getAllTerrestrialDistricts"));
+ }
+ return null;
+ }
+
+ @Override
+ public List<TerrestrialLocation> getAllPortsAndAuctions(TerrestrialLocation district) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<TerrestrialLocation> result = executeGetAllPortsAndAuctions(transaction, district);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceReferential.getAllPortsAndAuctions"));
+ }
+ return null;
+ }
+
+ @Override
+ public TerrestrialLocation getTerrestrialDistrict(String districtCode) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ TerrestrialLocation result = executeGetTerrestrialDistrict(transaction, districtCode);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceReferential.getTerrestrialDistrict"));
+ }
+ return null;
+ }
+
+ @Override
+ public List<ContactStateMotif> getAllContactStateMotifs(ContactState contactState) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<ContactStateMotif> result = executeGetAllContactStateMotifs(transaction, contactState);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceReferential.getAllContactStateMotifs"));
+ }
+ return null;
+ }
+
+ @Override
+ public ImportResults importTerrestrialDivisions(InputStream input) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ ImportResults result = executeImportTerrestrialDivisions(transaction, input);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceReferential.importTerrestrialDivisions"));
+ }
+ return null;
+ }
+
+ @Override
+ public List<TerrestrialDivision> getAllObservationUnits() throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<TerrestrialDivision> result = executeGetAllObservationUnits(transaction);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceReferential.getAllObservationUnits"));
+ }
+ return null;
+ }
+
+ @Override
+ public List<TerrestrialLocation> getAllPorts(TerrestrialLocation region) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<TerrestrialLocation> result = executeGetAllPorts(transaction, region);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceReferential.getAllPorts"));
+ }
+ return null;
+ }
+
+ @Override
+ public void initialImport() throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ executeInitialImport(transaction);
+
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceReferential.initialImport"));
+ }
+
+ }
+
+ @Override
+ public ImportResults importObsDebCodes(InputStream input) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ ImportResults result = executeImportObsDebCodes(transaction, input);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceReferential.importObsDebCodes"));
+ }
+ return null;
+ }
+
+ @Override
+ public List<TerrestrialLocation> getAllRegionIfremers() throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<TerrestrialLocation> result = executeGetAllRegionIfremers(transaction);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceReferential.getAllRegionIfremers"));
+ }
+ return null;
+ }
+
+ @Override
+ public ImportResults importContactStateMotives(InputStream input) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ ImportResults result = executeImportContactStateMotives(transaction, input);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceReferential.importContactStateMotives"));
+ }
+ return null;
+ }
+
+ @Override
+ public List<ReferentialState> getReferentialStates(ObsProgram obsProgram) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<ReferentialState> result = executeGetReferentialStates(transaction, obsProgram);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceReferential.getReferentialStates"));
+ }
+ return null;
+ }
+
+ @Override
+ public void updateReferentialMeta(String entityClassFqn) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ executeUpdateReferentialMeta(transaction, entityClassFqn);
+
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceReferential.updateReferentialMeta"));
+ }
+
+ }
+
+} //ServiceReferentialAbstract
Added: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSampling.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSampling.java (rev 0)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSampling.java 2012-06-04 16:25:02 UTC (rev 1615)
@@ -0,0 +1,76 @@
+package fr.ifremer.wao.service;
+
+import fr.ifremer.wao.WaoBusinessException;
+import fr.ifremer.wao.WaoException;
+import fr.ifremer.wao.bean.ConnectedUser;
+import fr.ifremer.wao.bean.FacadeRow;
+import fr.ifremer.wao.bean.ObservationType;
+import fr.ifremer.wao.bean.SamplingFilter;
+import fr.ifremer.wao.bean.SamplingFilterValues;
+import fr.ifremer.wao.bean.ValidationResult;
+import fr.ifremer.wao.entity.Boat;
+import fr.ifremer.wao.entity.Company;
+import fr.ifremer.wao.entity.FishingGearDCF;
+import fr.ifremer.wao.entity.Profession;
+import fr.ifremer.wao.entity.SampleMonth;
+import fr.ifremer.wao.entity.SampleRow;
+import fr.ifremer.wao.entity.SampleRowLog;
+import fr.ifremer.wao.entity.TargetSpeciesDCF;
+import fr.ifremer.wao.io.ImportResults;
+import java.io.InputStream;
+import java.util.Date;
+import java.util.List;
+import org.apache.commons.lang3.tuple.Pair;
+import org.nuiton.util.PeriodDates;
+
+public interface ServiceSampling {
+
+ FacadeRow getSampleRowsOrderedByFishingZone(SamplingFilter filter) throws WaoException;
+
+ SampleRow getSampleRow(String sampleRowId) throws WaoException;
+
+ ImportResults importSamplingPlanCsv(InputStream input, ConnectedUser connectedUser) throws WaoException, WaoBusinessException;
+
+ void createUpdateSampleRow(SampleRow sampleRow, List<Boat> boats, SampleRowLog rowLog, ConnectedUser connectedUser) throws WaoException;
+
+ SampleRow newSampleRow(ConnectedUser connectedUser) throws WaoException;
+
+ SampleMonth getNewSampleMonth(Date period, SampleRow row) throws WaoException;
+
+ List<SampleRow> getSampleRowsByFilter(SamplingFilter filter) throws WaoException;
+
+ void deleteSampleRow(SampleRow sampleRow) throws WaoException, WaoBusinessException;
+
+ Profession getNewProfession(Profession profession) throws WaoException;
+
+ List<String> getPrograms(Company company) throws WaoException;
+
+ InputStream exportSamplingPlanCsv(ConnectedUser user, SamplingFilter filter) throws WaoException;
+
+ SampleRow getSampleRowByCode(ConnectedUser user, String rowCode) throws WaoException, WaoBusinessException;
+
+ void createSampleRowLog(SampleRowLog rowLog) throws WaoException, WaoBusinessException;
+
+ SampleRowLog getNewSampleRowLog(SampleRow row, ConnectedUser user) throws WaoException;
+
+ List<FishingGearDCF> getDCFGears(SamplingFilter filter) throws WaoException;
+
+ List<TargetSpeciesDCF> getDCFSpecies(SamplingFilter filter) throws WaoException;
+
+ int countSampleRows(SamplingFilter filter) throws WaoException;
+
+ SamplingFilterValues getPossibleValuesForFilter(SamplingFilter filter) throws WaoException;
+
+ SamplingFilter newSamplingFilter(ConnectedUser connectedUser) throws WaoException;
+
+ ValidationResult validateSampleRow(SampleRow sampleRow) throws WaoException;
+
+ InputStream exportSamplingPlanICalendar(ConnectedUser connectedUser) throws WaoException;
+
+ List<SampleRow> getSampleRowsForEligibility(ConnectedUser connectedUser) throws WaoException;
+
+ SampleRow newSampleRow(ConnectedUser connectedUser, ObservationType observationType) throws WaoException;
+
+ Pair<Double, Long> getObservationTimesInDays(SampleRow sampleRow, boolean estimatedTides, PeriodDates period) throws WaoException;
+
+} //ServiceSampling
Added: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingAbstract.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingAbstract.java (rev 0)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingAbstract.java 2012-06-04 16:25:02 UTC (rev 1615)
@@ -0,0 +1,547 @@
+package fr.ifremer.wao.service;
+
+import fr.ifremer.wao.WaoBusinessException;
+import fr.ifremer.wao.WaoException;
+import fr.ifremer.wao.bean.ConnectedUser;
+import fr.ifremer.wao.bean.FacadeRow;
+import fr.ifremer.wao.bean.ObservationType;
+import fr.ifremer.wao.bean.SamplingFilter;
+import fr.ifremer.wao.bean.SamplingFilterValues;
+import fr.ifremer.wao.bean.ValidationResult;
+import fr.ifremer.wao.entity.Boat;
+import fr.ifremer.wao.entity.Company;
+import fr.ifremer.wao.entity.FishingGearDCF;
+import fr.ifremer.wao.entity.Profession;
+import fr.ifremer.wao.entity.SampleMonth;
+import fr.ifremer.wao.entity.SampleRow;
+import fr.ifremer.wao.entity.SampleRowLog;
+import fr.ifremer.wao.entity.TargetSpeciesDCF;
+import fr.ifremer.wao.io.ImportResults;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import org.apache.commons.lang3.tuple.Pair;
+import org.nuiton.i18n.I18n;
+import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.TopiaException;
+import org.nuiton.util.PeriodDates;
+
+public abstract class ServiceSamplingAbstract implements ServiceSampling {
+
+ protected abstract TopiaContext beginTransaction() throws TopiaException;
+
+ protected void commitTransaction(TopiaContext transaction) throws TopiaException {
+ transaction.commitTransaction();
+}
+
+ protected abstract void closeTransaction(TopiaContext transaction) throws TopiaException;
+
+ protected abstract void treateError(TopiaContext transaction, Exception eee, String message, Object... args) throws WaoException;
+
+ protected void treateError(Exception eee, String message, Object... args) throws WaoException {
+ treateError(null, eee, message, args);
+ }
+
+ protected abstract FacadeRow executeGetSampleRowsOrderedByFishingZone(TopiaContext transaction, SamplingFilter filter) throws Exception;
+
+ protected abstract SampleRow executeGetSampleRow(TopiaContext transaction, List<Object> errorArgs, String sampleRowId) throws Exception;
+
+ protected abstract ImportResults executeImportSamplingPlanCsv(TopiaContext transaction, List<Object> errorArgs, InputStream input, ConnectedUser connectedUser) throws Exception;
+
+ protected abstract void executeCreateUpdateSampleRow(TopiaContext transaction, SampleRow sampleRow, List<Boat> boats, SampleRowLog rowLog, ConnectedUser connectedUser) throws Exception;
+
+ protected abstract SampleRow executeNewSampleRow(TopiaContext transaction, ConnectedUser connectedUser) throws Exception;
+
+ protected abstract SampleMonth executeGetNewSampleMonth(Date period, SampleRow row) throws Exception;
+
+ protected abstract List<SampleRow> executeGetSampleRowsByFilter(TopiaContext transaction, SamplingFilter filter) throws Exception;
+
+ protected abstract void executeDeleteSampleRow(TopiaContext transaction, List<Object> errorArgs, SampleRow sampleRow) throws Exception;
+
+ protected abstract Profession executeGetNewProfession(Profession profession) throws Exception;
+
+ protected abstract List<String> executeGetPrograms(TopiaContext transaction, Company company) throws Exception;
+
+ protected abstract InputStream executeExportSamplingPlanCsv(TopiaContext transaction, List<Object> errorArgs, ConnectedUser user, SamplingFilter filter) throws Exception;
+
+ protected abstract SampleRow executeGetSampleRowByCode(TopiaContext transaction, List<Object> errorArgs, ConnectedUser user, String rowCode) throws Exception;
+
+ protected abstract void executeCreateSampleRowLog(TopiaContext transaction, SampleRowLog rowLog) throws Exception;
+
+ protected abstract SampleRowLog executeGetNewSampleRowLog(SampleRow row, ConnectedUser user) throws Exception;
+
+ protected abstract List<FishingGearDCF> executeGetDCFGears(TopiaContext transaction, SamplingFilter filter) throws Exception;
+
+ protected abstract List<TargetSpeciesDCF> executeGetDCFSpecies(TopiaContext transaction, SamplingFilter filter) throws Exception;
+
+ protected abstract int executeCountSampleRows(TopiaContext transaction, SamplingFilter filter) throws Exception;
+
+ protected abstract SamplingFilterValues executeGetPossibleValuesForFilter(TopiaContext transaction, SamplingFilter filter) throws Exception;
+
+ protected abstract SamplingFilter executeNewSamplingFilter(TopiaContext transaction, ConnectedUser connectedUser) throws Exception;
+
+ protected abstract ValidationResult executeValidateSampleRow(TopiaContext transaction, SampleRow sampleRow) throws Exception;
+
+ protected abstract InputStream executeExportSamplingPlanICalendar(TopiaContext transaction, ConnectedUser connectedUser) throws Exception;
+
+ protected abstract List<SampleRow> executeGetSampleRowsForEligibility(TopiaContext transaction, ConnectedUser connectedUser) throws Exception;
+
+ protected abstract SampleRow executeNewSampleRow(TopiaContext transaction, ConnectedUser connectedUser, ObservationType observationType) throws Exception;
+
+ protected abstract Pair<Double, Long> executeGetObservationTimesInDays(TopiaContext transaction, SampleRow sampleRow, boolean estimatedTides, PeriodDates period) throws Exception;
+
+ @Override
+ public FacadeRow getSampleRowsOrderedByFishingZone(SamplingFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ FacadeRow result = executeGetSampleRowsOrderedByFishingZone(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSampling.getSampleRowsOrderedByFishingZone"));
+ }
+ return null;
+ }
+
+ @Override
+ public SampleRow getSampleRow(String sampleRowId) throws WaoException {
+ List<Object> errorArgs = new ArrayList<Object>();
+
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ SampleRow result = executeGetSampleRow(transaction, errorArgs, sampleRowId);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSampling.getSampleRow"), errorArgs.toArray());
+ }
+ return null;
+ }
+
+ @Override
+ public ImportResults importSamplingPlanCsv(InputStream input, ConnectedUser connectedUser) throws WaoException, WaoBusinessException {
+ List<Object> errorArgs = new ArrayList<Object>();
+
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ ImportResults result = executeImportSamplingPlanCsv(transaction, errorArgs, input, connectedUser);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (WaoBusinessException eee) {
+ throw eee;
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSampling.importSamplingPlanCsv"), errorArgs.toArray());
+ }
+ return null;
+ }
+
+ @Override
+ public void createUpdateSampleRow(SampleRow sampleRow, List<Boat> boats, SampleRowLog rowLog, ConnectedUser connectedUser) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ executeCreateUpdateSampleRow(transaction, sampleRow, boats, rowLog, connectedUser);
+
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSampling.createUpdateSampleRow"));
+ }
+
+ }
+
+ @Override
+ public SampleRow newSampleRow(ConnectedUser connectedUser) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ SampleRow result = executeNewSampleRow(transaction, connectedUser);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSampling.newSampleRow"));
+ }
+ return null;
+ }
+
+ @Override
+ public SampleMonth getNewSampleMonth(Date period, SampleRow row) throws WaoException {
+ try {
+
+ SampleMonth result = executeGetNewSampleMonth(period, row);
+ return result;
+ } catch (Exception eee) {
+ treateError(eee, I18n.n_("wao.error.serviceSampling.getNewSampleMonth"));
+ }
+ return null;
+ }
+
+ @Override
+ public List<SampleRow> getSampleRowsByFilter(SamplingFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<SampleRow> result = executeGetSampleRowsByFilter(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSampling.getSampleRowsByFilter"));
+ }
+ return null;
+ }
+
+ @Override
+ public void deleteSampleRow(SampleRow sampleRow) throws WaoException, WaoBusinessException {
+ List<Object> errorArgs = new ArrayList<Object>();
+
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ executeDeleteSampleRow(transaction, errorArgs, sampleRow);
+
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (WaoBusinessException eee) {
+ throw eee;
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSampling.deleteSampleRow"), errorArgs.toArray());
+ }
+
+ }
+
+ @Override
+ public Profession getNewProfession(Profession profession) throws WaoException {
+ try {
+
+ Profession result = executeGetNewProfession(profession);
+ return result;
+ } catch (Exception eee) {
+ treateError(eee, I18n.n_("wao.error.serviceSampling.getNewProfession"));
+ }
+ return null;
+ }
+
+ @Override
+ public List<String> getPrograms(Company company) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<String> result = executeGetPrograms(transaction, company);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSampling.getPrograms"));
+ }
+ return null;
+ }
+
+ @Override
+ public InputStream exportSamplingPlanCsv(ConnectedUser user, SamplingFilter filter) throws WaoException {
+ List<Object> errorArgs = new ArrayList<Object>();
+
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ InputStream result = executeExportSamplingPlanCsv(transaction, errorArgs, user, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSampling.exportSamplingPlanCsv"), errorArgs.toArray());
+ }
+ return null;
+ }
+
+ @Override
+ public SampleRow getSampleRowByCode(ConnectedUser user, String rowCode) throws WaoException, WaoBusinessException {
+ List<Object> errorArgs = new ArrayList<Object>();
+
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ SampleRow result = executeGetSampleRowByCode(transaction, errorArgs, user, rowCode);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (WaoBusinessException eee) {
+ throw eee;
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSampling.getSampleRowByCode"), errorArgs.toArray());
+ }
+ return null;
+ }
+
+ @Override
+ public void createSampleRowLog(SampleRowLog rowLog) throws WaoException, WaoBusinessException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ executeCreateSampleRowLog(transaction, rowLog);
+
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (WaoBusinessException eee) {
+ throw eee;
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSampling.createSampleRowLog"));
+ }
+
+ }
+
+ @Override
+ public SampleRowLog getNewSampleRowLog(SampleRow row, ConnectedUser user) throws WaoException {
+ try {
+
+ SampleRowLog result = executeGetNewSampleRowLog(row, user);
+ return result;
+ } catch (Exception eee) {
+ treateError(eee, I18n.n_("wao.error.serviceSampling.getNewSampleRowLog"));
+ }
+ return null;
+ }
+
+ @Override
+ public List<FishingGearDCF> getDCFGears(SamplingFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<FishingGearDCF> result = executeGetDCFGears(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSampling.getDCFGears"));
+ }
+ return null;
+ }
+
+ @Override
+ public List<TargetSpeciesDCF> getDCFSpecies(SamplingFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<TargetSpeciesDCF> result = executeGetDCFSpecies(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSampling.getDCFSpecies"));
+ }
+ return null;
+ }
+
+ @Override
+ public int countSampleRows(SamplingFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ int result = executeCountSampleRows(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSampling.countSampleRows"));
+ }
+ return 0;
+ }
+
+ @Override
+ public SamplingFilterValues getPossibleValuesForFilter(SamplingFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ SamplingFilterValues result = executeGetPossibleValuesForFilter(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSampling.getPossibleValuesForFilter"));
+ }
+ return null;
+ }
+
+ @Override
+ public SamplingFilter newSamplingFilter(ConnectedUser connectedUser) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ SamplingFilter result = executeNewSamplingFilter(transaction, connectedUser);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSampling.newSamplingFilter"));
+ }
+ return null;
+ }
+
+ @Override
+ public ValidationResult validateSampleRow(SampleRow sampleRow) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ ValidationResult result = executeValidateSampleRow(transaction, sampleRow);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSampling.validateSampleRow"));
+ }
+ return null;
+ }
+
+ @Override
+ public InputStream exportSamplingPlanICalendar(ConnectedUser connectedUser) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ InputStream result = executeExportSamplingPlanICalendar(transaction, connectedUser);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSampling.exportSamplingPlanICalendar"));
+ }
+ return null;
+ }
+
+ @Override
+ public List<SampleRow> getSampleRowsForEligibility(ConnectedUser connectedUser) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<SampleRow> result = executeGetSampleRowsForEligibility(transaction, connectedUser);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSampling.getSampleRowsForEligibility"));
+ }
+ return null;
+ }
+
+ @Override
+ public SampleRow newSampleRow(ConnectedUser connectedUser, ObservationType observationType) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ SampleRow result = executeNewSampleRow(transaction, connectedUser, observationType);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSampling.newSampleRow"));
+ }
+ return null;
+ }
+
+ @Override
+ public Pair<Double, Long> getObservationTimesInDays(SampleRow sampleRow, boolean estimatedTides, PeriodDates period) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ Pair<Double, Long> result = executeGetObservationTimesInDays(transaction, sampleRow, estimatedTides, period);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSampling.getObservationTimesInDays"));
+ }
+ return null;
+ }
+
+} //ServiceSamplingAbstract
Added: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSynthesis.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSynthesis.java (rev 0)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSynthesis.java 2012-06-04 16:25:02 UTC (rev 1615)
@@ -0,0 +1,50 @@
+package fr.ifremer.wao.service;
+
+import fr.ifremer.wao.WaoException;
+import fr.ifremer.wao.bean.BoardingResult;
+import fr.ifremer.wao.bean.ContactAverageReactivity;
+import fr.ifremer.wao.bean.ContactFilter;
+import fr.ifremer.wao.bean.ContactStateStatistics;
+import fr.ifremer.wao.bean.GlobalSynthesisParameters;
+import fr.ifremer.wao.bean.GlobalSynthesisResult;
+import fr.ifremer.wao.bean.PieChartData;
+import fr.ifremer.wao.entity.IndicatorLog;
+import fr.ifremer.wao.entity.WaoUser;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedMap;
+import org.apache.commons.lang3.tuple.Pair;
+
+public interface ServiceSynthesis {
+
+ Pair<SortedMap<Date, Integer>, SortedMap<Date, Integer>> getDataSampling(ContactFilter filter) throws WaoException;
+
+ BoardingResult getBoardingBoats(ContactFilter filter) throws WaoException;
+
+ Map<String, Double> getComplianceBoardingIndicator(ContactFilter filter) throws WaoException;
+
+ Collection<ContactStateStatistics> getContactStateStatistics(ContactFilter filter) throws WaoException;
+
+ Collection<ContactAverageReactivity> getContactDataInputDateReactivity(ContactFilter filter) throws WaoException;
+
+ Map<String, Double> getDataReliability(ContactFilter filter) throws WaoException;
+
+ GlobalSynthesisResult getGlobalSynthesisResult(ContactFilter filter) throws WaoException;
+
+ GlobalSynthesisParameters getGlobalSynthesisParameters() throws WaoException;
+
+ void updateGlobalSynthesisParameters(GlobalSynthesisParameters parameters, WaoUser author, String comment) throws WaoException;
+
+ List<IndicatorLog> getAllIndicatorLogs() throws WaoException;
+
+ Map<String, PieChartData> getContactPieChartDataByBoatDistrict(ContactFilter filter) throws WaoException;
+
+ Map<String, PieChartData> getContactStateMotifsPieChartDataByBoatDistrict(ContactFilter filter) throws WaoException;
+
+ Map<String, Map<String, Integer>> getObservationHours(ContactFilter filter) throws WaoException;
+
+ Map<String, Map<String, Integer>> getDistinctBoatsCounts(ContactFilter filter) throws WaoException;
+
+} //ServiceSynthesis
Added: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSynthesisAbstract.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSynthesisAbstract.java (rev 0)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSynthesisAbstract.java 2012-06-04 16:25:02 UTC (rev 1615)
@@ -0,0 +1,333 @@
+package fr.ifremer.wao.service;
+
+import fr.ifremer.wao.WaoException;
+import fr.ifremer.wao.bean.BoardingResult;
+import fr.ifremer.wao.bean.ContactAverageReactivity;
+import fr.ifremer.wao.bean.ContactFilter;
+import fr.ifremer.wao.bean.ContactStateStatistics;
+import fr.ifremer.wao.bean.GlobalSynthesisParameters;
+import fr.ifremer.wao.bean.GlobalSynthesisResult;
+import fr.ifremer.wao.bean.PieChartData;
+import fr.ifremer.wao.entity.IndicatorLog;
+import fr.ifremer.wao.entity.WaoUser;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedMap;
+import org.apache.commons.lang3.tuple.Pair;
+import org.nuiton.i18n.I18n;
+import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.TopiaException;
+
+public abstract class ServiceSynthesisAbstract implements ServiceSynthesis {
+
+ protected abstract TopiaContext beginTransaction() throws TopiaException;
+
+ protected void commitTransaction(TopiaContext transaction) throws TopiaException {
+ transaction.commitTransaction();
+}
+
+ protected abstract void closeTransaction(TopiaContext transaction) throws TopiaException;
+
+ protected abstract void treateError(TopiaContext transaction, Exception eee, String message, Object... args) throws WaoException;
+
+ protected void treateError(Exception eee, String message, Object... args) throws WaoException {
+ treateError(null, eee, message, args);
+ }
+
+ protected abstract Pair<SortedMap<Date, Integer>, SortedMap<Date, Integer>> executeGetDataSampling(TopiaContext transaction, ContactFilter filter) throws Exception;
+
+ protected abstract BoardingResult executeGetBoardingBoats(TopiaContext transaction, ContactFilter filter) throws Exception;
+
+ protected abstract Map<String, Double> executeGetComplianceBoardingIndicator(TopiaContext transaction, ContactFilter filter) throws Exception;
+
+ protected abstract Collection<ContactStateStatistics> executeGetContactStateStatistics(TopiaContext transaction, ContactFilter filter) throws Exception;
+
+ protected abstract Collection<ContactAverageReactivity> executeGetContactDataInputDateReactivity(TopiaContext transaction, ContactFilter filter) throws Exception;
+
+ protected abstract Map<String, Double> executeGetDataReliability(TopiaContext transaction, ContactFilter filter) throws Exception;
+
+ protected abstract GlobalSynthesisResult executeGetGlobalSynthesisResult(TopiaContext transaction, ContactFilter filter) throws Exception;
+
+ protected abstract GlobalSynthesisParameters executeGetGlobalSynthesisParameters(TopiaContext transaction) throws Exception;
+
+ protected abstract void executeUpdateGlobalSynthesisParameters(TopiaContext transaction, GlobalSynthesisParameters parameters, WaoUser author, String comment) throws Exception;
+
+ protected abstract List<IndicatorLog> executeGetAllIndicatorLogs(TopiaContext transaction) throws Exception;
+
+ protected abstract Map<String, PieChartData> executeGetContactPieChartDataByBoatDistrict(TopiaContext transaction, ContactFilter filter) throws Exception;
+
+ protected abstract Map<String, PieChartData> executeGetContactStateMotifsPieChartDataByBoatDistrict(TopiaContext transaction, ContactFilter filter) throws Exception;
+
+ protected abstract Map<String, Map<String, Integer>> executeGetObservationHours(TopiaContext transaction, ContactFilter filter) throws Exception;
+
+ protected abstract Map<String, Map<String, Integer>> executeGetDistinctBoatsCounts(TopiaContext transaction, ContactFilter filter) throws Exception;
+
+ @Override
+ public Pair<SortedMap<Date, Integer>, SortedMap<Date, Integer>> getDataSampling(ContactFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ Pair<SortedMap<Date, Integer>, SortedMap<Date, Integer>> result = executeGetDataSampling(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSynthesis.getDataSampling"));
+ }
+ return null;
+ }
+
+ @Override
+ public BoardingResult getBoardingBoats(ContactFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ BoardingResult result = executeGetBoardingBoats(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSynthesis.getBoardingBoats"));
+ }
+ return null;
+ }
+
+ @Override
+ public Map<String, Double> getComplianceBoardingIndicator(ContactFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ Map<String, Double> result = executeGetComplianceBoardingIndicator(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSynthesis.getComplianceBoardingIndicator"));
+ }
+ return null;
+ }
+
+ @Override
+ public Collection<ContactStateStatistics> getContactStateStatistics(ContactFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ Collection<ContactStateStatistics> result = executeGetContactStateStatistics(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSynthesis.getContactStateStatistics"));
+ }
+ return null;
+ }
+
+ @Override
+ public Collection<ContactAverageReactivity> getContactDataInputDateReactivity(ContactFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ Collection<ContactAverageReactivity> result = executeGetContactDataInputDateReactivity(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSynthesis.getContactDataInputDateReactivity"));
+ }
+ return null;
+ }
+
+ @Override
+ public Map<String, Double> getDataReliability(ContactFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ Map<String, Double> result = executeGetDataReliability(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSynthesis.getDataReliability"));
+ }
+ return null;
+ }
+
+ @Override
+ public GlobalSynthesisResult getGlobalSynthesisResult(ContactFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ GlobalSynthesisResult result = executeGetGlobalSynthesisResult(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSynthesis.getGlobalSynthesisResult"));
+ }
+ return null;
+ }
+
+ @Override
+ public GlobalSynthesisParameters getGlobalSynthesisParameters() throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ GlobalSynthesisParameters result = executeGetGlobalSynthesisParameters(transaction);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSynthesis.getGlobalSynthesisParameters"));
+ }
+ return null;
+ }
+
+ @Override
+ public void updateGlobalSynthesisParameters(GlobalSynthesisParameters parameters, WaoUser author, String comment) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ executeUpdateGlobalSynthesisParameters(transaction, parameters, author, comment);
+
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSynthesis.updateGlobalSynthesisParameters"));
+ }
+
+ }
+
+ @Override
+ public List<IndicatorLog> getAllIndicatorLogs() throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<IndicatorLog> result = executeGetAllIndicatorLogs(transaction);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSynthesis.getAllIndicatorLogs"));
+ }
+ return null;
+ }
+
+ @Override
+ public Map<String, PieChartData> getContactPieChartDataByBoatDistrict(ContactFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ Map<String, PieChartData> result = executeGetContactPieChartDataByBoatDistrict(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSynthesis.getContactPieChartDataByBoatDistrict"));
+ }
+ return null;
+ }
+
+ @Override
+ public Map<String, PieChartData> getContactStateMotifsPieChartDataByBoatDistrict(ContactFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ Map<String, PieChartData> result = executeGetContactStateMotifsPieChartDataByBoatDistrict(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSynthesis.getContactStateMotifsPieChartDataByBoatDistrict"));
+ }
+ return null;
+ }
+
+ @Override
+ public Map<String, Map<String, Integer>> getObservationHours(ContactFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ Map<String, Map<String, Integer>> result = executeGetObservationHours(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSynthesis.getObservationHours"));
+ }
+ return null;
+ }
+
+ @Override
+ public Map<String, Map<String, Integer>> getDistinctBoatsCounts(ContactFilter filter) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ Map<String, Map<String, Integer>> result = executeGetDistinctBoatsCounts(transaction, filter);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceSynthesis.getDistinctBoatsCounts"));
+ }
+ return null;
+ }
+
+} //ServiceSynthesisAbstract
Added: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceUser.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceUser.java (rev 0)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceUser.java 2012-06-04 16:25:02 UTC (rev 1615)
@@ -0,0 +1,42 @@
+package fr.ifremer.wao.service;
+
+import fr.ifremer.wao.WaoBusinessException;
+import fr.ifremer.wao.WaoException;
+import fr.ifremer.wao.bean.ConnectedUser;
+import fr.ifremer.wao.entity.Company;
+import fr.ifremer.wao.entity.WaoUser;
+import java.util.List;
+
+public interface ServiceUser {
+
+ ConnectedUser connect(String login, String password) throws WaoException, WaoBusinessException;
+
+ void createUpdateUser(WaoUser user, boolean generatePassword) throws WaoException, WaoBusinessException;
+
+ void createUpdateCompany(Company company) throws WaoException;
+
+ List<Company> getCompanies(boolean activeOnly) throws WaoException;
+
+ void forgetPassword(String login) throws WaoException, WaoBusinessException;
+
+ List<WaoUser> getObservers(Company company, boolean activeOnly) throws WaoException;
+
+ void deleteUser(WaoUser user) throws WaoException, WaoBusinessException;
+
+ List<WaoUser> getUsersByCompany(Company company) throws WaoException;
+
+ WaoUser getNewUser(Company company) throws WaoException;
+
+ void createDefaultAdmin() throws WaoException;
+
+ Company getCompany(String companyId) throws WaoException;
+
+ void deleteCompany(Company company) throws WaoException, WaoBusinessException;
+
+ ConnectedUser getConnectedUserByToken(String tokenId) throws WaoException;
+
+ void addTokensToAllProfiles() throws WaoException;
+
+ void acceptCgu(ConnectedUser connectedUser) throws WaoException;
+
+} //ServiceUser
Added: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceUserAbstract.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceUserAbstract.java (rev 0)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceUserAbstract.java 2012-06-04 16:25:02 UTC (rev 1615)
@@ -0,0 +1,350 @@
+package fr.ifremer.wao.service;
+
+import fr.ifremer.wao.WaoBusinessException;
+import fr.ifremer.wao.WaoException;
+import fr.ifremer.wao.bean.ConnectedUser;
+import fr.ifremer.wao.entity.Company;
+import fr.ifremer.wao.entity.WaoUser;
+import java.util.ArrayList;
+import java.util.List;
+import org.nuiton.i18n.I18n;
+import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.TopiaException;
+
+public abstract class ServiceUserAbstract implements ServiceUser {
+
+ protected abstract TopiaContext beginTransaction() throws TopiaException;
+
+ protected void commitTransaction(TopiaContext transaction) throws TopiaException {
+ transaction.commitTransaction();
+}
+
+ protected abstract void closeTransaction(TopiaContext transaction) throws TopiaException;
+
+ protected abstract void treateError(TopiaContext transaction, Exception eee, String message, Object... args) throws WaoException;
+
+ protected void treateError(Exception eee, String message, Object... args) throws WaoException {
+ treateError(null, eee, message, args);
+ }
+
+ protected abstract ConnectedUser executeConnect(TopiaContext transaction, String login, String password) throws Exception;
+
+ protected abstract void executeCreateUpdateUser(TopiaContext transaction, WaoUser user, boolean generatePassword) throws Exception;
+
+ protected abstract void executeCreateUpdateCompany(TopiaContext transaction, Company company) throws Exception;
+
+ protected abstract List<Company> executeGetCompanies(TopiaContext transaction, boolean activeOnly) throws Exception;
+
+ protected abstract void executeForgetPassword(TopiaContext transaction, String login) throws Exception;
+
+ protected abstract List<WaoUser> executeGetObservers(TopiaContext transaction, Company company, boolean activeOnly) throws Exception;
+
+ protected abstract void executeDeleteUser(TopiaContext transaction, WaoUser user) throws Exception;
+
+ protected abstract List<WaoUser> executeGetUsersByCompany(TopiaContext transaction, List<Object> errorArgs, Company company) throws Exception;
+
+ protected abstract WaoUser executeGetNewUser(Company company) throws Exception;
+
+ protected abstract void executeCreateDefaultAdmin(TopiaContext transaction) throws Exception;
+
+ protected abstract Company executeGetCompany(TopiaContext transaction, String companyId) throws Exception;
+
+ protected abstract void executeDeleteCompany(TopiaContext transaction, Company company) throws Exception;
+
+ protected abstract ConnectedUser executeGetConnectedUserByToken(TopiaContext transaction, String tokenId) throws Exception;
+
+ protected abstract void executeAddTokensToAllProfiles(TopiaContext transaction) throws Exception;
+
+ protected abstract void executeAcceptCgu(TopiaContext transaction, ConnectedUser connectedUser) throws Exception;
+
+ @Override
+ public ConnectedUser connect(String login, String password) throws WaoException, WaoBusinessException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ ConnectedUser result = executeConnect(transaction, login, password);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (WaoBusinessException eee) {
+ throw eee;
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceUser.connect"));
+ }
+ return null;
+ }
+
+ @Override
+ public void createUpdateUser(WaoUser user, boolean generatePassword) throws WaoException, WaoBusinessException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ executeCreateUpdateUser(transaction, user, generatePassword);
+
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (WaoBusinessException eee) {
+ throw eee;
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceUser.createUpdateUser"));
+ }
+
+ }
+
+ @Override
+ public void createUpdateCompany(Company company) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ executeCreateUpdateCompany(transaction, company);
+
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceUser.createUpdateCompany"));
+ }
+
+ }
+
+ @Override
+ public List<Company> getCompanies(boolean activeOnly) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<Company> result = executeGetCompanies(transaction, activeOnly);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceUser.getCompanies"));
+ }
+ return null;
+ }
+
+ @Override
+ public void forgetPassword(String login) throws WaoException, WaoBusinessException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ executeForgetPassword(transaction, login);
+
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (WaoBusinessException eee) {
+ throw eee;
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceUser.forgetPassword"));
+ }
+
+ }
+
+ @Override
+ public List<WaoUser> getObservers(Company company, boolean activeOnly) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<WaoUser> result = executeGetObservers(transaction, company, activeOnly);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceUser.getObservers"));
+ }
+ return null;
+ }
+
+ @Override
+ public void deleteUser(WaoUser user) throws WaoException, WaoBusinessException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ executeDeleteUser(transaction, user);
+
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (WaoBusinessException eee) {
+ throw eee;
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceUser.deleteUser"));
+ }
+
+ }
+
+ @Override
+ public List<WaoUser> getUsersByCompany(Company company) throws WaoException {
+ List<Object> errorArgs = new ArrayList<Object>();
+
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ List<WaoUser> result = executeGetUsersByCompany(transaction, errorArgs, company);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceUser.getUsersByCompany"), errorArgs.toArray());
+ }
+ return null;
+ }
+
+ @Override
+ public WaoUser getNewUser(Company company) throws WaoException {
+ try {
+
+ WaoUser result = executeGetNewUser(company);
+ return result;
+ } catch (Exception eee) {
+ treateError(eee, I18n.n_("wao.error.serviceUser.getNewUser"));
+ }
+ return null;
+ }
+
+ @Override
+ public void createDefaultAdmin() throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ executeCreateDefaultAdmin(transaction);
+
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceUser.createDefaultAdmin"));
+ }
+
+ }
+
+ @Override
+ public Company getCompany(String companyId) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ Company result = executeGetCompany(transaction, companyId);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceUser.getCompany"));
+ }
+ return null;
+ }
+
+ @Override
+ public void deleteCompany(Company company) throws WaoException, WaoBusinessException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ executeDeleteCompany(transaction, company);
+
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (WaoBusinessException eee) {
+ throw eee;
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceUser.deleteCompany"));
+ }
+
+ }
+
+ @Override
+ public ConnectedUser getConnectedUserByToken(String tokenId) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ ConnectedUser result = executeGetConnectedUserByToken(transaction, tokenId);
+ return result;
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceUser.getConnectedUserByToken"));
+ }
+ return null;
+ }
+
+ @Override
+ public void addTokensToAllProfiles() throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ executeAddTokensToAllProfiles(transaction);
+
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceUser.addTokensToAllProfiles"));
+ }
+
+ }
+
+ @Override
+ public void acceptCgu(ConnectedUser connectedUser) throws WaoException {
+ TopiaContext transaction = null;
+ try {
+ transaction = beginTransaction();
+
+ try {
+ executeAcceptCgu(transaction, connectedUser);
+
+ } finally {
+ closeTransaction(transaction);
+ }
+
+ } catch (Exception eee) {
+ treateError(transaction, eee, I18n.n_("wao.error.serviceUser.acceptCgu"));
+ }
+
+ }
+
+} //ServiceUserAbstract
1
0
03 May '12
Author: maven-release
Date: 2012-05-03 17:28:50 +0200 (Thu, 03 May 2012)
New Revision: 1614
Url: http://forge.codelutin.com/repositories/revision/wao/1614
Log:
[maven-release-plugin] prepare for next development iteration
Modified:
trunk/pom.xml
trunk/wao-business/pom.xml
trunk/wao-ui/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-05-03 15:28:43 UTC (rev 1613)
+++ trunk/pom.xml 2012-05-03 15:28:50 UTC (rev 1614)
@@ -15,7 +15,7 @@
<groupId>fr.ifremer</groupId>
<artifactId>wao</artifactId>
- <version>3.3.4</version>
+ <version>3.3.5-SNAPSHOT</version>
<modules>
<module>wao-business</module>
@@ -354,12 +354,12 @@
<scm>
<connection>
- scm:svn:http://svn.forge.codelutin.com/svn/wao/tags/wao-3.3.4
+ scm:svn:http://svn.forge.codelutin.com/svn/wao/trunk
</connection>
<developerConnection>
- scm:svn:http://svn.forge.codelutin.com/svn/wao/tags/wao-3.3.4
+ scm:svn:http://svn.forge.codelutin.com/svn/wao/trunk
</developerConnection>
- <url>http://forge.codelutin.com/repositories/browse/wao/tags/wao-3.3.4</url>
+ <url>http://forge.codelutin.com/repositories/browse/wao/trunk</url>
</scm>
<distributionManagement>
Modified: trunk/wao-business/pom.xml
===================================================================
--- trunk/wao-business/pom.xml 2012-05-03 15:28:43 UTC (rev 1613)
+++ trunk/wao-business/pom.xml 2012-05-03 15:28:50 UTC (rev 1614)
@@ -10,7 +10,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>wao</artifactId>
- <version>3.3.4</version>
+ <version>3.3.5-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.wao</groupId>
Modified: trunk/wao-ui/pom.xml
===================================================================
--- trunk/wao-ui/pom.xml 2012-05-03 15:28:43 UTC (rev 1613)
+++ trunk/wao-ui/pom.xml 2012-05-03 15:28:50 UTC (rev 1614)
@@ -10,7 +10,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>wao</artifactId>
- <version>3.3.4</version>
+ <version>3.3.5-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.wao</groupId>
1
0
Author: maven-release
Date: 2012-05-03 17:28:43 +0200 (Thu, 03 May 2012)
New Revision: 1613
Url: http://forge.codelutin.com/repositories/revision/wao/1613
Log:
[maven-release-plugin] copy for tag wao-3.3.4
Added:
tags/wao-3.3.4/
Property changes on: tags/wao-3.3.4
___________________________________________________________________
Added: svn:ignore
+ *.ipr
*.iws
*.iml
*.idea
target
nbactions.xml
Added: svn:mergeinfo
+ /branches/wao-1.5.x:679-733
1
0
03 May '12
Author: maven-release
Date: 2012-05-03 17:28:36 +0200 (Thu, 03 May 2012)
New Revision: 1612
Url: http://forge.codelutin.com/repositories/revision/wao/1612
Log:
[maven-release-plugin] prepare release wao-3.3.4
Modified:
trunk/pom.xml
trunk/wao-business/pom.xml
trunk/wao-ui/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-05-03 15:21:03 UTC (rev 1611)
+++ trunk/pom.xml 2012-05-03 15:28:36 UTC (rev 1612)
@@ -15,7 +15,7 @@
<groupId>fr.ifremer</groupId>
<artifactId>wao</artifactId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.3.4</version>
<modules>
<module>wao-business</module>
@@ -354,12 +354,12 @@
<scm>
<connection>
- scm:svn:http://svn.forge.codelutin.com/svn/wao/trunk
+ scm:svn:http://svn.forge.codelutin.com/svn/wao/tags/wao-3.3.4
</connection>
<developerConnection>
- scm:svn:http://svn.forge.codelutin.com/svn/wao/trunk
+ scm:svn:http://svn.forge.codelutin.com/svn/wao/tags/wao-3.3.4
</developerConnection>
- <url>http://forge.codelutin.com/repositories/browse/wao/trunk</url>
+ <url>http://forge.codelutin.com/repositories/browse/wao/tags/wao-3.3.4</url>
</scm>
<distributionManagement>
Modified: trunk/wao-business/pom.xml
===================================================================
--- trunk/wao-business/pom.xml 2012-05-03 15:21:03 UTC (rev 1611)
+++ trunk/wao-business/pom.xml 2012-05-03 15:28:36 UTC (rev 1612)
@@ -10,7 +10,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>wao</artifactId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.3.4</version>
</parent>
<groupId>fr.ifremer.wao</groupId>
Modified: trunk/wao-ui/pom.xml
===================================================================
--- trunk/wao-ui/pom.xml 2012-05-03 15:21:03 UTC (rev 1611)
+++ trunk/wao-ui/pom.xml 2012-05-03 15:28:36 UTC (rev 1612)
@@ -10,7 +10,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>wao</artifactId>
- <version>3.3.4-SNAPSHOT</version>
+ <version>3.3.4</version>
</parent>
<groupId>fr.ifremer.wao</groupId>
1
0
r1611 - trunk/wao-business/src/main/java/fr/ifremer/wao/io/csv2/models/operations
by bleny@users.forge.codelutin.com 03 May '12
by bleny@users.forge.codelutin.com 03 May '12
03 May '12
Author: bleny
Date: 2012-05-03 17:21:03 +0200 (Thu, 03 May 2012)
New Revision: 1611
Url: http://forge.codelutin.com/repositories/revision/wao/1611
Log:
ent?\195?\170tes licence
Modified:
trunk/wao-business/src/main/java/fr/ifremer/wao/io/csv2/models/operations/SampleRowDistrictNameGetter.java
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/io/csv2/models/operations/SampleRowDistrictNameGetter.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/io/csv2/models/operations/SampleRowDistrictNameGetter.java 2012-04-27 16:04:09 UTC (rev 1610)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/io/csv2/models/operations/SampleRowDistrictNameGetter.java 2012-05-03 15:21:03 UTC (rev 1611)
@@ -1,3 +1,26 @@
+/*
+ * #%L
+ * Wao :: Business
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2012 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
package fr.ifremer.wao.io.csv2.models.operations;
import fr.ifremer.wao.entity.SampleRow;
1
0
r1610 - trunk/wao-business/src/main/java/fr/ifremer/wao/entity
by bleny@users.forge.codelutin.com 27 Apr '12
by bleny@users.forge.codelutin.com 27 Apr '12
27 Apr '12
Author: bleny
Date: 2012-04-27 18:04:09 +0200 (Fri, 27 Apr 2012)
New Revision: 1610
Url: http://forge.codelutin.com/repositories/revision/wao/1610
Log:
fixes #1179 Erreur dans le calcul du programm?\195?\169 dans la synth?\195?\168se si on filtre sur une fa?\195?\167ade
Modified:
trunk/wao-business/src/main/java/fr/ifremer/wao/entity/SampleRowDAOImpl.java
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/entity/SampleRowDAOImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/entity/SampleRowDAOImpl.java 2012-04-27 16:03:24 UTC (rev 1609)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/entity/SampleRowDAOImpl.java 2012-04-27 16:04:09 UTC (rev 1610)
@@ -74,21 +74,24 @@
if (filterOnFishingZone) {
String fishingZoneAlias = WaoQueryHelper.newFishingZoneProperty().defaultAlias();
- query.addDistinct()
- .addLeftJoin(query.getMainAlias() + "." + SampleRow.PROPERTY_FISHING_ZONE, fishingZoneAlias, false);
+ TopiaQuery subQuery = createQuery("SR2");
+ subQuery.setSelect("SR2." + SampleRow.TOPIA_ID)
+ .addJoin("SR2." + SampleRow.PROPERTY_FISHING_ZONE, fishingZoneAlias, false);
+
if (filterOnFaceName) {
- query.addEquals(
+ subQuery.addEquals(
fishingZoneAlias + "." + FishingZone.PROPERTY_FACADE_NAME,
filter.getFacadeName());
}
if (filterOnSectorName) {
- query.addEquals(
+ subQuery.addEquals(
fishingZoneAlias + "." + FishingZone.PROPERTY_SECTOR_NAME,
filter.getSectorName());
}
+ query.addSubQuery(query.getMainAlias() + "." + SampleRow.TOPIA_ID + " IN (?)", subQuery);
}
boolean filterOnDcfGears = filter.getFishingGearDCF() != null;
1
0