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
January 2010
- 4 participants
- 139 discussions
[Suiviobsmer-commits] r200 - in trunk/suiviobsmer-business/src/main: java/fr/ifremer/suiviobsmer/bean java/fr/ifremer/suiviobsmer/entity java/fr/ifremer/suiviobsmer/impl xmi
by fdesbois@users.labs.libre-entreprise.org 14 Jan '10
by fdesbois@users.labs.libre-entreprise.org 14 Jan '10
14 Jan '10
Author: fdesbois
Date: 2010-01-14 19:14:05 +0000 (Thu, 14 Jan 2010)
New Revision: 200
Modified:
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/BoatFilterImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/SampleMonthImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSynthesisImpl.java
trunk/suiviobsmer-business/src/main/xmi/suiviobsmer.zargo
Log:
- Delete old getPeriod method
- Add condition to avoid unused elligibleBoat join in Synthesis
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/BoatFilterImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/BoatFilterImpl.java 2010-01-14 18:44:17 UTC (rev 199)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/BoatFilterImpl.java 2010-01-14 19:14:05 UTC (rev 200)
@@ -57,4 +57,9 @@
}
return query;
}
+
+ @Override
+ public boolean isBoatFiltered() {
+ return !StringUtils.isEmpty(getBoatName()) || !StringUtils.isEmpty(getBoatDistrictCode()) || getBoatImmatriculation() != null;
+ }
}
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/SampleMonthImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/SampleMonthImpl.java 2010-01-14 18:44:17 UTC (rev 199)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/SampleMonthImpl.java 2010-01-14 19:14:05 UTC (rev 200)
@@ -26,9 +26,9 @@
import fr.ifremer.suiviobsmer.SuiviObsmerModelDAOHelper;
import java.io.Serializable;
import java.util.Calendar;
-import java.util.Date;
import java.util.GregorianCalendar;
import org.nuiton.topia.TopiaContext;
+import org.nuiton.util.PeriodDates;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -49,12 +49,13 @@
private static final long serialVersionUID = 1L;
- @Override
- @Deprecated
- public void setPeriod(Date date) {
- setPeriodDate(date);
- }
-
+// @Override
+// public PeriodDates getPeriod() {
+// PeriodDates period = new PeriodDates(getPeriodDate(), getPeriodDate());
+// period.initDayOfMonthExtremities();
+// return period;
+// }
+
protected Calendar getCalendar() {
Calendar calendar = new GregorianCalendar();
if (getPeriodDate() != null) {
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImpl.java 2010-01-14 18:44:17 UTC (rev 199)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImpl.java 2010-01-14 19:14:05 UTC (rev 200)
@@ -458,7 +458,7 @@
public SampleMonth getNewSampleMonth(Date period, SampleRow row) {
SampleMonth month = new SampleMonthImpl();
month.setSampleRow(row);
- month.setPeriod(period);
+ month.setPeriodDate(period);
return month;
}
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSynthesisImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSynthesisImpl.java 2010-01-14 18:44:17 UTC (rev 199)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSynthesisImpl.java 2010-01-14 19:14:05 UTC (rev 200)
@@ -5,6 +5,7 @@
import fr.ifremer.suiviobsmer.SuiviObsmerException;
import fr.ifremer.suiviobsmer.SuiviObsmerModelDAOHelper;
import fr.ifremer.suiviobsmer.bean.BoatFilter;
+import fr.ifremer.suiviobsmer.entity.Contact;
import fr.ifremer.suiviobsmer.entity.ElligibleBoat;
import fr.ifremer.suiviobsmer.entity.SampleMonth;
import fr.ifremer.suiviobsmer.entity.SampleMonthDAO;
@@ -77,9 +78,13 @@
query = filter.prepareQueryForUser(query, "M.sampleRow");
query = filter.prepareQueryForSampling(query, "M");
- query.addFrom(ElligibleBoat.class.getName() + " E").add("E IN elements(M.sampleRow)");
- query = filter.prepareQueryForBoat(query, "E");
+ if (filter.isBoatFiltered()) {
+ // ElligibleBoat is sufficient ? no need to check contacts (more difficult query) ?
+ query.addFrom(ElligibleBoat.class.getName() + " E").add("E IN elements(M.sampleRow)");
+ query = filter.prepareQueryForBoat(query, "E");
+ }
+
if (log.isTraceEnabled()) {
log.trace("Exec query : " + query);
}
Modified: trunk/suiviobsmer-business/src/main/xmi/suiviobsmer.zargo
===================================================================
(Binary files differ)
1
0
[Suiviobsmer-commits] r199 - in trunk/suiviobsmer-ui/src/main: java/fr/ifremer/suiviobsmer/ui/base java/fr/ifremer/suiviobsmer/ui/pages resources/fr/ifremer/suiviobsmer/ui/components webapp
by fdesbois@users.labs.libre-entreprise.org 14 Jan '10
by fdesbois@users.labs.libre-entreprise.org 14 Jan '10
14 Jan '10
Author: fdesbois
Date: 2010-01-14 18:44:17 +0000 (Thu, 14 Jan 2010)
New Revision: 199
Modified:
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/AbstractFilteredPage.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Contacts.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Synthesis.java
trunk/suiviobsmer-ui/src/main/resources/fr/ifremer/suiviobsmer/ui/components/Layout.tml
trunk/suiviobsmer-ui/src/main/webapp/Synthesis.tml
Log:
Improve use of AbstractFilteredPage
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/AbstractFilteredPage.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/AbstractFilteredPage.java 2010-01-14 18:15:08 UTC (rev 198)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/AbstractFilteredPage.java 2010-01-14 18:44:17 UTC (rev 199)
@@ -29,6 +29,21 @@
*
* Created: 14 janv. 2010
*
+ * This class uses the BoatFilter bean (also SamplingFilter and UserFilter which are supertypes).
+ *
+ * Known implementations are {@link fr.ifremer.suiviobsmer.ui.pages.Synthesis } and {@link fr.ifremer.suiviobsmer.ui.pages.Contacts }
+ *
+ * You must override the three abstract methods and call {@link #initFilter() } in the setupRender of the page.
+ * <pre>
+ * - BoatName uses an Autocomplete mixins :
+ * <t:textfield t:id="boatName" t:value="filter.boatName" t:mixins="Autocomplete"/>
+ * - FacadeName uses the zoneUpdater mixins :
+ * <input t:type="select" t:id="facadeName" t:model="facadeSelectModel" t:value="filter.facadeName" t:mixins="zoneUpdater" t:event="change" t:zone="..." .../>
+ * The zone_id is the one of the zone returned by {@link #getFilterZone() }
+ * - SampleRow select value is sampleRowId :
+ * <input t:type="select" t:id="sampleRow" t:model="sampleRowSelectModel" value="sampleRowId" />
+ * </pre>
+ *
* @author fdesbois
* @version $Revision$
*
@@ -41,7 +56,6 @@
private Logger log;
@SessionState
- @Property
private User user;
@Inject
@@ -68,7 +82,8 @@
@Persist
private SelectModel sectorSelectModel;
- void setupRender() throws SuiviObsmerException {
+
+ protected void initFilter() throws SuiviObsmerException {
facadeSelectModel = null;
getFacadeSelectModel();
sectorSelectModel = null;
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Contacts.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Contacts.java 2010-01-14 18:15:08 UTC (rev 198)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Contacts.java 2010-01-14 18:44:17 UTC (rev 199)
@@ -118,6 +118,7 @@
private String editableContactId;
void setupRender() throws SuiviObsmerException {
+ initFilter();
contacts = null;
getContacts();
contactsForm.clearErrors();
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Synthesis.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Synthesis.java 2010-01-14 18:15:08 UTC (rev 198)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Synthesis.java 2010-01-14 18:44:17 UTC (rev 199)
@@ -75,8 +75,8 @@
@Property
private User user;
- void setupRender() {
-
+ void setupRender() throws SuiviObsmerException {
+ initFilter();
}
/********************* DYNAMICAL GRAPH : DATASAMPLING *********************/
Modified: trunk/suiviobsmer-ui/src/main/resources/fr/ifremer/suiviobsmer/ui/components/Layout.tml
===================================================================
--- trunk/suiviobsmer-ui/src/main/resources/fr/ifremer/suiviobsmer/ui/components/Layout.tml 2010-01-14 18:15:08 UTC (rev 198)
+++ trunk/suiviobsmer-ui/src/main/resources/fr/ifremer/suiviobsmer/ui/components/Layout.tml 2010-01-14 18:44:17 UTC (rev 199)
@@ -79,11 +79,11 @@
GPLv3
</a> - Copyright 2009-2010
<!--<a href="http://www.codelutin.com" title="Code Lutin">-->
- DPMA
- <!--</a>-->
+ DPMA,
+ <!--</a>-->
<a href="http://www.ifremer.fr/sih" title="Ifremer">
Ifremer
- </a>
+ </a>,
<a href="http://www.codelutin.com" title="Code Lutin">
Code Lutin
</a>
Modified: trunk/suiviobsmer-ui/src/main/webapp/Synthesis.tml
===================================================================
--- trunk/suiviobsmer-ui/src/main/webapp/Synthesis.tml 2010-01-14 18:15:08 UTC (rev 198)
+++ trunk/suiviobsmer-ui/src/main/webapp/Synthesis.tml 2010-01-14 18:44:17 UTC (rev 199)
@@ -53,16 +53,16 @@
<div class="t-beaneditor">
<div>
<t:label t:for="boatName" />:
- <input t:type="textfield" t:id="boatName" class="width50" t:value="dataSamplingFilter.boatName" t:mixins="Autocomplete" />
+ <input t:type="textfield" t:id="boatName" class="width50" t:value="filter.boatName" t:mixins="Autocomplete" />
<t:label t:for="boatImmatriculation" />:
- <input t:type="textfield" t:id="boatImmatriculation" class="width50" t:value="dataSamplingFilter.boatImmatriculation" />
+ <input t:type="textfield" t:id="boatImmatriculation" class="width50" t:value="filter.boatImmatriculation" />
<t:label t:for="boatDistrictCode" />:
- <input t:type="textfield" t:id="boatDistrictCode" class="width50" t:value="dataSamplingFilter.boatDistrictCode" />
+ <input t:type="textfield" t:id="boatDistrictCode" class="width50" t:value="filter.boatDistrictCode" />
<t:label t:for="facadeName" />:
- <select t:type="select" t:id="facadeName" t:model="facadeSelectModel" value="dataSamplingFilter.facadeName"
+ <select t:type="select" t:id="facadeName" t:model="facadeSelectModel" value="filter.facadeName"
t:mixins="zoneUpdater" t:event="change" t:zone="so-contacts-filters"/>
<t:label t:for="sectorName" />:
- <select t:type="select" t:id="sectorName" t:model="sectorSelectModel" value="dataSamplingFilter.sectorName" />
+ <select t:type="select" t:id="sectorName" t:model="sectorSelectModel" value="filter.sectorName" />
<t:label t:for="sampleRow" />:
<input t:type="select" t:id="sampleRow" t:model="sampleRowSelectModel" value="sampleRowId" />
<!-- <t:if t:test="user.admin">
1
0
14 Jan '10
Author: fdesbois
Date: 2010-01-14 18:15:08 +0000 (Thu, 14 Jan 2010)
New Revision: 198
Modified:
trunk/changelog.txt
Log:
Complete changelog for 0.1.0 (still 0.0.4-SNAPSHOT in trunk)
Modified: trunk/changelog.txt
===================================================================
--- trunk/changelog.txt 2010-01-14 18:05:59 UTC (rev 197)
+++ trunk/changelog.txt 2010-01-14 18:15:08 UTC (rev 198)
@@ -4,9 +4,17 @@
0.1.0
-----
-- [fdesbois]
+- [fdesbois] Evol #2001 : Possibilité d'avoir un mois vide au milieu de la période d'une ligne d'échantillon
+- [fdesbois] Evol #2000 : Déplacement des dates de la période du programme vers les lignes d'échantillonnage
+- [fdesbois] Evol #1934 : Historique d'une ligne du plan (excepté changement sur le métier)
+- [fdesbois] Evol #1945 : Ajout d'un bas de page
+- [fdesbois] Evol #1972 : Envoi d'un email lors de la création d'un compte (et mot de passe oublié)
+- [fdesbois] Evol #1978 : Gestion d'un fichier .gz (GZIP) pour l'import des calendriers d'activité
+- [fdesbois] Evol #1979 : Affichage du détail des erreurs (et rejets) lors de l'import des contacts
+- [fdesbois] Ano #1988 : La session utilisateur n'est pas vidée à la déconnexion
+- [fdesbois] Ano #1990 : Problème d'enregistrement sur les données des marées sur une ligne d'échantillon
+- [fdesbois] Ano #1989 : Problème de modification des dates de la période d'une ligne d'échantillon
-
0.0.3
-----
1
0
[Suiviobsmer-commits] r197 - in trunk/suiviobsmer-ui/src/main: java/fr/ifremer/suiviobsmer/ui/base java/fr/ifremer/suiviobsmer/ui/pages webapp webapp/css
by fdesbois@users.labs.libre-entreprise.org 14 Jan '10
by fdesbois@users.labs.libre-entreprise.org 14 Jan '10
14 Jan '10
Author: fdesbois
Date: 2010-01-14 18:05:59 +0000 (Thu, 14 Jan 2010)
New Revision: 197
Added:
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/AbstractFilteredPage.java
Modified:
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Contacts.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Synthesis.java
trunk/suiviobsmer-ui/src/main/webapp/Synthesis.tml
trunk/suiviobsmer-ui/src/main/webapp/css/main.css
Log:
Add abstractFilteredPage for Contacts and Synthesis (not tested yet)
Added: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/AbstractFilteredPage.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/AbstractFilteredPage.java (rev 0)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/AbstractFilteredPage.java 2010-01-14 18:05:59 UTC (rev 197)
@@ -0,0 +1,154 @@
+
+package fr.ifremer.suiviobsmer.ui.base;
+
+import fr.ifremer.suiviobsmer.SuiviObsmerException;
+import fr.ifremer.suiviobsmer.bean.BoatFilter;
+import fr.ifremer.suiviobsmer.entity.SampleRow;
+import fr.ifremer.suiviobsmer.entity.User;
+import fr.ifremer.suiviobsmer.services.ServiceBoat;
+import fr.ifremer.suiviobsmer.services.ServiceReferential;
+import fr.ifremer.suiviobsmer.services.ServiceSampling;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.commons.lang.StringUtils;
+import org.apache.tapestry5.OptionModel;
+import org.apache.tapestry5.SelectModel;
+import org.apache.tapestry5.annotations.Log;
+import org.apache.tapestry5.annotations.Persist;
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.annotations.SessionState;
+import org.apache.tapestry5.corelib.components.Zone;
+import org.apache.tapestry5.internal.OptionModelImpl;
+import org.apache.tapestry5.internal.SelectModelImpl;
+import org.apache.tapestry5.ioc.annotations.Inject;
+import org.apache.tapestry5.ioc.services.PropertyAccess;
+import org.slf4j.Logger;
+
+/**
+ * AbstractFilteredPage
+ *
+ * Created: 14 janv. 2010
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public abstract class AbstractFilteredPage {
+
+ @Inject
+ private Logger log;
+
+ @SessionState
+ @Property
+ private User user;
+
+ @Inject
+ private PropertyAccess propertyAccess;
+
+ @Inject
+ private ServiceReferential serviceReferential;
+
+ @Inject
+ private ServiceSampling serviceSampling;
+
+ @Inject
+ private ServiceBoat serviceBoat;
+
+ @Persist
+ private GenericSelectModel<SampleRow> sampleRowSelectModel;
+
+ @Property
+ private String sampleRowId;
+
+ @Persist
+ private SelectModel facadeSelectModel;
+
+ @Persist
+ private SelectModel sectorSelectModel;
+
+ void setupRender() throws SuiviObsmerException {
+ facadeSelectModel = null;
+ getFacadeSelectModel();
+ sectorSelectModel = null;
+ getSectorSelectModel();
+ sampleRowSelectModel = null;
+ getSampleRowSelectModel();
+ }
+
+ public SelectModel getFacadeSelectModel() throws SuiviObsmerException {
+ if (facadeSelectModel == null) {
+ if (log.isInfoEnabled()) {
+ log.info("BUSINESS REQUEST [getFacades]");
+ }
+ List<OptionModel> options = new ArrayList<OptionModel>();
+ for (String facadeName : serviceReferential.getFacades()) {
+ options.add(new OptionModelImpl(facadeName,facadeName));
+ }
+ facadeSelectModel = new SelectModelImpl(null, options);
+ }
+ return facadeSelectModel;
+ }
+
+ public SelectModel getSectorSelectModel() throws SuiviObsmerException {
+ if (sectorSelectModel == null) {
+ if (log.isInfoEnabled()) {
+ log.info("BUSINESS REQUEST [getSectors]");
+ }
+ List<OptionModel> options = new ArrayList<OptionModel>();
+ for (String sectorName : serviceReferential.getSectors(getFilter().getFacadeName())) {
+ options.add(new OptionModelImpl(sectorName,sectorName));
+ }
+ sectorSelectModel = new SelectModelImpl(null, options);
+ }
+ return sectorSelectModel;
+ }
+
+ public GenericSelectModel<SampleRow> getSampleRowSelectModel() throws SuiviObsmerException {
+ if (sampleRowSelectModel == null) {
+ if (log.isInfoEnabled()) {
+ log.info("BUSINESS REQUEST [getSampleRowsForUser]");
+ }
+ List<SampleRow> sampleRows = serviceSampling.getSampleRowsForUser(user);
+ sampleRowSelectModel = new GenericSelectModel<SampleRow>(sampleRows, SampleRow.class,
+ "code", "topiaId", propertyAccess);
+ }
+ return sampleRowSelectModel;
+ }
+
+ public String[] onProvideCompletionsFromBoatName(String input) throws SuiviObsmerException {
+ if (log.isInfoEnabled()) {
+ log.info("BUSINESS REQUEST [getBoatNamesStartWith]");
+ }
+ List<String> results = serviceBoat.getBoatNamesStartWith(input);
+ return results.toArray(new String[0]);
+ }
+
+ protected abstract BoatFilter getFilter() throws SuiviObsmerException;
+
+ protected abstract void resetFilter();
+
+ protected abstract Zone getFilterZone();
+
+ @Log
+ public Object onChangeFromFacadeName(String value) throws SuiviObsmerException {
+ if (!StringUtils.isEmpty(value.trim())) {
+ // Reset filter to avoid strange behavior (cause of no form submit)
+ resetFilter();// = null;
+ // set facadeName selected in filter
+ getFilter().setFacadeName(value);
+ // Reset sectors to use facadeName selected
+ sectorSelectModel = null;
+ return getFilterZone().getBody();
+ }
+ return null;
+ }
+
+ @Log
+ public void onPrepareForSubmit() throws SuiviObsmerException {
+ SampleRow row = getSampleRowSelectModel().findObject(sampleRowId);
+ getFilter().setSampleRow(row);
+ }
+
+}
Property changes on: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/AbstractFilteredPage.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Contacts.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Contacts.java 2010-01-14 18:04:42 UTC (rev 196)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Contacts.java 2010-01-14 18:05:59 UTC (rev 197)
@@ -24,6 +24,7 @@
import fr.ifremer.suiviobsmer.SuiviObsmerBusinessException;
import fr.ifremer.suiviobsmer.SuiviObsmerContext;
import fr.ifremer.suiviobsmer.SuiviObsmerException;
+import fr.ifremer.suiviobsmer.bean.BoatFilter;
import fr.ifremer.suiviobsmer.bean.ContactFilter;
import fr.ifremer.suiviobsmer.bean.ContactFilterImpl;
import fr.ifremer.suiviobsmer.bean.ContactState;
@@ -36,6 +37,7 @@
import fr.ifremer.suiviobsmer.services.ServiceContact;
import fr.ifremer.suiviobsmer.services.ServiceReferential;
import fr.ifremer.suiviobsmer.services.ServiceSampling;
+import fr.ifremer.suiviobsmer.ui.base.AbstractFilteredPage;
import fr.ifremer.suiviobsmer.ui.data.BusinessUtils;
import fr.ifremer.suiviobsmer.ui.base.GenericSelectModel;
import fr.ifremer.suiviobsmer.ui.base.SuiviObsmerPage;
@@ -86,7 +88,7 @@
* par : $Author$
*/
@IncludeStylesheet("context:css/contacts.css")
-public class Contacts implements SuiviObsmerPage {
+public class Contacts extends AbstractFilteredPage implements SuiviObsmerPage {
@Override
public boolean isOnlyForAdmin() {
@@ -132,22 +134,22 @@
@InjectComponent
private Zone importExportZone;
- @Persist
- private GenericSelectModel<SampleRow> sampleRowSelectModel;
+// @Persist
+// private GenericSelectModel<SampleRow> sampleRowSelectModel;
+//
+// @Property
+// private String sampleRowId;
+//
+// @Inject
+// private ServiceReferential serviceReferential;
+//
+// @Persist
+// private SelectModel facadeSelectModel;
+//
+// @Persist
+// private SelectModel sectorSelectModel;
@Property
- private String sampleRowId;
-
- @Inject
- private ServiceReferential serviceReferential;
-
- @Persist
- private SelectModel facadeSelectModel;
-
- @Persist
- private SelectModel sectorSelectModel;
-
- @Property
@Persist("flash")
private boolean filtersVisible;
@@ -163,54 +165,69 @@
return contactFilter;
}
- public SelectModel getFacadeSelectModel() throws SuiviObsmerException {
- if (facadeSelectModel == null) {
- if (log.isInfoEnabled()) {
- log.info("BUSINESS REQUEST [getFacades]");
- }
- List<OptionModel> options = new ArrayList<OptionModel>();
- for (String facadeName : serviceReferential.getFacades()) {
- options.add(new OptionModelImpl(facadeName,facadeName));
- }
- facadeSelectModel = new SelectModelImpl(null, options);
- }
- return facadeSelectModel;
+ @Override
+ protected BoatFilter getFilter() throws SuiviObsmerException {
+ return getContactFilter();
}
- public SelectModel getSectorSelectModel() throws SuiviObsmerException {
- if (sectorSelectModel == null) {
- if (log.isInfoEnabled()) {
- log.info("BUSINESS REQUEST [getSectors]");
- }
- List<OptionModel> options = new ArrayList<OptionModel>();
- for (String sectorName : serviceReferential.getSectors(getContactFilter().getFacadeName())) {
- options.add(new OptionModelImpl(sectorName,sectorName));
- }
- sectorSelectModel = new SelectModelImpl(null, options);
- }
- return sectorSelectModel;
+ @Override
+ protected void resetFilter() {
+ contactFilter = null;
}
- public GenericSelectModel<SampleRow> getSampleRowSelectModel() throws SuiviObsmerException {
- if (sampleRowSelectModel == null) {
- if (log.isInfoEnabled()) {
- log.info("BUSINESS REQUEST [getSampleRowsForUser]");
- }
- List<SampleRow> sampleRows = serviceSampling.getSampleRowsForUser(user);
- sampleRowSelectModel = new GenericSelectModel<SampleRow>(sampleRows, SampleRow.class,
- "code", "topiaId", propertyAccess);
- }
- return sampleRowSelectModel;
+ @Override
+ protected Zone getFilterZone() {
+ return filtersZone;
}
- String[] onProvideCompletionsFromBoatName(String input) throws SuiviObsmerException {
- if (log.isInfoEnabled()) {
- log.info("BUSINESS REQUEST [getBoatNamesStartWith]");
- }
- List<String> results = serviceBoat.getBoatNamesStartWith(input);
- return results.toArray(new String[0]);
- }
+// public SelectModel getFacadeSelectModel() throws SuiviObsmerException {
+// if (facadeSelectModel == null) {
+// if (log.isInfoEnabled()) {
+// log.info("BUSINESS REQUEST [getFacades]");
+// }
+// List<OptionModel> options = new ArrayList<OptionModel>();
+// for (String facadeName : serviceReferential.getFacades()) {
+// options.add(new OptionModelImpl(facadeName,facadeName));
+// }
+// facadeSelectModel = new SelectModelImpl(null, options);
+// }
+// return facadeSelectModel;
+// }
+// public SelectModel getSectorSelectModel() throws SuiviObsmerException {
+// if (sectorSelectModel == null) {
+// if (log.isInfoEnabled()) {
+// log.info("BUSINESS REQUEST [getSectors]");
+// }
+// List<OptionModel> options = new ArrayList<OptionModel>();
+// for (String sectorName : serviceReferential.getSectors(getContactFilter().getFacadeName())) {
+// options.add(new OptionModelImpl(sectorName,sectorName));
+// }
+// sectorSelectModel = new SelectModelImpl(null, options);
+// }
+// return sectorSelectModel;
+// }
+//
+// public GenericSelectModel<SampleRow> getSampleRowSelectModel() throws SuiviObsmerException {
+// if (sampleRowSelectModel == null) {
+// if (log.isInfoEnabled()) {
+// log.info("BUSINESS REQUEST [getSampleRowsForUser]");
+// }
+// List<SampleRow> sampleRows = serviceSampling.getSampleRowsForUser(user);
+// sampleRowSelectModel = new GenericSelectModel<SampleRow>(sampleRows, SampleRow.class,
+// "code", "topiaId", propertyAccess);
+// }
+// return sampleRowSelectModel;
+// }
+
+// String[] onProvideCompletionsFromBoatName(String input) throws SuiviObsmerException {
+// if (log.isInfoEnabled()) {
+// log.info("BUSINESS REQUEST [getBoatNamesStartWith]");
+// }
+// List<String> results = serviceBoat.getBoatNamesStartWith(input);
+// return results.toArray(new String[0]);
+// }
+
void onSuccessFromSearchBoat() {
}
@@ -224,19 +241,19 @@
return importExportZone.getBody();
}
- @Log
- public Object onChangeFromFacadeName(String value) throws SuiviObsmerException {
- if (!StringUtils.isEmpty(value.trim())) {
- // Reset contactFilter to avoid strange behavior (cause of no form submit)
- contactFilter = null;
- // set facadeName selected in contactFilter
- getContactFilter().setFacadeName(value);
- // Reset sectors to use facadeName selected
- sectorSelectModel = null;
- return filtersZone.getBody();
- }
- return null;
- }
+// @Log
+// public Object onChangeFromFacadeName(String value) throws SuiviObsmerException {
+// if (!StringUtils.isEmpty(value.trim())) {
+// // Reset contactFilter to avoid strange behavior (cause of no form submit)
+// contactFilter = null;
+// // set facadeName selected in contactFilter
+// getContactFilter().setFacadeName(value);
+// // Reset sectors to use facadeName selected
+// sectorSelectModel = null;
+// return filtersZone.getBody();
+// }
+// return null;
+// }
void onSelectedFromReset() {
reset = true;
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Synthesis.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Synthesis.java 2010-01-14 18:04:42 UTC (rev 196)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Synthesis.java 2010-01-14 18:05:59 UTC (rev 197)
@@ -22,7 +22,11 @@
package fr.ifremer.suiviobsmer.ui.pages;
import fr.ifremer.suiviobsmer.SuiviObsmerException;
+import fr.ifremer.suiviobsmer.bean.BoatFilter;
+import fr.ifremer.suiviobsmer.bean.BoatFilterImpl;
+import fr.ifremer.suiviobsmer.entity.User;
import fr.ifremer.suiviobsmer.services.ServiceSynthesis;
+import fr.ifremer.suiviobsmer.ui.base.AbstractFilteredPage;
import fr.ifremer.suiviobsmer.ui.base.SuiviObsmerPage;
import fr.ifremer.suiviobsmer.ui.data.ChartUtils;
import fr.ifremer.suiviobsmer.ui.data.ChartUtils.ChartType;
@@ -32,7 +36,11 @@
import java.util.Map;
import java.util.SortedMap;
import org.apache.tapestry5.annotations.IncludeStylesheet;
+import org.apache.tapestry5.annotations.InjectComponent;
import org.apache.tapestry5.annotations.Persist;
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.annotations.SessionState;
+import org.apache.tapestry5.corelib.components.Zone;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.jfree.chart.JFreeChart;
import org.nuiton.util.PeriodDates;
@@ -50,7 +58,7 @@
* par : $Author$
*/
@IncludeStylesheet("context:css/synthesis.css")
-public class Synthesis implements SuiviObsmerPage {
+public class Synthesis extends AbstractFilteredPage implements SuiviObsmerPage {
@Override
public boolean isOnlyForAdmin() {
@@ -63,20 +71,58 @@
@Inject
private Logger log;
+ @SessionState
+ @Property
+ private User user;
+
+ void setupRender() {
+
+ }
+
/********************* DYNAMICAL GRAPH : DATASAMPLING *********************/
+
+ @Persist
+ private BoatFilter dataSamplingFilter;
+ @InjectComponent
+ private Zone dataSamplingFiltersZone;
+
@Persist
private ChartType dataSamplingChartType;
+ private boolean reset;
+
+ @Override
+ protected BoatFilter getFilter() throws SuiviObsmerException {
+ if (dataSamplingFilter == null) {
+ dataSamplingFilter = new BoatFilterImpl();
+ if (!user.getAdmin()) {
+ dataSamplingFilter.setCompany(user.getCompany());
+ }
+ PeriodDates period = PeriodDates.createMonthsPeriodFromToday(-12);
+ if (log.isDebugEnabled()) {
+ log.debug("Period : " + period);
+ }
+ dataSamplingFilter.setPeriod(period);
+ }
+ return dataSamplingFilter;
+ }
+
+ @Override
+ protected void resetFilter() {
+ dataSamplingFilter = null;
+ }
+
+ @Override
+ protected Zone getFilterZone() {
+ return dataSamplingFiltersZone;
+ }
+
public JFreeChart getDataSamplingChart() throws SuiviObsmerException {
if (log.isInfoEnabled()) {
log.info("BUSINESS REQUEST [getDataSampling]");
- }
- PeriodDates period = PeriodDates.createMonthsPeriodFromToday(-12);
- if (log.isDebugEnabled()) {
- log.debug("Period : " + period);
- }
- List<SortedMap<Date, Integer>> res = serviceSynthesis.getDataSampling(period);
+ }
+ List<SortedMap<Date, Integer>> res = serviceSynthesis.getDataSampling(getFilter());
Map<String, SortedMap<Date, Integer>> data = new HashMap<String, SortedMap<Date, Integer>>();
data.put("Données prévus", res.get(0));
data.put("Données réels", res.get(1));
@@ -106,5 +152,14 @@
this.dataSamplingChartType = ChartType.LINE;
}
+ void onSelectedFromReset() {
+ reset = true;
+ }
+
+ void onSuccessFromFiltersForm() {
+ if (reset) {
+ resetFilter();
+ }
+ }
}
Modified: trunk/suiviobsmer-ui/src/main/webapp/Synthesis.tml
===================================================================
--- trunk/suiviobsmer-ui/src/main/webapp/Synthesis.tml 2010-01-14 18:04:42 UTC (rev 196)
+++ trunk/suiviobsmer-ui/src/main/webapp/Synthesis.tml 2010-01-14 18:05:59 UTC (rev 197)
@@ -2,7 +2,7 @@
<t:layout t:pageTitle="Synthèse et indicateurs" t:contentId="so-synthesis"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter">
- <div class="clearfix" id="so-synthesis-indicators">
+<!-- <div class="clearfix" id="so-synthesis-indicators">
<div class="indicator fleft">
<p class="title">
<span t:type="ck/Tooltip" title="Description" t:effect="appear"
@@ -32,7 +32,7 @@
<p class="number">MAYFLOWERS (18)</p>
</div>
- </div>
+ </div>-->
<!-- <div class="graph">
<img src="${asset:context:}/tmp/graph1.png" alt="graphe"/>
<p class="description">Proin eu molestie dolor. Aliquam eget ultrices lorem. Phasellus molestie iaculis eleifend.
@@ -43,10 +43,53 @@
sed rutrum libero. </p>
</div>-->
- <p>
- <a t:type="actionlink" t:id="setDataSamplingChartBarType">BAR</a>
- <a t:type="actionlink" t:id="setDataSamplingChartAreaType">AREA</a>
- <a t:type="actionlink" t:id="setDataSamplingChartLineType">LINE</a>
- </p>
- <t:chart t:width="550" t:height="400" t:chart="dataSamplingChart" />
+ <div class="acenter">
+ <fieldset>
+ <legend>Recherche avancée</legend>
+ <div class="so-filters-form">
+ <div t:type="zone" t:id="dataSamplingFiltersZone" t:update="show" id="so-datasampling-filters">
+ <form t:type="form" t:id="filtersForm">
+ <t:errors />
+ <div class="t-beaneditor">
+ <div>
+ <t:label t:for="boatName" />:
+ <input t:type="textfield" t:id="boatName" class="width50" t:value="dataSamplingFilter.boatName" t:mixins="Autocomplete" />
+ <t:label t:for="boatImmatriculation" />:
+ <input t:type="textfield" t:id="boatImmatriculation" class="width50" t:value="dataSamplingFilter.boatImmatriculation" />
+ <t:label t:for="boatDistrictCode" />:
+ <input t:type="textfield" t:id="boatDistrictCode" class="width50" t:value="dataSamplingFilter.boatDistrictCode" />
+ <t:label t:for="facadeName" />:
+ <select t:type="select" t:id="facadeName" t:model="facadeSelectModel" value="dataSamplingFilter.facadeName"
+ t:mixins="zoneUpdater" t:event="change" t:zone="so-contacts-filters"/>
+ <t:label t:for="sectorName" />:
+ <select t:type="select" t:id="sectorName" t:model="sectorSelectModel" value="dataSamplingFilter.sectorName" />
+ <t:label t:for="sampleRow" />:
+ <input t:type="select" t:id="sampleRow" t:model="sampleRowSelectModel" value="sampleRowId" />
+<!-- <t:if t:test="user.admin">
+ <t:label t:for="program" />:
+ <input t:type="select" t:id="program" t:model="programSelectModel" value="dataSamplingFilter.programName" />
+ </t:if>
+ <t:label t:for="observer" />:
+ <input t:type="select" t:id="observer" t:model="observerSelectModel" value="observerId" />
+ <t:if t:test="user.admin">
+ <t:label t:for="company" />:
+ <input t:type="select" t:id="company" t:model="companySelectModel" value="companyId" />
+ </t:if>-->
+ </div><p> </p>
+ <div class="t-beaneditor-row aright">
+ <input t:type="submit" class="ico search-32px" t:id="search" value="Search" />
+ <input t:type="submit" class="ico undo" t:id="reset" value="Reset" />
+ </div>
+ </div>
+ </form>
+ </div>
+ </div>
+ </fieldset>
+ <p>
+ <a t:type="actionlink" t:id="setDataSamplingChartBarType">BAR</a>
+ <a t:type="actionlink" t:id="setDataSamplingChartAreaType">AREA</a>
+ <a t:type="actionlink" t:id="setDataSamplingChartLineType">LINE</a>
+ </p>
+ <t:chart t:width="550" t:height="350" t:chart="dataSamplingChart" />
+ </div>
</t:layout>
Modified: trunk/suiviobsmer-ui/src/main/webapp/css/main.css
===================================================================
--- trunk/suiviobsmer-ui/src/main/webapp/css/main.css 2010-01-14 18:04:42 UTC (rev 196)
+++ trunk/suiviobsmer-ui/src/main/webapp/css/main.css 2010-01-14 18:05:59 UTC (rev 197)
@@ -140,6 +140,7 @@
div#so-footer {
margin-top: 20px;
+ margin-bottom: 20px;
width: 100%;
text-align: center;
font-size: 0.8em;
1
0
[Suiviobsmer-commits] r196 - in trunk/suiviobsmer-business/src/main: java/fr/ifremer/suiviobsmer/bean java/fr/ifremer/suiviobsmer/impl xmi
by fdesbois@users.labs.libre-entreprise.org 14 Jan '10
by fdesbois@users.labs.libre-entreprise.org 14 Jan '10
14 Jan '10
Author: fdesbois
Date: 2010-01-14 18:04:42 +0000 (Thu, 14 Jan 2010)
New Revision: 196
Added:
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/SamplingFilterImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/UserFilterImpl.java
Modified:
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/BoatFilterImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/ContactFilterImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceContactImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSynthesisImpl.java
trunk/suiviobsmer-business/src/main/xmi/suiviobsmer.zargo
Log:
Add prepareQuery in filters
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/BoatFilterImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/BoatFilterImpl.java 2010-01-14 14:44:49 UTC (rev 195)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/BoatFilterImpl.java 2010-01-14 18:04:42 UTC (rev 196)
@@ -21,6 +21,11 @@
package fr.ifremer.suiviobsmer.bean;
+import org.apache.commons.lang.StringUtils;
+import org.nuiton.topia.framework.TopiaQuery;
+import org.nuiton.topia.framework.TopiaQuery.Op;
+import org.nuiton.topia.persistence.TopiaEntity;
+
/**
* BoatFilterImpl
*
@@ -34,4 +39,22 @@
*/
public class BoatFilterImpl extends BoatFilter {
+ @Override
+ public TopiaQuery prepareQueryForBoat(TopiaQuery query, String main) {
+
+ String boat = main + ".boat";
+
+ if (!StringUtils.isEmpty(getBoatName())) {
+ query.add(boat + ".name", Op.LIKE, getBoatName() + "%");
+ }
+
+ if (!StringUtils.isEmpty(getBoatDistrictCode())) {
+ query.add(boat + ".districtCode", getBoatDistrictCode());
+ }
+
+ if (getBoatImmatriculation() != null) {
+ query.add(boat + ".immatriculation", getBoatImmatriculation());
+ }
+ return query;
+ }
}
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/ContactFilterImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/ContactFilterImpl.java 2010-01-14 14:44:49 UTC (rev 195)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/ContactFilterImpl.java 2010-01-14 18:04:42 UTC (rev 196)
@@ -1,30 +1,15 @@
-/*
- * *##%
- * SuiviObsmer :: 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.suiviobsmer.bean;
+import fr.ifremer.suiviobsmer.entity.Contact;
+import java.util.ArrayList;
+import java.util.List;
+import org.nuiton.topia.framework.TopiaQuery;
+
/**
* ContactFilterImpl
*
- * Created: 5 janv. 2010
+ * Created: 14 janv. 2010
*
* @author fdesbois
* @version $Revision$
@@ -34,4 +19,41 @@
*/
public class ContactFilterImpl extends ContactFilter {
+ @Override
+ public TopiaQuery prepareQueryForContact(TopiaQuery query) {
+ query = prepareQueryForUser(query, query.getMainAlias());
+ query = prepareQueryForSampling(query, query.getMainAlias());
+ query = prepareQueryForBoat(query, query.getMainAlias());
+
+ String contact = query.getMainAlias();
+
+ if (getMammalsObservation() && getMammalsCapture()) {
+ query.add(contact + ".mammalsObservation = :mammals OR " + contact + ".mammalsCapture = :mammals").
+ addParam("mammals", Boolean.TRUE);
+ } else if (getMammalsObservation()) {
+ query.add(contact + "." + Contact.MAMMALS_OBSERVATION, Boolean.TRUE);
+ } else if (getMammalsCapture()) {
+ query.add(contact + "." + Contact.MAMMALS_CAPTURE, Boolean.TRUE);
+ }
+
+ List<Object> programValidValues = new ArrayList<Object>();
+ if (getProgramAccepted()) {
+ programValidValues.add(Boolean.TRUE);
+ }
+ if (getProgramRefused()) {
+ programValidValues.add(Boolean.FALSE);
+ }
+ query.add(contact + "." + Contact.VALIDATION_PROGRAM, programValidValues, getProgramUndefined());
+
+ List<Object> companyValidValues = new ArrayList<Object>();
+ if (getCompanyAccepted()) {
+ companyValidValues.add(Boolean.TRUE);
+ }
+ if (getCompanyRefused()) {
+ companyValidValues.add(Boolean.FALSE);
+ }
+ query.add(contact + "." + Contact.VALIDATION_COMPANY, companyValidValues, getCompanyUndefined());
+
+ return query;
+ }
}
Added: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/SamplingFilterImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/SamplingFilterImpl.java (rev 0)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/SamplingFilterImpl.java 2010-01-14 18:04:42 UTC (rev 196)
@@ -0,0 +1,42 @@
+
+package fr.ifremer.suiviobsmer.bean;
+
+import fr.ifremer.suiviobsmer.entity.FishingZone;
+import fr.ifremer.suiviobsmer.entity.SampleMonth;
+import org.apache.commons.lang.StringUtils;
+import org.nuiton.topia.framework.TopiaQuery;
+import org.nuiton.topia.persistence.TopiaEntity;
+
+/**
+ * SamplingFilterImpl
+ *
+ * Created: 14 janv. 2010
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public class SamplingFilterImpl extends SamplingFilter {
+
+ @Override
+ public TopiaQuery prepareQueryForSampling(TopiaQuery query, String main) {
+ //query = super.prepareQuery(query);
+
+ String sampleRow = main + ".sampleRow";
+
+ if (getSampleRow() != null) {
+ query.add(sampleRow, getSampleRow());
+ } else if (!StringUtils.isEmpty(getSectorName())) {
+ query.addFrom(FishingZone.class.getName() + " F");
+ query.add("F.sectorName", getSectorName()).add(sampleRow + " IN elements(F.sampleRow)");
+ } else if (!StringUtils.isEmpty(getFacadeName())) {
+ query.addFrom(FishingZone.class.getName() + " F");
+ query.add("F.facadeName", getFacadeName()).add(sampleRow + " IN elements(F.sampleRow)");
+ }
+
+ return query;
+ }
+
+}
Property changes on: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/SamplingFilterImpl.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Added: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/UserFilterImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/UserFilterImpl.java (rev 0)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/UserFilterImpl.java 2010-01-14 18:04:42 UTC (rev 196)
@@ -0,0 +1,34 @@
+
+package fr.ifremer.suiviobsmer.bean;
+
+import fr.ifremer.suiviobsmer.entity.Contact;
+import org.nuiton.topia.framework.TopiaQuery;
+
+/**
+ * UserFilterImpl
+ *
+ * Created: 14 janv. 2010
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public class UserFilterImpl extends UserFilter {
+
+
+ @Override
+ public TopiaQuery prepareQueryForUser(TopiaQuery query, String main) {
+
+ String user = main + ".user";
+
+ if (getObserver() != null) {
+ query.add(user, getObserver());
+ } else if (getCompany() != null) {
+ query.add(user + ".company", getCompany());
+ }
+
+ return query;
+ }
+}
Property changes on: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/UserFilterImpl.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceContactImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceContactImpl.java 2010-01-14 14:44:49 UTC (rev 195)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceContactImpl.java 2010-01-14 18:04:42 UTC (rev 196)
@@ -103,60 +103,62 @@
TopiaQuery<Contact> query = dao.createQuery("C").addOrderDesc("C." + TopiaEntity.TOPIA_CREATE_DATE);
- if (filter.getSampleRow() != null) {
- query.add("C." + Contact.SAMPLE_ROW, filter.getSampleRow());
- } else if (!StringUtils.isEmpty(filter.getSectorName())) {
- query.addFrom(FishingZone.class.getName() + " F");
- query.add("F.sectorName", filter.getSectorName()).add("C.sampleRow IN elements(F.sampleRow)");
- } else if (!StringUtils.isEmpty(filter.getFacadeName())) {
- query.addFrom(FishingZone.class.getName() + " F");
- query.add("F.facadeName", filter.getFacadeName()).add("C.sampleRow IN elements(F.sampleRow)");
- }
+// if (filter.getSampleRow() != null) {
+// query.add("C." + Contact.SAMPLE_ROW, filter.getSampleRow());
+// } else if (!StringUtils.isEmpty(filter.getSectorName())) {
+// query.addFrom(FishingZone.class.getName() + " F");
+// query.add("F.sectorName", filter.getSectorName()).add("C.sampleRow IN elements(F.sampleRow)");
+// } else if (!StringUtils.isEmpty(filter.getFacadeName())) {
+// query.addFrom(FishingZone.class.getName() + " F");
+// query.add("F.facadeName", filter.getFacadeName()).add("C.sampleRow IN elements(F.sampleRow)");
+// }
+//
+// if (!StringUtils.isEmpty(filter.getBoatName())) {
+// query.add("C.boat.name", Op.LIKE, filter.getBoatName() + "%");
+// }
+//
+// if (!StringUtils.isEmpty(filter.getBoatDistrictCode())) {
+// query.add("C.boat.districtCode", filter.getBoatDistrictCode());
+// }
+//
+// if (filter.getBoatImmatriculation() != null) {
+// query.add("C.boat.immatriculation", filter.getBoatImmatriculation());
+// }
- if (!StringUtils.isEmpty(filter.getBoatName())) {
- query.add("C.boat.name", Op.LIKE, filter.getBoatName() + "%");
- }
+ query = filter.prepareQueryForContact(query);
- if (!StringUtils.isEmpty(filter.getBoatDistrictCode())) {
- query.add("C.boat.districtCode", filter.getBoatDistrictCode());
- }
+// if (filter.getObserver() != null) {
+// query.add(Contact.USER, filter.getObserver());
+// } else if (filter.getCompany() != null) {
+// query.add("C.user.company", filter.getCompany());
+// }
- if (filter.getBoatImmatriculation() != null) {
- query.add("C.boat.immatriculation", filter.getBoatImmatriculation());
- }
+// if (filter.getMammalsObservation() && filter.getMammalsCapture()) {
+// query.add("C.mammalsObservation = :mammals OR C.mammalsCapture = :mammals").addParam("mammals", Boolean.TRUE);
+// } else if (filter.getMammalsObservation()) {
+// query.add("C." + Contact.MAMMALS_OBSERVATION, Boolean.TRUE);
+// } else if (filter.getMammalsCapture()) {
+// query.add("C." + Contact.MAMMALS_CAPTURE, Boolean.TRUE);
+// }
+//
+// List<Object> programValidValues = new ArrayList<Object>();
+// if (filter.getProgramAccepted()) {
+// programValidValues.add(Boolean.TRUE);
+// }
+// if (filter.getProgramRefused()) {
+// programValidValues.add(Boolean.FALSE);
+// }
+// query.add("C." + Contact.VALIDATION_PROGRAM, programValidValues, filter.getProgramUndefined());
+//
+// List<Object> companyValidValues = new ArrayList<Object>();
+// if (filter.getCompanyAccepted()) {
+// companyValidValues.add(Boolean.TRUE);
+// }
+// if (filter.getCompanyRefused()) {
+// companyValidValues.add(Boolean.FALSE);
+// }
+// query.add("C." + Contact.VALIDATION_COMPANY, companyValidValues, filter.getCompanyUndefined());
- if (filter.getObserver() != null) {
- query.add(Contact.USER, filter.getObserver());
- } else if (filter.getCompany() != null) {
- query.add("C.user.company", filter.getCompany());
- }
-
- if (filter.getMammalsObservation() && filter.getMammalsCapture()) {
- query.add("C.mammalsObservation = :mammals OR C.mammalsCapture = :mammals").addParam("mammals", Boolean.TRUE);
- } else if (filter.getMammalsObservation()) {
- query.add("C." + Contact.MAMMALS_OBSERVATION, Boolean.TRUE);
- } else if (filter.getMammalsCapture()) {
- query.add("C." + Contact.MAMMALS_CAPTURE, Boolean.TRUE);
- }
-
- List<Object> programValidValues = new ArrayList<Object>();
- if (filter.getProgramAccepted()) {
- programValidValues.add(Boolean.TRUE);
- }
- if (filter.getProgramRefused()) {
- programValidValues.add(Boolean.FALSE);
- }
- query.add("C." + Contact.VALIDATION_PROGRAM, programValidValues, filter.getProgramUndefined());
-
- List<Object> companyValidValues = new ArrayList<Object>();
- if (filter.getCompanyAccepted()) {
- companyValidValues.add(Boolean.TRUE);
- }
- if (filter.getCompanyRefused()) {
- companyValidValues.add(Boolean.FALSE);
- }
- query.add("C." + Contact.VALIDATION_COMPANY, companyValidValues, filter.getCompanyUndefined());
-
query.addLoad("user.company", "sampleRow.profession", "sampleRow.company");
if (log.isDebugEnabled()) {
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSynthesisImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSynthesisImpl.java 2010-01-14 14:44:49 UTC (rev 195)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSynthesisImpl.java 2010-01-14 18:04:42 UTC (rev 196)
@@ -4,6 +4,8 @@
import fr.ifremer.suiviobsmer.SuiviObsmerContext;
import fr.ifremer.suiviobsmer.SuiviObsmerException;
import fr.ifremer.suiviobsmer.SuiviObsmerModelDAOHelper;
+import fr.ifremer.suiviobsmer.bean.BoatFilter;
+import fr.ifremer.suiviobsmer.entity.ElligibleBoat;
import fr.ifremer.suiviobsmer.entity.SampleMonth;
import fr.ifremer.suiviobsmer.entity.SampleMonthDAO;
import fr.ifremer.suiviobsmer.services.ServiceSynthesis;
@@ -43,12 +45,13 @@
}
@Override
- public List<SortedMap<Date, Integer>> getDataSampling(PeriodDates period) throws SuiviObsmerException {
+ public List<SortedMap<Date, Integer>> getDataSampling(BoatFilter filter) throws SuiviObsmerException {
TopiaContext transaction = null;
List<SortedMap<Date, Integer>> results = new ArrayList<SortedMap<Date, Integer>>();
try {
transaction = rootContext.beginTransaction();
+ PeriodDates period = filter.getPeriod();
if (period.getFromDate() == null || period.getThruDate() == null) {
return results;
}
@@ -68,11 +71,14 @@
TopiaQuery<SampleMonth> query = dao.createQuery("M").
setSelect("M.periodDate, SUM(M.realTidesValue), SUM(M.expectedTidesValue)").
//addFrom(SampleRow.class.getName() + " M").add("M IN elements(S)").
-// add("M.periodDate >= :fromDate").addParam("fromDate", period.getFromDate()).
-// add("M.periodDate <= :thruDate").addParam("thruDate", period.getThruDate()).
add("M.periodDate", Op.GE, period.getFromDate()).
add("M.periodDate", Op.LE, period.getThruDate()).
addGroup("M.periodDate").addOrder("M.periodDate");
+
+ query = filter.prepareQueryForUser(query, "M.sampleRow");
+ query = filter.prepareQueryForSampling(query, "M");
+ query.addFrom(ElligibleBoat.class.getName() + " E").add("E IN elements(M.sampleRow)");
+ query = filter.prepareQueryForBoat(query, "E");
if (log.isTraceEnabled()) {
log.trace("Exec query : " + query);
Modified: trunk/suiviobsmer-business/src/main/xmi/suiviobsmer.zargo
===================================================================
(Binary files differ)
1
0
[Suiviobsmer-commits] r195 - in trunk: . suiviobsmer-business suiviobsmer-business/src/main suiviobsmer-business/src/main/filters suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer suiviobsmer-business/src/main/resources suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/components suiviobsmer-ui/src/main/resources/fr/ifremer/suiviobsmer/ui/components suiviobsmer-ui/src/main/webapp/css suiviobsmer-ui/src/main/webapp/img
by fdesbois@users.labs.libre-entreprise.org 14 Jan '10
by fdesbois@users.labs.libre-entreprise.org 14 Jan '10
14 Jan '10
Author: fdesbois
Date: 2010-01-14 14:44:49 +0000 (Thu, 14 Jan 2010)
New Revision: 195
Added:
trunk/suiviobsmer-business/src/main/filters/
trunk/suiviobsmer-business/src/main/filters/SuiviObsmer.properties
trunk/suiviobsmer-ui/src/main/webapp/img/logo-gplv3.png
Removed:
trunk/suiviobsmer-business/src/main/resources/SuiviObsmer.properties
Modified:
trunk/
trunk/changelog.txt
trunk/suiviobsmer-business/pom.xml
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerContext.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/components/Layout.java
trunk/suiviobsmer-ui/src/main/resources/fr/ifremer/suiviobsmer/ui/components/Layout.tml
trunk/suiviobsmer-ui/src/main/webapp/css/main.css
Log:
Add footer
Property changes on: trunk
___________________________________________________________________
Modified: svn:ignore
- target
*.iml
*.ipr
*.iws
+ *.ipr
*.iws
*.iml
target
nbactions.xml
Modified: trunk/changelog.txt
===================================================================
--- trunk/changelog.txt 2010-01-13 18:35:55 UTC (rev 194)
+++ trunk/changelog.txt 2010-01-14 14:44:49 UTC (rev 195)
@@ -1,58 +1,67 @@
+Release note
+============
+
+0.1.0
+-----
+
+- [fdesbois]
+
+
0.0.3
-----
-[fdesbois] Amélioration performance imports (ActivityCalendar et Boats)
-[fdesbois] Ajout des filtres pour les contacts
-[fdesbois] Utilisation de TopiaQuery pour les requêtages HQL
+- [fdesbois] Amélioration performance imports (ActivityCalendar et Boats)
+- [fdesbois] Ajout des filtres pour les contacts
+- [fdesbois] Utilisation de TopiaQuery pour les requêtages HQL
0.0.1-alpha-2
-------------
-[18-12-2009] [fdesbois] EVO METIER #1957 (Boats / BoatInfos)
- Ajout d'un attribut tideNbDays dans l'entité Contact (calculé automatiquement à chaque changement de date)
+- [18-12-2009] [fdesbois] EVO METIER #1957 (Boats / BoatInfos)
+ Ajout d'un attribut tideNbDays dans l'entité Contact (calculé automatiquement à chaque changement de date)
-[17-12-2009] [fdesbois] EVO TECHNIQUE
- * Mise à jour de la configuration de génération pour ToPIA 2.3 et EUGene 2.0
- * Ajout d'un index sur l'attribut "immatriculation" de l'entité Boat
+- [17-12-2009] [fdesbois] EVO TECHNIQUE
+ * Mise à jour de la configuration de génération pour ToPIA 2.3 et EUGene 2.0
+ * Ajout d'un index sur l'attribut "immatriculation" de l'entité Boat
-[16-12-2009] [tchemit] EVO TECHNIQUE
- Migration version ChenilleKit vers 1.2.0
-[16-12-2009] [fdesbois] EVO IHM #1941 (Boats / BoatActivityCalendar)
- Ajout page BoatActivityCalendar pour l'affichage d'un calendrier d'activité pour un navire
-[16-12-2009] [fdesbois] EVO TECHNIQUE
- Utilisation d'ApplicationConfig de nuiton-utils pour gérer les fichiers de configuration
+- [16-12-2009] [tchemit] EVO TECHNIQUE
+ Migration version ChenilleKit vers 1.2.0
+- [16-12-2009] [fdesbois] EVO IHM #1941 (Boats / BoatActivityCalendar)
+ Ajout page BoatActivityCalendar pour l'affichage d'un calendrier d'activité pour un navire
+- [16-12-2009] [fdesbois] EVO TECHNIQUE
+ Utilisation d'ApplicationConfig de nuiton-utils pour gérer les fichiers de configuration
-[15-12-2009] [fdesbois] EVO IHM #1958 (Boats / BoatInfos)
- Ajout du dernier contact du navire pour la société
-[15-12-2009] [fdesbois] EVO IHM (Contacts)
- Ajout d'une liste déroulante pour choisir l'observateur en mode édition d'un contact
-[15-12-2009] [fdesbois] EVO IHM #1953 (Contacts)
- Validations pour les changements d'état d'un contact + calcul des jours réels d'embarquements
-[15-12-2009] [fdesbois] EVO IHM #1941 (Boats / BoatActivityCalendar)
- Ajout du champ d'import pour les calendriers d'activité + accès au fichier de log des imports
+- [15-12-2009] [fdesbois] EVO IHM #1958 (Boats / BoatInfos)
+ Ajout du dernier contact du navire pour la société
+- [15-12-2009] [fdesbois] EVO IHM (Contacts)
+ Ajout d'une liste déroulante pour choisir l'observateur en mode édition d'un contact
+- [15-12-2009] [fdesbois] EVO IHM #1953 (Contacts)
+ Validations pour les changements d'état d'un contact + calcul des jours réels d'embarquements
+- [15-12-2009] [fdesbois] EVO IHM #1941 (Boats / BoatActivityCalendar)
+ Ajout du champ d'import pour les calendriers d'activité + accès au fichier de log des imports
-[13-12-2009] [fdesbois] EVO METIER #1941 (Boats / BoatActivityCalendar)
- * Renommage classe SuiviObsmerUtils par SuiviObsmerContext plus approprié
- * Ajout gestion import des calendriers d'activité (Lancé en arrière-plan)
+- [13-12-2009] [fdesbois] EVO METIER #1941 (Boats / BoatActivityCalendar)
+ * Renommage classe SuiviObsmerUtils par SuiviObsmerContext plus approprié
+ * Ajout gestion import des calendriers d'activité (Lancé en arrière-plan)
-[10-12-2009] [fdesbois] EVO IHM #1938 (Boats / BoatInfos)
- * Ajout d'un message lorsque l'utilisateur vient de la page "SamplingPlan" pour sélection d'un navire
- * Ajout d'un texte en bas des informations sur le navire sélectionnée pour informer l'utilisateur de la confidentialité de ses saisies
- * Le code de l'armateur n'est plus visible
+- [10-12-2009] [fdesbois] EVO IHM #1938 (Boats / BoatInfos)
+ * Ajout d'un message lorsque l'utilisateur vient de la page "SamplingPlan" pour sélection d'un navire
+ * Ajout d'un texte en bas des informations sur le navire sélectionnée pour informer l'utilisateur de la confidentialité de ses saisies
+ * Le code de l'armateur n'est plus visible
-[09-12-2009] [fdesbois] EVO IHM #1951 (SamplingPlan)
- Ajout d'un lien sur les programmes pour filtrer la période
+- [09-12-2009] [fdesbois] EVO IHM #1951 (SamplingPlan)
+ Ajout d'un lien sur les programmes pour filtrer la période
-[08-12-2009] [fdesbois] ANO IHM (BoatInfos)
- En mode admin le champ de sélection des sociétés ne charge pas les données
-[08-12-2009] [fdesbois] EVO TECHNIQUE
- Ajout d'une config pour logger les erreurs/debugs dans un fichier
-[08-12-2009] [fdesbois] ANO IHM (SamplingPlan)
- Caractère de fin manquant sur l'affichage des zones de pêche
-[08-12-2009] [fdesbois] EVO IHM (Contacts)
- Renommage colonne "Mammifères" en "Observations et captures accidentelles"
-[08-12-2009] [fdesbois] EVO IHM (BoatInfos)
- Renomage texte "... embarquements dont X dans votre société..." par "... embarquements
- dont X pour votre société..."
-[08-12-2009] [fdesbois] ANO IHM (BoatInfos)
- Lien présent pour la création d'un contact lorsque la ligne du plan est barré
+- [08-12-2009] [fdesbois] ANO IHM (BoatInfos)
+ En mode admin le champ de sélection des sociétés ne charge pas les données
+- [08-12-2009] [fdesbois] EVO TECHNIQUE
+ Ajout d'une config pour logger les erreurs/debugs dans un fichier
+- [08-12-2009] [fdesbois] ANO IHM (SamplingPlan)
+ Caractère de fin manquant sur l'affichage des zones de pêche
+- [08-12-2009] [fdesbois] EVO IHM (Contacts)
+ Renommage colonne "Mammifères" en "Observations et captures accidentelles"
+- [08-12-2009] [fdesbois] EVO IHM (BoatInfos)
+ Renomage texte "... embarquements dont X dans votre société..." par "... embarquements
+ dont X pour votre société..."
+- [08-12-2009] [fdesbois] ANO IHM (BoatInfos)
+ Lien présent pour la création d'un contact lorsque la ligne du plan est barré
Modified: trunk/suiviobsmer-business/pom.xml
===================================================================
--- trunk/suiviobsmer-business/pom.xml 2010-01-13 18:35:55 UTC (rev 194)
+++ trunk/suiviobsmer-business/pom.xml 2010-01-14 14:44:49 UTC (rev 195)
@@ -93,6 +93,16 @@
<!-- ************************************************************* -->
<build>
+ <!-- Filter for resolving maven properties in SuiviObsmer.properties in resource folder -->
+ <resources>
+ <resource>
+ <directory>src/main/filters</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>SuiviObsmer.properties</include>
+ </includes>
+ </resource>
+ </resources>
<plugins>
<plugin>
<groupId>org.nuiton.eugene</groupId>
Copied: trunk/suiviobsmer-business/src/main/filters/SuiviObsmer.properties (from rev 193, trunk/suiviobsmer-business/src/main/resources/SuiviObsmer.properties)
===================================================================
--- trunk/suiviobsmer-business/src/main/filters/SuiviObsmer.properties (rev 0)
+++ trunk/suiviobsmer-business/src/main/filters/SuiviObsmer.properties 2010-01-14 14:44:49 UTC (rev 195)
@@ -0,0 +1,19 @@
+## Default properties for H2 database
+hibernate.hbm2ddl.auto=update
+hibernate.show_sql=false
+
+hibernate.dialect=org.hibernate.dialect.H2Dialect
+hibernate.connection.username=sa
+hibernate.connection.password=
+hibernate.connection.driver_class=org.h2.Driver
+hibernate.connection.url=jdbc:h2:file:~/.local/suiviobsmer/h2data
+
+suiviobsmer.log.activityCalendar=log/activity.log
+
+## Config for sending Email
+suiviobsmer.email.host=smtp.free.fr
+suiviobsmer.email.port=25
+suiviobsmer.email.from=admin at suiviobsmer.org
+
+## Version
+suiviobsmer.version=${project.version}
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerContext.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerContext.java 2010-01-13 18:35:55 UTC (rev 194)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerContext.java 2010-01-14 14:44:49 UTC (rev 195)
@@ -58,6 +58,7 @@
public static final String PROP_EMAIL_HOST = "suiviobsmer.email.host";
public static final String PROP_EMAIL_PORT = "suiviobsmer.email.port";
public static final String PROP_EMAIL_FROM = "suiviobsmer.email.from";
+ public static final String PROP_VERSION = "suiviobsmer.version";
private static SuiviObsmerRunner runner;
Deleted: trunk/suiviobsmer-business/src/main/resources/SuiviObsmer.properties
===================================================================
--- trunk/suiviobsmer-business/src/main/resources/SuiviObsmer.properties 2010-01-13 18:35:55 UTC (rev 194)
+++ trunk/suiviobsmer-business/src/main/resources/SuiviObsmer.properties 2010-01-14 14:44:49 UTC (rev 195)
@@ -1,16 +0,0 @@
-# Propri\u00C3\u00A9t\u00C3\u00A9s par d\u00C3\u00A9faut pour une base de donn\u00C3\u00A9es de type H2
-hibernate.hbm2ddl.auto=update
-hibernate.show_sql=false
-
-hibernate.dialect=org.hibernate.dialect.H2Dialect
-hibernate.connection.username=sa
-hibernate.connection.password=
-hibernate.connection.driver_class=org.h2.Driver
-hibernate.connection.url=jdbc:h2:file:~/.local/suiviobsmer/h2data
-
-suiviobsmer.log.activityCalendar=log/activity.log
-
-# Config for sending Email
-suiviobsmer.email.host=smtp.free.fr
-suiviobsmer.email.port=25
-suiviobsmer.email.from=admin at suiviobsmer.org
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/components/Layout.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/components/Layout.java 2010-01-13 18:35:55 UTC (rev 194)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/components/Layout.java 2010-01-14 14:44:49 UTC (rev 195)
@@ -22,6 +22,7 @@
package fr.ifremer.suiviobsmer.ui.components;
import fr.ifremer.suiviobsmer.SuiviObsmerBusinessException;
+import fr.ifremer.suiviobsmer.SuiviObsmerContext;
import fr.ifremer.suiviobsmer.SuiviObsmerException;
import fr.ifremer.suiviobsmer.entity.User;
import fr.ifremer.suiviobsmer.services.ServiceUser;
@@ -32,7 +33,6 @@
import org.apache.tapestry5.annotations.InjectContainer;
import org.apache.tapestry5.annotations.Log;
import org.apache.tapestry5.annotations.Parameter;
-import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.ioc.annotations.Inject;
@@ -99,6 +99,10 @@
return request.getContextPath();
}
+ public String getVersion() {
+ return SuiviObsmerContext.getProperty(SuiviObsmerContext.PROP_VERSION);
+ }
+
/**
* User for connexion form data
*/
Modified: trunk/suiviobsmer-ui/src/main/resources/fr/ifremer/suiviobsmer/ui/components/Layout.tml
===================================================================
--- trunk/suiviobsmer-ui/src/main/resources/fr/ifremer/suiviobsmer/ui/components/Layout.tml 2010-01-13 18:35:55 UTC (rev 194)
+++ trunk/suiviobsmer-ui/src/main/resources/fr/ifremer/suiviobsmer/ui/components/Layout.tml 2010-01-14 14:44:49 UTC (rev 195)
@@ -15,7 +15,9 @@
</a>
</div>
<div class="fleft">
- <img src="${asset:context:}/img/MiniLogo.jpg" alt="Obsmer logo"/>
+ <a href="mailto:obsmer at ifremer.fr" title="Contacter un responsable Obsmer">
+ <img src="${asset:context:}/img/MiniLogo.jpg" alt="Obsmer logo"/>
+ </a>
</div>
<div id="user-infos" class="fleft">
Vous êtes <strong>${currentUser.fullName}</strong> de la société <strong>${currentUser.company.name}</strong>
@@ -63,6 +65,33 @@
<t:body />
</t:if>
</div>
+ <div id="so-footer">
+ <a href="http://suiviobsmer.labs.libre-entreprise.org/suiviobsmer/" title="Documentation de l'application">
+ WAO
+ </a>
+ <a href="http://suiviobsmer.labs.libre-entreprise.org/suiviobsmer/" title="Modifications faites pour cette version">
+ ${version}
+ </a> -
+ <a href="mailto:obsmer at ifremer.fr" title="Contacter un responsable Obsmer">
+ Obsmer
+ </a> -
+ <a href="http://www.gnu.org/licenses/gpl.html" title="License GPL v3">
+ GPLv3
+ </a> - Copyright 2009-2010
+ <!--<a href="http://www.codelutin.com" title="Code Lutin">-->
+ DPMA
+ <!--</a>-->
+ <a href="http://www.ifremer.fr/sih" title="Ifremer">
+ Ifremer
+ </a>
+ <a href="http://www.codelutin.com" title="Code Lutin">
+ Code Lutin
+ </a>
+<!-- -
+ <a href="https://labs.libre-entreprise.org/tracker/?atid=692&group_id=154&func=browse" title="Bug Tracker">
+ Bugs
+ </a>-->
+ </div>
<!-- Connexion -->
<p:else>
Modified: trunk/suiviobsmer-ui/src/main/webapp/css/main.css
===================================================================
--- trunk/suiviobsmer-ui/src/main/webapp/css/main.css 2010-01-13 18:35:55 UTC (rev 194)
+++ trunk/suiviobsmer-ui/src/main/webapp/css/main.css 2010-01-14 14:44:49 UTC (rev 195)
@@ -136,4 +136,19 @@
border-bottom: 3px solid #007CC2;
color: white;
cursor: pointer;
+}
+
+div#so-footer {
+ margin-top: 20px;
+ width: 100%;
+ text-align: center;
+ font-size: 0.8em;
+}
+
+div#so-footer a {
+ color: #133852;
+}
+
+div#so-footer a:hover {
+ text-decoration: none;
}
\ No newline at end of file
Added: trunk/suiviobsmer-ui/src/main/webapp/img/logo-gplv3.png
===================================================================
(Binary files differ)
Property changes on: trunk/suiviobsmer-ui/src/main/webapp/img/logo-gplv3.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
1
0
13 Jan '10
Author: fdesbois
Date: 2010-01-13 18:35:55 +0000 (Wed, 13 Jan 2010)
New Revision: 194
Added:
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/data/BusinessUtils.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/data/ChartUtils.java
Removed:
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/BusinessUtils.java
Modified:
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSynthesisImpl.java
trunk/suiviobsmer-business/src/main/xmi/suiviobsmer.zargo
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/components/Chart.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Boats.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Contacts.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Synthesis.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/services/AppModule.java
trunk/suiviobsmer-ui/src/main/resources/log4j.properties
trunk/suiviobsmer-ui/src/main/webapp/Synthesis.tml
Log:
Add dynamic graph synthesis with Tapestry (no filter yet)
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSynthesisImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSynthesisImpl.java 2010-01-13 18:06:05 UTC (rev 193)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSynthesisImpl.java 2010-01-13 18:35:55 UTC (rev 194)
@@ -5,9 +5,10 @@
import fr.ifremer.suiviobsmer.SuiviObsmerException;
import fr.ifremer.suiviobsmer.SuiviObsmerModelDAOHelper;
import fr.ifremer.suiviobsmer.entity.SampleMonth;
-import fr.ifremer.suiviobsmer.entity.SampleRow;
-import fr.ifremer.suiviobsmer.entity.SampleRowDAO;
+import fr.ifremer.suiviobsmer.entity.SampleMonthDAO;
import fr.ifremer.suiviobsmer.services.ServiceSynthesis;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -63,27 +64,38 @@
serie2.put(month, 0);
}
- SampleRowDAO dao = SuiviObsmerModelDAOHelper.getSampleRowDAO(transaction);
- TopiaQuery<SampleRow> query = dao.createQuery("S").
- addFrom(SampleMonth.class.getName() + " M").add("M IN elements(S)").
+ SampleMonthDAO dao = SuiviObsmerModelDAOHelper.getSampleMonthDAO(transaction);
+ TopiaQuery<SampleMonth> query = dao.createQuery("M").
+ setSelect("M.periodDate, SUM(M.realTidesValue), SUM(M.expectedTidesValue)").
+ //addFrom(SampleRow.class.getName() + " M").add("M IN elements(S)").
+// add("M.periodDate >= :fromDate").addParam("fromDate", period.getFromDate()).
+// add("M.periodDate <= :thruDate").addParam("thruDate", period.getThruDate()).
add("M.periodDate", Op.GE, period.getFromDate()).
add("M.periodDate", Op.LE, period.getThruDate()).
addGroup("M.periodDate").addOrder("M.periodDate");
- List<Object[]> res =
- (List<Object[]>)query.setSelect("M.periodDate, SUM(M.realTidesValue), SUM(M.expectedTidesValue)").execute();
+ if (log.isTraceEnabled()) {
+ log.trace("Exec query : " + query);
+ }
+ List<Object[]> res = (List<Object[]>)query.execute();
+
for (Object[] tab : res) {
Date date = (Date)tab[0];
- int sumReal = (Integer)tab[1];
- int sumExpected = (Integer)tab[2];
+ int sumReal = ((Long)tab[1]).intValue();
+ int sumExpected = ((Long)tab[2]).intValue();
serie1.put(date, sumExpected);
serie2.put(date, sumReal);
+ if (log.isTraceEnabled()) {
+ DateFormat dateFormat = new SimpleDateFormat(period.getPattern());
+ log.trace("Res : " + dateFormat.format(date) + " : " + sumReal + " / " + sumExpected);
+ }
}
transaction.closeContext();
} catch (Exception eee) {
-
+ SuiviObsmerContext.serviceException(transaction,
+ "Impossible de récupérer les données pour le graphique dynamique des efforts de marées", eee);
}
return results;
}
Modified: trunk/suiviobsmer-business/src/main/xmi/suiviobsmer.zargo
===================================================================
(Binary files differ)
Deleted: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/BusinessUtils.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/BusinessUtils.java 2010-01-13 18:06:05 UTC (rev 193)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/BusinessUtils.java 2010-01-13 18:35:55 UTC (rev 194)
@@ -1,83 +0,0 @@
-/*
- * *##%
- * SuiviObsmer :: Web Interface
- * 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.suiviobsmer.ui.base;
-
-import fr.ifremer.suiviobsmer.entity.Boat;
-import fr.ifremer.suiviobsmer.entity.FishingZone;
-import fr.ifremer.suiviobsmer.entity.Profession;
-import fr.ifremer.suiviobsmer.entity.SampleRow;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import org.apache.commons.lang.StringUtils;
-
-/**
- * DataUtils
- *
- * Created: 3 déc. 2009
- *
- * @author fdesbois
- * @version $Revision$
- *
- * Mise a jour: $Date$
- * par : $Author$
- */
-public class BusinessUtils {
-
-
- public static String getTooltipSampleRow(SampleRow row) {
- String result = "";
- DateFormat dateFormat = new SimpleDateFormat("MM/yyyy");
- Profession profession = row.getProfession();
- result += "<strong>Métier : </strong>" + profession.getCodeDCF5();
- if (!StringUtils.isEmpty(profession.getMeshSize())) {
- result+= " " + profession.getMeshSize();
- }
- if (!StringUtils.isEmpty(profession.getSize())) {
- result+= " " + profession.getSize();
- }
- if (!StringUtils.isEmpty(profession.getOther())) {
- result+= " " + profession.getOther();
- }
- result += " - " + profession.getLibelle();
- if (!StringUtils.isEmpty(profession.getSpecies())) {
- result += "<br /><strong>Espèces cibles : </strong>" + 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());
-
- for (FishingZone zone : row.getFishingZone()) {
- result += "<br /><strong>Zone de pêche : </strong>" + zone.getCode();
- }
-
- return result;
- }
-
- 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;
- }
-}
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/components/Chart.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/components/Chart.java 2010-01-13 18:06:05 UTC (rev 193)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/components/Chart.java 2010-01-13 18:35:55 UTC (rev 194)
@@ -16,12 +16,10 @@
package fr.ifremer.suiviobsmer.ui.components;
-import java.awt.image.BufferedImage;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.util.List;
import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.Link;
@@ -34,7 +32,6 @@
import org.apache.tapestry5.services.Response;
import org.jfree.chart.ChartUtilities;
import org.jfree.chart.JFreeChart;
-import org.nuiton.util.ArrayUtil;
/**
* Composant qui affiche un graphe de type PieChart.
@@ -93,6 +90,8 @@
void beginRender(MarkupWriter writer) {
+ currentChart = _chart;
+
// event link params
Object[] params = new Object[] { _title, _width, _height };
// params = ArrayUtil.concat(params, _values.toArray());
@@ -154,10 +153,13 @@
}
public InputStream getStream() throws IOException {
- BufferedImage image = currentChart.createBufferedImage(width, height);
- ByteArrayOutputStream byteArray = new ByteArrayOutputStream();
- ChartUtilities.writeBufferedImageAsPNG(byteArray, image);
- return new ByteArrayInputStream(byteArray.toByteArray());
+// BufferedImage image = currentChart.createBufferedImage(width, height);
+// ByteArrayOutputStream byteArray = new ByteArrayOutputStream();
+// ChartUtilities.writeBufferedImageAsPNG(byteArray, image);
+// return new ByteArrayInputStream(byteArray.toByteArray());
+ File res = new File("/tmp", "chart.png");
+ ChartUtilities.saveChartAsPNG(res, currentChart, width, height);
+ return new FileInputStream(res);
}
public void prepareResponse(Response response) {
Copied: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/data/BusinessUtils.java (from rev 185, trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/BusinessUtils.java)
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/data/BusinessUtils.java (rev 0)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/data/BusinessUtils.java 2010-01-13 18:35:55 UTC (rev 194)
@@ -0,0 +1,105 @@
+/*
+ * *##%
+ * SuiviObsmer :: Web Interface
+ * 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.suiviobsmer.ui.data;
+
+import fr.ifremer.suiviobsmer.bean.ContactState;
+import fr.ifremer.suiviobsmer.entity.Boat;
+import fr.ifremer.suiviobsmer.entity.Contact;
+import fr.ifremer.suiviobsmer.entity.FishingZone;
+import fr.ifremer.suiviobsmer.entity.Profession;
+import fr.ifremer.suiviobsmer.entity.SampleRow;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import org.apache.commons.lang.BooleanUtils;
+import org.apache.commons.lang.StringUtils;
+
+/**
+ * DataUtils
+ *
+ * Created: 3 déc. 2009
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public class BusinessUtils {
+
+
+ public static String getTooltipSampleRow(SampleRow row) {
+ String result = "";
+ DateFormat dateFormat = new SimpleDateFormat("MM/yyyy");
+ Profession profession = row.getProfession();
+ result += "<strong>Métier : </strong>" + profession.getCodeDCF5();
+ if (!StringUtils.isEmpty(profession.getMeshSize())) {
+ result+= " " + profession.getMeshSize();
+ }
+ if (!StringUtils.isEmpty(profession.getSize())) {
+ result+= " " + profession.getSize();
+ }
+ if (!StringUtils.isEmpty(profession.getOther())) {
+ result+= " " + profession.getOther();
+ }
+ result += " - " + profession.getLibelle();
+ if (!StringUtils.isEmpty(profession.getSpecies())) {
+ result += "<br /><strong>Espèces cibles : </strong>" + 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());
+
+ for (FishingZone zone : row.getFishingZone()) {
+ result += "<br /><strong>Zone de pêche : </strong>" + zone.getCode();
+ }
+
+ return result;
+ }
+
+ 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;
+ }
+
+ public static String getCSSColorClassForContact(Contact contact, boolean admin) {
+ String result = "";
+ ContactState state = ContactState.createContactStateEnum(contact.getState());
+ if (BooleanUtils.isFalse(contact.getValidationProgram()) ||
+ (!admin && BooleanUtils.isFalse(contact.getValidationCompany()))) {
+ result = "refused";
+ } else if (BooleanUtils.isTrue(contact.getValidationProgram()) ||
+ (!admin && BooleanUtils.isTrue(contact.getValidationCompany()))) {
+ result = "accepted";
+ } else if (state.isUnfinishedState()) {
+ result = "unfinished";
+ } else if (state.equals(ContactState.BOARDING_DONE)) {
+ result = "even";
+ } else {
+ result = "odd";
+ }
+ return result;
+ }
+}
Property changes on: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/data/BusinessUtils.java
___________________________________________________________________
Added: svn:mergeinfo
+
Added: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/data/ChartUtils.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/data/ChartUtils.java (rev 0)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/data/ChartUtils.java 2010-01-13 18:35:55 UTC (rev 194)
@@ -0,0 +1,86 @@
+
+package fr.ifremer.suiviobsmer.ui.data;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Map;
+import java.util.SortedMap;
+import org.jfree.chart.JFreeChart;
+import org.jfree.chart.axis.CategoryAxis;
+import org.jfree.chart.axis.CategoryLabelPositions;
+import org.jfree.chart.axis.NumberAxis;
+import org.jfree.chart.axis.ValueAxis;
+import org.jfree.chart.labels.StandardCategoryItemLabelGenerator;
+import org.jfree.chart.plot.CategoryPlot;
+import org.jfree.chart.plot.PlotOrientation;
+import org.jfree.chart.renderer.category.AbstractCategoryItemRenderer;
+import org.jfree.chart.renderer.category.AreaRenderer;
+import org.jfree.chart.renderer.category.BarRenderer;
+import org.jfree.chart.renderer.category.LineAndShapeRenderer;
+import org.jfree.data.category.DefaultCategoryDataset;
+
+/**
+ * ChartUtils
+ *
+ * Created: 13 janv. 2010
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public class ChartUtils {
+
+ public enum ChartType {
+ BAR(BarRenderer.class), LINE(LineAndShapeRenderer.class), AREA(AreaRenderer.class);
+
+ protected Class<? extends AbstractCategoryItemRenderer> rendererClass;
+
+ ChartType(Class<? extends AbstractCategoryItemRenderer> rendererClass) {
+ this.rendererClass = rendererClass;
+ }
+
+ public AbstractCategoryItemRenderer createRenderer() {
+ try {
+ return rendererClass.newInstance();
+ } catch (Exception eee) {
+ // will never happens
+ throw new RuntimeException(eee);
+ }
+ }
+ }
+
+
+ public static JFreeChart createCategoryChart(String title, String axisName, ChartType type,
+ Map<String, SortedMap<Date, Integer>> input) {
+ DateFormat format = new SimpleDateFormat("MM/yyyy");
+
+ DefaultCategoryDataset dataset = new DefaultCategoryDataset();
+
+ // Fill data in dataset
+ int i = 0;
+ for (Map.Entry<String, SortedMap<Date, Integer>> map : input.entrySet()) {
+ for (Map.Entry<Date, Integer> data : map.getValue().entrySet()) {
+ dataset.setValue(data.getValue(), map.getKey(), format.format(data.getKey()));
+ }
+ i++;
+ }
+
+ // Axises
+ CategoryAxis categoryAxis = new CategoryAxis("Mois");
+ categoryAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
+ ValueAxis valueAxis = new NumberAxis(axisName);
+
+ // Renderer for Category
+ AbstractCategoryItemRenderer renderer = type.createRenderer();
+ // Show labels on each element
+ renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
+ renderer.setBaseItemLabelsVisible(Boolean.TRUE);
+
+ CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer);
+ plot.setOrientation(PlotOrientation.VERTICAL);
+ return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, true);
+ }
+}
Property changes on: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/data/ChartUtils.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Boats.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Boats.java 2010-01-13 18:06:05 UTC (rev 193)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Boats.java 2010-01-13 18:35:55 UTC (rev 194)
@@ -40,7 +40,7 @@
import fr.ifremer.suiviobsmer.services.ServiceReferential;
import fr.ifremer.suiviobsmer.services.ServiceSampling;
import fr.ifremer.suiviobsmer.services.ServiceUser;
-import fr.ifremer.suiviobsmer.ui.base.BusinessUtils;
+import fr.ifremer.suiviobsmer.ui.data.BusinessUtils;
import fr.ifremer.suiviobsmer.ui.base.GenericSelectModel;
import fr.ifremer.suiviobsmer.ui.base.SuiviObsmerPage;
import fr.ifremer.suiviobsmer.ui.components.FeedBack;
@@ -577,25 +577,8 @@
}
public String getlastContactClass() throws SuiviObsmerException {
- //even = !even;
- String result = "";
Contact contact = getCompanyBoatInfos().getLastContact();
- ContactState state = ContactState.createContactStateEnum(contact.getState());
- if (BooleanUtils.isFalse(contact.getValidationProgram()) ||
- (!user.getAdmin() && BooleanUtils.isFalse(contact.getValidationCompany()))) {
- result = "refused";
- } else if (BooleanUtils.isTrue(contact.getValidationProgram()) ||
- (!user.getAdmin() && BooleanUtils.isTrue(contact.getValidationCompany()))) {
- result = "accepted";
- } else if (state.isUnfinishedState()) {
- result = "unfinished";
- } else if (state.equals(ContactState.BOARDING_DONE)) {
- result = "even";
- } else {
- result = "odd";
- }
- return result;
- //return even ? "even" : "odd";
+ return BusinessUtils.getCSSColorClassForContact(contact, user.getAdmin());
}
/** /////////////////////// FOR EACH ELLIGIBLEBOAT ROW ///////////////// **/
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Contacts.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Contacts.java 2010-01-13 18:06:05 UTC (rev 193)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Contacts.java 2010-01-13 18:35:55 UTC (rev 194)
@@ -36,7 +36,7 @@
import fr.ifremer.suiviobsmer.services.ServiceContact;
import fr.ifremer.suiviobsmer.services.ServiceReferential;
import fr.ifremer.suiviobsmer.services.ServiceSampling;
-import fr.ifremer.suiviobsmer.ui.base.BusinessUtils;
+import fr.ifremer.suiviobsmer.ui.data.BusinessUtils;
import fr.ifremer.suiviobsmer.ui.base.GenericSelectModel;
import fr.ifremer.suiviobsmer.ui.base.SuiviObsmerPage;
import fr.ifremer.suiviobsmer.ui.components.Layout;
@@ -385,24 +385,7 @@
}
public String getRowClass() {
- //even = !even;
- String result = "";
- ContactState state = ContactState.createContactStateEnum(contact.getState());
- if (contact.getTopiaId().equals(contactSelectedId)) {
- result = "selected";
- } else if (BooleanUtils.isFalse(contact.getValidationProgram()) ||
- (!user.getAdmin() && BooleanUtils.isFalse(contact.getValidationCompany()))) {
- result = "refused";
- } else if (BooleanUtils.isTrue(contact.getValidationProgram()) ||
- (!user.getAdmin() && BooleanUtils.isTrue(contact.getValidationCompany()))) {
- result = "accepted";
- } else if (state.isUnfinishedState()) {
- result = "unfinished";
- } else if (state.equals(ContactState.BOARDING_DONE)) {
- result = "even";
- }
- return result;
- //return even ? "even" : "odd";
+ return BusinessUtils.getCSSColorClassForContact(contact, user.getAdmin());
}
public DateFormat getDateFormat() {
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Synthesis.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Synthesis.java 2010-01-13 18:06:05 UTC (rev 193)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Synthesis.java 2010-01-13 18:35:55 UTC (rev 194)
@@ -21,9 +21,22 @@
package fr.ifremer.suiviobsmer.ui.pages;
+import fr.ifremer.suiviobsmer.SuiviObsmerException;
+import fr.ifremer.suiviobsmer.services.ServiceSynthesis;
import fr.ifremer.suiviobsmer.ui.base.SuiviObsmerPage;
+import fr.ifremer.suiviobsmer.ui.data.ChartUtils;
+import fr.ifremer.suiviobsmer.ui.data.ChartUtils.ChartType;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedMap;
import org.apache.tapestry5.annotations.IncludeStylesheet;
+import org.apache.tapestry5.annotations.Persist;
+import org.apache.tapestry5.ioc.annotations.Inject;
import org.jfree.chart.JFreeChart;
+import org.nuiton.util.PeriodDates;
+import org.slf4j.Logger;
/**
* Synthesis
@@ -44,9 +57,54 @@
return false;
}
-// public JFreeChart getTestChart() {
-//
-// }
+ @Inject
+ private ServiceSynthesis serviceSynthesis;
+ @Inject
+ private Logger log;
+
+ /********************* DYNAMICAL GRAPH : DATASAMPLING *********************/
+
+ @Persist
+ private ChartType dataSamplingChartType;
+
+ public JFreeChart getDataSamplingChart() throws SuiviObsmerException {
+ if (log.isInfoEnabled()) {
+ log.info("BUSINESS REQUEST [getDataSampling]");
+ }
+ PeriodDates period = PeriodDates.createMonthsPeriodFromToday(-12);
+ if (log.isDebugEnabled()) {
+ log.debug("Period : " + period);
+ }
+ List<SortedMap<Date, Integer>> res = serviceSynthesis.getDataSampling(period);
+ Map<String, SortedMap<Date, Integer>> data = new HashMap<String, SortedMap<Date, Integer>>();
+ data.put("Données prévus", res.get(0));
+ data.put("Données réels", res.get(1));
+ return ChartUtils.createCategoryChart("Données des marées", "Nb marées", getDataSamplingChartType(), data);
+ }
+
+ public ChartType getDataSamplingChartType() {
+ // Default type is BAR
+ if (dataSamplingChartType == null) {
+ dataSamplingChartType = ChartType.BAR;
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("ChartType : " + dataSamplingChartType);
+ }
+ return dataSamplingChartType;
+ }
+
+ void onActionFromSetDataSamplingChartBarType() {
+ this.dataSamplingChartType = ChartType.BAR;
+ }
+
+ void onActionFromSetDataSamplingChartAreaType() {
+ this.dataSamplingChartType = ChartType.AREA;
+ }
+
+ void onActionFromSetDataSamplingChartLineType() {
+ this.dataSamplingChartType = ChartType.LINE;
+ }
+
}
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/services/AppModule.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/services/AppModule.java 2010-01-13 18:06:05 UTC (rev 193)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/services/AppModule.java 2010-01-13 18:35:55 UTC (rev 194)
@@ -57,6 +57,7 @@
binder.bind(ServiceBoat.class, ServiceBoatImpl.class);
binder.bind(ServiceContact.class, ServiceContactImpl.class);
binder.bind(ContactModelFactory.class);
+ binder.bind(ServiceSynthesis.class, ServiceSynthesisImpl.class);
// binder.bind(SuiviObsmerModelDAOHelper.getContractClass(User.class),
// SuiviObsmerModelDAOHelper.getImplementationClass(User.class));
}
Modified: trunk/suiviobsmer-ui/src/main/resources/log4j.properties
===================================================================
--- trunk/suiviobsmer-ui/src/main/resources/log4j.properties 2010-01-13 18:06:05 UTC (rev 193)
+++ trunk/suiviobsmer-ui/src/main/resources/log4j.properties 2010-01-13 18:35:55 UTC (rev 194)
@@ -20,5 +20,5 @@
log4j.logger.org.apache.tapestry5.services.TapestryModule.ComponentClassResolver=INFO
log4j.logger.org.apache.tapestry5.TapestryFilter=INFO
-log4j.logger.fr.ifremer.suiviobsmer=DEBUG
+log4j.logger.fr.ifremer.suiviobsmer=TRACE
log4j.logger.org.nuiton.util=DEBUG
Modified: trunk/suiviobsmer-ui/src/main/webapp/Synthesis.tml
===================================================================
--- trunk/suiviobsmer-ui/src/main/webapp/Synthesis.tml 2010-01-13 18:06:05 UTC (rev 193)
+++ trunk/suiviobsmer-ui/src/main/webapp/Synthesis.tml 2010-01-13 18:35:55 UTC (rev 194)
@@ -1,3 +1,4 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<t:layout t:pageTitle="Synthèse et indicateurs" t:contentId="so-synthesis"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter">
@@ -32,7 +33,7 @@
</div>
</div>
- <div class="graph">
+<!-- <div class="graph">
<img src="${asset:context:}/tmp/graph1.png" alt="graphe"/>
<p class="description">Proin eu molestie dolor. Aliquam eget ultrices lorem. Phasellus molestie iaculis eleifend.
Aenean vehicula elit eget felis vestibulum ut tempor est congue. Ut nulla felis,
@@ -40,7 +41,12 @@
risus libero, tincidunt eget aliquam sit amet, auctor id libero. Proin in
lectus nunc. Proin molestie molestie augue aliquet suscipit. Sed id enim diam,
sed rutrum libero. </p>
- </div>
+ </div>-->
- <t:chart t:width="300" t:height="250" t:chart="testChart" />
+ <p>
+ <a t:type="actionlink" t:id="setDataSamplingChartBarType">BAR</a>
+ <a t:type="actionlink" t:id="setDataSamplingChartAreaType">AREA</a>
+ <a t:type="actionlink" t:id="setDataSamplingChartLineType">LINE</a>
+ </p>
+ <t:chart t:width="550" t:height="400" t:chart="dataSamplingChart" />
</t:layout>
1
0
[Suiviobsmer-commits] r193 - trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl
by fdesbois@users.labs.libre-entreprise.org 13 Jan '10
by fdesbois@users.labs.libre-entreprise.org 13 Jan '10
13 Jan '10
Author: fdesbois
Date: 2010-01-13 18:06:05 +0000 (Wed, 13 Jan 2010)
New Revision: 193
Modified:
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImpl.java
Log:
Resolve issue on saving FishingZone for SampleRow
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImpl.java 2010-01-13 18:02:43 UTC (rev 192)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImpl.java 2010-01-13 18:06:05 UTC (rev 193)
@@ -212,17 +212,11 @@
}
// Add new linked FishingZone
// ConcurrentModificationException ????
- for (FishingZone zone : newZones) {
- if (log.isInfoEnabled()) {
- log.info("boucle 2, begin for zone : "+zone.getCode()+" list size = "+newZones.size());
- }
+ for (FishingZone zone : new ArrayList<FishingZone>(newZones)) {
if (!oldZones.contains(zone)) {
updateFishingZones(transaction, zone.getTopiaId(), row, false);
rowLog.addChange("La zone de pêche " + zone.getCode() + " a été associée à la ligne");
}
- if (log.isInfoEnabled()) {
- log.info("boucle 2, end for zone : "+zone.getCode()+" list size = "+newZones.size());
- }
}
// Save sampleRow : create or update
@@ -233,21 +227,6 @@
row.addSampleRowLog(rowLog);
rowDAO.update(row);
- if(newRow) {
-
- // Save fishingZones : update links
- // FIXME find a way to avoid saving links from FishingZone instead of SampleRow :
- // variable inverse="true" in hibernate mapping of FishingZone, how to set this variable to SampleRow instead
- FishingZoneDAO fishingZoneDAO = SuiviObsmerModelDAOHelper.getFishingZoneDAO(transaction);
- for (FishingZone zone : row.getFishingZone()) {
- FishingZone zoneFromDB = fishingZoneDAO.findByTopiaId(zone.getTopiaId());
- List<SampleRow> rows = zoneFromDB.getSampleRow();
- rows.add(row);
- zoneFromDB.setSampleRow(rows);
- fishingZoneDAO.update(zoneFromDB);
- }
- }
-
if (log.isDebugEnabled()) {
log.debug("Change log : " + rowLog.getLogText());
log.debug("commit transaction !");
@@ -696,6 +675,7 @@
* @throws IOException for CsvReader errors
* @throws TopiaException for SampleMonthDAO errors
* @throws ParseException for format errors
+ * @see #getMonthAndYear(java.lang.String)
*/
protected void updateRow(TopiaContext transaction, SampleRow sampleRow, CsvReader reader)
throws IOException, TopiaException, ParseException {
1
0
[Suiviobsmer-commits] r192 - in trunk: . src/site src/site/rst suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl suiviobsmer-business/src/site suiviobsmer-business/src/site/rst suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl suiviobsmer-ui/src/site suiviobsmer-ui/src/site/rst
by tchemit@users.labs.libre-entreprise.org 13 Jan '10
by tchemit@users.labs.libre-entreprise.org 13 Jan '10
13 Jan '10
Author: tchemit
Date: 2010-01-13 18:02:43 +0000 (Wed, 13 Jan 2010)
New Revision: 192
Added:
trunk/src/site/rst/index.rst
trunk/src/site/site_fr.xml
trunk/suiviobsmer-business/src/site/rst/
trunk/suiviobsmer-business/src/site/rst/index.rst
trunk/suiviobsmer-business/src/site/site_fr.xml
trunk/suiviobsmer-ui/src/site/rst/
trunk/suiviobsmer-ui/src/site/rst/index.rst
trunk/suiviobsmer-ui/src/site/site_fr.xml
Removed:
trunk/src/site/site.xml
trunk/suiviobsmer-business/src/site/site.xml
trunk/suiviobsmer-ui/src/site/site.xml
Modified:
trunk/pom.xml
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImpl.java
trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImplTest.java
Log:
use mavenpom4labs
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-01-13 13:42:12 UTC (rev 191)
+++ trunk/pom.xml 2010-01-13 18:02:43 UTC (rev 192)
@@ -7,11 +7,11 @@
<!-- *** POM Relationships *************************************** -->
<!-- ************************************************************* -->
- <!--parent>
+ <parent>
<groupId>org.nuiton</groupId>
- <artifactId>labspom</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- </parent-->
+ <artifactId>mavenpom4labs</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
<groupId>fr.ifremer</groupId>
<artifactId>suiviobsmer</artifactId>
@@ -158,10 +158,10 @@
<developers>
<developer>
<id>fdesbois</id>
- <name>Florian DESBOIS</name>
- <email>florian.desbois at gmail.com</email>
- <organization>ALMA - Code Lutin</organization>
- <organizationUrl>http:/alma.univ-nantes.fr</organizationUrl>
+ <name>Florian Desbois</name>
+ <email>fdesbois at codelutin.com</email>
+ <organization>CodeLutin</organization>
+ <organizationUrl>http://www.codelutin.com</organizationUrl>
<timezone>+1</timezone>
<roles>
<role>Chef de Projet</role>
@@ -169,11 +169,20 @@
<role>Développeur</role>
</roles>
</developer>
+ <developer>
+ <name>Tony Chemit</name>
+ <id>tchemit</id>
+ <email>chemit at codelutin.com</email>
+ <organization>CodeLutin</organization>
+ <organizationUrl>http://www.codelutin.com</organizationUrl>
+ <timezone>+2</timezone>
+ <roles>
+ <role>Développeur</role>
+ </roles>
+ </developer>
</developers>
-
-
- <url>http://${projectId}.labs.libre-entreprise.org</url>
+ <url>http://suiviobsmer.labs.libre-entreprise.org</url>
<licenses>
<license>
@@ -183,6 +192,11 @@
</license>
</licenses>
+ <issueManagement>
+ <system>gforge</system>
+ <url>https://${platform}/activity?group_id=${labs.id}</url>
+ </issueManagement>
+
<!-- ************************************************************* -->
<!-- *** Build Settings ****************************************** -->
<!-- ************************************************************* -->
@@ -190,63 +204,17 @@
<packaging>pom</packaging>
<properties>
+
<projectId>suiviobsmer</projectId>
+ <platform>labs.libre-entreprise.org</platform>
-
- <!-- labs -->
-
- <labs.list.host>lists.labs.libre-entreprise.org</labs.list.host>
-
- <!-- java level is 1.6 -->
- <maven.compile.source>1.6</maven.compile.source>
- <maven.compile.target>1.6</maven.compile.target>
-
- <!-- default encoding -->
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-
- <!-- by default, use maven 2 source base dir -->
- <maven.src.dir>${basedir}/src</maven.src.dir>
-
- <!-- where to generate sources -->
- <maven.gen.dir>${project.build.directory}/generated-sources</maven.gen.dir>
-
- <!-- where to generate test sources -->
- <maven.test.gen.dir>${project.build.directory}/generated-test-sources</maven.test.gen.dir>
-
- <!-- locales for the site generation, by default only french -->
- <maven.site.locales>fr</maven.site.locales>
-
- <!-- to allow bad tests -->
- <maven.test.testFailureIgnore>false</maven.test.testFailureIgnore>
-
- <!-- to skip tests (can use also profile notests) -->
- <maven.test.skip>false</maven.test.skip>
-
- <!-- to control fork mode of tests -->
- <maven.test.forkMode>once</maven.test.forkMode>
-
- <!-- to activate generation of reports and javadoc when doing a site -->
- <maven.reports.generate>true</maven.reports.generate>
-
- <!-- pour ne pas generer la javadoc (quand on aura un javadoc 2.5) -->
- <maven.javadoc.skip>false</maven.javadoc.skip>
-
- <!-- do not use 2.5 version, it is buggy (crazy aggregate mode !) -->
- <javadoc.version>2.4</javadoc.version>
-
- <!-- libraries version -->
- <maven.version>2.2.1</maven.version>
-
<!-- labs -->
<labs.id>154</labs.id>
<!-- libraries version -->
<nuitonutils.version>1.1.3-SNAPSHOT</nuitonutils.version>
<topia.version>2.3.0-beta-4-SNAPSHOT</topia.version>
- <license.version>2.0.0</license.version>
- <helper.version>1.1.0</helper.version>
<eugene.version>2.0.0-beta-3-SNAPSHOT</eugene.version>
<tapestry.version>5.1.0.5</tapestry.version>
@@ -259,7 +227,6 @@
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
-
<scm>
<connection>scm:svn:svn://anonymous at labs.libre-entreprise.org/svnroot/suiviobsmer/trunk</connection>
<developerConnection>scm:svn:svn+ssh://fdesbois at labs.libre-entreprise.org/svnroot/suiviobsmer/trunk</developerConnection>
@@ -273,209 +240,19 @@
<pluginManagement>
<plugins>
- <!-- plugin resources -->
- <plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.4.1</version>
- <configuration>
- <encoding>${project.build.sourceEncoding}</encoding>
- </configuration>
- </plugin>
-
- <!-- plugin compiler -->
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.0.2</version>
- <configuration>
- <fork>true</fork>
- <source>${maven.compile.source}</source>
- <target>${maven.compile.target}</target>
- <encoding>${project.build.sourceEncoding}</encoding>
- </configuration>
- </plugin>
-
- <!-- plugin surefire -->
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.3</version>
- <configuration>
- <forkMode>once</forkMode>
- <skip>${maven.test.skip}</skip>
- <testFailureIgnore>${maven.test.testFailureIgnore}</testFailureIgnore>
- </configuration>
- </plugin>
-
- <!-- plugin dependency -->
- <plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>2.1</version>
- <executions>
- <execution>
- <id>copy-dependencies</id>
- <phase>package</phase>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <configuration>
- <overWriteReleases>false</overWriteReleases>
- <overWriteSnapshots>false</overWriteSnapshots>
- <overWriteIfNewer>true</overWriteIfNewer>
- <outputDirectory>${project.build.directory}/lib</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <!-- plugin jar -->
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.2</version>
- <inherited>true</inherited>
-
- <configuration>
- <archive>
- <!-- cela fait bugger le chargement des service via
- ServiceLoader donc on desactive -->
- <!--index>true</index-->
- <manifest>
- <mainClass>${maven.jar.main.class}</mainClass>
- </manifest>
- <manifestEntries>
- <url>${pom.url}</url>
- </manifestEntries>
- <index>false</index>
- </archive>
- </configuration>
- </plugin>
-
- <!-- plugin source -->
- <plugin>
- <artifactId>maven-source-plugin</artifactId>
- <version>2.1.1</version>
- <inherited>true</inherited>
- <!--executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions-->
- </plugin>
-
- <!-- plugin javadoc -->
- <plugin>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>${javadoc.version}</version>
- <configuration>
- <docencoding>${project.reporting.outputEncoding}</docencoding>
- <encoding>${project.reporting.outputEncoding}</encoding>
- <charset>${project.reporting.outputEncoding}</charset>
- <quiet>true</quiet>
- <excludePackageNames>${maven.javadoc.excludePackageNames}</excludePackageNames>
- </configuration>
- <!--executions>
- <execution>
- <id>attach-javadocs</id>
- <goals>
- <goal>jar</goal>
- </goals>
- <configuration>
- <attach>true</attach>
- <quiet>true</quiet>
- </configuration>
- </execution>
- </executions-->
-
- </plugin>
-
<!-- plugin site -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
- <version>2.0.1</version>
- <configuration>
- <inputEncoding>${project.reporting.outputEncoding}</inputEncoding>
- <outputEncoding>${project.reporting.outputEncoding}</outputEncoding>
- <generateReports>${maven.reports.generate}</generateReports>
- <locales>fr</locales>
- <attach>false</attach>
- </configuration>
<dependencies>
<dependency>
<groupId>org.nuiton.jrst</groupId>
<artifactId>doxia-module-jrst</artifactId>
- <version>1.0.0</version>
+ <version>${jrst.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
- <artifactId>maven-release-plugin</artifactId>
- <version>2.0-beta-9</version>
- </plugin>
-
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.2-beta-4</version>
- </plugin>
-
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.3</version>
- </plugin>
-
- <plugin>
- <groupId>org.nuiton.thirdparty</groupId>
- <artifactId>webstart-maven-plugin</artifactId>
- <version>1.0-alpha-2-cl_20091001</version>
- <configuration>
-
- <libPath>lib</libPath>
- <makeArchive>false</makeArchive>
- <verbose>false</verbose>
-
- <jnlp>
- <mainClass>${maven.jar.main.class}</mainClass>
- <allPermissions>true</allPermissions>
- <offlineAllowed>true</offlineAllowed>
- </jnlp>
-
- <!-- Add some extensions for the already signed libs -->
- <!--jnlpExtensions>
- <jnlpExtension>
- <name>sun</name>
- <title>Sun MicroSystems</title>
- <vendor>Sun MicroSystems, Inc.</vendor>
- <includes>
- <include>javax.help:javahelp</include>
- </includes>
- </jnlpExtension>
- <jnlpExtension>
- <name>jxlayer</name>
- <title>Swing labs JXLayer </title>
- <vendor>Swing Labs</vendor>
- <includes>
- <include>org.swinglabs:jxlayer</include>
- </includes>
- </jnlpExtension>
- </jnlpExtensions-->
-
- <sign>
- <keystore>${keystorepath}</keystore>
- <storepass>${keystorepass}</storepass>
- <alias>${keyalias}</alias>
- <keypass>${keypass}</keypass>
- <verify>true</verify>
- <keystoreConfig>
- <delete>false</delete>
- <gen>false</gen>
- </keystoreConfig>
- </sign>
-
- </configuration>
- </plugin>
-
- <plugin>
<groupId>org.nuiton.eugene</groupId>
<artifactId>maven-eugene-plugin</artifactId>
<version>${eugene.version}</version>
@@ -497,64 +274,10 @@
</build>
- <!--Site-->
- <reporting>
- <plugins>
-
- <!--
- The Project Info Reports Plugin has twelve goals:
- see http://maven.apache.org/plugins/maven-project-info-reports-plugin
- -->
- <plugin>
- <artifactId>maven-project-info-reports-plugin</artifactId>
- <version>2.1.2</version>
- </plugin>
- <plugin>
- <artifactId>maven-jxr-plugin</artifactId>
- <version>2.1</version>
- </plugin>
-
- <plugin>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>${javadoc.version}</version>
- <configuration>
- <quiet>true</quiet>
- <docencoding>${project.build.sourceEncoding}</docencoding>
- <encoding>${project.build.sourceEncoding}</encoding>
- <excludePackageNames>${maven.javadoc.excludePackageNames}</excludePackageNames>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-surefire-report-plugin</artifactId>
- <version>2.4.3</version>
- </plugin>
-
- <plugin>
- <artifactId>maven-checkstyle-plugin</artifactId>
- <version>2.4</version>
- <configuration>
- <configLocation>checkstyle.xml</configLocation>
- </configuration>
- </plugin>
-
- </plugins>
- </reporting>
-
<!-- ************************************************************* -->
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
- <!-- prerequisites -->
- <prerequisites>
- <maven>2.1.0</maven>
- </prerequisites>
-
- <ciManagement>
- <system>hudson</system>
- <url>http://hudson.nuiton.org/job/${projectId}</url>
- </ciManagement>
-
<!--Any mailing lists for the project-->
<mailingLists>
@@ -570,10 +293,10 @@
<!--Distribution-->
<distributionManagement>
- <repository>
+ <!--repository>
<id>codelutin</id>
<url>scpexe://labs.libre-entreprise.org/home/groups/lutinbuilder/htdocs/maven2</url>
- </repository>
+ </repository-->
<site>
<id>codelutin</id>
<url>scpexe://labs.libre-entreprise.org/home/groups/${projectId}/htdocs/${projec…</url>
@@ -582,7 +305,7 @@
<repositories>
- <repository>
+ <!--repository>
<id>codelutin.repository</id>
<name>CodeLutinRepository</name>
<url>http://lutinbuilder.labs.libre-entreprise.org/maven2</url>
@@ -592,7 +315,7 @@
<releases>
<checksumPolicy>warn</checksumPolicy>
</releases>
- </repository>
+ </repository-->
<!-- depot des releases nuiton -->
@@ -661,301 +384,4 @@
</pluginRepositories>
- <profiles>
- <!-- do not execute tests (generaly a bad idea...) -->
- <profile>
- <id>notests</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <properties>
- <maven.test.skip>true</maven.test.skip>
- </properties>
- </profile>
-
- <!-- perform only on a release stage when using the maven-release-plugin -->
- <profile>
- <id>release-profile</id>
- <activation>
- <property>
- <name>performRelease</name>
- <value>true</value>
- </property>
- </activation>
- <build>
-
- <plugins>
-
- <!-- always check labs properties -->
- <plugin>
- <artifactId>maven-enforcer-plugin</artifactId>
- <executions>
- <execution>
- <id>validate-project</id>
- <goals>
- <goal>enforce</goal>
- </goals>
- <phase>initialize</phase>
- </execution>
- </executions>
- <configuration>
- <rules>
- <requireFilesExist>
- <files>
- <file>changelog.txt</file>
- <file>LICENSE.txt</file>
- <file>README.txt</file>
- </files>
- </requireFilesExist>
- </rules>
- <ignoreCache>true</ignoreCache>
- <failFast>true</failFast>
- <fail>true</fail>
-
- </configuration>
- </plugin>
-
- <!-- always compute source jar -->
- <plugin>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <!-- always compute javadoc jar -->
- <plugin>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-javadocs</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <!-- add license and third-party files to build -->
- <plugin>
- <groupId>org.nuiton</groupId>
- <artifactId>maven-license-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-licenses</id>
- <goals>
- <goal>add-license</goal>
- <goal>add-third-party</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
-
- </build>
- </profile>
-
- <!-- use this plugin to run the main class -->
- <profile>
- <id>run</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <defaultGoal>compile</defaultGoal>
- <plugins>
- <plugin>
- <artifactId>maven-enforcer-plugin</artifactId>
- <executions>
- <execution>
- <id>run</id>
- <goals>
- <goal>enforce</goal>
- </goals>
- <phase>initialize</phase>
- <configuration>
- <rules>
- <requireProperty>
- <property>maven.jar.main.class</property>
- <message>Could not find the "maven.jar.main.class" required property, use
- -Dmaven.jar.main.class=your.main.class.fqn
- </message>
- </requireProperty>
- </rules>
- <ignoreCache>true</ignoreCache>
- <failFast>true</failFast>
- <fail>true</fail>
-
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>run</id>
- <goals>
- <goal>java</goal>
- </goals>
- <phase>compile</phase>
- <configuration>
- <mainClass>${maven.jar.main.class}</mainClass>
- <classpathScope>runtime</classpathScope>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
- <properties>
- <exec.mainClass>${maven.jar.main.class}</exec.mainClass>
- <exec.classpathScope>runtime</exec.classpathScope>
- </properties>
- </profile>
-
- <!-- just add to build the webstart -->
- <profile>
- <id>webstart-profile</id>
- <activation>
- <property>
- <name>doWebstart</name>
- <value>true</value>
- </property>
- </activation>
- <build>
- <plugins>
-
- <plugin>
- <groupId>org.nuiton</groupId>
- <artifactId>maven-helper-plugin</artifactId>
- <executions>
- <execution>
- <id>get-keystore</id>
- <goals>
- <goal>share-server-secret</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <serverId>codelutin-keystore</serverId>
- <privateKeyOut>keystorepath</privateKeyOut>
- <passwordOut>keystorepass</passwordOut>
- <usernameOut>keyalias</usernameOut>
- <passphraseOut>keypass</passphraseOut>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.nuiton.thirdparty</groupId>
- <artifactId>webstart-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>generate-jnlp</id>
- <phase>package</phase>
- <goals>
- <goal>jnlp-inline</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
- </profile>
-
- <!-- just add to buil the local webstart (codebase will be in target/jnlp) -->
- <profile>
- <id>local-webstart-profile</id>
- <activation>
- <property>
- <name>doLocalWebstart</name>
- <value>true</value>
- </property>
- </activation>
- <properties>
- <jnlp.codebase>file://${project.build.directory}/jnlp</jnlp.codebase>
- </properties>
- <build>
- <plugins>
-
- <plugin>
- <groupId>org.nuiton</groupId>
- <artifactId>maven-helper-plugin</artifactId>
- <executions>
- <execution>
- <id>get-keystore</id>
- <goals>
- <goal>share-server-secret</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <serverId>codelutin-keystore</serverId>
- <privateKeyOut>keystorepath</privateKeyOut>
- <passwordOut>keystorepass</passwordOut>
- <usernameOut>keyalias</usernameOut>
- <passphraseOut>keypass</passphraseOut>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.nuiton.thirdparty</groupId>
- <artifactId>webstart-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>generate-jnlp-local</id>
- <phase>package</phase>
- <goals>
- <goal>jnlp-inline</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
- </profile>
- <!-- ce profile permet de generer les entetes de licenses pour les
- fichiers java -->
- <profile>
- <id>update-java-header</id>
- <activation>
- <property>
- <name>updateJavaHeader</name>
- <value>true</value>
- </property>
- </activation>
- <build>
- <defaultGoal>process-resources</defaultGoal>
- <plugins>
- <plugin>
- <groupId>org.nuiton</groupId>
- <artifactId>maven-license-plugin</artifactId>
- <executions>
- <execution>
- <id>update-java-header</id>
- <goals>
- <goal>update-header</goal>
- </goals>
- <phase>process-resources</phase>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- </profiles>
</project>
Added: trunk/src/site/rst/index.rst
===================================================================
--- trunk/src/site/rst/index.rst (rev 0)
+++ trunk/src/site/rst/index.rst 2010-01-13 18:02:43 UTC (rev 192)
@@ -0,0 +1,4 @@
+Accueil
+=======
+
+TODO
Deleted: trunk/src/site/site.xml
===================================================================
--- trunk/src/site/site.xml 2010-01-13 13:42:12 UTC (rev 191)
+++ trunk/src/site/site.xml 2010-01-13 18:02:43 UTC (rev 192)
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="${project.name}">
-
- <publishDate format="dd/MM/yyyy"/>
-
- <bannerLeft>
- <src alt="Web Applicatif Obsmer">logo-wao.png</src>
- <name>${project.name}</name>
- <href>index.html</href>
- </bannerLeft>
-
- <bannerRight>
- <src alt="Obsmer">logo-obsmer.jpg</src>
- </bannerRight>
-
- <poweredBy>
- <logo href="http://maven.apache.org" name="Maven" img="http://maven-site.nuiton.org/jrst/images/logos/maven-feather.png"/>
- <logo href="http://maven-site.nuiton.org/jrst" name="JRst" img="http://maven-site.nuiton.org/jrst/images/jrst-logo.png"/>
- <logo href="http://docutils.sourceforge.net/rst.html" name="ReStructuredText" img="http://maven-site.nuiton.org/jrst/images/restructuredtext-logo.png"/>
- </poweredBy>
-
- <body>
-
- <breadcrumbs>
- <item name="${project.name}" href="${project.url}" />
- </breadcrumbs>
-
-<!-- <links>
- <item name="Libre-Entreprise" href="http://www.libre-entreprise.org/" />
- <item name="[fr" href="index.html" />
- <item name="en]" href="../en/index.html" />
- </links>-->
-
- <menu name ="Documentation">
- <item name="Import/Export">
- <item name="Plan d'échantillonnage" href="import/samplingPlan.html"/>
- <item name="Navires" href="import/boats.html"/>
- <item name="Contacts" href="import/contacts.html"/>
- <!--<item name="Calendrier d'activité" href="import/activityCalendar.html"/>-->
- </item>
- <item name="Règles métier" href="business-rules.html" />
- </menu>
-
- <menu name ="Mise en place">
- <item name="Téléchargement" href="http://labs.libre-entreprise.org/frs/?group_id=154" />
- <item name="Installation" href="installation.html"/>
- <item name="Demo" href="http://demo.codelutin.com/suiviobsmer"/>
- <item name="Tracker" href="http://labs.libre-entreprise.org/tracker/?group_id=154"/>
- </menu>
-
- <!--<menu ref="parent"/>-->
- <menu ref="modules"/>
- <menu ref="reports"/>
-
- </body>
-
-</project>
-
Copied: trunk/src/site/site_fr.xml (from rev 191, trunk/src/site/site.xml)
===================================================================
--- trunk/src/site/site_fr.xml (rev 0)
+++ trunk/src/site/site_fr.xml 2010-01-13 18:02:43 UTC (rev 192)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="${project.name}">
+
+ <bannerLeft>
+ <src alt="Web Applicatif Obsmer">logo-wao.png</src>
+ <name>${project.name}</name>
+ <href>index.html</href>
+ </bannerLeft>
+
+ <bannerRight>
+ <src alt="Obsmer">logo-obsmer.jpg</src>
+ </bannerRight>
+
+ <poweredBy>
+ <logo href="http://maven.apache.org" name="Maven" img="http://maven-site.nuiton.org/jrst/images/logos/maven-feather.png"/>
+ <logo href="http://maven-site.nuiton.org/jrst" name="JRst" img="http://maven-site.nuiton.org/jrst/images/jrst-logo.png"/>
+ <logo href="http://docutils.sourceforge.net/rst.html" name="ReStructuredText" img="http://maven-site.nuiton.org/jrst/images/restructuredtext-logo.png"/>
+ </poweredBy>
+
+ <body>
+
+ <breadcrumbs>
+ <item name="${project.name}" href="index.html" />
+ </breadcrumbs>
+
+<!-- <links>
+ <item name="Libre-Entreprise" href="http://www.libre-entreprise.org/" />
+ <item name="[fr" href="index.html" />
+ <item name="en]" href="../en/index.html" />
+ </links>-->
+
+ <menu name ="Documentation">
+ <item name="Import/Export">
+ <item name="Plan d'échantillonnage" href="import/samplingPlan.html"/>
+ <item name="Navires" href="import/boats.html"/>
+ <item name="Contacts" href="import/contacts.html"/>
+ <!--<item name="Calendrier d'activité" href="import/activityCalendar.html"/>-->
+ </item>
+ <item name="Règles métier" href="business-rules.html" />
+ </menu>
+
+ <menu name ="Mise en place">
+ <item name="Téléchargement" href="http://labs.libre-entreprise.org/frs/?group_id=154" />
+ <item name="Installation" href="installation.html"/>
+ <item name="Demo" href="http://demo.codelutin.com/suiviobsmer"/>
+ <item name="Tracker" href="http://labs.libre-entreprise.org/tracker/?group_id=154"/>
+ </menu>
+
+ <!--<menu ref="parent"/>-->
+ <menu ref="modules"/>
+ <menu ref="reports"/>
+
+ </body>
+
+</project>
+
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImpl.java 2010-01-13 13:42:12 UTC (rev 191)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImpl.java 2010-01-13 18:02:43 UTC (rev 192)
@@ -204,20 +204,26 @@
// Remove no longer linked FishingZone
List<FishingZone> newZones = row.getFishingZone();
-// for (FishingZone oldZone : oldZones) {
-// if (!newZones.contains(oldZone)) {
-// updateFishingZones(transaction, oldZone.getTopiaId(), row, true);
-// rowLog.addChange("La zone de pêche " + oldZone.getCode() + " a été dissocié de la ligne");
-// }
-// }
+ for (FishingZone oldZone : oldZones) {
+ if (!newZones.contains(oldZone)) {
+ updateFishingZones(transaction, oldZone.getTopiaId(), row, true);
+ rowLog.addChange("La zone de pêche " + oldZone.getCode() + " a été dissociée de la ligne");
+ }
+ }
// Add new linked FishingZone
// ConcurrentModificationException ????
-// for (FishingZone zone : newZones) {
-// if (!oldZones.contains(zone)) {
-// updateFishingZones(transaction, zone.getTopiaId(), row, false);
-// rowLog.addChange("La zone de pêche " + zone.getCode() + " a été associé de la ligne");
-// }
-// }
+ for (FishingZone zone : newZones) {
+ if (log.isInfoEnabled()) {
+ log.info("boucle 2, begin for zone : "+zone.getCode()+" list size = "+newZones.size());
+ }
+ if (!oldZones.contains(zone)) {
+ updateFishingZones(transaction, zone.getTopiaId(), row, false);
+ rowLog.addChange("La zone de pêche " + zone.getCode() + " a été associée à la ligne");
+ }
+ if (log.isInfoEnabled()) {
+ log.info("boucle 2, end for zone : "+zone.getCode()+" list size = "+newZones.size());
+ }
+ }
// Save sampleRow : create or update
SampleRowDAO rowDAO = SuiviObsmerModelDAOHelper.getSampleRowDAO(transaction);
@@ -690,7 +696,6 @@
* @throws IOException for CsvReader errors
* @throws TopiaException for SampleMonthDAO errors
* @throws ParseException for format errors
- * @see #getMonthAndYear(java.lang.String)
*/
protected void updateRow(TopiaContext transaction, SampleRow sampleRow, CsvReader reader)
throws IOException, TopiaException, ParseException {
Added: trunk/suiviobsmer-business/src/site/rst/index.rst
===================================================================
--- trunk/suiviobsmer-business/src/site/rst/index.rst (rev 0)
+++ trunk/suiviobsmer-business/src/site/rst/index.rst 2010-01-13 18:02:43 UTC (rev 192)
@@ -0,0 +1,4 @@
+Accueil
+=======
+
+TODO
Deleted: trunk/suiviobsmer-business/src/site/site.xml
===================================================================
--- trunk/suiviobsmer-business/src/site/site.xml 2010-01-13 13:42:12 UTC (rev 191)
+++ trunk/suiviobsmer-business/src/site/site.xml 2010-01-13 18:02:43 UTC (rev 192)
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="${project.name}">
-
- <publishDate format="dd/MM/yyyy"/>
-
- <bannerLeft>
- <name>${project.name}</name>
- <href>index.html</href>
- </bannerLeft>
-
-<!-- <bannerRight>
- <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src>
- <href>http://www.codelutin.com</href>
- </bannerRight>-->
-
- <poweredBy>
- <logo href="http://maven.apache.org" name="Maven" img="http://maven-site.nuiton.org/jrst/images/logos/maven-feather.png"/>
- <logo href="http://maven-site.nuiton.org/jrst" name="JRst" img="http://maven-site.nuiton.org/jrst/images/jrst-logo.png"/>
- <logo href="http://docutils.sourceforge.net/rst.html" name="ReStructuredText" img="http://maven-site.nuiton.org/jrst/images/restructuredtext-logo.png"/>
- </poweredBy>
-
- <body>
-
- <breadcrumbs>
- <item name="${project.name}" href="${project.url}" />
- </breadcrumbs>
-
- <menu ref="parent"/>
- <menu ref="reports"/>
-
- </body>
-
-</project>
-
Copied: trunk/suiviobsmer-business/src/site/site_fr.xml (from rev 191, trunk/suiviobsmer-business/src/site/site.xml)
===================================================================
--- trunk/suiviobsmer-business/src/site/site_fr.xml (rev 0)
+++ trunk/suiviobsmer-business/src/site/site_fr.xml 2010-01-13 18:02:43 UTC (rev 192)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="${project.name}">
+
+ <bannerLeft>
+ <name>${project.name}</name>
+ <href>index.html</href>
+ </bannerLeft>
+
+ <body>
+
+ <breadcrumbs>
+ <item name="${project.name}" href="index.html" />
+ </breadcrumbs>
+
+ <menu ref="parent"/>
+ <menu ref="reports"/>
+
+ </body>
+
+</project>
+
Modified: trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImplTest.java
===================================================================
--- trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImplTest.java 2010-01-13 13:42:12 UTC (rev 191)
+++ trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImplTest.java 2010-01-13 18:02:43 UTC (rev 192)
@@ -181,7 +181,7 @@
/**
* Test of getSampleRowsOrderedByFishingZone method, of class ServiceSamplingImpl.
*/
- @Test
+// @Test
public void testGetSampleRowsOrderedByFishingZone() throws Exception {
log.info("getSampleRowsOrderedByFishingZone");
@@ -393,7 +393,7 @@
}
- @Test
+// @Test
public void testDeleteSampleRow() throws Exception {
log.info("deleteSampleRow");
@@ -439,7 +439,7 @@
transaction.closeContext();
}
- @Test
+// @Test
public void testImportSamplingPlanCsv() throws SuiviObsmerException, TopiaException {
log.info("importSamplingPlanCsv");
@@ -497,7 +497,7 @@
transaction.closeContext();
}
- @Test
+// @Test
public void testGetPrograms() throws Exception {
/** PREPARE DATA **/
TopiaContext transaction = SuiviObsmerContext.getTopiaRootContext().beginTransaction();
@@ -521,7 +521,7 @@
}
- @Test
+// @Test
public void testGetNewSampleRowCode() throws Exception {
log.info("getNewSampleRowCode");
Added: trunk/suiviobsmer-ui/src/site/rst/index.rst
===================================================================
--- trunk/suiviobsmer-ui/src/site/rst/index.rst (rev 0)
+++ trunk/suiviobsmer-ui/src/site/rst/index.rst 2010-01-13 18:02:43 UTC (rev 192)
@@ -0,0 +1,4 @@
+Accueil
+=======
+
+TODO
Deleted: trunk/suiviobsmer-ui/src/site/site.xml
===================================================================
--- trunk/suiviobsmer-ui/src/site/site.xml 2010-01-13 13:42:12 UTC (rev 191)
+++ trunk/suiviobsmer-ui/src/site/site.xml 2010-01-13 18:02:43 UTC (rev 192)
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="${project.name}">
-
- <publishDate format="dd/MM/yyyy"/>
-
- <bannerLeft>
- <name>${project.name}</name>
- <href>index.html</href>
- </bannerLeft>
-
-<!-- <bannerRight>
- <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src>
- <href>http://www.codelutin.com</href>
- </bannerRight>-->
-
- <poweredBy>
- <logo href="http://maven.apache.org" name="Maven" img="http://maven-site.nuiton.org/jrst/images/logos/maven-feather.png"/>
- <logo href="http://maven-site.nuiton.org/jrst" name="JRst" img="http://maven-site.nuiton.org/jrst/images/jrst-logo.png"/>
- <logo href="http://docutils.sourceforge.net/rst.html" name="ReStructuredText" img="http://maven-site.nuiton.org/jrst/images/restructuredtext-logo.png"/>
- </poweredBy>
-
- <body>
-
- <breadcrumbs>
- <item name="${project.name}" href="${project.url}" />
- </breadcrumbs>
-
- <menu ref="parent"/>
- <menu ref="reports"/>
-
- </body>
-
-</project>
-
Copied: trunk/suiviobsmer-ui/src/site/site_fr.xml (from rev 191, trunk/suiviobsmer-ui/src/site/site.xml)
===================================================================
--- trunk/suiviobsmer-ui/src/site/site_fr.xml (rev 0)
+++ trunk/suiviobsmer-ui/src/site/site_fr.xml 2010-01-13 18:02:43 UTC (rev 192)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="${project.name}">
+
+ <bannerLeft>
+ <name>${project.name}</name>
+ <href>index.html</href>
+ </bannerLeft>
+
+ <body>
+
+ <breadcrumbs>
+ <item name="${project.name}" href="index.html" />
+ </breadcrumbs>
+
+ <menu ref="parent"/>
+ <menu ref="reports"/>
+
+ </body>
+
+</project>
+
1
0
[Suiviobsmer-commits] r191 - in trunk: suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl suiviobsmer-business/src/main/xmi suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages suiviobsmer-ui/src/main/webapp/css
by fdesbois@users.labs.libre-entreprise.org 13 Jan '10
by fdesbois@users.labs.libre-entreprise.org 13 Jan '10
13 Jan '10
Author: fdesbois
Date: 2010-01-13 13:42:12 +0000 (Wed, 13 Jan 2010)
New Revision: 191
Modified:
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/ImportHelper.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceContactImpl.java
trunk/suiviobsmer-business/src/main/xmi/suiviobsmer.zargo
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Contacts.java
trunk/suiviobsmer-ui/src/main/webapp/css/sampling.css
Log:
Evol #1979 : all error messages for Contact import
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/ImportHelper.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/ImportHelper.java 2010-01-13 11:27:45 UTC (rev 190)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/ImportHelper.java 2010-01-13 13:42:12 UTC (rev 191)
@@ -347,7 +347,7 @@
}
public static String read(CsvReader reader, ImportHeader header) throws IOException {
- return reader.get(header.name().trim());
+ return reader.get(header.name()).trim();
}
public static int readInt(CsvReader reader, ImportHeader header) throws IOException {
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceContactImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceContactImpl.java 2010-01-13 11:27:45 UTC (rev 190)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceContactImpl.java 2010-01-13 13:42:12 UTC (rev 191)
@@ -35,6 +35,8 @@
import org.nuiton.topia.framework.TopiaQuery;
import fr.ifremer.suiviobsmer.bean.states.ContactStateEnum;
import fr.ifremer.suiviobsmer.bean.ContactFilter;
+import fr.ifremer.suiviobsmer.bean.ImportResults;
+import fr.ifremer.suiviobsmer.bean.ImportResultsImpl;
import fr.ifremer.suiviobsmer.entity.Boat;
import fr.ifremer.suiviobsmer.entity.BoatDAO;
import fr.ifremer.suiviobsmer.entity.Company;
@@ -333,9 +335,9 @@
}
@Override
- public int importContactCsv(User user, InputStream input) throws SuiviObsmerException {
+ public ImportResults importContactCsv(User user, InputStream input) throws SuiviObsmerException {
TopiaContext transaction = null;
- int result = 0;
+ ImportResults result = new ImportResultsImpl();
int currRow = 1;
try {
transaction = rootContext.beginTransaction();
@@ -474,26 +476,27 @@
contact.setMammalsCapture(mammalsCapture);
contact.setMammalsObservation(mammalsObsv);
- result++;
+ result.incNbImported();
- } else if (log.isWarnEnabled()) {
- log.warn("Import contact ligne " + currRow + " : " +
- "Navire inexistant avec l'immatriculation : " + boatImmatriculation);
+ } else {
+ result.addError(currRow, "Navire inexistant avec l'immatriculation : " + boatImmatriculation);
+ result.incNbRefused();
}
- } else if (log.isWarnEnabled()) {
- log.warn("Import contact ligne " + currRow + " : " +
- "Ligne d'échantillon inexistante ou incompatible avec la société pour le code : " + rowCode);
+ } else {
+ result.addError(currRow, "Ligne d'échantillon inexistante ou incompatible avec la société " +
+ "pour le code : " + rowCode);
+ result.incNbRefused();
}
- } else if (log.isErrorEnabled()) {
- log.error("Import contact ligne " + currRow + " : " +
- "Cette utilisateur n'est lié à aucune société : " + user);
+ } else {
+ result.addError(currRow, "Cette utilisateur n'est lié à aucune société : " + user.getFullName());
+ result.incNbRefused();
}
- } else if (log.isWarnEnabled()) {
- log.warn("Import contact ligne " + currRow + " : " +
- "Utilisateur inexistant avec l'identifiant : " + observerId);
+ } else {
+ result.addError(currRow, "Utilisateur inexistant avec l'identifiant : " + observerId);
+ result.incNbRefused();
}
- if (result % 1000 == 0) {
+ if (result.getNbRowsImported() % 1000 == 0) {
transaction.commitTransaction();
tic = ImportHelper.logTimeAndMemory(log, tic, "contacts ligne " + currRow);
}
@@ -505,8 +508,7 @@
} catch (ParseException eee) {
SuiviObsmerContext.serviceException(transaction,
"Erreur ligne " + currRow + " : " +
- "Le format des dates est incorrect, il doit être de la forme : JJ/MM/AAAA " +
- "(ou JJ/MM/AAAA HH:MM:SS pour la date de création d'un contact existant)", eee);
+ "Le format des dates est incorrect, il doit être de la forme : JJ/MM/AAAA", eee);
} catch (Exception eee) {
SuiviObsmerContext.serviceException(transaction,
"Impossible d'importer les contacts", eee);
Modified: trunk/suiviobsmer-business/src/main/xmi/suiviobsmer.zargo
===================================================================
(Binary files differ)
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Contacts.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Contacts.java 2010-01-13 11:27:45 UTC (rev 190)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Contacts.java 2010-01-13 13:42:12 UTC (rev 191)
@@ -27,6 +27,7 @@
import fr.ifremer.suiviobsmer.bean.ContactFilter;
import fr.ifremer.suiviobsmer.bean.ContactFilterImpl;
import fr.ifremer.suiviobsmer.bean.ContactState;
+import fr.ifremer.suiviobsmer.bean.ImportResults;
import fr.ifremer.suiviobsmer.entity.Boat;
import fr.ifremer.suiviobsmer.entity.Contact;
import fr.ifremer.suiviobsmer.entity.SampleRow;
@@ -71,7 +72,6 @@
import org.apache.tapestry5.services.BeanModelSource;
import org.apache.tapestry5.services.Response;
import org.apache.tapestry5.upload.services.UploadedFile;
-import org.nuiton.util.DateUtils;
import org.slf4j.Logger;
/**
@@ -259,10 +259,14 @@
void onSuccessFromImportContacts() throws SuiviObsmerException {
//importBoatsForm.clearErrors();
try {
- int result = serviceContact.importContactCsv(user, contactsCsvFile.getStream());
+ ImportResults result = serviceContact.importContactCsv(user, contactsCsvFile.getStream());
// Suppress persitant list of contacts
contacts = null;
- layout.getFeedBack().addInfo(result + " contacts importés");
+ layout.getFeedBack().addInfo(result.getNbRowsImported() + " contacts importés, " +
+ result.getNbRowsRefused() + " refusés.");
+ for (String error : result.getErrors()) {
+ layout.getFeedBack().addInfo(error);
+ }
} catch (SuiviObsmerBusinessException eee) {
layout.getFeedBack().addError(eee.getMessage());
}
Modified: trunk/suiviobsmer-ui/src/main/webapp/css/sampling.css
===================================================================
--- trunk/suiviobsmer-ui/src/main/webapp/css/sampling.css 2010-01-13 11:27:45 UTC (rev 190)
+++ trunk/suiviobsmer-ui/src/main/webapp/css/sampling.css 2010-01-13 13:42:12 UTC (rev 191)
@@ -80,11 +80,11 @@
color: white;
}
-div#so-sampling table tbody td.month span.real-warning-inf {
+div#so-sampling table tbody span.real-warning-inf {
color: red;
}
-div#so-sampling table tbody td.month span.real-warning-sup {
+div#so-sampling table tbody span.real-warning-sup {
color: blue;
}
1
0