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
April 2010
- 4 participants
- 73 discussions
[Suiviobsmer-commits] r443 - in trunk/wao-ui: . src/main/java/fr/ifremer/wao/ui/components src/test src/test/java src/test/java/fr src/test/java/fr/ifremer src/test/java/fr/ifremer/wao src/test/java/fr/ifremer/wao/ui src/test/java/fr/ifremer/wao/ui/data src/test/resources
by fdesbois@users.labs.libre-entreprise.org 13 Apr '10
by fdesbois@users.labs.libre-entreprise.org 13 Apr '10
13 Apr '10
Author: fdesbois
Date: 2010-04-13 10:46:01 +0000 (Tue, 13 Apr 2010)
New Revision: 443
Log:
test
Added:
trunk/wao-ui/src/test/java/fr/
trunk/wao-ui/src/test/java/fr/ifremer/
trunk/wao-ui/src/test/java/fr/ifremer/wao/
trunk/wao-ui/src/test/java/fr/ifremer/wao/ui/
trunk/wao-ui/src/test/java/fr/ifremer/wao/ui/data/
trunk/wao-ui/src/test/java/fr/ifremer/wao/ui/data/BusinessUtilsTest.java
trunk/wao-ui/src/test/java/fr/ifremer/wao/ui/pages/
trunk/wao-ui/src/test/resources/
trunk/wao-ui/src/test/resources/log4j.properties
Modified:
trunk/wao-ui/pom.xml
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/components/Layout.java
Modified: trunk/wao-ui/pom.xml
===================================================================
--- trunk/wao-ui/pom.xml 2010-04-12 17:05:24 UTC (rev 442)
+++ trunk/wao-ui/pom.xml 2010-04-13 10:46:01 UTC (rev 443)
@@ -57,6 +57,18 @@
</dependency>
<!-- Tests -->
<dependency>
+ <groupId>org.apache.tapestry</groupId>
+ <artifactId>tapestry-test</artifactId>
+ </dependency>
+<!-- <dependency>
+ <groupId>com.formos.tapestry</groupId>
+ <artifactId>tapestry-testify</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ </dependency>-->
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
@@ -137,6 +149,12 @@
<url>http://kenai.com/svn/t5-easy-fckeditor~maven-release-repository</url>
<layout>default</layout>
</repository>
+
+ <repository>
+ <id>tapestry</id>
+ <name>Tapestry Formos</name>
+ <url>http://tapestry.formos.com/maven-repository</url>
+ </repository>
</repositories>
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/components/Layout.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/components/Layout.java 2010-04-12 17:05:24 UTC (rev 442)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/components/Layout.java 2010-04-13 10:46:01 UTC (rev 443)
@@ -107,7 +107,7 @@
if (logger.isDebugEnabled()) {
logger.debug("Initialize page from Layout");
}
- page.initialize();
+ //page.initialize();
}
boolean afterRender() {
Added: trunk/wao-ui/src/test/java/fr/ifremer/wao/ui/data/BusinessUtilsTest.java
===================================================================
--- trunk/wao-ui/src/test/java/fr/ifremer/wao/ui/data/BusinessUtilsTest.java (rev 0)
+++ trunk/wao-ui/src/test/java/fr/ifremer/wao/ui/data/BusinessUtilsTest.java 2010-04-13 10:46:01 UTC (rev 443)
@@ -0,0 +1,73 @@
+
+package fr.ifremer.wao.ui.data;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * @author fdesbois
+ */
+public class BusinessUtilsTest {
+
+ private Logger logger = LoggerFactory.getLogger(BusinessUtilsTest.class);
+
+ public BusinessUtilsTest() {
+ }
+
+ @BeforeClass
+ public static void setUpClass() throws Exception {
+ }
+
+ @AfterClass
+ public static void tearDownClass() throws Exception {
+ }
+
+ @Before
+ public void setUp() {
+ }
+
+ @After
+ public void tearDown() {
+ }
+
+ /**
+ * Test of getTooltipSampleRow method, of class BusinessUtils.
+ */
+ @Test
+ public void testGetTooltipSampleRow() throws Exception {
+ logger.info("getTooltipSampleRow");
+
+ BusinessUtils.getTooltipBoat(null);
+ }
+
+ /**
+ * Test of getTooltipBoat method, of class BusinessUtils.
+ */
+ @Test
+ public void testGetTooltipBoat() {
+ System.out.println("getTooltipBoat");
+ }
+
+ /**
+ * Test of getDataSamplingTitle method, of class BusinessUtils.
+ */
+ @Test
+ public void testGetDataSamplingTitle() {
+ System.out.println("getDataSamplingTitle");
+ }
+
+ /**
+ * Test of getContactStyle method, of class BusinessUtils.
+ */
+ @Test
+ public void testGetContactStyle() {
+ System.out.println("getContactStyle");
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/wao-ui/src/test/java/fr/ifremer/wao/ui/data/BusinessUtilsTest.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Added: trunk/wao-ui/src/test/resources/log4j.properties
===================================================================
--- trunk/wao-ui/src/test/resources/log4j.properties (rev 0)
+++ trunk/wao-ui/src/test/resources/log4j.properties 2010-04-13 10:46:01 UTC (rev 443)
@@ -0,0 +1,8 @@
+# Default to info level output; this is very handy if you eventually use Hibernate as well.
+log4j.rootCategory=WARN, console
+
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%d [%p] %c %m%n
+#log4j.appender.console.layout.ConversionPattern=%d{HH:mm:ss} %5p (%F:%L) %m%n
+log4j.appender.console.Threshold=DEBUG
1
0
[Suiviobsmer-commits] r442 - in trunk: . wao-business/src/main/java/fr/ifremer/wao/bean wao-ui/src/main/java/fr/ifremer/wao/ui/base wao-ui/src/main/java/fr/ifremer/wao/ui/components wao-ui/src/main/java/fr/ifremer/wao/ui/pages
by fdesbois@users.labs.libre-entreprise.org 12 Apr '10
by fdesbois@users.labs.libre-entreprise.org 12 Apr '10
12 Apr '10
Author: fdesbois
Date: 2010-04-12 17:05:24 +0000 (Mon, 12 Apr 2010)
New Revision: 442
Log:
- Ano #2242 : Change of observer when editing a contact (not same id compared)
- Problem with initialize filter -> add initizalize method in WaoPage called in Layout for global initialization (used for abstract page)
Modified:
trunk/changelog.txt
trunk/wao-business/src/main/java/fr/ifremer/wao/bean/SamplingFilterImpl.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/base/AbstractFilteredPage.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/base/WaoPage.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/components/FeedBack.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/components/Layout.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/BoatActivityCalendar.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Boats.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/ExceptionReport.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Index.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowHistoric.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Synthesis.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/UserProfile.java
Modified: trunk/changelog.txt
===================================================================
--- trunk/changelog.txt 2010-04-12 14:21:11 UTC (rev 441)
+++ trunk/changelog.txt 2010-04-12 17:05:24 UTC (rev 442)
@@ -9,20 +9,22 @@
Evolutions
++++++++++
-- [fdesbois] Evo #2244 : Ajout infos CNIL dans le pied de page
+- [fdesbois] Evo #2244 : Ajout infos CNIL dans le pied de page.
- [fdesbois] Evo #2060 : Dans la partie contact des informations privées du
- navire, ajouter les champs Adresse (code postal + ville + adresse) et N° SIRET
+ navire, ajouter les champs Adresse (code postal + ville + adresse) et N° SIRET.
- [fdesbois] Evo #2069 : Role admin : Ajouter la visibilité réduite sur les
- contacts et le plan d'échantillonnage
-- [fdesbois] Evo #2059 : Filtres sur tableau plan échantillonnage
+ contacts et le plan d'échantillonnage.
+- [fdesbois] Evo #2059 : Filtres sur tableau plan échantillonnage.
- [fdesbois] Evo #2241 : Revoir chargement des observateurs lorsqu'un
- utilisateur (observateur/coordinateur) est connecté
+ utilisateur (observateur/coordinateur) est connecté.
Anomalies
+++++++++
+- [fdesbois] Ano #2242 : Changement du nom de l'observateur lors de l'édition
+ d'une ligne de contact.
- [fdesbois] Ano #2245 : Erreur création ligne du plan : le chargement des
- colonnes des mois en fonction de la période ne fonctionne pas
+ colonnes des mois en fonction de la période ne fonctionne pas.
Dépendances
+++++++++++
@@ -30,6 +32,8 @@
- **Nuiton-utils** 1.2.1 -> 1.2.2 [http://maven-site.nuiton.org/nuiton-utils]
- **EUGene** 2.0 -> 2.0.1 [http://maven-site.nuiton.org/eugene]
- **ToPIA** 2.3.2.1 -> 2.3.3 [http://maven-site.nuiton.org/topia]
+- **mavenpom4labs** 2.0.7 -> 2.1 [http://maven-site.nuiton.org/mavenpom/mavenpom4labs]
+ TODO
1.1.1 (patch)
-------------
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/bean/SamplingFilterImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/bean/SamplingFilterImpl.java 2010-04-12 14:21:11 UTC (rev 441)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/bean/SamplingFilterImpl.java 2010-04-12 17:05:24 UTC (rev 442)
@@ -49,7 +49,7 @@
* FishingZone {@code main} alias for the query.
*
* @param query to prepare with fishingZone filters (facadeName, sectorName)
- * @param main alias of the fishingZone in the query
+ * @param sampleRow alias of the fishingZone in the query
* @return the query with elements added
* @since 1.1.2
*/
@@ -74,7 +74,7 @@
* alias to set SampleRow properties.
*
* @param query to prepare with sampleRow filters
- * @param main alias for sampleRow entity in the query
+ * @param sampleRow alias for sampleRow entity in the query
* @return the query with filtered elements added
*/
@Override
@@ -89,7 +89,7 @@
* the query already have the fishingZone.
*
* @param query to prepare with sampleRow filters
- * @param main alias for sampleRow entity in the query
+ * @param sampleRow alias for sampleRow entity in the query
* @param zoneAlias for fishingZone entity in the query (can be null)
* @return the query with filtered elements added
*/
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/base/AbstractFilteredPage.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/base/AbstractFilteredPage.java 2010-04-12 14:21:11 UTC (rev 441)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/base/AbstractFilteredPage.java 2010-04-12 17:05:24 UTC (rev 442)
@@ -80,7 +80,7 @@
* Mise a jour: $Date$
* par : $Author$
*/
-public abstract class AbstractFilteredPage {
+public abstract class AbstractFilteredPage implements WaoPage {
@Inject
private Logger log;
@@ -135,15 +135,33 @@
@Persist
private boolean programSelect;
+
/**
+ * Need to be call in setupRender of the page which inherits this abstract
+ * class.
+ */
+ @Override
+ public void initialize() {
+ // Very very important to do that at beginning
+ if (!user.isAdmin()) {
+ if (log.isDebugEnabled()) {
+ log.debug("Company filtered : " + user.getCompany().getName());
+ }
+ getFilter().setCompany(user.getCompany());
+ }
+ }
+
+ /**
* Initialize all select for filters. By default, only facade, sector and
* sampleRow selects will be initialized.
*
* @param companySelect if true, company select will be initialized
* @param observerSelect if true, observer select will be initialized
+ * @param programSelect
* @throws WaoException
*/
- protected void initSelectFilters(boolean companySelect, boolean observerSelect, boolean programSelect) throws WaoException {
+ protected void initSelectFilters(boolean companySelect,
+ boolean observerSelect, boolean programSelect) throws WaoException {
this.observerSelect = observerSelect;
this.programSelect = programSelect;
@@ -159,12 +177,13 @@
if (getFilter().getCompany() != null) {
companyId = getFilter().getCompany().getTopiaId();
}
- } else if (!user.isAdmin()) {
- if (log.isDebugEnabled()) {
- log.debug("Company filtered : " + user.getCompany());
- }
- getFilter().setCompany(user.getCompany());
}
+// else if (!user.isAdmin()) {
+// if (log.isDebugEnabled()) {
+// log.debug("Company filtered : " + user.getCompany());
+// }
+// getFilter().setCompany(user.getCompany());
+// }
if (observerSelect) {
observerSelectModel = null;
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/base/WaoPage.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/base/WaoPage.java 2010-04-12 14:21:11 UTC (rev 441)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/base/WaoPage.java 2010-04-12 17:05:24 UTC (rev 442)
@@ -34,6 +34,16 @@
*/
public interface WaoPage {
+ /**
+ * Used to determine if the page has to be displayed (depends on user right)
+ *
+ * @return true if the page has to be displayed
+ */
boolean canDisplay();
+ /**
+ * Used to initialize data in renderer of Layout component
+ */
+ void initialize();
+
}
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/components/FeedBack.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/components/FeedBack.java 2010-04-12 14:21:11 UTC (rev 441)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/components/FeedBack.java 2010-04-12 17:05:24 UTC (rev 442)
@@ -146,7 +146,6 @@
return reload;
}
- @Log
public void clearErrors() {
errorMessages.clear();
reload = false;
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/components/Layout.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/components/Layout.java 2010-04-12 14:21:11 UTC (rev 441)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/components/Layout.java 2010-04-12 17:05:24 UTC (rev 442)
@@ -104,6 +104,10 @@
contentFeedback.addError("Vous n'êtes pas autorisé à accéder" +
" à cette page !");
}
+ if (logger.isDebugEnabled()) {
+ logger.debug("Initialize page from Layout");
+ }
+ page.initialize();
}
boolean afterRender() {
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java 2010-04-12 14:21:11 UTC (rev 441)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java 2010-04-12 17:05:24 UTC (rev 442)
@@ -73,6 +73,11 @@
return currentUser.isAdmin() && !currentUser.getReadOnly();
}
+ @Override
+ public void initialize() {
+
+ }
+
@Inject
private Logger log;
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/BoatActivityCalendar.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/BoatActivityCalendar.java 2010-04-12 14:21:11 UTC (rev 441)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/BoatActivityCalendar.java 2010-04-12 17:05:24 UTC (rev 442)
@@ -65,7 +65,12 @@
public boolean canDisplay() {
return true;
}
+
+ @Override
+ public void initialize() {
+ }
+
@Inject
private Logger log;
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Boats.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Boats.java 2010-04-12 14:21:11 UTC (rev 441)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Boats.java 2010-04-12 17:05:24 UTC (rev 442)
@@ -42,7 +42,6 @@
import fr.ifremer.wao.ui.base.AbstractFilteredPage;
import fr.ifremer.wao.ui.data.BusinessUtils;
import fr.ifremer.wao.ui.base.GenericSelectModel;
-import fr.ifremer.wao.ui.base.WaoPage;
import fr.ifremer.wao.ui.components.FeedBack;
import fr.ifremer.wao.ui.components.Layout;
import fr.ifremer.wao.ui.data.BoatDataSource;
@@ -91,7 +90,7 @@
* par : $Author$
*/
@IncludeStylesheet("context:css/boats.css")
-public class Boats extends AbstractFilteredPage implements WaoPage {
+public class Boats extends AbstractFilteredPage {
/**
* No restriction to display this page.
@@ -103,6 +102,10 @@
return true;
}
+ @Override
+ public void initialize() {
+ }
+
@Inject
private Logger log;
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java 2010-04-12 14:21:11 UTC (rev 441)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java 2010-04-12 17:05:24 UTC (rev 442)
@@ -41,7 +41,6 @@
import fr.ifremer.wao.ui.data.ContactDataSource;
import fr.ifremer.wao.ui.data.BusinessUtils;
import fr.ifremer.wao.ui.base.GenericSelectModel;
-import fr.ifremer.wao.ui.base.WaoPage;
import fr.ifremer.wao.ui.components.Layout;
import fr.ifremer.wao.ui.data.ExportStreamResponse;
import fr.ifremer.wao.ui.services.ContactModelFactory;
@@ -86,7 +85,7 @@
* par : $Author$
*/
@IncludeStylesheet("context:css/contacts.css")
-public class Contacts extends AbstractFilteredPage implements WaoPage {
+public class Contacts extends AbstractFilteredPage {
/**
* No restriction to display this page.
@@ -128,9 +127,9 @@
if (isFiltersVisible()) {
initSelectFilters(true, false, true);
}
- // Initialize fullView to true for amdmin user
- if (fullView == null && user.isAdmin()) {
- fullView = true;
+ // Initialize fullView to true for admin user
+ if (fullView == null) {
+ fullView = user.isAdmin();
}
}
@@ -517,18 +516,22 @@
}
}
+ @Log
void onSelectedFromEditContact(String contactId) throws WaoException {
if (log.isDebugEnabled()) {
log.debug("Edit contact : " + contactId);
+ log.debug("Contact : " + getContacts().get(contactId));
+ log.debug("Set observerId : " + getContacts().get(contactId).getObserver());
}
contactEdited = getContacts().get(contactId); //prepareContactEdited(contactId);
- contactUserId = contactEdited.getObserver().getTopiaId();
+ contactUserId = contactEdited.getObserver().getId();
//contactEditedId = contactId;
contactSelectedId = contactId;
oldComment = contactEdited.getComment();
edited = true;
}
+ @Log
void onSelectedFromDeleteContact(String contactId) throws WaoException {
if (log.isDebugEnabled()) {
log.debug("Delete contact : " + contactId);
@@ -537,9 +540,11 @@
deleted = true;
}
+ @Log
void onSelectedFromSaveContact(String contactId) throws WaoException {
if (log.isDebugEnabled()) {
log.debug("Save contact : " + contactId);
+ log.debug("Observer Id : " + contactUserId);
}
// ContactEdited is in session, previously set by Edit action
// contactEdited.setState(contactState.toString());
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/ExceptionReport.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/ExceptionReport.java 2010-04-12 14:21:11 UTC (rev 441)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/ExceptionReport.java 2010-04-12 17:05:24 UTC (rev 442)
@@ -54,6 +54,10 @@
return true;
}
+ @Override
+ public void initialize() {
+ }
+
@InjectComponent
private Layout layout;
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Index.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Index.java 2010-04-12 14:21:11 UTC (rev 441)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Index.java 2010-04-12 17:05:24 UTC (rev 442)
@@ -66,6 +66,10 @@
return true;
}
+ @Override
+ public void initialize() {
+ }
+
@Inject
private ServiceNews serviceNews;
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java 2010-04-12 14:21:11 UTC (rev 441)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java 2010-04-12 17:05:24 UTC (rev 442)
@@ -92,6 +92,10 @@
return user.isAdmin() && !user.getReadOnly();
}
+ @Override
+ public void initialize() {
+ }
+
@Inject
private Logger log;
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowHistoric.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowHistoric.java 2010-04-12 14:21:11 UTC (rev 441)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowHistoric.java 2010-04-12 17:05:24 UTC (rev 442)
@@ -67,6 +67,10 @@
return true;
}
+ @Override
+ public void initialize() {
+ }
+
@Inject
private Logger log;
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java 2010-04-12 14:21:11 UTC (rev 441)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java 2010-04-12 17:05:24 UTC (rev 442)
@@ -36,7 +36,6 @@
import fr.ifremer.wao.service.ServiceReferential;
import fr.ifremer.wao.service.ServiceSampling;
import fr.ifremer.wao.ui.base.AbstractFilteredPage;
-import fr.ifremer.wao.ui.base.WaoPage;
import fr.ifremer.wao.ui.components.Layout;
import fr.ifremer.wao.ui.data.ExportStreamResponse;
import java.io.IOException;
@@ -46,7 +45,6 @@
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
-import org.apache.commons.lang.time.DurationFormatUtils;
import org.apache.tapestry5.StreamResponse;
import org.apache.tapestry5.annotations.IncludeStylesheet;
import org.apache.tapestry5.annotations.InjectComponent;
@@ -75,7 +73,7 @@
* par : $Author$
*/
@IncludeStylesheet("context:css/sampling.css")
-public class SamplingPlan extends AbstractFilteredPage implements WaoPage {
+public class SamplingPlan extends AbstractFilteredPage {
/**
* No restriction to display this page.
@@ -115,9 +113,6 @@
* Page initialization
*/
void setupRender() {
- if (log.isDebugEnabled()) {
- log.debug("Data is null ? : " + (data == null));
- }
if (isFiltersVisible()) {
// Initialize filters
initSelectFilters(true, false, true);
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Synthesis.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Synthesis.java 2010-04-12 14:21:11 UTC (rev 441)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Synthesis.java 2010-04-12 17:05:24 UTC (rev 442)
@@ -75,7 +75,7 @@
* par : $Author$
*/
@IncludeStylesheet("context:css/synthesis.css")
-public class Synthesis extends AbstractFilteredPage implements WaoPage {
+public class Synthesis extends AbstractFilteredPage {
/**
* No restriction to display this page.
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/UserProfile.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/UserProfile.java 2010-04-12 14:21:11 UTC (rev 441)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/UserProfile.java 2010-04-12 17:05:24 UTC (rev 442)
@@ -61,6 +61,10 @@
return true;
}
+ @Override
+ public void initialize() {
+ }
+
@Inject
private Logger log;
1
0
12 Apr '10
Author: fdesbois
Date: 2010-04-12 14:21:11 +0000 (Mon, 12 Apr 2010)
New Revision: 441
Log:
Update changelog for 1.2
Modified:
trunk/changelog.txt
Modified: trunk/changelog.txt
===================================================================
--- trunk/changelog.txt 2010-04-12 14:13:02 UTC (rev 440)
+++ trunk/changelog.txt 2010-04-12 14:21:11 UTC (rev 441)
@@ -9,6 +9,7 @@
Evolutions
++++++++++
+- [fdesbois] Evo #2244 : Ajout infos CNIL dans le pied de page
- [fdesbois] Evo #2060 : Dans la partie contact des informations privées du
navire, ajouter les champs Adresse (code postal + ville + adresse) et N° SIRET
- [fdesbois] Evo #2069 : Role admin : Ajouter la visibilité réduite sur les
@@ -20,6 +21,9 @@
Anomalies
+++++++++
+- [fdesbois] Ano #2245 : Erreur création ligne du plan : le chargement des
+ colonnes des mois en fonction de la période ne fonctionne pas
+
Dépendances
+++++++++++
1
0
[Suiviobsmer-commits] r440 - in trunk/wao-ui/src/main: resources/fr/ifremer/wao/ui/components webapp/css
by fdesbois@users.labs.libre-entreprise.org 12 Apr '10
by fdesbois@users.labs.libre-entreprise.org 12 Apr '10
12 Apr '10
Author: fdesbois
Date: 2010-04-12 14:13:02 +0000 (Mon, 12 Apr 2010)
New Revision: 440
Log:
Evo #2244 : add cnil text in footer
Modified:
trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/components/Layout.tml
trunk/wao-ui/src/main/webapp/css/main.css
Modified: trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/components/Layout.tml
===================================================================
--- trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/components/Layout.tml 2010-04-12 14:02:38 UTC (rev 439)
+++ trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/components/Layout.tml 2010-04-12 14:13:02 UTC (rev 440)
@@ -81,30 +81,36 @@
</t:if>
</div>
<div id="so-footer">
- <a href="http://suiviobsmer.labs.libre-entreprise.org/wao/" title="Documentation de l'application" target="blank">
- WAO
- </a>
- <a href="http://suiviobsmer.labs.libre-entreprise.org/wao/release-note.html" title="Modifications faites pour cette version" target="blank">
- ${version}
- </a> -
- <a href="mailto:obsmer at ifremer.fr" title="Contacter un responsable Obsmer" target="blank">
- Obsmer
- </a> -
- <a href="http://www.ifremer.fr/sih" title="Page d'accueil du SIH" target="blank">
- Ifremer SIH
- </a> -
- <a href="http://www.gnu.org/licenses/gpl.html" title="License GPL v3" target="blank">
- GPLv3
- </a> - Copyright 2009-2010
- <a href="http://www.ifremer.fr" title="Ifremer" target="blank">
- Ifremer</a>,
- <a href="http://www.codelutin.com" title="Code Lutin" target="blank">
- Code Lutin
- </a>
-<!-- -
- <a href="https://labs.libre-entreprise.org/tracker/?atid=692&group_id=154&func=browse" title="Bug Tracker">
- Bugs
- </a>-->
+ <p>
+ <a href="http://suiviobsmer.labs.libre-entreprise.org/wao/" title="Documentation de l'application" target="blank">
+ WAO
+ </a>
+ <a href="http://suiviobsmer.labs.libre-entreprise.org/wao/release-note.html" title="Modifications faites pour cette version" target="blank">
+ ${version}
+ </a> -
+ <a href="mailto:obsmer at ifremer.fr" title="Contacter un responsable Obsmer" target="blank">
+ Obsmer
+ </a> -
+ <a href="http://www.ifremer.fr/sih" title="Page d'accueil du SIH" target="blank">
+ Ifremer SIH
+ </a> -
+ <a href="http://www.gnu.org/licenses/gpl.html" title="License GPL v3" target="blank">
+ GPLv3
+ </a> - Copyright 2009-2010
+ <a href="http://www.ifremer.fr" title="Ifremer" target="blank">
+ Ifremer</a>,
+ <a href="http://www.codelutin.com" title="Code Lutin" target="blank">
+ Code Lutin
+ </a>
+ <!-- -
+ <a href="https://labs.libre-entreprise.org/tracker/?atid=692&group_id=154&func=browse" title="Bug Tracker">
+ Bugs
+ </a>-->
+ </p>
+ <p class="cnil">
+ Le site de "SUIVI DU REALISE DU PLAN D'ECHANTILLONNAGE DES OBSERVATIONS A LA MER" a fait l'objet d'une déclaration à
+ la CNIL sous le numéro suivant : 1414476
+ </p>
</div>
</body>
Modified: trunk/wao-ui/src/main/webapp/css/main.css
===================================================================
--- trunk/wao-ui/src/main/webapp/css/main.css 2010-04-12 14:02:38 UTC (rev 439)
+++ trunk/wao-ui/src/main/webapp/css/main.css 2010-04-12 14:13:02 UTC (rev 440)
@@ -165,4 +165,8 @@
div#so-footer a:hover {
text-decoration: underline;
+}
+
+div#so-footer p.cnil {
+ font-size: 0.7em;
}
\ No newline at end of file
1
0
12 Apr '10
Author: fdesbois
Date: 2010-04-12 14:02:38 +0000 (Mon, 12 Apr 2010)
New Revision: 439
Log:
- Ano #2245 : Problem on sampleRow creation (NPE on listener for new months)
- Improve samplingPlan loading (calcul move to SampleRowImpl + done only once when sampleRows are loading from db)
- Replace concatenation by StringBuilder in BusinessUtils for Tooltips
- Clean log4j for prod
Modified:
trunk/wao-business/src/main/java/fr/ifremer/wao/WaoContextImpl.java
trunk/wao-business/src/main/java/fr/ifremer/wao/bean/FacadeRowImpl.java
trunk/wao-business/src/main/java/fr/ifremer/wao/entity/SampleRowImpl.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java
trunk/wao-business/src/main/xmi/wao.zargo
trunk/wao-business/src/test/resources/log4j.properties
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/components/Layout.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/data/BusinessUtils.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java
trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/components/Layout.tml
trunk/wao-ui/src/main/resources/log4j.properties
trunk/wao-ui/src/main/webapp/SamplingPlan.tml
trunk/wao-ui/src/main/webapp/css/sampling.css
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/WaoContextImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/WaoContextImpl.java 2010-04-08 17:14:30 UTC (rev 438)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/WaoContextImpl.java 2010-04-12 14:02:38 UTC (rev 439)
@@ -24,11 +24,11 @@
import fr.ifremer.wao.io.ImportHelper;
import fr.ifremer.wao.service.ServiceUser;
+import java.io.PrintStream;
import java.nio.charset.Charset;
import java.security.NoSuchAlgorithmException;
import java.util.Date;
import java.util.Locale;
-import java.util.logging.Level;
import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.mail.EmailException;
@@ -128,16 +128,24 @@
conf.setConfigFileName(DEFAULT_FILENAME);
conf.parse(new String[]{});
- conf.printConfig();
-
loadMigrationConfiguration(conf);
loadConfiguration(conf);
+
+ printConfiguration();
} catch (ArgumentsParserException eee) {
treateError(eee, n_("wao.error.context.parse"), DEFAULT_FILENAME);
}
}
+ protected void printConfiguration() {
+ //StringWriter writer = new StringWriter();
+// PrintWriter printWriter = new PrintWriter(new StringWriter());
+// PrintStream stream = new PrintStream();
+ configuration.printConfig();
+// stream.
+ }
+
protected void loadMigrationConfiguration(ApplicationConfig conf) {
// migration configuration
String callBackName = null;
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/bean/FacadeRowImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/bean/FacadeRowImpl.java 2010-04-08 17:14:30 UTC (rev 438)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/bean/FacadeRowImpl.java 2010-04-12 14:02:38 UTC (rev 439)
@@ -26,6 +26,7 @@
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import org.nuiton.util.PeriodDates;
/**
* FacadeRowImpl
@@ -64,6 +65,9 @@
rows = new ArrayList<SampleRow>();
sectorMap.put(sectors, rows);
}
+ // Prepare data by month : calculate tides (real/expected) and remove
+ // unused months for period
+ row.prepareDataByMonth(period);
// Add the row to the list
rows.add(row);
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/entity/SampleRowImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/entity/SampleRowImpl.java 2010-04-08 17:14:30 UTC (rev 438)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/entity/SampleRowImpl.java 2010-04-12 14:02:38 UTC (rev 439)
@@ -29,13 +29,18 @@
import fr.ifremer.wao.WaoProperty;
import fr.ifremer.wao.bean.UserRole;
import java.io.Serializable;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import org.apache.commons.lang.BooleanUtils;
+import org.apache.commons.lang.time.DurationFormatUtils;
import org.apache.commons.mail.EmailException;
import org.nuiton.i18n.I18n;
import org.nuiton.topia.TopiaContext;
@@ -61,33 +66,95 @@
private static final long serialVersionUID = 1L;
+ protected Integer totalTidesReal;
+
+ protected Integer totalTidesExpected;
+
+ protected Map<String, SampleMonth> sampleMonthMap;
+
+ protected DateFormat monthFormat = new SimpleDateFormat("MM/yyyy");
+
/**
- * Get a SampleMonth from a date. The month and year of the date must correspond to the SampleMonth to get.
+ * Get a SampleMonth from a date. The month and year of the date must
+ * correspond to the SampleMonth to get.
* @param date a Date
- * @return the SampleMonth if it exists in the SampleMonth list or null otherwise
+ * @return the SampleMonth if it exists in the SampleMonth list or null
+ * otherwise
*/
@Override
public SampleMonth getSampleMonth(Date date) {
if (getSampleMonth() == null) {
return null;
}
-// Calendar ref = new GregorianCalendar();
-// ref.setTime(date);
- //log.info("Ref : " + date);
- for (SampleMonth curr : getSampleMonth()) {
- //log.info("Curr month : " + curr.getPeriodDate() + " : " + curr.getPeriodMonth() + " / " + curr.getPeriodYear());
-// if (ref.get(Calendar.MONTH) == (curr.getPeriodMonth()-1) && ref.get(Calendar.YEAR) == curr.getPeriodYear()) {
+//// Calendar ref = new GregorianCalendar();
+//// ref.setTime(date);
+// //log.info("Ref : " + date);
+// for (SampleMonth curr : getSampleMonth()) {
+// //log.info("Curr month : " + curr.getPeriodDate() + " : " + curr.getPeriodMonth() + " / " + curr.getPeriodYear());
+//// if (ref.get(Calendar.MONTH) == (curr.getPeriodMonth()-1) && ref.get(Calendar.YEAR) == curr.getPeriodYear()) {
+//// return curr;
+//// }
+// Date min = DateUtils.setFirstDayOfMonth(curr.getPeriodDate());
+// Date max = DateUtils.setLastDayOfMonth(curr.getPeriodDate());
+// if (DateUtils.between(date, min, max)) {
// return curr;
// }
- Date min = DateUtils.setFirstDayOfMonth(curr.getPeriodDate());
- Date max = DateUtils.setLastDayOfMonth(curr.getPeriodDate());
- if (DateUtils.between(date, min, max)) {
- return curr;
+// }
+ if (sampleMonthMap != null) {
+ // Direct access if map is defined from prepareDataByMonth
+ String dateFormatted = monthFormat.format(date);
+ return sampleMonthMap.get(dateFormatted);
+ } else {
+ for (SampleMonth curr : getSampleMonth()) {
+ Date min = DateUtils.setFirstDayOfMonth(curr.getPeriodDate());
+ Date max = DateUtils.setLastDayOfMonth(curr.getPeriodDate());
+ if (DateUtils.between(date, min, max)) {
+ return curr;
+ }
}
}
return null;
}
+ @Override
+ public void prepareDataByMonth(PeriodDates period) {
+ // Do not call this method outside a TopiaContext, will not work
+ // because of lazy initialization over sampleMonth. Also this
+ // calcul need to be done when data for sampleRows is loading.
+ long start = System.currentTimeMillis();
+ totalTidesExpected = 0;
+ totalTidesReal = 0;
+ Iterator<SampleMonth> it = getSampleMonth().iterator();
+ sampleMonthMap = new HashMap<String, SampleMonth>();
+ while (it.hasNext()) {
+ SampleMonth curr = it.next();
+ if (period == null || period.between(curr.getPeriodDate())) {
+ totalTidesExpected += curr.getExpectedTidesValue();
+ totalTidesReal += curr.getRealTidesValue();
+ String date = monthFormat.format(curr.getPeriodDate());
+ sampleMonthMap.put(date, curr);
+ } else {
+ // Month not used for period
+ it.remove();
+ }
+ }
+ if (log.isTraceEnabled()) {
+ long stop = System.currentTimeMillis();
+ log.trace("prepareDataByMonth Time : " +
+ DurationFormatUtils.formatDurationHMS(stop - start));
+ }
+ }
+
+ @Override
+ public Integer getTotalTidesReal() {
+ return totalTidesReal;
+ }
+
+ @Override
+ public Integer getTotalTidesExpected() {
+ return totalTidesExpected;
+ }
+
/**
* Return the first fishingZone of the list linked with the SampleRow.
* @return a FishingZone or null if there is no fishingZone linked with the SampleRow
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java 2010-04-08 17:14:30 UTC (rev 438)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java 2010-04-12 14:02:38 UTC (rev 439)
@@ -287,6 +287,7 @@
SamplingFilter filter, Company company)
throws TopiaException {
FacadeRow result = new FacadeRowImpl();
+ result.setPeriod(filter.getPeriod());
SampleRowDAO dao = WaoDAOHelper.getSampleRowDAO(transaction);
@@ -312,7 +313,7 @@
}
// Load data
- query.addLoad(SampleRow.SAMPLE_MONTH);
+// query.addLoad(SampleRow.SAMPLE_MONTH);
List<SampleRow> results = dao.findAllByQuery(query);
for (SampleRow row : results) {
Modified: trunk/wao-business/src/main/xmi/wao.zargo
===================================================================
(Binary files differ)
Modified: trunk/wao-business/src/test/resources/log4j.properties
===================================================================
--- trunk/wao-business/src/test/resources/log4j.properties 2010-04-08 17:14:30 UTC (rev 438)
+++ trunk/wao-business/src/test/resources/log4j.properties 2010-04-12 14:02:38 UTC (rev 439)
@@ -8,6 +8,6 @@
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d [%p] %c{2} %m%n
-log4j.logger.fr.ifremer.wao=DEBUG
+log4j.logger.fr.ifremer.wao=INFO
log4j.logger.org.nuiton.util=INFO
log4j.logger.org.nuiton.util.beans.BinderProvider=ERROR
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/components/Layout.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/components/Layout.java 2010-04-08 17:14:30 UTC (rev 438)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/components/Layout.java 2010-04-12 14:02:38 UTC (rev 439)
@@ -29,6 +29,7 @@
import fr.ifremer.wao.service.ServiceUser;
import fr.ifremer.wao.ui.base.WaoPage;
import fr.ifremer.wao.ui.pages.Index;
+import fr.ifremer.wao.ui.services.WaoManager;
import org.apache.commons.lang.StringUtils;
import org.apache.tapestry5.BindingConstants;
import org.apache.tapestry5.PersistenceConstants;
@@ -56,6 +57,9 @@
*/
public class Layout {
+ @Inject
+ private WaoManager manager;
+
@Parameter(required = true, defaultPrefix = BindingConstants.LITERAL)
private String pageTitle;
@@ -121,6 +125,10 @@
return true;
}
+ public boolean isDevEnvironment() {
+ return manager.isDevEnvironment();
+ }
+
/**
* Test if the current user in session is a valid user.
* Test topia id existence because WaoUser can be empty when session is lost
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/data/BusinessUtils.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/data/BusinessUtils.java 2010-04-08 17:14:30 UTC (rev 438)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/data/BusinessUtils.java 2010-04-12 14:02:38 UTC (rev 439)
@@ -21,8 +21,6 @@
package fr.ifremer.wao.ui.data;
-import fr.ifremer.wao.WaoBusinessException;
-import fr.ifremer.wao.WaoException;
import fr.ifremer.wao.bean.ContactState;
import fr.ifremer.wao.bean.SamplingFilter;
import fr.ifremer.wao.entity.Boat;
@@ -34,8 +32,6 @@
import java.text.SimpleDateFormat;
import org.apache.commons.lang.BooleanUtils;
import org.apache.commons.lang.StringUtils;
-import org.apache.tapestry5.ioc.Messages;
-import org.slf4j.Logger;
/**
* DataUtils
@@ -52,81 +48,94 @@
public static String getTooltipSampleRow(SampleRow row) {
- String result = "";
+ StringBuilder result = new StringBuilder();
DateFormat dateFormat = new SimpleDateFormat("MM/yyyy");
Profession profession = row.getProfession();
- result += "<strong>Métier : </strong>" + profession.getCodeDCF5();
+ result.append("<strong>Métier : </strong>").
+ append(profession.getCodeDCF5());
if (!StringUtils.isEmpty(profession.getMeshSize())) {
- result+= " " + profession.getMeshSize();
+ result.append(' ').append(profession.getMeshSize());
}
if (!StringUtils.isEmpty(profession.getSize())) {
- result+= " " + profession.getSize();
+ result.append(' ').append(profession.getSize());
}
if (!StringUtils.isEmpty(profession.getOther())) {
- result+= " " + profession.getOther();
+ result.append(' ').append(profession.getOther());
}
- result += " - " + profession.getLibelle();
+ result.append(" - ").append(profession.getLibelle());
if (!StringUtils.isEmpty(profession.getSpecies())) {
- result += "<br /><strong>Espèces cibles : </strong>" + profession.getSpecies();
+ result.append("<br /><strong>Espèces cibles : </strong>").
+ append(profession.getSpecies());
}
- result += "<br /><strong>Programme : </strong>" + row.getProgramName();
- result += "<br /><strong>Période : </strong> du " + dateFormat.format(row.getPeriodBegin()) +
- " au " + dateFormat.format(row.getPeriodEnd());
+ result.append("<br /><strong>Programme : </strong>").
+ append(row.getProgramName()).
+ append("<br /><strong>Période : </strong> du ").
+ append(dateFormat.format(row.getPeriodBegin())).append(" au ").
+ append(dateFormat.format(row.getPeriodEnd()));
for (FishingZone zone : row.getFishingZone()) {
- result += "<br /><strong>Zone de pêche : </strong>" + zone.getCode();
+ result.append("<br /><strong>Zone de pêche : </strong>").
+ append(zone.getCode());
}
- return result;
+ return result.toString();
}
public static String getTooltipBoat(Boat boat) {
- String result = "";
- result += "<strong>" + boat.getImmatriculation() + "</strong>";
- result += "<br /><strong>Quartier : </strong>" + boat.getDistrictCode();
- result += "<br /><strong>Longueur : </strong>" + boat.getBoatLength() + " m";
- result += "<br /><strong>Année de construction : </strong>" + boat.getBuildYear();
- return result;
+ StringBuilder result = new StringBuilder("<strong>").
+ append(boat.getImmatriculation()).append("</strong>").
+ append("<br /><strong>Quartier : </strong>").
+ append(boat.getDistrictCode()).
+ append("<br /><strong>Longueur : </strong>").
+ append(boat.getBoatLength()).append(" m").
+ append("<br /><strong>Année de construction : </strong>").
+ append(boat.getBuildYear());
+ return result.toString();
}
public static String getDataSamplingTitle(SamplingFilter filter) {
- String result = "Données des marées";
- boolean filtered = false;
+ StringBuilder result = new StringBuilder("Données des marées");
+ String separator = " : ";
if (filter.getCompany() != null) {
- //result += !filtered ? " : " : ", ";
- result += " :\nSociété " + filter.getCompany().getName();
- filtered = true;
+ //result.append(!filtered ? " : " : ", ";
+ result.append(separator).
+ append("\nSociété ").append(filter.getCompany().getName());
+ separator = ", ";
}
if (StringUtils.isNotEmpty(filter.getProgramName())) {
- result += !filtered ? " : " : ", ";
- result += "\nProgramme " + filter.getProgramName();
- filtered = true;
+ result.append(separator).
+ append("\nProgramme ").append(filter.getProgramName());
+ separator = ", ";
}
if (filter.getSampleRow() != null) {
Profession profession = filter.getSampleRow().getProfession();
- result += !filtered ? " : " : ", ";
- result += "\nMétier " + profession.getCode();
- result += StringUtils.isNotEmpty(profession.getLibelle()) ? " - " + profession.getLibelle() : "";
- result += StringUtils.isNotEmpty(profession.getSpecies()) ? "\nEspèces (" + profession.getSpecies() + ")" : "";
- result += "\nZones de pêche (";
+ result.append(separator).
+ append("\nMétier ").append(profession.getCode());
+ if (StringUtils.isNotEmpty(profession.getLibelle())) {
+ result.append(" - ").append(profession.getLibelle());
+ }
+ if (StringUtils.isNotEmpty(profession.getSpecies())) {
+ result.append("\nEspèces (").
+ append(profession.getSpecies()).append(")");
+ }
+ result.append("\nZones de pêche (");
for (FishingZone zone : filter.getSampleRow().getFishingZone()) {
- result += zone.getDistrictCode() + " ";
+ result.append(zone.getDistrictCode()).append(' ');
}
- result += ")";
- filtered = true;
+ result.append(")");
+ separator = ", ";
} else {
if (filter.getFacadeName() != null) {
- result += !filtered ? " : " : ", ";
- result += "\nFaçade " + filter.getFacadeName();
- filtered = true;
+ result.append(separator).
+ append("\nFaçade ").append(filter.getFacadeName());
+ separator = ", ";
}
if (filter.getSectorName() != null) {
- result += !filtered ? " : " : ", ";
- result += "\nZone " + filter.getSectorName();
- //filtered = true;
+ result.append(separator).
+ append("\nZone ").append(filter.getSectorName());
}
}
- return result;
+ return result.toString();
}
public static String getContactStyle(Contact contact, boolean admin) {
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java 2010-04-08 17:14:30 UTC (rev 438)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java 2010-04-12 14:02:38 UTC (rev 439)
@@ -388,7 +388,10 @@
// If an other period is set
} else if (periodChanged) {
if (curr == null) {
- curr = serviceSampling.getNewSampleMonth(currMonth, getSampleRow());
+ curr = serviceSampling.getNewSampleMonth(currMonth,
+ getSampleRow());
+ curr.addPropertyChangeListener(
+ SampleMonth.EXPECTED_TIDES_VALUE, propertyChange);
}
sampleMonths.add(curr);
}
@@ -462,7 +465,9 @@
@Log
void onSelectedFromDeleteMonth(int index) throws WaoException {
- getSampleMonths().remove(index);
+ SampleMonth month = getSampleMonths().remove(index);
+ month.removePropertyChangeListener(
+ SampleMonth.EXPECTED_TIDES_VALUE, propertyChange);
edited = true;
}
@@ -503,7 +508,6 @@
if (sampleRow == null) {
if (!StringUtils.isEmpty(sampleRowId)) {
sampleRow = serviceSampling.getSampleRow(sampleRowId);
- propertyChange = new WaoPropertyChangeListener();
for (SampleMonth month : sampleRow.getSampleMonth()) {
month.addPropertyChangeListener(
SampleMonth.EXPECTED_TIDES_VALUE, propertyChange);
@@ -511,6 +515,7 @@
} else {
sampleRow = serviceSampling.getNewSampleRow();
}
+ propertyChange = new WaoPropertyChangeListener();
}
return sampleRow;
}
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java 2010-04-08 17:14:30 UTC (rev 438)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java 2010-04-12 14:02:38 UTC (rev 439)
@@ -46,6 +46,7 @@
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
+import org.apache.commons.lang.time.DurationFormatUtils;
import org.apache.tapestry5.StreamResponse;
import org.apache.tapestry5.annotations.IncludeStylesheet;
import org.apache.tapestry5.annotations.InjectComponent;
@@ -58,6 +59,8 @@
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.upload.services.UploadedFile;
import org.nuiton.util.PeriodDates;
+import org.nuiton.util.StringUtil;
+import org.nuiton.util.StringUtil.ToString;
import org.slf4j.Logger;
/**
@@ -100,17 +103,28 @@
@Property
private WaoUser user;
+ private long nbTidesExpectedTime;
+
+ private long nbTidesRealTime;
+
+ private long totalTidesExpectedTime;
+
+ private long totalTidesRealTime;
+
/**
* Page initialization
*/
void setupRender() {
+ if (log.isDebugEnabled()) {
+ log.debug("Data is null ? : " + (data == null));
+ }
if (isFiltersVisible()) {
// Initialize filters
initSelectFilters(true, false, true);
}
- // Initialize fullView to true for admin user
- if (fullView == null && user.isAdmin()) {
- fullView = true;
+ // Initialize fullView depends on user admin role
+ if (fullView == null) {
+ fullView = user.isAdmin();
}
}
@@ -223,9 +237,16 @@
void onSelectedFromReset() {
reset = true;
}
+
+// void onSuccessFromPeriodForm() {
+// // Reset data
+// data = null;
+// }
Object onSuccessFromFiltersForm() {
if (isEdited()) {
+ // Reset data
+// data = null;
return filtersZone.getBody();
}
if (reset) {
@@ -260,6 +281,7 @@
/**
* Main data for samplingPlan : List of SampleRow ordered by FishingZone.
*/
+// @Persist
private List<SampleRow> data;
private List<Date> months;
@@ -332,27 +354,41 @@
}
public Integer getNbTidesExpected() {
+ Integer result = null;
SampleMonth sampleMonth = row.getSampleMonth(month);
if (sampleMonth != null) {
- return sampleMonth.getExpectedTidesValue();
+ result = sampleMonth.getExpectedTidesValue();
}
- return null;
+ return result;
}
+ private static final ToString<FishingZone> FISHING_ZONE_TO_STRING_DISTRICT =
+ new ToString<FishingZone>() {
+
+ @Override
+ public String toString(FishingZone o) {
+ return o.getDistrictCode();
+ }
+ };
+
public String getFishingZones() {
- String result = "";
- for (FishingZone zone : row.getFishingZone()) {
- result += zone.getDistrictCode() + ", ";
- }
- return result.substring(0, result.length()-2);
+ return StringUtil.join(row.getFishingZone(),
+ FISHING_ZONE_TO_STRING_DISTRICT, ", ", false);
+// String result = "";
+// for (FishingZone zone : row.getFishingZone()) {
+// result += zone.getDistrictCode() + ", ";
+// }
+// return result.substring(0, result.length()-2);
+
}
public Integer getNbTidesReal() {
+ Integer result = null;
SampleMonth sampleMonth = row.getSampleMonth(month);
if (sampleMonth != null) {
- return sampleMonth.getRealTidesValue();
+ result = sampleMonth.getRealTidesValue();
}
- return null;
+ return result;
}
public boolean hasNbTidesReal() {
@@ -361,32 +397,38 @@
return validMonth && getNbTidesReal() != null;
}
- public int getTotalTidesExpected() {
- int total = 0;
- for (Date currentMonth : getMonths()) {
- SampleMonth sampleMonth = row.getSampleMonth(currentMonth);
- if (sampleMonth != null) {
- total += sampleMonth.getExpectedTidesValue();
- }
- }
- return total;
- }
+// public int getTotalTidesExpected() {
+// long start = System.currentTimeMillis();
+// int total = 0;
+// for (Date currentMonth : getMonths()) {
+// SampleMonth sampleMonth = row.getSampleMonth(currentMonth);
+// if (sampleMonth != null) {
+// total += sampleMonth.getExpectedTidesValue();
+// }
+// }
+// long stop = System.currentTimeMillis();
+// totalTidesExpectedTime += (stop - start);
+// return total;
+// }
+//
+// public int getTotalTidesReal() {
+// long start = System.currentTimeMillis();
+// int total = 0;
+// for (Date currentMonth : getMonths()) {
+// SampleMonth sampleMonth = row.getSampleMonth(currentMonth);
+// if (sampleMonth != null) {
+// total += sampleMonth.getRealTidesValue();
+// }
+// }
+// long stop = System.currentTimeMillis();
+// totalTidesRealTime += (stop - start);
+// return total;
+// }
- public int getTotalTidesReal() {
- int total = 0;
- for (Date currentMonth : getMonths()) {
- SampleMonth sampleMonth = row.getSampleMonth(currentMonth);
- if (sampleMonth != null) {
- total += sampleMonth.getRealTidesValue();
- }
- }
- return total;
- }
-
public String getTotalPercentage() {
double result = 0;
- if (getTotalTidesExpected() > 0) {
- result = (double)getTotalTidesReal() / (double)getTotalTidesExpected();
+ if (row.getTotalTidesExpected() > 0) {
+ result = (double)row.getTotalTidesReal() / (double)row.getTotalTidesExpected();
}
return NumberFormat.getPercentInstance().format(result);
}
Modified: trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/components/Layout.tml
===================================================================
--- trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/components/Layout.tml 2010-04-08 17:14:30 UTC (rev 438)
+++ trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/components/Layout.tml 2010-04-12 14:02:38 UTC (rev 439)
@@ -9,17 +9,19 @@
</head>
<t:if t:test="currentUserExists">
<body>
- <!-- Script for Google Analytics -->
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+ <t:unless t:test="devEnvironment">
+ <!-- Script for Google Analytics -->
+ <script type="text/javascript">
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+ </script>
+ <script type="text/javascript">
+ try {
+ var pageTracker = _gat._getTracker("UA-12982015-1");
+ pageTracker._trackPageview();
+ } catch(err) {}
</script>
- <script type="text/javascript">
- try {
- var pageTracker = _gat._getTracker("UA-12982015-1");
- pageTracker._trackPageview();
- } catch(err) {}
- </script>
+ </t:unless>
<div id="so-session" class="clearfix">
<div class="fleft">
<a t:type="pagelink" t:page="index" title="Page d'accueil">
Modified: trunk/wao-ui/src/main/resources/log4j.properties
===================================================================
--- trunk/wao-ui/src/main/resources/log4j.properties 2010-04-08 17:14:30 UTC (rev 438)
+++ trunk/wao-ui/src/main/resources/log4j.properties 2010-04-12 14:02:38 UTC (rev 439)
@@ -11,17 +11,8 @@
# wao.log.home must be defined when starting server
# ex : -Dwao.log.home=/home/user/.local/wao
log4j.appender.globalfile.File=${wao.log.home}/wao.log
-log4j.appender.globalfile.MaxFileSize=500KB
+log4j.appender.globalfile.MaxFileSize=2MB
log4j.appender.globalfile.Append=true
-log4j.appender.globalfile.MaxBackupIndex=10
-log4j.appender.globalfile.Threshold=TRACE
+log4j.appender.globalfile.Threshold=INFO
log4j.appender.globalfile.layout=org.apache.log4j.PatternLayout
log4j.appender.globalfile.layout.ConversionPattern=%d{yyyy/MM/dd hh:mm:ss} %5p (%F:%L) %m%n
-
-# For Tapestry
-log4j.logger.org.apache.tapestry5.services.TapestryModule.ComponentClassResolver=INFO
-log4j.logger.org.apache.tapestry5.TapestryFilter=INFO
-
-log4j.logger.fr.ifremer.wao=DEBUG
-log4j.logger.org.nuiton.util=INFO
-log4j.logger.org.nuiton.topia=INFO
Modified: trunk/wao-ui/src/main/webapp/SamplingPlan.tml
===================================================================
--- trunk/wao-ui/src/main/webapp/SamplingPlan.tml 2010-04-08 17:14:30 UTC (rev 438)
+++ trunk/wao-ui/src/main/webapp/SamplingPlan.tml 2010-04-12 14:02:38 UTC (rev 439)
@@ -204,7 +204,7 @@
</t:loop>
<td class="width50 acenter bright">
<span t:type="ck/Tooltip" title="Infos" t:value="Total sur la période du ${dateFormat.format(period.fromDate)} au ${dateFormat.format(period.thruDate)}" t:effect="appear">
- ${totalTidesExpected} <em>(${totalTidesReal})</em><br /><strong>${totalPercentage}</strong>
+ ${row.totalTidesExpected} <em>(${row.totalTidesReal})</em><br /><strong>${totalPercentage}</strong>
</span>
</td>
<td class="width60 acenter"><t:output t:value="row.averageTideTime" t:format="numberFormat" /></td>
Modified: trunk/wao-ui/src/main/webapp/css/sampling.css
===================================================================
--- trunk/wao-ui/src/main/webapp/css/sampling.css 2010-04-08 17:14:30 UTC (rev 438)
+++ trunk/wao-ui/src/main/webapp/css/sampling.css 2010-04-12 14:02:38 UTC (rev 439)
@@ -38,6 +38,10 @@
margin-bottom: 10px;
}
+div#so-sampling-filters {
+ width: 60%;
+}
+
div#so-sampling-filters div.t-beaneditor div {
margin-top: 5px;
}
1
0
[Suiviobsmer-commits] r438 - trunk/src/site/resources/schemas
by fdesbois@users.labs.libre-entreprise.org 08 Apr '10
by fdesbois@users.labs.libre-entreprise.org 08 Apr '10
08 Apr '10
Author: fdesbois
Date: 2010-04-08 17:14:30 +0000 (Thu, 08 Apr 2010)
New Revision: 438
Modified:
trunk/src/site/resources/schemas/Modele_WAO.png
Log:
Update model schema for documentation
Modified: trunk/src/site/resources/schemas/Modele_WAO.png
===================================================================
(Binary files differ)
1
0
08 Apr '10
Author: fdesbois
Date: 2010-04-08 17:14:03 +0000 (Thu, 08 Apr 2010)
New Revision: 437
Added:
trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/
trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/
trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/
trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/
trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/
trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ActivityCalendarImpl.hbm.xml
trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ActivityMonthImpl.hbm.xml
trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ActivityProfessionImpl.hbm.xml
trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ActivityZoneImpl.hbm.xml
trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/BoatImpl.hbm.xml
trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/BoatInfosImpl.hbm.xml
trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/CompanyImpl.hbm.xml
trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ContactImpl.hbm.xml
trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ElligibleBoatImpl.hbm.xml
trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/FishingZoneImpl.hbm.xml
trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/NewsImpl.hbm.xml
trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ProfessionImpl.hbm.xml
trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/SampleMonthImpl.hbm.xml
trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/SampleRowImpl.hbm.xml
trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/SampleRowLogImpl.hbm.xml
trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ShipOwnerImpl.hbm.xml
trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/WaoUserImpl.hbm.xml
trunk/wao-ui/src/main/resources/org/
trunk/wao-ui/src/main/resources/org/apache/
trunk/wao-ui/src/main/resources/org/apache/tapestry5/
trunk/wao-ui/src/main/resources/org/apache/tapestry5/internal/
trunk/wao-ui/src/main/resources/org/apache/tapestry5/internal/ValidationMessages_fr.properties
trunk/wao-ui/src/main/webapp/img/sample-table.png
Modified:
trunk/changelog.txt
trunk/src/site/rst/model.rst
trunk/wao-business/src/main/filters/Wao.properties
trunk/wao-business/src/main/java/fr/ifremer/wao/PgMigrationCallback.java
trunk/wao-business/src/main/java/fr/ifremer/wao/WaoMigrationCallBack.java
trunk/wao-business/src/main/xmi/wao.zargo
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/data/BusinessUtils.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Boats.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/ExceptionReport.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/WaoManager.java
trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/pages/Boats.properties
trunk/wao-ui/src/main/webapp/Boats.tml
trunk/wao-ui/src/main/webapp/css/boats.css
Log:
- Evo #2060 : Add new properties for BoatInfos (migration 1.2)
- Move method to manage WaoException messages from BusinessUtils to WaoManager
- Add isDevEnvironment method in WaoManager to display more error messages in ExceptionReport
Modified: trunk/changelog.txt
===================================================================
--- trunk/changelog.txt 2010-04-08 16:07:20 UTC (rev 436)
+++ trunk/changelog.txt 2010-04-08 17:14:03 UTC (rev 437)
@@ -4,11 +4,13 @@
Historique des versions
1.2
----
+----
Evolutions
++++++++++
+- [fdesbois] Evo #2060 : Dans la partie contact des informations privées du
+ navire, ajouter les champs Adresse (code postal + ville + adresse) et N° SIRET
- [fdesbois] Evo #2069 : Role admin : Ajouter la visibilité réduite sur les
contacts et le plan d'échantillonnage
- [fdesbois] Evo #2059 : Filtres sur tableau plan échantillonnage
Modified: trunk/src/site/rst/model.rst
===================================================================
--- trunk/src/site/rst/model.rst 2010-04-08 16:07:20 UTC (rev 436)
+++ trunk/src/site/rst/model.rst 2010-04-08 17:14:03 UTC (rev 437)
@@ -205,6 +205,11 @@
+ contactLastName : nom du contact du navire
+ contactEmail : adresse e-mail du contact du navire
+ contactPhoneNumber : numéro de téléphone du contact du navire
+ + contactAddress1 : première ligne d'adresse
+ + contactAddress2 : deuxième ligne d'adresse (complément d'adresse)
+ + contactPostalCode : code postal de l'adresse
+ + contactCity : ville de l'adresse
+ + contactSiret : N° SIRET du contact
+ dup : Capacité d'accueil du navire en personnels spécialisés
+ comment : commentaire supplémentaire sur le contact ou le navire
+ [lien] boat : navire concerné
@@ -226,4 +231,10 @@
- [WaoUser] Création du champs readOnly (boolean)
- [Contact] Modification du type pour le champs state (varchar -> smallint)
- [SampleRowLog] Modification du rôle de l'association vers WaoUser (admin ->
- author)
\ No newline at end of file
+ author)
+
+Version 1.2
+~~~~~~~~~~~
+
+- [BoatInfos] Ajout des champs : contactAddress1, contactAddress2,
+ contactPostalCode, contactCity et contactSiret.
\ No newline at end of file
Modified: trunk/wao-business/src/main/filters/Wao.properties
===================================================================
--- trunk/wao-business/src/main/filters/Wao.properties 2010-04-08 16:07:20 UTC (rev 436)
+++ trunk/wao-business/src/main/filters/Wao.properties 2010-04-08 17:14:03 UTC (rev 437)
@@ -23,4 +23,4 @@
wao.server.path=localhost:8080/wao
## Version (not necessary to override it)
-wao.version=1.1.2
\ No newline at end of file
+wao.version=1.2
\ No newline at end of file
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/PgMigrationCallback.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/PgMigrationCallback.java 2010-04-08 16:07:20 UTC (rev 436)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/PgMigrationCallback.java 2010-04-08 17:14:03 UTC (rev 437)
@@ -38,7 +38,7 @@
public class PgMigrationCallback extends WaoMigrationCallBack {
@Override
- protected void createUserRoleColumn_1_1(List<String> queries) {
+ protected void createUserRoleColumn_1_1a(List<String> queries) {
// Evo #2063
queries.add("ALTER TABLE WaoUser ADD role SMALLINT;");
queries.add("UPDATE WaoUser SET role = 0 WHERE admin = TRUE;");
@@ -52,7 +52,7 @@
}
@Override
- protected void changeContactStateColumn_1_1(List<String> queries) {
+ protected void changeContactStateColumn_1_1b(List<String> queries) {
queries.add("ALTER TABLE Contact ADD state1 SMALLINT;");
for (ContactState state : ContactState.values()) {
queries.add("UPDATE Contact SET state1 = " + state.ordinal() +
@@ -63,9 +63,20 @@
}
@Override
- protected void changeSampleRowLogAdminColumn_1_1(List<String> queries) {
+ protected void changeSampleRowLogAdminColumn_1_1c(List<String> queries) {
// Evo #1960 : change column name admin to author for sampleRowLog
queries.add("ALTER TABLE SampleRowLog RENAME admin TO author;");
}
+ @Override
+ protected void createBoatInfosNewColumns_1_2(List<String> queries) {
+ // Evo #2060 : add new columns in BoatInfos (contactSiret,
+ // contactAddress1, contactAddress2, contactCity, contactPostalCode)
+ queries.add("ALTER TABLE BoatInfos ADD contactAddress1 TEXT;");
+ queries.add("ALTER TABLE BoatInfos ADD contactAddress2 TEXT;");
+ queries.add("ALTER TABLE BoatInfos ADD contactCity TEXT;");
+ queries.add("ALTER TABLE BoatInfos ADD contactPostalCode INTEGER;");
+ queries.add("ALTER TABLE BoatInfos ADD contactSiret TEXT;");
+ }
+
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/WaoMigrationCallBack.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/WaoMigrationCallBack.java 2010-04-08 16:07:20 UTC (rev 436)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/WaoMigrationCallBack.java 2010-04-08 17:14:03 UTC (rev 437)
@@ -29,6 +29,7 @@
import org.nuiton.util.Version;
import java.util.List;
+import org.nuiton.topia.TopiaContext;
public abstract class WaoMigrationCallBack extends ManualMigrationCallback {
@@ -37,6 +38,24 @@
*/
private static final Log log = LogFactory.getLog(WaoMigrationCallBack.class);
+ protected abstract void createUserRoleColumn_1_1a(List<String> queries);
+
+ protected abstract void changeContactStateColumn_1_1b(List<String> queries);
+
+ protected abstract void changeSampleRowLogAdminColumn_1_1c(
+ List<String> queries);
+
+ protected abstract void createBoatInfosNewColumns_1_2(
+ List<String> queries);
+
+ @Override
+ public boolean askUser(Version dbVersion,
+ Version applicationVersion,
+ List<Version> versions) {
+ // Always migrate the database
+ return true;
+ }
+
public void migrateTo_1_0(TopiaContextImplementor tx,
boolean showSql,
boolean showProgression) throws TopiaException {
@@ -53,29 +72,29 @@
List<String> queries = new ArrayList<String>();
- createUserRoleColumn_1_1(queries);
+ createUserRoleColumn_1_1a(queries);
- changeContactStateColumn_1_1(queries);
+ changeContactStateColumn_1_1b(queries);
- changeSampleRowLogAdminColumn_1_1(queries);
+ changeSampleRowLogAdminColumn_1_1c(queries);
String[] strings = queries.toArray(new String[queries.size()]);
executeSQL(tx, showSql, showProgression, strings);
}
- protected abstract void createUserRoleColumn_1_1(List<String> queries);
+ public void migrateTo_1_2(TopiaContextImplementor tx,
+ boolean showSql,
+ boolean showProgression) throws TopiaException {
+ if (log.isInfoEnabled()) {
+ log.info("Migrate to version 1.2");
+ }
- protected abstract void changeContactStateColumn_1_1(List<String> queries);
+ List<String> queries = new ArrayList<String>();
- protected abstract void changeSampleRowLogAdminColumn_1_1(
- List<String> queries);
+ createBoatInfosNewColumns_1_2(queries);
- @Override
- public boolean askUser(Version dbVersion,
- Version applicationVersion,
- List<Version> versions) {
- // Always migrate the database
- return true;
+ String[] strings = queries.toArray(new String[queries.size()]);
+ executeSQL(tx, showSql, showProgression, strings);
}
}
Added: trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ActivityCalendarImpl.hbm.xml
===================================================================
--- trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ActivityCalendarImpl.hbm.xml (rev 0)
+++ trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ActivityCalendarImpl.hbm.xml 2010-04-08 17:14:03 UTC (rev 437)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.wao.entity">
+ <class name="fr.ifremer.wao.entity.ActivityCalendarImpl" table="activityCalendar" node="fr.ifremer.wao.entity.ActivityCalendarImpl" abstract="false" proxy="fr.ifremer.wao.entity.ActivityCalendar" >
+ <id name="topiaId" type="string" length="255" node="@topiaId"/>
+ <version name="topiaVersion" type="long" node="@topiaVersion"/>
+ <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
+ <property name="year" type="int" access="field" column="year" node="year"/>
+ <property name="fiability" type="int" access="field" column="fiability" node="fiability"/>
+ <bag name="activityMonth" inverse="true" order-by="month" lazy="true" cascade="all,delete-orphan" node="activityMonth" embed-xml="false">
+ <key column="activityCalendar"/>
+ <one-to-many class="fr.ifremer.wao.entity.ActivityMonthImpl" node="topiaId" embed-xml="false"/>
+ </bag>
+ <many-to-one name="boat" class="fr.ifremer.wao.entity.BoatImpl" column="boat" node="boat/@topiaId" embed-xml="false"/>
+ </class>
+</hibernate-mapping>
Added: trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ActivityMonthImpl.hbm.xml
===================================================================
--- trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ActivityMonthImpl.hbm.xml (rev 0)
+++ trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ActivityMonthImpl.hbm.xml 2010-04-08 17:14:03 UTC (rev 437)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.wao.entity">
+ <class name="fr.ifremer.wao.entity.ActivityMonthImpl" table="activityMonth" node="fr.ifremer.wao.entity.ActivityMonthImpl" abstract="false" proxy="fr.ifremer.wao.entity.ActivityMonth" >
+ <id name="topiaId" type="string" length="255" node="@topiaId"/>
+ <version name="topiaVersion" type="long" node="@topiaVersion"/>
+ <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
+ <property name="harbourLibelle" type="text" access="field" column="harbourLibelle" node="harbourLibelle"/>
+ <property name="active" type="boolean" access="field" column="active" node="active"/>
+ <property name="nbBoardingPersons" type="java.lang.Integer" access="field" column="nbBoardingPersons" node="nbBoardingPersons"/>
+ <property name="nbSeaDays" type="java.lang.Integer" access="field" column="nbSeaDays" node="nbSeaDays"/>
+ <property name="nbFishingDays" type="java.lang.Integer" access="field" column="nbFishingDays" node="nbFishingDays"/>
+ <property name="month" type="int" access="field" column="month" node="month"/>
+ <property name="harbourCode" type="text" access="field" column="harbourCode" node="harbourCode"/>
+ <property name="harbourId" type="int" access="field" column="harbourId" node="harbourId"/>
+ <bag name="activityProfession" inverse="true" order-by="professionOrder" lazy="true" cascade="all,delete-orphan" node="activityProfession" embed-xml="false">
+ <key column="activityMonth"/>
+ <one-to-many class="fr.ifremer.wao.entity.ActivityProfessionImpl" node="topiaId" embed-xml="false"/>
+ </bag>
+ <many-to-one name="activityCalendar" class="fr.ifremer.wao.entity.ActivityCalendarImpl" column="activityCalendar" node="activityCalendar/@topiaId" embed-xml="false"/>
+ </class>
+</hibernate-mapping>
Added: trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ActivityProfessionImpl.hbm.xml
===================================================================
--- trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ActivityProfessionImpl.hbm.xml (rev 0)
+++ trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ActivityProfessionImpl.hbm.xml 2010-04-08 17:14:03 UTC (rev 437)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.wao.entity">
+ <class name="fr.ifremer.wao.entity.ActivityProfessionImpl" table="activityProfession" node="fr.ifremer.wao.entity.ActivityProfessionImpl" abstract="false" proxy="fr.ifremer.wao.entity.ActivityProfession" >
+ <id name="topiaId" type="string" length="255" node="@topiaId"/>
+ <version name="topiaVersion" type="long" node="@topiaVersion"/>
+ <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
+ <property name="code" type="text" access="field" column="code" node="code"/>
+ <property name="libelle" type="text" access="field" column="libelle" node="libelle"/>
+ <property name="id" type="int" access="field" column="id" node="id"/>
+ <property name="professionOrder" type="int" access="field" column="professionOrder" node="professionOrder"/>
+ <many-to-one name="activityMonth" class="fr.ifremer.wao.entity.ActivityMonthImpl" column="activityMonth" node="activityMonth/@topiaId" embed-xml="false"/>
+ <bag name="activityZone" inverse="true" order-by="zoneId" lazy="true" cascade="all,delete-orphan" node="activityZone" embed-xml="false">
+ <key column="activityProfession"/>
+ <one-to-many class="fr.ifremer.wao.entity.ActivityZoneImpl" node="topiaId" embed-xml="false"/>
+ </bag>
+ </class>
+</hibernate-mapping>
Added: trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ActivityZoneImpl.hbm.xml
===================================================================
--- trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ActivityZoneImpl.hbm.xml (rev 0)
+++ trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ActivityZoneImpl.hbm.xml 2010-04-08 17:14:03 UTC (rev 437)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.wao.entity">
+ <class name="fr.ifremer.wao.entity.ActivityZoneImpl" table="activityZone" node="fr.ifremer.wao.entity.ActivityZoneImpl" abstract="false" proxy="fr.ifremer.wao.entity.ActivityZone" >
+ <id name="topiaId" type="string" length="255" node="@topiaId"/>
+ <version name="topiaVersion" type="long" node="@topiaVersion"/>
+ <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
+ <property name="zoneCode" type="text" access="field" column="zoneCode" node="zoneCode"/>
+ <property name="zoneLibelle" type="text" access="field" column="zoneLibelle" node="zoneLibelle"/>
+ <property name="zoneId" type="int" access="field" column="zoneId" node="zoneId"/>
+ <property name="gradiantCode" type="int" access="field" column="gradiantCode" node="gradiantCode"/>
+ <property name="gradiantLibelle" type="text" access="field" column="gradiantLibelle" node="gradiantLibelle"/>
+ <many-to-one name="activityProfession" class="fr.ifremer.wao.entity.ActivityProfessionImpl" column="activityProfession" node="activityProfession/@topiaId" embed-xml="false"/>
+ </class>
+</hibernate-mapping>
Added: trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/BoatImpl.hbm.xml
===================================================================
--- trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/BoatImpl.hbm.xml (rev 0)
+++ trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/BoatImpl.hbm.xml 2010-04-08 17:14:03 UTC (rev 437)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.wao.entity">
+ <class name="fr.ifremer.wao.entity.BoatImpl" table="boat" node="fr.ifremer.wao.entity.BoatImpl" abstract="false" proxy="fr.ifremer.wao.entity.Boat" >
+ <id name="topiaId" type="string" length="255" node="@topiaId"/>
+ <version name="topiaVersion" type="long" node="@topiaVersion"/>
+ <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
+ <property name="immatriculation" type="int" access="field" column="immatriculation" node="immatriculation" index="boat_immatriculation_idx" unique="true"/>
+ <property name="name" type="text" access="field" column="name" node="name"/>
+ <property name="districtCode" type="text" access="field" column="districtCode" node="districtCode"/>
+ <property name="boatLength" type="int" access="field" column="boatLength" node="boatLength"/>
+ <property name="buildYear" type="int" access="field" column="buildYear" node="buildYear"/>
+ <property name="active" type="boolean" access="field" column="active" node="active"/>
+ <many-to-one name="shipOwner" class="fr.ifremer.wao.entity.ShipOwnerImpl" column="shipOwner" lazy="false" node="shipOwner/@topiaId" embed-xml="false"/>
+ <bag name="companyBoatInfos" inverse="true" lazy="true" cascade="all,delete-orphan" node="companyBoatInfos" embed-xml="false">
+ <key column="boat"/>
+ <one-to-many class="fr.ifremer.wao.entity.BoatInfosImpl" node="topiaId" embed-xml="false"/>
+ </bag>
+ <bag name="activityCalendar" inverse="true" lazy="true" cascade="all,delete-orphan" node="activityCalendar" embed-xml="false">
+ <key column="boat"/>
+ <one-to-many class="fr.ifremer.wao.entity.ActivityCalendarImpl" node="topiaId" embed-xml="false"/>
+ </bag>
+ <bag name="elligibleBoat" inverse="true" order-by="companyActive" lazy="true" node="elligibleBoat" embed-xml="false">
+ <key column="boat"/>
+ <one-to-many class="fr.ifremer.wao.entity.ElligibleBoatImpl" node="topiaId" embed-xml="false"/>
+ </bag>
+ </class>
+</hibernate-mapping>
Added: trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/BoatInfosImpl.hbm.xml
===================================================================
--- trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/BoatInfosImpl.hbm.xml (rev 0)
+++ trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/BoatInfosImpl.hbm.xml 2010-04-08 17:14:03 UTC (rev 437)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.wao.entity">
+ <class name="fr.ifremer.wao.entity.BoatInfosImpl" table="boatInfos" node="fr.ifremer.wao.entity.BoatInfosImpl" abstract="false" proxy="fr.ifremer.wao.entity.BoatInfos" >
+ <id name="topiaId" type="string" length="255" node="@topiaId"/>
+ <version name="topiaVersion" type="long" node="@topiaVersion"/>
+ <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
+ <property name="contactFirstName" type="text" access="field" column="contactFirstName" node="contactFirstName"/>
+ <property name="contactLastName" type="text" access="field" column="contactLastName" node="contactLastName"/>
+ <property name="contactEmail" type="text" access="field" column="contactEmail" node="contactEmail"/>
+ <property name="contactPhoneNumber" type="text" access="field" column="contactPhoneNumber" node="contactPhoneNumber"/>
+ <property name="dup" type="java.lang.Integer" access="field" column="dup" node="dup"/>
+ <property name="comment" type="text" access="field" column="comment" node="comment"/>
+ <property name="contactAddress1" type="text" access="field" column="contactAddress1" node="contactAddress1"/>
+ <property name="contactAddress2" type="text" access="field" column="contactAddress2" node="contactAddress2"/>
+ <property name="contactCity" type="text" access="field" column="contactCity" node="contactCity"/>
+ <property name="contactPostalCode" type="java.lang.Integer" access="field" column="contactPostalCode" node="contactPostalCode"/>
+ <property name="contactSiret" type="text" access="field" column="contactSiret" node="contactSiret"/>
+ <many-to-one name="company" class="fr.ifremer.wao.entity.CompanyImpl" column="company" node="company/@topiaId" embed-xml="false" />
+ <many-to-one name="boat" class="fr.ifremer.wao.entity.BoatImpl" column="boat" node="boat/@topiaId" embed-xml="false" />
+ </class>
+</hibernate-mapping>
Added: trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/CompanyImpl.hbm.xml
===================================================================
--- trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/CompanyImpl.hbm.xml (rev 0)
+++ trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/CompanyImpl.hbm.xml 2010-04-08 17:14:03 UTC (rev 437)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.wao.entity">
+ <class name="fr.ifremer.wao.entity.CompanyImpl" table="company" node="fr.ifremer.wao.entity.CompanyImpl" abstract="false" proxy="fr.ifremer.wao.entity.Company" >
+ <id name="topiaId" type="string" length="255" node="@topiaId"/>
+ <version name="topiaVersion" type="long" node="@topiaVersion"/>
+ <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
+ <property name="name" type="text" access="field" column="name" node="name"/>
+ <property name="phoneNumber" type="text" access="field" column="phoneNumber" node="phoneNumber"/>
+ <property name="address1" type="text" access="field" column="address1" node="address1"/>
+ <property name="address2" type="text" access="field" column="address2" node="address2"/>
+ <property name="active" type="boolean" access="field" column="active" node="active"/>
+ <property name="email" type="text" access="field" column="email" node="email"/>
+ <property name="city" type="text" access="field" column="city" node="city"/>
+ <property name="postalCode" type="int" access="field" column="postalCode" node="postalCode"/>
+ <bag name="waoUser" inverse="true" lazy="true" cascade="all,delete-orphan" node="waoUser" embed-xml="false">
+ <key column="company"/>
+ <one-to-many class="fr.ifremer.wao.entity.WaoUserImpl" node="topiaId" embed-xml="false"/>
+ </bag>
+ <bag name="boatBoatInfos" inverse="true" lazy="true" cascade="all,delete-orphan" node="boatBoatInfos" embed-xml="false">
+ <key column="company"/>
+ <one-to-many class="fr.ifremer.wao.entity.BoatInfosImpl" node="topiaId" embed-xml="false"/>
+ </bag>
+ </class>
+</hibernate-mapping>
Added: trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ContactImpl.hbm.xml
===================================================================
--- trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ContactImpl.hbm.xml (rev 0)
+++ trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ContactImpl.hbm.xml 2010-04-08 17:14:03 UTC (rev 437)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.wao.entity">
+ <class name="fr.ifremer.wao.entity.ContactImpl" table="contact" node="fr.ifremer.wao.entity.ContactImpl" abstract="false" proxy="fr.ifremer.wao.entity.Contact" >
+ <id name="topiaId" type="string" length="255" node="@topiaId"/>
+ <version name="topiaVersion" type="long" node="@topiaVersion"/>
+ <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
+ <property name="tideBeginDate" type="java.util.Date" access="field" column="tideBeginDate" node="tideBeginDate"/>
+ <property name="tideEndDate" type="java.util.Date" access="field" column="tideEndDate" node="tideEndDate"/>
+ <property name="nbObservants" type="int" access="field" column="nbObservants" node="nbObservants"/>
+ <property name="mammalsObservation" type="boolean" access="field" column="mammalsObservation" node="mammalsObservation"/>
+ <property name="mammalsCapture" type="boolean" access="field" column="mammalsCapture" node="mammalsCapture"/>
+ <property name="validationProgram" type="java.lang.Boolean" access="field" column="validationProgram" node="validationProgram"/>
+ <property name="validationCompany" type="java.lang.Boolean" access="field" column="validationCompany" node="validationCompany"/>
+ <property name="dataInputDate" type="java.util.Date" access="field" column="dataInputDate" node="dataInputDate"/>
+ <property name="comment" type="text" access="field" column="comment" node="comment"/>
+ <property name="state" type="int" access="field" column="state" node="state"/>
+ <property name="tideNbDays" type="int" access="field" column="tideNbDays" node="tideNbDays"/>
+ <many-to-one name="observer" class="fr.ifremer.wao.entity.WaoUserImpl" column="observer" node="observer/@topiaId" embed-xml="false"/>
+ <many-to-one name="sampleRow" class="fr.ifremer.wao.entity.SampleRowImpl" column="sampleRow" lazy="false" node="sampleRow/@topiaId" embed-xml="false"/>
+ <many-to-one name="boat" class="fr.ifremer.wao.entity.BoatImpl" column="boat" lazy="false" node="boat/@topiaId" embed-xml="false"/>
+ </class>
+</hibernate-mapping>
Added: trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ElligibleBoatImpl.hbm.xml
===================================================================
--- trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ElligibleBoatImpl.hbm.xml (rev 0)
+++ trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ElligibleBoatImpl.hbm.xml 2010-04-08 17:14:03 UTC (rev 437)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.wao.entity">
+ <class name="fr.ifremer.wao.entity.ElligibleBoatImpl" table="elligibleBoat" node="fr.ifremer.wao.entity.ElligibleBoatImpl" abstract="false" proxy="fr.ifremer.wao.entity.ElligibleBoat" >
+ <id name="topiaId" type="string" length="255" node="@topiaId"/>
+ <version name="topiaVersion" type="long" node="@topiaVersion"/>
+ <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
+ <property name="globalActive" type="boolean" access="field" column="globalActive" node="globalActive"/>
+ <property name="companyActive" type="java.lang.Boolean" access="field" column="companyActive" node="companyActive"/>
+ <many-to-one name="boat" class="fr.ifremer.wao.entity.BoatImpl" column="boat" lazy="false" node="boat/@topiaId" embed-xml="false"/>
+ <many-to-one name="sampleRow" class="fr.ifremer.wao.entity.SampleRowImpl" column="sampleRow" node="sampleRow/@topiaId" embed-xml="false"/>
+ </class>
+</hibernate-mapping>
Added: trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/FishingZoneImpl.hbm.xml
===================================================================
--- trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/FishingZoneImpl.hbm.xml (rev 0)
+++ trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/FishingZoneImpl.hbm.xml 2010-04-08 17:14:03 UTC (rev 437)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.wao.entity">
+ <class name="fr.ifremer.wao.entity.FishingZoneImpl" table="fishingZone" node="fr.ifremer.wao.entity.FishingZoneImpl" abstract="false" proxy="fr.ifremer.wao.entity.FishingZone" >
+ <id name="topiaId" type="string" length="255" node="@topiaId"/>
+ <version name="topiaVersion" type="long" node="@topiaVersion"/>
+ <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
+ <property name="sectorName" type="text" access="field" column="sectorName" node="sectorName"/>
+ <property name="facadeName" type="text" access="field" column="facadeName" node="facadeName"/>
+ <property name="districtCode" type="text" access="field" column="districtCode" node="districtCode"/>
+ <bag name="sampleRow" table="fishingzone_samplerow" inverse="true" lazy="true" node="sampleRow" embed-xml="true">
+ <key column="fishingZone"/>
+ <many-to-many class="fr.ifremer.wao.entity.SampleRowImpl" column="sampleRow" order-by="code" node="topiaId"/>
+ </bag>
+ </class>
+</hibernate-mapping>
Added: trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/NewsImpl.hbm.xml
===================================================================
--- trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/NewsImpl.hbm.xml (rev 0)
+++ trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/NewsImpl.hbm.xml 2010-04-08 17:14:03 UTC (rev 437)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.wao.entity">
+ <class name="fr.ifremer.wao.entity.NewsImpl" table="news" node="fr.ifremer.wao.entity.NewsImpl" abstract="false" proxy="fr.ifremer.wao.entity.News" >
+ <id name="topiaId" type="string" length="255" node="@topiaId"/>
+ <version name="topiaVersion" type="long" node="@topiaVersion"/>
+ <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
+ <property name="title" type="text" access="field" column="title" node="title"/>
+ <property name="content" type="text" access="field" column="content" node="content"/>
+ </class>
+</hibernate-mapping>
Added: trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ProfessionImpl.hbm.xml
===================================================================
--- trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ProfessionImpl.hbm.xml (rev 0)
+++ trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ProfessionImpl.hbm.xml 2010-04-08 17:14:03 UTC (rev 437)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.wao.entity">
+ <class name="fr.ifremer.wao.entity.ProfessionImpl" table="profession" node="fr.ifremer.wao.entity.ProfessionImpl" abstract="false" proxy="fr.ifremer.wao.entity.Profession" >
+ <id name="topiaId" type="string" length="255" node="@topiaId"/>
+ <version name="topiaVersion" type="long" node="@topiaVersion"/>
+ <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
+ <property name="codeDCF5" type="text" access="field" column="codeDCF5" node="codeDCF5"/>
+ <property name="meshSize" type="text" access="field" column="meshSize" node="meshSize"/>
+ <property name="size" type="text" access="field" column="size" node="size"/>
+ <property name="other" type="text" access="field" column="other" node="other"/>
+ <property name="libelle" type="text" access="field" column="libelle" node="libelle"/>
+ <property name="species" type="text" access="field" column="species" node="species"/>
+ </class>
+</hibernate-mapping>
Added: trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/SampleMonthImpl.hbm.xml
===================================================================
--- trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/SampleMonthImpl.hbm.xml (rev 0)
+++ trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/SampleMonthImpl.hbm.xml 2010-04-08 17:14:03 UTC (rev 437)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.wao.entity">
+ <class name="fr.ifremer.wao.entity.SampleMonthImpl" table="sampleMonth" node="fr.ifremer.wao.entity.SampleMonthImpl" abstract="false" proxy="fr.ifremer.wao.entity.SampleMonth" >
+ <id name="topiaId" type="string" length="255" node="@topiaId"/>
+ <version name="topiaVersion" type="long" node="@topiaVersion"/>
+ <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
+ <property name="realTidesValue" type="int" access="field" column="realTidesValue" node="realTidesValue"/>
+ <property name="expectedTidesValue" type="int" access="field" column="expectedTidesValue" node="expectedTidesValue"/>
+ <property name="periodDate" type="java.util.Date" access="field" column="periodDate" node="periodDate"/>
+ <many-to-one name="sampleRow" class="fr.ifremer.wao.entity.SampleRowImpl" column="sampleRow" node="sampleRow/@topiaId" embed-xml="false"/>
+ </class>
+</hibernate-mapping>
Added: trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/SampleRowImpl.hbm.xml
===================================================================
--- trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/SampleRowImpl.hbm.xml (rev 0)
+++ trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/SampleRowImpl.hbm.xml 2010-04-08 17:14:03 UTC (rev 437)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.wao.entity">
+ <class name="fr.ifremer.wao.entity.SampleRowImpl" table="sampleRow" node="fr.ifremer.wao.entity.SampleRowImpl" abstract="false" proxy="fr.ifremer.wao.entity.SampleRow" >
+ <id name="topiaId" type="string" length="255" node="@topiaId"/>
+ <version name="topiaVersion" type="long" node="@topiaVersion"/>
+ <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
+ <property name="nbObservants" type="int" access="field" column="nbObservants" node="nbObservants"/>
+ <property name="averageTideTime" type="double" access="field" column="averageTideTime" node="averageTideTime"/>
+ <property name="code" type="text" access="field" column="code" node="code" index="sampleRow_code_idx" unique="true"/>
+ <property name="fishingZonesInfos" type="text" access="field" column="fishingZonesInfos" node="fishingZonesInfos"/>
+ <property name="comment" type="text" access="field" column="comment" node="comment"/>
+ <property name="programName" type="text" access="field" column="programName" node="programName"/>
+ <property name="periodBegin" type="java.util.Date" access="field" column="periodBegin" node="periodBegin"/>
+ <property name="periodEnd" type="java.util.Date" access="field" column="periodEnd" node="periodEnd"/>
+ <many-to-one name="profession" class="fr.ifremer.wao.entity.ProfessionImpl" column="profession" lazy="false" node="profession/@topiaId" embed-xml="false"/>
+ <bag name="sampleMonth" inverse="true" order-by="periodDate" lazy="true" cascade="all,delete-orphan" node="sampleMonth" embed-xml="false">
+ <key column="sampleRow"/>
+ <one-to-many class="fr.ifremer.wao.entity.SampleMonthImpl" node="topiaId" embed-xml="false"/>
+ </bag>
+ <many-to-one name="company" class="fr.ifremer.wao.entity.CompanyImpl" column="company" lazy="false" node="company/@topiaId" embed-xml="false"/>
+ <bag name="sampleRowLog" inverse="true" order-by="topiaCreateDate desc" lazy="true" cascade="all,delete-orphan" node="sampleRowLog" embed-xml="false">
+ <key column="sampleRow"/>
+ <one-to-many class="fr.ifremer.wao.entity.SampleRowLogImpl" node="topiaId" embed-xml="false"/>
+ </bag>
+ <bag name="elligibleBoat" inverse="true" order-by="companyActive" lazy="true" cascade="all,delete-orphan" node="elligibleBoat" embed-xml="false">
+ <key column="sampleRow"/>
+ <one-to-many class="fr.ifremer.wao.entity.ElligibleBoatImpl" node="topiaId" embed-xml="false"/>
+ </bag>
+ <bag name="fishingZone" table="fishingzone_samplerow" lazy="false" node="fishingZone" embed-xml="true">
+ <key column="sampleRow"/>
+ <many-to-many class="fr.ifremer.wao.entity.FishingZoneImpl" column="fishingZone" order-by="facadeName,sectorName,districtCode" node="topiaId"/>
+ </bag>
+ <bag name="contact" inverse="true" lazy="true" node="contact" embed-xml="false">
+ <key column="sampleRow"/>
+ <one-to-many class="fr.ifremer.wao.entity.ContactImpl" node="topiaId" embed-xml="false"/>
+ </bag>
+ </class>
+</hibernate-mapping>
Added: trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/SampleRowLogImpl.hbm.xml
===================================================================
--- trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/SampleRowLogImpl.hbm.xml (rev 0)
+++ trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/SampleRowLogImpl.hbm.xml 2010-04-08 17:14:03 UTC (rev 437)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.wao.entity">
+ <class name="fr.ifremer.wao.entity.SampleRowLogImpl" table="sampleRowLog" node="fr.ifremer.wao.entity.SampleRowLogImpl" abstract="false" proxy="fr.ifremer.wao.entity.SampleRowLog" >
+ <id name="topiaId" type="string" length="255" node="@topiaId"/>
+ <version name="topiaVersion" type="long" node="@topiaVersion"/>
+ <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
+ <property name="logText" type="text" access="field" column="logText" node="logText"/>
+ <property name="comment" type="text" access="field" column="comment" node="comment"/>
+ <many-to-one name="sampleRow" class="fr.ifremer.wao.entity.SampleRowImpl" column="sampleRow" node="sampleRow/@topiaId" embed-xml="false"/>
+ <many-to-one name="author" class="fr.ifremer.wao.entity.WaoUserImpl" column="author" lazy="false" node="author/@topiaId" embed-xml="false"/>
+ </class>
+</hibernate-mapping>
Added: trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ShipOwnerImpl.hbm.xml
===================================================================
--- trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ShipOwnerImpl.hbm.xml (rev 0)
+++ trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/ShipOwnerImpl.hbm.xml 2010-04-08 17:14:03 UTC (rev 437)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.wao.entity">
+ <class name="fr.ifremer.wao.entity.ShipOwnerImpl" table="shipOwner" node="fr.ifremer.wao.entity.ShipOwnerImpl" abstract="false" proxy="fr.ifremer.wao.entity.ShipOwner" >
+ <id name="topiaId" type="string" length="255" node="@topiaId"/>
+ <version name="topiaVersion" type="long" node="@topiaVersion"/>
+ <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
+ <property name="code" type="text" access="field" column="code" node="code" index="shipOwner_code_idx" unique="true"/>
+ <property name="firstName" type="text" access="field" column="firstName" node="firstName"/>
+ <property name="lastName" type="text" access="field" column="lastName" node="lastName"/>
+ </class>
+</hibernate-mapping>
Added: trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/WaoUserImpl.hbm.xml
===================================================================
--- trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/WaoUserImpl.hbm.xml (rev 0)
+++ trunk/wao-business/src/main/resources/oldmappings/Wao/1.2/fr/ifremer/wao/entity/WaoUserImpl.hbm.xml 2010-04-08 17:14:03 UTC (rev 437)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping default-access="field" auto-import="true" package="fr.ifremer.wao.entity">
+ <class name="fr.ifremer.wao.entity.WaoUserImpl" table="waoUser" node="fr.ifremer.wao.entity.WaoUserImpl" abstract="false" proxy="fr.ifremer.wao.entity.WaoUser" >
+ <id name="topiaId" type="string" length="255" node="@topiaId"/>
+ <version name="topiaVersion" type="long" node="@topiaVersion"/>
+ <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/>
+ <property name="firstName" type="text" access="field" column="firstName" node="firstName"/>
+ <property name="lastName" type="text" access="field" column="lastName" node="lastName"/>
+ <property name="phoneNumber" type="text" access="field" column="phoneNumber" node="phoneNumber"/>
+ <property name="login" type="text" access="field" column="login" node="login"/>
+ <property name="password" type="text" access="field" column="password" node="password"/>
+ <property name="active" type="boolean" access="field" column="active" node="active"/>
+ <property name="role" type="int" access="field" column="role" node="role"/>
+ <property name="readOnly" type="boolean" access="field" column="readOnly" node="readOnly"/>
+ <many-to-one name="company" class="fr.ifremer.wao.entity.CompanyImpl" column="company" node="company/@topiaId" embed-xml="false"/>
+ <bag name="contact" inverse="true" lazy="true" node="contact" embed-xml="false">
+ <key column="observer"/>
+ <one-to-many class="fr.ifremer.wao.entity.ContactImpl" node="topiaId" embed-xml="false"/>
+ </bag>
+ </class>
+</hibernate-mapping>
Modified: trunk/wao-business/src/main/xmi/wao.zargo
===================================================================
(Binary files differ)
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/data/BusinessUtils.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/data/BusinessUtils.java 2010-04-08 16:07:20 UTC (rev 436)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/data/BusinessUtils.java 2010-04-08 17:14:03 UTC (rev 437)
@@ -149,43 +149,4 @@
}
return result;
}
-
- public static String[] getErrorMessages(WaoException eee, Messages messages,
- Logger logger) {
-
- String[] results = null;
- String cause = null;
- if (eee.getCause() != null) {
- cause = eee.getCause().getClass().getSimpleName() +
- " : " + eee.getCause().getMessage();
- results = new String[2];
- results[1] = cause;
- } else {
- results = new String[1];
- }
-
-
- if (logger.isDebugEnabled()) {
- logger.debug("ERROR from business : " + eee.getMessage() +
- " _ args = " + eee.getArgs());
- if (cause != null) {
- logger.debug("ERROR caused by : " + cause);
- }
- }
-
- if (eee.getArgs() != null) {
- results[0] = messages.format(eee.getMessage(), eee.getArgs());
- } else {
- results[0] = messages.get(eee.getMessage());
- }
- return results;
- }
-
- public static String getErrorMessage(WaoBusinessException eee, Messages messages,
- Logger logger) {
- if (logger.isDebugEnabled()) {
- logger.debug("ERROR from business : " + eee.getMessage());
- }
- return eee.getMessage();
- }
}
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java 2010-04-08 16:07:20 UTC (rev 436)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java 2010-04-08 17:14:03 UTC (rev 437)
@@ -32,7 +32,7 @@
import fr.ifremer.wao.ui.base.GenericSelectModel;
import fr.ifremer.wao.ui.base.WaoPage;
import fr.ifremer.wao.ui.components.Layout;
-import fr.ifremer.wao.ui.data.BusinessUtils;
+import fr.ifremer.wao.ui.services.WaoManager;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.apache.tapestry5.EventContext;
@@ -155,6 +155,9 @@
@Inject
private Messages messages;
+ @Inject
+ private WaoManager manager;
+
@Log
void onSuccessFromImportFishingZones() {
try {
@@ -163,7 +166,7 @@
layout.addInfo(result + " zones de pêche importées");
} catch (WaoException eee) {
String[] errors =
- BusinessUtils.getErrorMessages(eee, messages, log);
+ manager.getErrorMessages(eee, messages, log);
layout.addError(errors);
}
}
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Boats.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Boats.java 2010-04-08 16:07:20 UTC (rev 436)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Boats.java 2010-04-08 17:14:03 UTC (rev 437)
@@ -23,11 +23,11 @@
import fr.ifremer.wao.WaoBusinessException;
import fr.ifremer.wao.WaoException;
-import fr.ifremer.wao.WaoException;
import fr.ifremer.wao.bean.BoatFilterImpl;
import fr.ifremer.wao.entity.Boat;
import fr.ifremer.wao.bean.BoatFilter;
import fr.ifremer.wao.bean.CompanyBoatInfos;
+import fr.ifremer.wao.bean.SamplingFilter;
import fr.ifremer.wao.entity.BoatInfos;
import fr.ifremer.wao.entity.Company;
import fr.ifremer.wao.entity.Contact;
@@ -215,7 +215,7 @@
result[1] + " nouveaux");
} catch (WaoBusinessException eee) {
String error =
- BusinessUtils.getErrorMessage(eee, messages, log);
+ manager.getErrorMessage(eee, messages, log);
layout.addError(error);
}
}
@@ -352,7 +352,11 @@
* @see AbstractFilteredPage
*/
@Override
- public BoatFilter getFilter() throws WaoException {
+ public SamplingFilter getFilter() throws WaoException {
+ return getBoatFilter();
+ }
+
+ public BoatFilter getBoatFilter() throws WaoException {
if (boatFilter == null) {
if (log.isDebugEnabled()) {
log.debug("Create filter");
@@ -493,7 +497,7 @@
*/
public BoatDataSource getBoats() throws WaoException {
if (boats == null) {
- boats = new BoatDataSource(getFilter(), serviceBoat);
+ boats = new BoatDataSource(getBoatFilter(), serviceBoat);
}
return boats;
}
@@ -538,7 +542,7 @@
if (log.isDebugEnabled()) {
log.debug("Filter sampleRow : " + getFilter().getSampleRow());
}
- result = serviceBoat.exportBoatCsv(getFilter());
+ result = serviceBoat.exportBoatCsv(getBoatFilter());
} catch (WaoException eee) {
throw new IOException(eee);
}
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/ExceptionReport.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/ExceptionReport.java 2010-04-08 16:07:20 UTC (rev 436)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/ExceptionReport.java 2010-04-08 17:14:03 UTC (rev 437)
@@ -24,7 +24,7 @@
import fr.ifremer.wao.WaoException;
import fr.ifremer.wao.ui.base.WaoPage;
import fr.ifremer.wao.ui.components.Layout;
-import fr.ifremer.wao.ui.data.BusinessUtils;
+import fr.ifremer.wao.ui.services.WaoManager;
import org.apache.tapestry5.annotations.InjectComponent;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.Messages;
@@ -63,31 +63,30 @@
@Inject
private Messages messages;
+ @Inject
+ private WaoManager manager;
+
@Property
private Throwable exception;
@Override
public void reportException(Throwable eee) {
-// this.exception = getWaoExceptionO(eee);
-// if (exception != null) {
-// layout.addError(exception.getMessage());
-// this.exception = exception.getCause();
-// layout.addError("Erreur : " + this.exception.getClass().getSimpleName()
-// + " : " + this.exception.getMessage());
-// } else {
- exception = getWaoException(eee);
- if (exception != null) {
- String[] errors =
- BusinessUtils.getErrorMessages(
- (WaoException)exception, messages, log);
- layout.addError(errors);
- } else {
- log.error("Unexpected exception", eee);
- layout.addError("Erreur : " +
- eee.getClass().getSimpleName()
- + " : " + eee.getMessage());
- }
-// }
+ exception = getWaoException(eee);
+ if (exception != null) {
+ String[] errors =
+ manager.getErrorMessages(
+ (WaoException)exception, messages, log);
+ layout.addError(errors);
+ // Show other errors only in dev environment
+ } else if (manager.isDevEnvironment()) {
+ log.error("Unexpected exception", eee);
+ layout.addError("Erreur : " +
+ eee.getClass().getSimpleName() + " : " + eee.getMessage());
+ } else {
+ layout.addError("Une erreur inattendue vient de se produire. " +
+ "Veuillez recharger la page. Contactez un administrateur " +
+ "si ce message continue de s'afficher.");
+ }
}
protected Throwable getWaoException(Throwable eee) {
@@ -99,15 +98,5 @@
}
return getWaoException(eee.getCause());
}
-
-// protected Throwable getWaoExceptionO(Throwable eee) {
-// if (eee == null) {
-// return eee;
-// }
-// if (eee instanceof WaoExceptionO) {
-// return eee;
-// }
-// return getWaoExceptionO(eee.getCause());
-// }
}
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/WaoManager.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/WaoManager.java 2010-04-08 16:07:20 UTC (rev 436)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/WaoManager.java 2010-04-08 17:14:03 UTC (rev 437)
@@ -21,10 +21,13 @@
package fr.ifremer.wao.ui.services;
+import fr.ifremer.wao.WaoBusinessException;
import fr.ifremer.wao.WaoContext;
+import fr.ifremer.wao.WaoException;
import fr.ifremer.wao.WaoProperty;
import fr.ifremer.wao.service.ServiceUser;
import java.util.Date;
+import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.services.RegistryShutdownListener;
import org.nuiton.util.ApplicationConfig;
import org.slf4j.Logger;
@@ -110,6 +113,50 @@
return context.getCurrentDate();
}
+ public boolean isDevEnvironment() {
+ return log.isDebugEnabled();
+ }
+
+ public String[] getErrorMessages(WaoException eee, Messages messages,
+ Logger logger) {
+
+ String[] results = null;
+ String cause = null;
+ // Only show cause on dev environment
+ if (eee.getCause() != null && isDevEnvironment()) {
+ cause = eee.getCause().getClass().getSimpleName() +
+ " : " + eee.getCause().getMessage();
+ results = new String[2];
+ results[1] = cause;
+ } else {
+ results = new String[1];
+ }
+
+
+ if (logger.isDebugEnabled()) {
+ logger.debug("ERROR from business : " + eee.getMessage() +
+ " _ args = " + eee.getArgs());
+ if (cause != null) {
+ logger.debug("ERROR caused by : " + cause);
+ }
+ }
+
+ if (eee.getArgs() != null) {
+ results[0] = messages.format(eee.getMessage(), eee.getArgs());
+ } else {
+ results[0] = messages.get(eee.getMessage());
+ }
+ return results;
+ }
+
+ public String getErrorMessage(WaoBusinessException eee, Messages messages,
+ Logger logger) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("ERROR from business : " + eee.getMessage());
+ }
+ return eee.getMessage();
+ }
+
}
Modified: trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/pages/Boats.properties
===================================================================
--- trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/pages/Boats.properties 2010-04-08 16:07:20 UTC (rev 436)
+++ trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/pages/Boats.properties 2010-04-08 17:14:03 UTC (rev 437)
@@ -26,6 +26,12 @@
contactLastName-label: Nom
contactPhoneNumber-label: T\u00E9l\u00E9phone
contactEmail-label: E-mail
+contactAddress1-label: Adresse
+contactAddress2-label: Compl\u00E9ment d'adresse
+contactCity-label: Ville
+contactPostalCode-label: Code postal
+contactPostalCode-validate: Le code postal doit avoir une valeur num\u00E9rique
+contactSiret-label: N\u00B0 SIRET
shipOwner-label: Armateur
fromDate-label: Sollicitations du navire depuis le
dup-label: Capacit\u00E9 d'accueil du navire en personnels sp\u00E9cialis\u00E9s
Added: trunk/wao-ui/src/main/resources/org/apache/tapestry5/internal/ValidationMessages_fr.properties
===================================================================
--- trunk/wao-ui/src/main/resources/org/apache/tapestry5/internal/ValidationMessages_fr.properties (rev 0)
+++ trunk/wao-ui/src/main/resources/org/apache/tapestry5/internal/ValidationMessages_fr.properties 2010-04-08 17:14:03 UTC (rev 437)
@@ -0,0 +1,10 @@
+required=Le champs %s est requis.
+minimum-string-length=Le champs %2$s doit contenir plus de %1$d caract\u00E8res.
+maximum-string-length=Le champs %2$s est limit\u00E9 \u00E0 %1$d caract\u00E8res.
+min-integer=Le champs %2$s doit avoir une valeur sup\u00E9rieure \u00E0 %1$d.
+max-integer=Le champs %2$s doit avoir une valeur inf\u00E9rieure \u00E0 %1$d.
+regexp=Le champs %2$s ne correspond pas \u00E0 l'expression '%1$s'.
+invalid-email='%s' n'est pas une adresse email valide.
+integer-format-exception=Vous devez fournir un nombre entier pour %s.
+number-format-exception=Vous devez fournir une valeur num\u00E9rique pour %s.
+
Modified: trunk/wao-ui/src/main/webapp/Boats.tml
===================================================================
--- trunk/wao-ui/src/main/webapp/Boats.tml 2010-04-08 16:07:20 UTC (rev 436)
+++ trunk/wao-ui/src/main/webapp/Boats.tml 2010-04-08 17:14:03 UTC (rev 437)
@@ -93,11 +93,11 @@
<!-- Boat filter -->
<t:label t:for="boatName" />
<span> nom </span>
- <input t:type="textfield" t:id="boatName" class="width150" t:value="filter.boatName" t:mixins="Autocomplete" />
+ <input t:type="textfield" t:id="boatName" class="width150" t:value="boatFilter.boatName" t:mixins="Autocomplete" />
<span> immatriculation </span>
- <input t:type="textfield" t:id="boatImmatriculation" class="width50" t:value="filter.boatImmatriculation" />
+ <input t:type="textfield" t:id="boatImmatriculation" class="width50" t:value="boatFilter.boatImmatriculation" />
<span> code quartier </span>
- <input t:type="textfield" t:id="boatDistrictCode" class="width50" t:value="filter.boatDistrictCode" />
+ <input t:type="textfield" t:id="boatDistrictCode" class="width50" t:value="boatFilter.boatDistrictCode" />
</div>
<div class="t-beaneditor-row aright">
<input t:type="submit" class="ico search-32px" t:id="search" value="Search" title="Rechercher les navires correspondants aux filtres saisies" />
@@ -226,7 +226,8 @@
<fieldset id="so-boats-boat-infos-contact">
<legend>Contact</legend>
<div t:type="beandisplay" t:id="boatInfosContact" t:object="boatInfos"
- t:include="contactFirstName, contactLastName, contactPhoneNumber, contactEmail" />
+ t:include="contactFirstName, contactLastName, contactPhoneNumber, contactEmail,
+ contactAddress1, contactAddress2, contactPostalCode, contactCity, contactSiret" />
</fieldset>
@@ -322,7 +323,8 @@
<legend>Contact</legend>
<div class="t-beaneditor">
<t:beaneditor t:id="editBoatInfosContact" t:object="boatInfos"
- t:include="contactFirstName, contactLastName, contactPhoneNumber, contactEmail" />
+ t:include="contactFirstName, contactLastName, contactPhoneNumber, contactEmail,
+ contactAddress1, contactAddress2, contactPostalCode, contactCity, contactSiret" />
</div>
</fieldset>
Modified: trunk/wao-ui/src/main/webapp/css/boats.css
===================================================================
--- trunk/wao-ui/src/main/webapp/css/boats.css 2010-04-08 16:07:20 UTC (rev 436)
+++ trunk/wao-ui/src/main/webapp/css/boats.css 2010-04-08 17:14:03 UTC (rev 437)
@@ -110,9 +110,14 @@
fieldset#so-boats-boat-infos-lastcontact dl.t-beandisplay dt,
fieldset#so-boats-boat-infos-contact dl.t-beandisplay dt {
padding-right: 20px;
- width: 100px;
+ width: 150px;
+ font-size: 0.8em;
}
+fieldset#so-boats-boat-infos-contact div.t-beaneditor label {
+ width: 150px;
+}
+
fieldset#so-boats-boat-infos-boarding ul li {
list-style-type:square;
margin-left: 20px;
Added: trunk/wao-ui/src/main/webapp/img/sample-table.png
===================================================================
(Binary files differ)
Property changes on: trunk/wao-ui/src/main/webapp/img/sample-table.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
1
0
[Suiviobsmer-commits] r436 - in trunk/wao-ui/src/main: java/fr/ifremer/wao/ui/pages webapp webapp/img webapp/img/source
by fdesbois@users.labs.libre-entreprise.org 08 Apr '10
by fdesbois@users.labs.libre-entreprise.org 08 Apr '10
08 Apr '10
Author: fdesbois
Date: 2010-04-08 16:07:20 +0000 (Thu, 08 Apr 2010)
New Revision: 436
Added:
trunk/wao-ui/src/main/webapp/img/contacts-full.png
trunk/wao-ui/src/main/webapp/img/contacts-reduce.png
trunk/wao-ui/src/main/webapp/img/source/
trunk/wao-ui/src/main/webapp/img/source/contacts-full.xcf
trunk/wao-ui/src/main/webapp/img/source/contacts-reduce.xcf
trunk/wao-ui/src/main/webapp/img/source/contacts-table.png
trunk/wao-ui/src/main/webapp/img/source/samplingPlan-full.xcf
trunk/wao-ui/src/main/webapp/img/source/samplingPlan-reduce.xcf
Removed:
trunk/wao-ui/src/main/webapp/img/samplingPlan-full.xcf
trunk/wao-ui/src/main/webapp/img/samplingPlan-reduce.xcf
Modified:
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java
trunk/wao-ui/src/main/webapp/Contacts.tml
Log:
Evo #2069 : reduce mode for admin on contacts table
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java 2010-04-08 15:12:47 UTC (rev 435)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java 2010-04-08 16:07:20 UTC (rev 436)
@@ -117,23 +117,21 @@
@Inject
private ServiceBoat serviceBoat;
-// @Persist(PersistenceConstants.FLASH)
-// private String contactEditedId;
-
@Log
void setupRender() throws WaoException {
-// if (contactEdited == null) {
- if (log.isDebugEnabled()) {
- log.debug("RESET DATA");
- }
- if (isFiltersVisible()) {
- // Initialize filters
- initSelectFilters(true, false, true);
- }
- contacts = null;
- getContacts();
-// }
+ if (log.isDebugEnabled()) {
+ log.debug("RESET DATA");
+ }
+ contacts = null;
contactsForm.clearErrors();
+ // Initialize filters if needed
+ if (isFiltersVisible()) {
+ initSelectFilters(true, false, true);
+ }
+ // Initialize fullView to true for amdmin user
+ if (fullView == null && user.isAdmin()) {
+ fullView = true;
+ }
}
/**************************** CONTACT FILTERS *****************************/
@@ -267,6 +265,22 @@
return null;
}
+ /**************************** CONTACT DISPLAY MODE ************************/
+
+ @Persist
+ @Property
+ private Boolean fullView;
+
+ /**
+ * ACTION:: Used to change the display mode of the contacts table.
+ * This change affect the loading of the css style over the main table.
+ *
+ * @see #getGridClass()
+ */
+ void onActionFromToggleDisplayMode() {
+ fullView = !fullView;
+ }
+
/**************************** CONTACT LIST ********************************/
@Inject
@@ -303,8 +317,8 @@
public ContactDataSource getContacts() throws WaoException {
if (contacts == null) {
- if (log.isInfoEnabled()) {
- log.info("Create DataSource");
+ if (log.isDebugEnabled()) {
+ log.debug("Create DataSource");
}
contacts = new ContactDataSource(getContactFilter(), serviceContact);
}
@@ -313,7 +327,7 @@
public BeanModel<Contact> getContactModel() {
if (contactModel == null) {
- contactModel = user.isAdmin() ?
+ contactModel = fullView ?
contactModelFactory.buildAdminContactModel(beanModelSource, resources) :
contactModelFactory.buildContactModel(beanModelSource, resources);
}
@@ -360,7 +374,7 @@
}
public String getGridClass() {
- return user.isAdmin() ? "admin" : "user";
+ return fullView ? "admin" : "user";
}
public String getRowClass() {
Modified: trunk/wao-ui/src/main/webapp/Contacts.tml
===================================================================
--- trunk/wao-ui/src/main/webapp/Contacts.tml 2010-04-08 15:12:47 UTC (rev 435)
+++ trunk/wao-ui/src/main/webapp/Contacts.tml 2010-04-08 16:07:20 UTC (rev 436)
@@ -19,6 +19,17 @@
import/export
</a>
</t:if>
+ <t:if t:test="user.admin">
+
+ <a t:type="actionlink" t:id="toggleDisplayMode" class="display-form">
+ <t:if t:test="fullView">
+ réduire la vue
+ <p:else>
+ agrandir la vue
+ </p:else>
+ </t:if>
+ </a>
+ </t:if>
</div>
<!-- FILTRES -->
<div t:type="zone" class="so-filters" t:id="filtersZone" t:visible="prop:filtersVisible" id="so-contacts-filters">
Added: trunk/wao-ui/src/main/webapp/img/contacts-full.png
===================================================================
(Binary files differ)
Property changes on: trunk/wao-ui/src/main/webapp/img/contacts-full.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/wao-ui/src/main/webapp/img/contacts-reduce.png
===================================================================
(Binary files differ)
Property changes on: trunk/wao-ui/src/main/webapp/img/contacts-reduce.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: trunk/wao-ui/src/main/webapp/img/samplingPlan-full.xcf
===================================================================
(Binary files differ)
Deleted: trunk/wao-ui/src/main/webapp/img/samplingPlan-reduce.xcf
===================================================================
(Binary files differ)
Added: trunk/wao-ui/src/main/webapp/img/source/contacts-full.xcf
===================================================================
(Binary files differ)
Property changes on: trunk/wao-ui/src/main/webapp/img/source/contacts-full.xcf
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/wao-ui/src/main/webapp/img/source/contacts-reduce.xcf
===================================================================
(Binary files differ)
Property changes on: trunk/wao-ui/src/main/webapp/img/source/contacts-reduce.xcf
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/wao-ui/src/main/webapp/img/source/contacts-table.png
===================================================================
(Binary files differ)
Property changes on: trunk/wao-ui/src/main/webapp/img/source/contacts-table.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/wao-ui/src/main/webapp/img/source/samplingPlan-full.xcf
===================================================================
(Binary files differ)
Property changes on: trunk/wao-ui/src/main/webapp/img/source/samplingPlan-full.xcf
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/wao-ui/src/main/webapp/img/source/samplingPlan-reduce.xcf
===================================================================
(Binary files differ)
Property changes on: trunk/wao-ui/src/main/webapp/img/source/samplingPlan-reduce.xcf
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
1
0
[Suiviobsmer-commits] r435 - in trunk: . wao-ui/src/main/java/fr/ifremer/wao/ui/pages wao-ui/src/main/webapp wao-ui/src/main/webapp/css wao-ui/src/main/webapp/img
by fdesbois@users.labs.libre-entreprise.org 08 Apr '10
by fdesbois@users.labs.libre-entreprise.org 08 Apr '10
08 Apr '10
Author: fdesbois
Date: 2010-04-08 15:12:47 +0000 (Thu, 08 Apr 2010)
New Revision: 435
Added:
trunk/wao-ui/src/main/webapp/img/samplingPlan-full.png
trunk/wao-ui/src/main/webapp/img/samplingPlan-full.xcf
trunk/wao-ui/src/main/webapp/img/samplingPlan-reduce.png
trunk/wao-ui/src/main/webapp/img/samplingPlan-reduce.xcf
Modified:
trunk/changelog.txt
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java
trunk/wao-ui/src/main/webapp/SamplingPlan.tml
trunk/wao-ui/src/main/webapp/css/sampling.css
Log:
Evo #2069 : reduce mode for admin on samplingPlan table
Modified: trunk/changelog.txt
===================================================================
--- trunk/changelog.txt 2010-04-08 10:34:27 UTC (rev 434)
+++ trunk/changelog.txt 2010-04-08 15:12:47 UTC (rev 435)
@@ -9,6 +9,8 @@
Evolutions
++++++++++
+- [fdesbois] Evo #2069 : Role admin : Ajouter la visibilité réduite sur les
+ contacts et le plan d'échantillonnage
- [fdesbois] Evo #2059 : Filtres sur tableau plan échantillonnage
- [fdesbois] Evo #2241 : Revoir chargement des observateurs lorsqu'un
utilisateur (observateur/coordinateur) est connecté
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java 2010-04-08 10:34:27 UTC (rev 434)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java 2010-04-08 15:12:47 UTC (rev 435)
@@ -108,6 +108,10 @@
// Initialize filters
initSelectFilters(true, false, true);
}
+ // Initialize fullView to true for admin user
+ if (fullView == null && user.isAdmin()) {
+ fullView = true;
+ }
}
/**************************** IMPORT (ADMIN) *******************************/
@@ -233,11 +237,26 @@
return this;
}
+ /**************************** MAIN ACTIONS ********************************/
- /**************************** MAIN TABLE ***********************************/
+ @Persist
+ @Property
+ private Boolean fullView;
- /** ------------------------- DATA -------------------------------------- **/
+ /**
+ * ACTION:: Used to change the display mode of the samplingPlan table.
+ * This change affect the loading of the css style over the main table.
+ *
+ * @see #getMainClass()
+ */
+ void onActionFromToggleDisplayMode() {
+ fullView = !fullView;
+ }
+ /**************************** MAIN TABLE **********************************/
+
+ /** ------------------------- DATA ------------------------------------- **/
+
/**
* Main data for samplingPlan : List of SampleRow ordered by FishingZone.
*/
@@ -376,7 +395,7 @@
return NumberFormat.getNumberInstance();
}
- /** ------------------------- HTML & STYLE ------------------------------ **/
+ /** ------------------------- HTML & STYLE ----------------------------- **/
@Property
private int rowIndex;
@@ -391,7 +410,7 @@
public int getNbColumnsForProfession() {
// code, program.name, fishingZone.districts, profession.code, profession.libelle
int fixed = 5;
- if (user.isAdmin()) {
+ if (fullView) {
// company, program.periodBegin, program.periodEnd, fishingZonesInfos
// profession.meshSize, profession.size, profession.other, profession.species
fixed += 8;
@@ -413,7 +432,7 @@
}
public String getMainClass() {
- return user.isAdmin() ? "admin" : "user";
+ return fullView ? "admin" : "user";
}
public String getParityClass() {
@@ -421,7 +440,7 @@
}
public String getActionsClass() {
- return user.isAdmin() ? "width100" : "width30";
+ return fullView ? "width100" : "width50";
}
public String getRealTidesClass() {
@@ -442,7 +461,7 @@
return new SimpleDateFormat("MM/yyyy");
}
- /** ------------------------- ACTIONS ----------------------------------- **/
+ /** ------------------------- ACTIONS ---------------------------------- **/
/**
* Can edit the sampleRow. Only for admin with no readOnly rights.
Modified: trunk/wao-ui/src/main/webapp/SamplingPlan.tml
===================================================================
--- trunk/wao-ui/src/main/webapp/SamplingPlan.tml 2010-04-08 10:34:27 UTC (rev 434)
+++ trunk/wao-ui/src/main/webapp/SamplingPlan.tml 2010-04-08 15:12:47 UTC (rev 435)
@@ -16,74 +16,88 @@
</div>
</t:if>
<div class="clearfix mbottom10">
- <div class="fleft">
- <h1>
- Plan d'échantillonnage
- <a t:type="actionlink" t:id="exportSamplingPlan">
- <img src="${asset:context:}/img/file-export-22px.png" alt="Export CSV"
- title="Exporter le plan d'échantillonnage du ${dateFormat.format(period.fromDate)} au ${dateFormat.format(period.thruDate)}" />
- </a>
- </h1>
- <form t:type="form" t:id="periodForm" action="post">
- <div>
- <t:label t:for="periodBegin" /> :
- <input t:type="datefield" class="width70" t:id="periodBegin" t:value="period.fromDate" t:format="MM/yyyy" t:validate="required"/>
- <t:label t:for="periodEnd" /> :
- <input t:type="datefield" class="width70" t:id="periodEnd" t:value="period.thruDate" t:format="MM/yyyy" t:validate="required" />
- <input t:type="submit" class="ico search" value="Search" t:title="Affichage des lignes du plan couvertes par la période sélectionnée" />
- <a t:type="actionlink" t:id="showFilters" t:zone="so-sampling-filters" class="display-form">recherche avancée</a>
- </div>
- </form>
- <div t:type="zone" t:id="filtersZone" t:visible="prop:filtersVisible" id="so-sampling-filters">
- <fieldset>
- <legend>Recherche avancée</legend>
- <div class="so-filters-form">
- <form t:type="form" t:id="filtersForm" t:zone="so-sampling-filters" action="post">
- <t:errors />
- <div class="t-beaneditor">
- <div>
- <t:if t:test="user.admin">
- <t:label t:for="company" />:
- <input t:type="select" t:id="company" t:model="companySelectModel" value="companyId"/>
- <input t:type="submit" class="ico22px refresh" t:id="refreshByCompany" value="Refresh"
- title="Rafraîchir les filtres en fonction de la société sélectionnée"/>
- </t:if>
- <t:label t:for="programName" />:
- <select t:type="select" t:id="programName" t:model="programSelectModel" t:value="filter.programName" />
- <t:label t:for="codeDCF5" />:
- <input t:type="textfield" t:id="codeDCF5" value="filter.codeDCF5" t:mixins="Autocomplete"/>
- </div>
- <div>
- <t:label t:for="facadeName" />:
- <select t:type="select" t:id="facadeName" t:model="facadeSelectModel" t:value="filter.facadeName" />
- <input t:type="submit" class="ico22px refresh" t:id="refreshByFacade" value="Refresh"
- title="Rafraîchir les zones et les métiers en fonction de la façade sélectionnée"/>
- <t:label t:for="sectorName" />:
- <select t:type="select" t:id="sectorName" t:model="sectorSelectModel" t:value="filter.sectorName" />
- <input t:type="submit" class="ico22px refresh" t:id="refreshBySector" value="Refresh"
- title="Rafraîchir les métiers en fonction de la zone sélectionnée"/>
- <t:label t:for="sampleRow" />:
- <input t:type="select" t:id="sampleRow" t:model="sampleRowSelectModel" value="sampleRowId" />
- </div>
- <div class="t-beaneditor-row aright">
- <input t:type="submit" class="ico search-32px" t:id="search" value="Search" title="Rechercher les lignes du plan correspondants aux filtres saisies" />
- <input t:type="submit" class="ico undo" t:id="reset" value="Reset" title="Remettre les filtres par défaut" />
- </div>
- </div>
- </form>
- </div>
- </fieldset>
- </div>
- </div>
- <t:if t:test="canEditSampleRow()">
- <div class="actions fright">
+ <div class="clearfix">
+ <h1 class="fleft">Plan d'échantillonnage</h1>
+ <div class="fleft actions-top">
<span>
- <a t:type="pagelink" t:page="sampleRowForm">
- <img src="${asset:context:}/img/add-32px.png" alt="Ajouter" title="Ajouter une nouvelle ligne"/>
- </a>
+ <a t:type="actionlink" t:id="exportSamplingPlan">
+ <img src="${asset:context:}/img/file-export-22px.png" alt="Export CSV"
+ title="Exporter le plan d'échantillonnage du ${dateFormat.format(period.fromDate)} au ${dateFormat.format(period.thruDate)}" />
+ </a>
</span>
+ <t:if t:test="user.admin">
+ <span>
+ <a t:type="actionlink" t:id="toggleDisplayMode">
+ <t:if t:test="fullView">
+ <img src="${asset:context:}/img/samplingPlan-reduce.png" alt="Réduire"
+ title="Réduire le plan d'échantillonnage"/>
+ <p:else>
+ <img src="${asset:context:}/img/samplingPlan-full.png" alt="Agrandir"
+ title="Agrandir le plan d'échantillonnage"/>
+ </p:else>
+ </t:if>
+ </a>
+ </span>
+ <t:if t:test="canEditSampleRow()">
+ <span>
+ <a t:type="pagelink" t:page="sampleRowForm">
+ <img src="${asset:context:}/img/add.png" alt="Ajouter" title="Ajouter une nouvelle ligne"/>
+ </a>
+ </span>
+ </t:if>
+ </t:if>
</div>
- </t:if>
+ </div>
+ <form t:type="form" t:id="periodForm" action="post">
+ <div>
+ <t:label t:for="periodBegin" /> :
+ <input t:type="datefield" class="width70" t:id="periodBegin" t:value="period.fromDate" t:format="MM/yyyy" t:validate="required"/>
+ <t:label t:for="periodEnd" /> :
+ <input t:type="datefield" class="width70" t:id="periodEnd" t:value="period.thruDate" t:format="MM/yyyy" t:validate="required" />
+ <input t:type="submit" class="ico search" value="Search" t:title="Affichage des lignes du plan couvertes par la période sélectionnée" />
+ <a t:type="actionlink" t:id="showFilters" t:zone="so-sampling-filters" class="display-form">recherche avancée</a>
+ </div>
+ </form>
+ <div t:type="zone" t:id="filtersZone" t:visible="prop:filtersVisible" id="so-sampling-filters">
+ <fieldset>
+ <legend>Recherche avancée</legend>
+ <div class="so-filters-form">
+ <form t:type="form" t:id="filtersForm" t:zone="so-sampling-filters" action="post">
+ <t:errors />
+ <div class="t-beaneditor">
+ <div>
+ <t:if t:test="user.admin">
+ <t:label t:for="company" />:
+ <input t:type="select" t:id="company" t:model="companySelectModel" value="companyId"/>
+ <input t:type="submit" class="ico22px refresh" t:id="refreshByCompany" value="Refresh"
+ title="Rafraîchir les filtres en fonction de la société sélectionnée"/>
+ </t:if>
+ <t:label t:for="programName" />:
+ <select t:type="select" t:id="programName" t:model="programSelectModel" t:value="filter.programName" />
+ <t:label t:for="codeDCF5" />:
+ <input t:type="textfield" t:id="codeDCF5" value="filter.codeDCF5" t:mixins="Autocomplete"/>
+ </div>
+ <div>
+ <t:label t:for="facadeName" />:
+ <select t:type="select" t:id="facadeName" t:model="facadeSelectModel" t:value="filter.facadeName" />
+ <input t:type="submit" class="ico22px refresh" t:id="refreshByFacade" value="Refresh"
+ title="Rafraîchir les zones et les métiers en fonction de la façade sélectionnée"/>
+ <t:label t:for="sectorName" />:
+ <select t:type="select" t:id="sectorName" t:model="sectorSelectModel" t:value="filter.sectorName" />
+ <input t:type="submit" class="ico22px refresh" t:id="refreshBySector" value="Refresh"
+ title="Rafraîchir les métiers en fonction de la zone sélectionnée"/>
+ <t:label t:for="sampleRow" />:
+ <input t:type="select" t:id="sampleRow" t:model="sampleRowSelectModel" value="sampleRowId" />
+ </div>
+ <div class="t-beaneditor-row aright">
+ <input t:type="submit" class="ico search-32px" t:id="search" value="Search" title="Rechercher les lignes du plan correspondants aux filtres saisies" />
+ <input t:type="submit" class="ico undo" t:id="reset" value="Reset" title="Remettre les filtres par défaut" />
+ </div>
+ </div>
+ </form>
+ </div>
+ </fieldset>
+ </div>
</div>
<t:zone t:id="samplingZone">
<table class="t-data-grid">
@@ -96,11 +110,11 @@
<tr>
<td class="bleft">Code ligne</td>
<td class="width150">Programme ou règlement rattachement</td>
- <t:if t:test="user.admin">
+ <t:if t:test="fullView">
<td>Société</td>
</t:if>
<td>Zone</td>
- <t:if t:test="user.admin">
+ <t:if t:test="fullView">
<td>Zone de pêche info</td>
<td>METIER<br />Code DCF5</td>
<td>METIER<br />Maillage</td>
@@ -152,10 +166,10 @@
</a>
</td>
<td class="width150">${row.programName}</td>
- <t:if t:test="user.admin">
+ <t:if t:test="fullView">
<td>${companyName}</td>
</t:if>
- <t:if t:test="user.admin">
+ <t:if t:test="fullView">
<td>${fishingZones}</td>
<td>${row.fishingZonesInfos}</td>
<td>${row.profession.codeDCF5}</td>
Modified: trunk/wao-ui/src/main/webapp/css/sampling.css
===================================================================
--- trunk/wao-ui/src/main/webapp/css/sampling.css 2010-04-08 10:34:27 UTC (rev 434)
+++ trunk/wao-ui/src/main/webapp/css/sampling.css 2010-04-08 15:12:47 UTC (rev 435)
@@ -29,11 +29,21 @@
width: 40%;
}
+div#so-sampling h1 {
+ padding-bottom: 5px;
+ padding-right: 5px;
+}
+
+div#so-sampling div.actions-top {
+ margin-bottom: 10px;
+}
+
div#so-sampling-filters div.t-beaneditor div {
margin-top: 5px;
}
div#so-sampling-filters fieldset {
+ margin-top: 5px;
padding: 5px;
}
Added: trunk/wao-ui/src/main/webapp/img/samplingPlan-full.png
===================================================================
(Binary files differ)
Property changes on: trunk/wao-ui/src/main/webapp/img/samplingPlan-full.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/wao-ui/src/main/webapp/img/samplingPlan-full.xcf
===================================================================
(Binary files differ)
Property changes on: trunk/wao-ui/src/main/webapp/img/samplingPlan-full.xcf
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/wao-ui/src/main/webapp/img/samplingPlan-reduce.png
===================================================================
(Binary files differ)
Property changes on: trunk/wao-ui/src/main/webapp/img/samplingPlan-reduce.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/wao-ui/src/main/webapp/img/samplingPlan-reduce.xcf
===================================================================
(Binary files differ)
Property changes on: trunk/wao-ui/src/main/webapp/img/samplingPlan-reduce.xcf
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
1
0
[Suiviobsmer-commits] r434 - in trunk: wao-business/src/main/java/fr/ifremer/wao wao-business/src/main/java/fr/ifremer/wao/io wao-business/src/main/java/fr/ifremer/wao/service wao-business/src/main/resources/i18n wao-business/src/main/xmi wao-business/src/test/java/fr/ifremer/wao wao-ui/src/main/java/fr/ifremer/wao/ui/services
by fdesbois@users.labs.libre-entreprise.org 08 Apr '10
by fdesbois@users.labs.libre-entreprise.org 08 Apr '10
08 Apr '10
Author: fdesbois
Date: 2010-04-08 10:34:27 +0000 (Thu, 08 Apr 2010)
New Revision: 434
Added:
trunk/wao-business/src/main/java/fr/ifremer/wao/WaoContext.java
Removed:
trunk/wao-business/src/main/java/fr/ifremer/wao/MD5.java
Modified:
trunk/wao-business/src/main/java/fr/ifremer/wao/WaoContextImpl.java
trunk/wao-business/src/main/java/fr/ifremer/wao/WaoUtils.java
trunk/wao-business/src/main/java/fr/ifremer/wao/io/ImportHelper.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ActivityCalendarImport.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceBoatImpl.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactImpl.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceNewsImpl.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceReferentialImpl.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSynthesisImpl.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceUserImpl.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
trunk/wao-business/src/main/xmi/wao.zargo
trunk/wao-business/src/test/java/fr/ifremer/wao/TestManager.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/WaoManager.java
Log:
- Don't generate WaoContext
- Use StringUtil.encodeMD5 instead of MD5 class, now deleted
- Use only one interface for context (no more WaoContextImplementor)
Deleted: trunk/wao-business/src/main/java/fr/ifremer/wao/MD5.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/MD5.java 2010-04-08 10:16:35 UTC (rev 433)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/MD5.java 2010-04-08 10:34:27 UTC (rev 434)
@@ -1,64 +0,0 @@
-/* *##%
- * Wao :: Business
- * Copyright (C) 2009 - 2010 Ifremer
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Lesser Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/gpl-3.0.html>.
- * ##%*/
-
-package fr.ifremer.wao;
-
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
-/**
- * Classe utilitaire permettant d'encoder des chaîne en MD5.
- *
- * @version $Id$
- */
-public class MD5 {
-
- /**
- * Encode la chaine passé en paramètre avec l’algorithme MD5
- *
- * @param key : la chaine à encoder
- * @return la valeur (string) hexadécimale sur 32 bits
- */
- public static String encode(String key) {
- if (key == null) {
- return key;
- }
- byte[] uniqueKey = key.getBytes();
- byte[] hash = null;
-
- try {
- // on récupère un objet qui permettra de crypter la chaine
- hash = MessageDigest.getInstance("MD5").digest(uniqueKey);
- } catch (NoSuchAlgorithmException eee) {
- throw new RuntimeException("no MD5 support in this VM", eee);
- }
-
- StringBuffer hashString = new StringBuffer();
- for (int i = 0; i < hash.length; ++i) {
- String hex = Integer.toHexString(hash[i]);
- if (hex.length() == 1) {
- hashString.append("0");
- hashString.append(hex.charAt(hex.length() - 1));
- } else {
- hashString.append(hex.substring(hex.length() - 2));
- }
- }
- return hashString.toString();
- }
-}
Added: trunk/wao-business/src/main/java/fr/ifremer/wao/WaoContext.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/WaoContext.java (rev 0)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/WaoContext.java 2010-04-08 10:34:27 UTC (rev 434)
@@ -0,0 +1,142 @@
+package fr.ifremer.wao;
+
+import fr.ifremer.wao.service.ServiceUser;
+import java.nio.charset.Charset;
+import java.util.Date;
+import org.apache.commons.mail.EmailException;
+import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.persistence.TopiaEntity;
+import org.nuiton.util.ApplicationConfig;
+
+
+public interface WaoContext {
+
+ /**
+ * getProperty :
+ * @param property
+ * @return String
+ */
+ public String getProperty(WaoProperty property);
+
+ /**
+ * isActivityCalendarImportRun :
+ * @return boolean
+ */
+ public boolean isActivityCalendarImportRun();
+
+ /**
+ * getConfiguration :
+ * @return ApplicationConfig
+ */
+ public ApplicationConfig getConfiguration();
+
+ /**
+ * start :
+ * @param serviceUser
+ */
+ public void start(ServiceUser serviceUser);
+
+ /**
+ * stop :
+ */
+ public void stop();
+
+ /**
+ * setActivityCalendarImportRun :
+ * @param run
+ */
+ public void setActivityCalendarImportRun(boolean run);
+
+ /**
+ * createRandomString :
+ * @param length
+ * @return String
+ */
+ public String createRandomString(int length);
+
+ /**
+ * encodeString :
+ * @param str
+ * @return String
+ */
+ public String encodeString(String str);
+
+ /**
+ * convertId :
+ * @param topiaId
+ * @return String
+ */
+ public String convertId(String topiaId);
+
+ /**
+ * getCsvCharset :
+ * @return Charset
+ */
+ public Charset getCsvCharset();
+
+ /**
+ * prepareSampleRowCode :
+ * @param code
+ * @return String
+ */
+ public String prepareSampleRowCode(String code);
+
+ /**
+ * prepareTopiaId :
+ * @param <E>
+ * @param entityClass
+ * @param entity
+ * @return boolean
+ */
+ public <E extends TopiaEntity> boolean prepareTopiaId(Class<E> entityClass, E entity);
+
+ /**
+ * sendEmail :
+ * @param to
+ * @param subject
+ * @param msg
+ * @throws EmailException
+ */
+ public void sendEmail(String to, String subject, String msg) throws EmailException;
+
+ /**
+ * getCurrentDate :
+ * @return Date
+ */
+ public Date getCurrentDate();
+
+ /**
+ * beginTransaction :
+ * @return TopiaContext
+ * @throws TopiaException
+ */
+ public TopiaContext beginTransaction() throws TopiaException;
+
+ /**
+ * treateError :
+ * @param eee
+ * @param message
+ * @param args
+ * @throws WaoException
+ */
+ public void treateError(Exception eee, String message, Object... args) throws WaoException;
+
+ /**
+ * treateError :
+ * @param transaction
+ * @param eee
+ * @param message
+ * @param args
+ * @throws WaoException
+ */
+ public void treateError(TopiaContext transaction, Exception eee, String message, Object... args) throws WaoException;
+
+ /**
+ * closeTransaction :
+ * @param transaction
+ */
+ public void closeTransaction(TopiaContext transaction);
+
+
+} //WaoContext
Property changes on: trunk/wao-business/src/main/java/fr/ifremer/wao/WaoContext.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/WaoContextImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/WaoContextImpl.java 2010-04-08 10:16:35 UTC (rev 433)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/WaoContextImpl.java 2010-04-08 10:34:27 UTC (rev 434)
@@ -25,8 +25,10 @@
import fr.ifremer.wao.io.ImportHelper;
import fr.ifremer.wao.service.ServiceUser;
import java.nio.charset.Charset;
+import java.security.NoSuchAlgorithmException;
import java.util.Date;
import java.util.Locale;
+import java.util.logging.Level;
import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.mail.EmailException;
@@ -43,6 +45,7 @@
import org.nuiton.topia.persistence.TopiaId;
import org.nuiton.util.ApplicationConfig;
import org.nuiton.util.ArgumentsParserException;
+import org.nuiton.util.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.nuiton.i18n.I18n.n_;
@@ -59,7 +62,7 @@
* Last update: $Date$
* by : $Author: fdesbois $
*/
-public class WaoContextImpl implements WaoContextImplementor {
+public class WaoContextImpl implements WaoContext {
private static final Logger log =
LoggerFactory.getLogger(WaoContextImpl.class);
@@ -365,7 +368,12 @@
@Override
public String encodeString(String string) {
- return MD5.encode(string);
+ try {
+ return StringUtil.encodeMD5(string);
+ } catch (NoSuchAlgorithmException eee) {
+ treateError(eee, n_("wao.error.context.encodeString"));
+ }
+ return null;
}
@Override
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/WaoUtils.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/WaoUtils.java 2010-04-08 10:16:35 UTC (rev 433)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/WaoUtils.java 2010-04-08 10:34:27 UTC (rev 434)
@@ -50,11 +50,11 @@
private static final Logger logger =
LoggerFactory.getLogger(WaoUtils.class);
- private static WaoContextImplementor context;
+ private static WaoContext context;
private static org.apache.log4j.Logger activityCalendarAccessLogger;
- static void setContext(WaoContextImplementor context) {
+ static void setContext(WaoContext context) {
WaoUtils.context = context;
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/io/ImportHelper.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/io/ImportHelper.java 2010-04-08 10:16:35 UTC (rev 433)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/io/ImportHelper.java 2010-04-08 10:34:27 UTC (rev 434)
@@ -60,7 +60,7 @@
protected CsvReader reader;
- protected static WaoContextImplementor context;
+ protected static WaoContext context;
// 2000 -> 2099
public static final int CURRENT_MILLENIUM = 2000;
@@ -72,7 +72,7 @@
this.reader = reader;
}
- public static void setContext(WaoContextImplementor context) {
+ public static void setContext(WaoContext context) {
ImportHelper.context = context;
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ActivityCalendarImport.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ActivityCalendarImport.java 2010-04-08 10:16:35 UTC (rev 433)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ActivityCalendarImport.java 2010-04-08 10:34:27 UTC (rev 434)
@@ -69,7 +69,7 @@
*/
public class ActivityCalendarImport implements Runnable {
- private WaoContextImplementor context;
+ private WaoContext context;
private InputStream input;
@@ -121,7 +121,7 @@
}
}
- public ActivityCalendarImport(WaoContextImplementor context,
+ public ActivityCalendarImport(WaoContext context,
InputStream input) throws IOException {
super();
this.context = context;
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceBoatImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceBoatImpl.java 2010-04-08 10:16:35 UTC (rev 433)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceBoatImpl.java 2010-04-08 10:34:27 UTC (rev 434)
@@ -25,7 +25,7 @@
import com.csvreader.CsvWriter;
import fr.ifremer.wao.WaoBusinessException;
import fr.ifremer.wao.WaoBusinessException.Type;
-import fr.ifremer.wao.WaoContextImplementor;
+import fr.ifremer.wao.WaoContext;
import fr.ifremer.wao.WaoDAOHelper;
import fr.ifremer.wao.WaoException;
import fr.ifremer.wao.WaoProperty;
@@ -75,9 +75,9 @@
private static final Logger log =
LoggerFactory.getLogger(ServiceBoatImpl.class);
- private WaoContextImplementor context;
+ private WaoContext context;
- public void setContext(WaoContextImplementor context) {
+ public void setContext(WaoContext context) {
this.context = context;
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactImpl.java 2010-04-08 10:16:35 UTC (rev 433)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactImpl.java 2010-04-08 10:34:27 UTC (rev 434)
@@ -28,7 +28,7 @@
import fr.ifremer.wao.io.ImportHelper.*;
import fr.ifremer.wao.WaoBusinessException;
import fr.ifremer.wao.WaoBusinessException.Type;
-import fr.ifremer.wao.WaoContextImplementor;
+import fr.ifremer.wao.WaoContext;
import fr.ifremer.wao.WaoDAOHelper;
import fr.ifremer.wao.bean.ContactState;
import java.io.IOException;
@@ -91,9 +91,9 @@
private static final Logger log =
LoggerFactory.getLogger(ServiceContactImpl.class);
- private WaoContextImplementor context;
+ private WaoContext context;
- public void setContext(WaoContextImplementor context) {
+ public void setContext(WaoContext context) {
this.context = context;
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceNewsImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceNewsImpl.java 2010-04-08 10:16:35 UTC (rev 433)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceNewsImpl.java 2010-04-08 10:34:27 UTC (rev 434)
@@ -21,7 +21,7 @@
package fr.ifremer.wao.service;
-import fr.ifremer.wao.WaoContextImplementor;
+import fr.ifremer.wao.WaoContext;
import fr.ifremer.wao.WaoDAOHelper;
import fr.ifremer.wao.WaoException;
import fr.ifremer.wao.entity.News;
@@ -49,9 +49,9 @@
private static final Logger logger =
LoggerFactory.getLogger(ServiceNewsImpl.class);
- private WaoContextImplementor context;
+ private WaoContext context;
- public void setContext(WaoContextImplementor context) {
+ public void setContext(WaoContext context) {
this.context = context;
}
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 2010-04-08 10:16:35 UTC (rev 433)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceReferentialImpl.java 2010-04-08 10:34:27 UTC (rev 434)
@@ -22,7 +22,7 @@
package fr.ifremer.wao.service;
import com.csvreader.CsvReader;
-import fr.ifremer.wao.WaoContextImplementor;
+import fr.ifremer.wao.WaoContext;
import fr.ifremer.wao.WaoDAOHelper;
import fr.ifremer.wao.WaoException;
import fr.ifremer.wao.bean.SamplingFilter;
@@ -61,9 +61,9 @@
private static final Logger log =
LoggerFactory.getLogger(ServiceReferentialImpl.class);
- private WaoContextImplementor context;
+ private WaoContext context;
- public void setContext(WaoContextImplementor context) {
+ public void setContext(WaoContext context) {
this.context = context;
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java 2010-04-08 10:16:35 UTC (rev 433)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java 2010-04-08 10:34:27 UTC (rev 434)
@@ -26,7 +26,7 @@
import fr.ifremer.wao.io.ImportHelper;
import fr.ifremer.wao.WaoBusinessException;
import fr.ifremer.wao.WaoBusinessException.Type;
-import fr.ifremer.wao.WaoContextImplementor;
+import fr.ifremer.wao.WaoContext;
import fr.ifremer.wao.WaoDAOHelper;
import fr.ifremer.wao.WaoException;
import fr.ifremer.wao.bean.FacadeRow;
@@ -83,9 +83,9 @@
private static final Logger log =
LoggerFactory.getLogger(ServiceSamplingImpl.class);
- private WaoContextImplementor context;
+ private WaoContext context;
- public void setContext(WaoContextImplementor context) {
+ public void setContext(WaoContext context) {
this.context = context;
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSynthesisImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSynthesisImpl.java 2010-04-08 10:16:35 UTC (rev 433)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSynthesisImpl.java 2010-04-08 10:34:27 UTC (rev 434)
@@ -21,7 +21,7 @@
package fr.ifremer.wao.service;
-import fr.ifremer.wao.WaoContextImplementor;
+import fr.ifremer.wao.WaoContext;
import fr.ifremer.wao.WaoDAOHelper;
import fr.ifremer.wao.WaoException;
import fr.ifremer.wao.bean.ContactAverageReactivityImpl;
@@ -77,9 +77,9 @@
private static final Logger log =
LoggerFactory.getLogger(ServiceSynthesisImpl.class);
- private WaoContextImplementor context;
+ private WaoContext context;
- public void setContext(WaoContextImplementor context) {
+ public void setContext(WaoContext context) {
this.context = context;
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceUserImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceUserImpl.java 2010-04-08 10:16:35 UTC (rev 433)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceUserImpl.java 2010-04-08 10:34:27 UTC (rev 434)
@@ -23,7 +23,7 @@
import fr.ifremer.wao.WaoBusinessException;
import fr.ifremer.wao.WaoBusinessException.Type;
-import fr.ifremer.wao.WaoContextImplementor;
+import fr.ifremer.wao.WaoContext;
import fr.ifremer.wao.WaoDAOHelper;
import fr.ifremer.wao.WaoException;
import fr.ifremer.wao.WaoProperty;
@@ -63,9 +63,9 @@
private static final Logger log =
LoggerFactory.getLogger(ServiceUserImpl.class);
- private WaoContextImplementor context;
+ private WaoContext context;
- public void setContext(WaoContextImplementor context) {
+ public void setContext(WaoContext context) {
this.context = context;
}
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 2010-04-08 10:16:35 UTC (rev 433)
+++ trunk/wao-business/src/main/resources/i18n/wao-business-en_GB.properties 2010-04-08 10:34:27 UTC (rev 434)
@@ -2,6 +2,7 @@
wao.error.boat.getNbBoarding=
wao.error.boatInfos.getNbBoardingForCompany=
wao.error.context.close=
+wao.error.context.encodeString=
wao.error.context.getRootContext=
wao.error.context.parse=
wao.error.context.rollback=
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 2010-04-08 10:16:35 UTC (rev 433)
+++ trunk/wao-business/src/main/resources/i18n/wao-business-fr_FR.properties 2010-04-08 10:34:27 UTC (rev 434)
@@ -2,6 +2,7 @@
wao.error.boat.getNbBoarding=Impossible de r\u00E9cup\u00E9rer le nombre d'embarquements r\u00E9els depuis le %1$s
wao.error.boatInfos.getNbBoardingForCompany=Impossible de r\u00E9cup\u00E9rer le nombre d'embarquements r\u00E9els depuis le %1$s pour la soci\u00E9t\u00E9 %2$s
wao.error.context.close=Une erreur est survenue pendant la fermeture du contexte principale de ToPIA
+wao.error.context.encodeString=
wao.error.context.getRootContext=Une erreur est survenue pour la r\u00E9cup\u00E9ration du contexte principale de ToPIA
wao.error.context.parse=Une erreur est survenue pendant le chargement de la configuration du fichier %1$s
wao.error.context.rollback=Une erreur est survenue pendant l'annulation de la transaction courante
Modified: trunk/wao-business/src/main/xmi/wao.zargo
===================================================================
(Binary files differ)
Modified: trunk/wao-business/src/test/java/fr/ifremer/wao/TestManager.java
===================================================================
--- trunk/wao-business/src/test/java/fr/ifremer/wao/TestManager.java 2010-04-08 10:16:35 UTC (rev 433)
+++ trunk/wao-business/src/test/java/fr/ifremer/wao/TestManager.java 2010-04-08 10:34:27 UTC (rev 434)
@@ -103,7 +103,7 @@
}
}
- public WaoContextImplementor getContext() {
+ public WaoContext getContext() {
return context;
}
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/WaoManager.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/WaoManager.java 2010-04-08 10:16:35 UTC (rev 433)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/WaoManager.java 2010-04-08 10:34:27 UTC (rev 434)
@@ -21,7 +21,7 @@
package fr.ifremer.wao.ui.services;
-import fr.ifremer.wao.WaoContextImplementor;
+import fr.ifremer.wao.WaoContext;
import fr.ifremer.wao.WaoProperty;
import fr.ifremer.wao.service.ServiceUser;
import java.util.Date;
@@ -46,7 +46,7 @@
private static final Logger log =
LoggerFactory.getLogger(WaoManager.class);
- private WaoContextImplementor context;
+ private WaoContext context;
private ServiceUser serviceUser;
@@ -55,7 +55,7 @@
*
* @param context used to manage application lifecycle
*/
- public WaoManager(WaoContextImplementor context) {
+ public WaoManager(WaoContext context) {
this.context = context;
}
@@ -90,7 +90,7 @@
*
* @return the WaoContext of the application
*/
- WaoContextImplementor getContext() {
+ WaoContext getContext() {
return context;
}
1
0