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 2011
- 2 participants
- 91 discussions
[Suiviobsmer-commits] r946 - in trunk/wao-ui/src/main: java/fr/ifremer/wao/ui/pages resources/fr/ifremer/wao/ui/pages
by bleny@users.labs.libre-entreprise.org 26 Jan '11
by bleny@users.labs.libre-entreprise.org 26 Jan '11
26 Jan '11
Author: bleny
Date: 2011-01-26 10:03:54 +0000 (Wed, 26 Jan 2011)
New Revision: 946
Log:
fix misc minor issues
Modified:
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java
trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/pages/SampleRowForm_fr.properties
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java 2011-01-26 09:05:34 UTC (rev 945)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java 2011-01-26 10:03:54 UTC (rev 946)
@@ -616,7 +616,7 @@
}
private OptionModel newUserRoleOption(UserRole role) {
- return new OptionModelImpl(messages.get(role.toString()), role);
+ return new OptionModelImpl(role.toString(), role);
}
@Log
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java 2011-01-26 09:05:34 UTC (rev 945)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java 2011-01-26 10:03:54 UTC (rev 946)
@@ -594,7 +594,10 @@
sampleRowModel = beanModelSource.createEditModel(SampleRow.class, resources.getMessages());
sampleRowModel.add("company", null);
sampleRowModel.add("boats", null);
- sampleRowModel.include("code", "company", "nbObservants", "averageTideTime", "boats", "comment");
+ sampleRowModel.include("code", "company", "boats", "comment");
+ if (user.getProfile().getObsProgram() == ObsProgram.OBSMER) {
+ sampleRowModel.include("code", "company", "nbObservants", "averageTideTime", "boats", "comment");
+ }
if (user.getProfile().getObsProgram() == ObsProgram.OBSVENTE) {
sampleRowModel.add("samplingStrategy");
}
Modified: trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/pages/SampleRowForm_fr.properties
===================================================================
--- trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/pages/SampleRowForm_fr.properties 2011-01-26 09:05:34 UTC (rev 945)
+++ trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/pages/SampleRowForm_fr.properties 2011-01-26 10:03:54 UTC (rev 946)
@@ -26,7 +26,7 @@
professionSelect-label: Code m\u00e9tier
dcf5codes-label: Code DCF Niv. 5*
meshSize-label: Maillage (mm)
-size-label: Taille (mm)
+size-label: Taille du navire (m)
other-label: Autre information
libelle-label: Libell\u00e9
species-label: Esp\u00e8ces cibles
1
0
[Suiviobsmer-commits] r945 - in trunk/wao-business/src: main/java/fr/ifremer/wao/service test/resources/import
by bleny@users.labs.libre-entreprise.org 26 Jan '11
by bleny@users.labs.libre-entreprise.org 26 Jan '11
26 Jan '11
Author: bleny
Date: 2011-01-26 09:05:34 +0000 (Wed, 26 Jan 2011)
New Revision: 945
Log:
fix 'null' appearance in sampling plan export
Modified:
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java
trunk/wao-business/src/test/resources/import/echantillonnage.csv
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java 2011-01-25 16:48:52 UTC (rev 944)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java 2011-01-26 09:05:34 UTC (rev 945)
@@ -874,7 +874,9 @@
export.record(SAMPLING.PLAN_NB_OBSERV, numberFormat.format(row.getNbObservants()));
export.record(SAMPLING.PLAN_DUREE_MOY, numberFormat.format(row.getAverageTideTime()));
- export.record(SAMPLING.PLAN_COMMENT, String.valueOf(row.getComment()));
+ if (row.getComment() != null) {
+ export.record(SAMPLING.PLAN_COMMENT, String.valueOf(row.getComment()));
+ }
export.record(SAMPLING.PLAN_STRATEGIE, row.getSamplingStrategy().name());
if (row.getTerrestrialLocation() != null) {
if (row.getTerrestrialLocation().getDistrictCode() != null) {
@@ -1069,7 +1071,7 @@
"Cette ligne est lié à une zone inexistante : " + districtCode);
}
row.addFishingZone(zone);
- }
+ }
}
/**
Modified: trunk/wao-business/src/test/resources/import/echantillonnage.csv
===================================================================
--- trunk/wao-business/src/test/resources/import/echantillonnage.csv 2011-01-25 16:48:52 UTC (rev 944)
+++ trunk/wao-business/src/test/resources/import/echantillonnage.csv 2011-01-26 09:05:34 UTC (rev 945)
@@ -1,4 +1,4 @@
-"PLAN_CODE","SOCIETE_NOM","PECHE_DIVISION","PECHE_AUTRE","METIER_CODE_DCF5","METIER_MAILLAGE","METIER_TAILLE","METIER_AUTRE","METIER_LIBELLE","METIER_ESPECES","PROGRAMME_CODE","PROGRAMME_DEBUT","PROGRAMME_FIN",12/2009,01/2010,02/2010,03/2010,04/2010,05/2010,06/2010,07/2010,08/2010,09/2010,10/2010,11/2010,12/2010,01/2011,02/2011,03/2011,"PLAN_DUREE_MOY","PLAN_NB_OBSERV","PLAN_COMMENT","PLAN_STRATEGIE"
+"PLAN_CODE","SOCIETE_NOM","PECHE_DIVISION","PECHE_AUTRE","METIER_CODE_DCF5","METIER_MAILLAGE","METIER_TAILLE","METIER_AUTRE","METIER_LIBELLE","METIER_ESPECES","PROGRAMME_CODE","PROGRAMME_DEBUT","PROGRAMME_FIN",12/2009,01/2010,02/2010,03/2010,04/2010,05/2010,06/2010,07/2010,08/2010,09/2010,10/2010,11/2010,12/2010,01/2011,02/2011,03/2011,"PLAN_DUREE_MOY","PLAN_NB_OBSERV","PLAN_COMMENT","PLAN_STRATEGIE","PLAN_LIEU_CODE","PLAN_LIEU_NOM"
"2010_1",TARTANPION,"IId / I",,"DRB_ALG",,,,,,"MA-2009",03/2010,01/2011,,,,0,0,0,0,0,0,0,2,0,0,4,,,"1,5",1,"Un petit commentaire",SIMULTANEOUS_ALL_SPECIES
"2010_2",,"IId",,"DRH_CAT et DRH_CRU",,,,"Fileyage","poissons tubes","MANY",01/2008,12/2008,,20,0,0,21,0,0,21,0,0,21,0,0,,,,1,1,,
"2010_03",,"IId / IV",,"FAR",,,,"balottage en plein air","divers choses visqueuses","MA-2009",03/2010,01/2011,,,,0,22,0,0,25,0,0,21,0,0,25,,,2,1,,
1
0
[Suiviobsmer-commits] r944 - trunk/wao-ui/src/main/webapp/css
by bleny@users.labs.libre-entreprise.org 25 Jan '11
by bleny@users.labs.libre-entreprise.org 25 Jan '11
25 Jan '11
Author: bleny
Date: 2011-01-25 16:48:52 +0000 (Tue, 25 Jan 2011)
New Revision: 944
Log:
make Contacts page the most thin possible
Modified:
trunk/wao-ui/src/main/webapp/css/contacts.css
Modified: trunk/wao-ui/src/main/webapp/css/contacts.css
===================================================================
--- trunk/wao-ui/src/main/webapp/css/contacts.css 2011-01-25 16:13:40 UTC (rev 943)
+++ trunk/wao-ui/src/main/webapp/css/contacts.css 2011-01-25 16:48:52 UTC (rev 944)
@@ -90,100 +90,25 @@
/* TABLE OF CONTACTS */
-div#so-contacts table.user {
- width: 100%;
-}
-
-div#so-contacts table.admin {
- width: 2000px;
- font-size: 0.8em;
-}
-
-div#so-contacts table.t-data-grid thead a {
+div#so-contacts thead a {
text-decoration: none;
}
-div#so-contacts table.t-data-grid thead a:hover {
+div#so-contacts thead a:hover {
text-decoration: underline;
}
-div#so-contacts table.t-data-grid thead tr th {
+div#so-contacts th {
text-align: center;
-}
-
-div#so-contacts table.t-data-grid thead tr th.topiaCreateDate,
-div#so-contacts table.t-data-grid thead tr th.dataInputDate,
-div#so-contacts table.t-data-grid thead tr th.tideEndDate,
-div#so-contacts table.t-data-grid thead tr th.tideBeginDate {
- width: 90px;
white-space: normal;
- text-align: center;
+ max-width: 200px;
}
-div#so-contacts table.t-data-grid thead tr th.nbObservants {
- width: 40px;
- white-space: normal;
- text-align: center;
-}
-
-div#so-contacts table.t-data-grid thead tr th.mammals {
- white-space: normal;
- width: 100px;
-}
-
-
-div#so-contacts table.t-data-grid thead tr th.actions {
- width: 90px;
-}
-
-
-div#so-contacts table.t-data-grid tbody tr td {
+div#so-contacts td.actions {
white-space: nowrap;
}
-div#so-contacts table.t-data-grid tbody tr td.comment,
-div#so-contacts table.t-data-grid thead tr th.commentCoordinator,
-div#so-contacts table.t-data-grid thead tr th.commentAdmin
-div#so-contacts table.t-data-grid thead tr th.dataReliability {
- white-space: normal;
- width: 100px;
- text-align: center;
-}
-
-div#so-contacts table.t-data-grid tbody tr td.nbObservants {
- text-align: center;
-}
-
-a.save {
- cursor: pointer;
-}
-
-td.validation, td.mammals, /* TEMP */
-div#so-contacts table.t-data-grid tbody td.validation,
-div#so-contacts table.t-data-grid tbody td.mammals {
- text-align: center;
-}
-
-/** FORM **/
-div#so-contacts div.t-error {
- width: 60%;
- margin: 5px auto;
-}
-
-div#so-contacts div.t-error li {
- margin-left: 20px;
-}
-
-div#so-contacts-edit {
- width: 40%;
- margin-left: auto;
- margin-right: auto;
-}
-
-input.date {
- width: 70px;
-}
-
-input.nbObservants {
- width: 18px;
-}
+div#so-contacts th.actions {
+ max-width: 600px;
+ width: 600px;
+}
\ No newline at end of file
1
0
[Suiviobsmer-commits] r943 - in trunk: . wao-business/src/main/java/fr/ifremer/wao/entity wao-business/src/main/resources/i18n
by bleny@users.labs.libre-entreprise.org 25 Jan '11
by bleny@users.labs.libre-entreprise.org 25 Jan '11
25 Jan '11
Author: bleny
Date: 2011-01-25 16:13:40 +0000 (Tue, 25 Jan 2011)
New Revision: 943
Log:
add district name for non-french districts
Modified:
trunk/pom.xml
trunk/wao-business/src/main/java/fr/ifremer/wao/entity/TerrestrialLocationImpl.java
trunk/wao-business/src/main/resources/i18n/wao-business_en_GB.properties
trunk/wao-business/src/main/resources/i18n/wao-business_fr_FR.properties
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-01-25 14:37:48 UTC (rev 942)
+++ trunk/pom.xml 2011-01-25 16:13:40 UTC (rev 943)
@@ -328,10 +328,10 @@
<labs.id>154</labs.id>
<!-- libraries version -->
- <nuitonI18nVersion>2.1</nuitonI18nVersion>
+ <nuitonI18nVersion>2.2</nuitonI18nVersion>
<nuitonUtilsVersion>1.5.3</nuitonUtilsVersion>
<nuitonWebVersion>1.0-SNAPSHOT</nuitonWebVersion>
- <topiaVersion>2.5</topiaVersion>
+ <topiaVersion>2.5.1-SNAPSHOT</topiaVersion>
<eugeneVersion>2.3</eugeneVersion>
<tapestryVersion>5.2.4</tapestryVersion>
<hibernateVersion>3.3.2.GA</hibernateVersion>
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/entity/TerrestrialLocationImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/entity/TerrestrialLocationImpl.java 2011-01-25 14:37:48 UTC (rev 942)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/entity/TerrestrialLocationImpl.java 2011-01-25 16:13:40 UTC (rev 943)
@@ -1,7 +1,10 @@
package fr.ifremer.wao.entity;
+import fr.ifremer.wao.WaoUtils;
import fr.ifremer.wao.bean.LocationType;
+import static org.nuiton.i18n.I18n.n_;
+
public class TerrestrialLocationImpl extends TerrestrialLocationAbstract {
@Override
@@ -18,6 +21,15 @@
}
}
+ @Override
+ public String getDistrictName() {
+ String districtName = super.getDistrictName();
+ if (districtName == null) {
+ districtName = WaoUtils.translate(n_("wao.business.other"));
+ }
+ return districtName;
+ }
+
public boolean isDistrict() {
boolean isDistrict = getLocationType() == null;
return isDistrict;
Modified: trunk/wao-business/src/main/resources/i18n/wao-business_en_GB.properties
===================================================================
--- trunk/wao-business/src/main/resources/i18n/wao-business_en_GB.properties 2011-01-25 14:37:48 UTC (rev 942)
+++ trunk/wao-business/src/main/resources/i18n/wao-business_en_GB.properties 2011-01-25 16:13:40 UTC (rev 943)
@@ -99,6 +99,7 @@
fr.ifremer.wao.entity.FishingGearDCF.TMS=Shrimp trawls
fr.ifremer.wao.entity.FishingGearDCF.TX=Other trawls (not specified)
fr.ifremer.wao.entity.TargetSpeciesDCF.=Not specified
+wao.business.other=Other
wao.error.boat.canCreateContact=
wao.error.boat.getNbBoarding=
wao.error.boatInfos.getNbBoardingForCompany=
Modified: trunk/wao-business/src/main/resources/i18n/wao-business_fr_FR.properties
===================================================================
--- trunk/wao-business/src/main/resources/i18n/wao-business_fr_FR.properties 2011-01-25 14:37:48 UTC (rev 942)
+++ trunk/wao-business/src/main/resources/i18n/wao-business_fr_FR.properties 2011-01-25 16:13:40 UTC (rev 943)
@@ -111,6 +111,7 @@
fr.ifremer.wao.entity.TargetSpeciesDCF.LPF=Grands p\u00E9lagiques
fr.ifremer.wao.entity.TargetSpeciesDCF.MOL=Mollusques
fr.ifremer.wao.entity.TargetSpeciesDCF.SPF=Petits p\u00E9lagiques
+wao.business.other=Autre
wao.error.boat.canCreateContact=Impossible de cr\u00E9er un nouveau contact pour la soci\u00E9t\u00E9 %1$s et le navire %2$s (%3$d)
wao.error.boat.getNbBoarding=Impossible de r\u00E9cup\u00E9rer le nombre d'embarquements r\u00E9els depuis le %1$s
wao.error.boatInfos.getNbBoardingForCompany=Impossible de r\u00E9cup\u00E9rer le nombre d'embarquements r\u00E9els depuis le %1$s pour la soci\u00E9t\u00E9 %2$s
1
0
[Suiviobsmer-commits] r942 - in trunk: wao-business/src/main/java/fr/ifremer/wao/entity wao-business/src/main/java/fr/ifremer/wao/service wao-business/src/main/xmi wao-ui/src/main/java/fr/ifremer/wao/ui/pages wao-ui/src/main/java/fr/ifremer/wao/ui/services wao-ui/src/main/resources/fr/ifremer/wao/ui/pages wao-ui/src/main/webapp
by bleny@users.labs.libre-entreprise.org 25 Jan '11
by bleny@users.labs.libre-entreprise.org 25 Jan '11
25 Jan '11
Author: bleny
Date: 2011-01-25 14:37:48 +0000 (Tue, 25 Jan 2011)
New Revision: 942
Log:
add terrestrial location in SamplingPlan
Modified:
trunk/wao-business/src/main/java/fr/ifremer/wao/entity/TerrestrialLocationImpl.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactImpl.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java
trunk/wao-business/src/main/xmi/wao.zargo
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/ContactForm.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/ContactModelFactory.java
trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/pages/Contacts_fr.properties
trunk/wao-ui/src/main/webapp/Contacts.tml
trunk/wao-ui/src/main/webapp/SampleRowHistoric.tml
trunk/wao-ui/src/main/webapp/SamplingPlan.tml
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/entity/TerrestrialLocationImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/entity/TerrestrialLocationImpl.java 2011-01-25 10:41:14 UTC (rev 941)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/entity/TerrestrialLocationImpl.java 2011-01-25 14:37:48 UTC (rev 942)
@@ -17,4 +17,34 @@
setLocationTypeOrdinal(locationType.ordinal());
}
}
+
+ public boolean isDistrict() {
+ boolean isDistrict = getLocationType() == null;
+ return isDistrict;
+ }
+
+ /** Get a description of the location like « Maracaibo (Port, Venezuela) »
+ *
+ */
+ public String getDescription() {
+ StringBuilder description = new StringBuilder();
+ if (isDistrict()) {
+ description.append(getDistrictName()).append(" (");
+ } else {
+ description.append(getName()).append(" (")
+ .append(getLocationType()).append(", ");
+ if ( ! getPortName().equals(getName())) {
+ description.append(getPortName()).append(", ");
+ }
+ }
+
+ if (getRegionName() == null) {
+ description.append(getCountryName());
+ } else {
+ description.append(getRegionName());
+ }
+
+ description.append(")");
+ return description.toString();
+ }
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactImpl.java 2011-01-25 10:41:14 UTC (rev 941)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactImpl.java 2011-01-25 14:37:48 UTC (rev 942)
@@ -190,6 +190,7 @@
for (Contact contact : results.values()) {
contact.getMainObserver();
contact.sizeSecondaryObservers();
+ contact.getTerrestrialLocation();
}
return results;
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java 2011-01-25 10:41:14 UTC (rev 941)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java 2011-01-25 14:37:48 UTC (rev 942)
@@ -263,6 +263,11 @@
if (oldRow.getAverageTideTime() != row.getAverageTideTime()) {
rowLog.addChange("La durée moyenne d'une marée est passé de " + oldRow.getAverageTideTime() + " jours à " + row.getAverageTideTime());
}
+
+ if (oldRow.getTerrestrialLocation() != row.getTerrestrialLocation()) {
+ rowLog.addChange("Le lieu est passé de " + oldRow.getTerrestrialLocation().getDescription() + " à "
+ + row.getTerrestrialLocation().getDescription());
+ }
} else {
rowLog.addChange("Le nombre d'observateurs est " + row.getNbObservants());
rowLog.addChange("La durée moyenne d'une marée est " + row.getAverageTideTime());
Modified: trunk/wao-business/src/main/xmi/wao.zargo
===================================================================
(Binary files differ)
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/ContactForm.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/ContactForm.java 2011-01-25 10:41:14 UTC (rev 941)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/ContactForm.java 2011-01-25 14:37:48 UTC (rev 942)
@@ -317,7 +317,7 @@
serviceReferential.getAllTerrestrialLocations(new ContactFilterImpl(),
contact.getSampleRow().getTerrestrialLocation().getDistrictCode());
terrestrialLocationSelectModel = new GenericSelectModel<TerrestrialLocation>(locations, TerrestrialLocation.class,
- TerrestrialLocation.PROPERTY_NAME, TerrestrialLocation.TOPIA_ID, propertyAccess);
+ "description", TerrestrialLocation.TOPIA_ID, propertyAccess);
}
return terrestrialLocationSelectModel;
}
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java 2011-01-25 10:41:14 UTC (rev 941)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java 2011-01-25 14:37:48 UTC (rev 942)
@@ -570,13 +570,17 @@
}
public int getNbColumnsForProfession() {
- // code, program.name, fishingZone.districts, profession.code, profession.libelle
+ // Code ligne | Programme ou règlement rattachement | Zone
+ // | METIER Code | METIER Libellé
int fixed = 5;
if (fullView) {
// company, program.periodBegin, program.periodEnd, fishingZonesInfos
// profession.meshSize, profession.size, profession.other, profession.species
fixed += 8;
}
+ if (showObsVente()) {
+ fixed += 2; // add sampling strategy, terrestrial location
+ }
return fixed;
}
@@ -586,9 +590,6 @@
public int getNbColumnsForOther() {
int nbColumnsForOther = 4;
- if (showObsVente()) {
- nbColumnsForOther += 1; // add sampling strategy
- }
return nbColumnsForOther;
}
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/ContactModelFactory.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/ContactModelFactory.java 2011-01-25 10:41:14 UTC (rev 941)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/ContactModelFactory.java 2011-01-25 14:37:48 UTC (rev 942)
@@ -28,6 +28,7 @@
import fr.ifremer.wao.bean.UserRole;
import fr.ifremer.wao.entity.Contact;
import fr.ifremer.wao.entity.FishingZone;
+import fr.ifremer.wao.entity.TerrestrialLocation;
import fr.ifremer.wao.entity.WaoUser;
import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.PropertyConduit;
@@ -87,6 +88,7 @@
addNonSortableProperty("fishingZoneFacade", getFishingZoneFacadePropertyConduit());
addNonSortableProperty("fishingZoneSector", getFishingZoneSectorPropertyConduit());
addNonSortableProperty("fishingZoneDivision", getFishingZoneDivisionPropertyConduit());
+ addNonSortableProperty(Contact.PROPERTY_TERRESTRIAL_LOCATION, getTerrestrialLocationPropertyConduit());
addNonSortableProperty(Contact.PROPERTY_BOAT, getBoatPropertyConduit());
addNonSortableProperty("boatImmatriculation", getBoatImmatriculationPropertyConduit());
addNonSortableProperty("boatDistrictCode", getBoatDistrictCodePropertyConduit());
@@ -112,10 +114,13 @@
if (obsProgram == ObsProgram.OBSMER) {
model.exclude("expectedSamplingStrategy",
"actualSamplingStrategy",
- Contact.PROPERTY_COMPLETE_SAMPLING);
+ Contact.PROPERTY_COMPLETE_SAMPLING,
+ Contact.PROPERTY_TERRESTRIAL_LOCATION);
}
if (obsProgram == ObsProgram.OBSVENTE) {
+ model.exclude(Contact.PROPERTY_STATE);
+ model.exclude("mammals");
model.exclude("dataReliability");
}
@@ -342,5 +347,20 @@
};
}
+ protected PropertyConduit getTerrestrialLocationPropertyConduit() {
+ return new ContactReaderPropertyConduit() {
+ @Override
+ public String getValue(Contact contact) {
+ TerrestrialLocation terrestrialLocation = contact.getTerrestrialLocation();
+ String value;
+ if (terrestrialLocation == null) {
+ value = "";
+ } else {
+ value = contact.getTerrestrialLocation().getDescription();
+ }
+ return value;
+ }
+ };
+ }
}
Modified: trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/pages/Contacts_fr.properties
===================================================================
--- trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/pages/Contacts_fr.properties 2011-01-25 10:41:14 UTC (rev 941)
+++ trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/pages/Contacts_fr.properties 2011-01-25 14:37:48 UTC (rev 942)
@@ -38,7 +38,7 @@
boatImmatriculation-label: N\u00b0
boatDistrictCode-label: CQ
mammals-label: Observations et captures accidentelles
-dataInputDate-label: Saisie des donn\u00e9es dans Allegro
+dataInputDate-label: Saisie des donn\u00e9es dans Allegro / Arp\u00e8ge
comment-label: Commentaire observateur
program-label: Programme
professionCode-label: Code m\u00e9tier
@@ -55,3 +55,4 @@
expectedSamplingStrategy-label: Strat\u00e9gie d'\u00e9chantillonnage attendue
actualSamplingStrategy-label: Strat\u00e9gie d'\u00e9chantillonnage utilis\u00e9e
completeSampling-label: \u00c9chantillonnage complet
+terrestrialLocation-label: Lieu
Modified: trunk/wao-ui/src/main/webapp/Contacts.tml
===================================================================
--- trunk/wao-ui/src/main/webapp/Contacts.tml 2011-01-25 10:41:14 UTC (rev 941)
+++ trunk/wao-ui/src/main/webapp/Contacts.tml 2011-01-25 14:37:48 UTC (rev 942)
@@ -221,6 +221,11 @@
<p:topiaCreateDateCell>
<t:output value="contact.topiaCreateDate" format="dateFormat" />
</p:topiaCreateDateCell>
+ <p:terrestrialLocationCell>
+ <span t:type="ck/Tooltip" title="Infos" t:value="${contact.terrestrialLocation.description}" t:effect="appear">
+ ${contact.terrestrialLocation.name}
+ </span>
+ </p:terrestrialLocationCell>
<p:boatCell>
<span t:type="ck/Tooltip" title="Infos" t:value="prop:boatDescription" t:effect="appear">
${contact.boat.name}
Modified: trunk/wao-ui/src/main/webapp/SampleRowHistoric.tml
===================================================================
--- trunk/wao-ui/src/main/webapp/SampleRowHistoric.tml 2011-01-25 10:41:14 UTC (rev 941)
+++ trunk/wao-ui/src/main/webapp/SampleRowHistoric.tml 2011-01-25 14:37:48 UTC (rev 942)
@@ -29,7 +29,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<t:layout t:pageTitle="Historique d'une ligne du plan" t:contentId="so-samplerow-historic"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter">
- <h1>${format:wao.ui.sampleRowLog.title=sampleRow.code</h1>
+ <h1>${format:wao.ui.sampleRowLog.title=sampleRow.code}</h1>
<p class="aright">${message:wao.ui.misc.createdOnF} <t:output t:format="dateFormat" t:value="sampleRow.topiaCreateDate"/></p>
<hr />
<t:if t:test="canAddComment()">
Modified: trunk/wao-ui/src/main/webapp/SamplingPlan.tml
===================================================================
--- trunk/wao-ui/src/main/webapp/SamplingPlan.tml 2011-01-25 10:41:14 UTC (rev 941)
+++ trunk/wao-ui/src/main/webapp/SamplingPlan.tml 2011-01-25 14:37:48 UTC (rev 942)
@@ -162,6 +162,9 @@
<td>Zone</td>
<t:if t:test="fullView">
<td>Zone de pêche info</td>
+ <t:if test="showObsVente()">
+ <td>Lieu</td>
+ </t:if>
<td>METIER<br />Code DCF5</td>
<td>METIER<br />Maillage</td>
<td>METIER<br />Taille</td>
@@ -169,21 +172,24 @@
<td>METIER<br />Libellé</td>
<td>METIER<br />Espèces cibles</td>
<td>Date de début</td>
- <td class="bright">Date de fin</td>
+ <td>Date de fin</td>
<p:else>
+ <t:if test="showObsVente()">
+ <td>Lieu</td>
+ </t:if>
<td>METIER<br />Code</td>
- <td class="bright">METIER<br />Libellé</td>
+ <td>METIER<br />Libellé</td>
</p:else>
</t:if>
+ <t:if test="showObsVente()">
+ <td class="width60 bright">Stratégie d'échantillonnage</td>
+ </t:if>
<t:loop source="months" value="month">
<td class="width50"><t:output value="month" format="dateFormat" /></td>
</t:loop>
<td class="width50 bright">total</td>
<td class="width60">Durée moyenne d'une marée (J.)</td>
<td class="width60">Nb. d'observateurs</td>
- <t:if test="showObsVente()">
- <td class="width60 bright">Stratégie d'échantillonnage</td>
- </t:if>
<td class="width60 bright">Commentaire</td>
<td class="bright">Actions</td>
</tr>
@@ -223,6 +229,13 @@
<t:if t:test="fullView">
<td>${fishingZones}</td>
<td>${row.fishingZonesInfos}</td>
+ <t:if test="showObsVente()">
+ <td>
+ <span t:type="ck/Tooltip" title="Infos" t:value="${row.terrestrialLocation.description}" t:effect="appear">
+ ${row.terrestrialLocation.districtName}
+ </span>
+ </td>
+ </t:if>
<td>
<t:loop source="row.dcf5code" value="dcf5code">
<span t:type="ck/Tooltip" t:value="${dcf5CodeDescription}" t:effect="appear">
@@ -236,13 +249,20 @@
<td>${row.profession.libelle}</td>
<td>${row.profession.species}</td>
<td><t:output value="row.periodBegin" format="dateFormat" /></td>
- <td class="bright"><t:output value="row.periodEnd" format="dateFormat" /></td>
+ <td><t:output value="row.periodEnd" format="dateFormat" /></td>
<p:else>
<td>
<span t:type="ck/Tooltip" title="Infos" t:value="prop:row.fishingZonesInfos" t:effect="appear">
${fishingZones}
</span>
</td>
+ <t:if test="showObsVente()">
+ <td>
+ <span t:type="ck/Tooltip" title="Infos" t:value="${row.terrestrialLocation.description}" t:effect="appear">
+ ${row.terrestrialLocation.districtName}
+ </span>
+ </td>
+ </t:if>
<td>
<t:loop source="row.dcf5code" value="dcf5code">
<span t:type="ck/Tooltip" t:value="${dcf5CodeDescription}" t:effect="appear">
@@ -251,13 +271,18 @@
</t:loop>
${row.professionDescriptionWithoutDCF5}
</td>
- <td class="bright">
+ <td>
<span t:type="ck/Tooltip" title="Infos" t:value="Espèces cibles : ${row.profession.species}" t:effect="appear">
${row.profession.libelle}
</span>
</td>
</p:else>
</t:if>
+ <t:if test="showObsVente()">
+ <td class="bright">
+ ${row.samplingStrategy}
+ </td>
+ </t:if>
<t:loop source="months" value="month">
<td class="width50 acenter ${monthCurrentClass}">
${nbTidesExpected}
@@ -276,11 +301,6 @@
</td>
<td class="width60 acenter"><t:output t:value="row.averageTideTime" t:format="numberFormat" /></td>
<td class="width60 acenter">${row.nbObservants}</td>
- <t:if test="showObsVente()">
- <td class="width60 acenter">
- ${row.samplingStrategy}
- </td>
- </t:if>
<td class="width60 acenter bright">
<t:if t:test="row.comment">
<span t:type="ck/Tooltip" title="Commentaire" t:value="prop:rowComment" t:effect="appear">
1
0
25 Jan '11
Author: bleny
Date: 2011-01-25 10:41:14 +0000 (Tue, 25 Jan 2011)
New Revision: 941
Log:
translation of enum is business are now rendered in UI
Modified:
trunk/pom.xml
trunk/wao-business/src/main/java/fr/ifremer/wao/PostgresMigrationCallback.java
trunk/wao-business/src/main/java/fr/ifremer/wao/WaoContext.java
trunk/wao-business/src/main/java/fr/ifremer/wao/WaoContextImpl.java
trunk/wao-business/src/main/java/fr/ifremer/wao/WaoUtils.java
trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ContactPieChartConstant.java
trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ContactState.java
trunk/wao-business/src/main/java/fr/ifremer/wao/bean/DataReliability.java
trunk/wao-business/src/main/java/fr/ifremer/wao/bean/GlobalIndicatorValue.java
trunk/wao-business/src/main/java/fr/ifremer/wao/bean/LocationType.java
trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ObsProgram.java
trunk/wao-business/src/main/java/fr/ifremer/wao/bean/SamplingStrategy.java
trunk/wao-business/src/main/java/fr/ifremer/wao/bean/SynthesisId.java
trunk/wao-business/src/main/java/fr/ifremer/wao/bean/UserRole.java
trunk/wao-business/src/main/java/fr/ifremer/wao/entity/ContactImpl.java
trunk/wao-business/src/main/java/fr/ifremer/wao/entity/UserProfileImpl.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSynthesisImpl.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceUserImpl.java
trunk/wao-business/src/main/resources/i18n/wao-business_en_GB.properties
trunk/wao-business/src/main/resources/i18n/wao-business_fr_FR.properties
trunk/wao-business/src/test/java/fr/ifremer/wao/TestManager.java
trunk/wao-ui/pom.xml
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/components/Layout.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/AppModule.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/WaoManager.java
trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/components/Layout.tml
trunk/wao-ui/src/main/resources/i18n/wao-ui_en_GB.properties
trunk/wao-ui/src/main/resources/i18n/wao-ui_fr_FR.properties
trunk/wao-ui/src/main/webapp/ContactForm.tml
trunk/wao-ui/src/main/webapp/SamplingPlan.tml
trunk/wao-ui/src/main/webapp/Synthesis.tml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/pom.xml 2011-01-25 10:41:14 UTC (rev 941)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4labs</artifactId>
- <version>2.4.1</version>
+ <version>2.4.2</version>
</parent>
<groupId>fr.ifremer</groupId>
@@ -328,7 +328,7 @@
<labs.id>154</labs.id>
<!-- libraries version -->
- <nuitonI18nVersion>2.1-SNAPSHOT</nuitonI18nVersion>
+ <nuitonI18nVersion>2.1</nuitonI18nVersion>
<nuitonUtilsVersion>1.5.3</nuitonUtilsVersion>
<nuitonWebVersion>1.0-SNAPSHOT</nuitonWebVersion>
<topiaVersion>2.5</topiaVersion>
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/PostgresMigrationCallback.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/PostgresMigrationCallback.java 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/PostgresMigrationCallback.java 2011-01-25 10:41:14 UTC (rev 941)
@@ -25,6 +25,7 @@
package fr.ifremer.wao;
import fr.ifremer.wao.bean.ContactState;
+import fr.ifremer.wao.bean.DataReliability;
import fr.ifremer.wao.bean.ObsProgram;
import fr.ifremer.wao.bean.SynthesisId;
import fr.ifremer.wao.bean.UserRole;
@@ -450,8 +451,8 @@
/** Add a columns to Contact. */
@Override
protected void addDataReliability_1_6(List<String> queries) {
- // 3 is for DataReliability.UNKNOWN
- queries.add("ALTER TABLE Contact ADD dataReliabilityOrdinal SMALLINT NOT NULL DEFAULT 3;");
+ queries.add(String.format("ALTER TABLE Contact ADD dataReliabilityOrdinal SMALLINT NOT NULL DEFAULT %s;",
+ DataReliability.UNKNOWN.ordinal()));
}
@Override
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/WaoContext.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/WaoContext.java 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/WaoContext.java 2011-01-25 10:41:14 UTC (rev 941)
@@ -33,6 +33,7 @@
import java.nio.charset.Charset;
import java.util.Date;
+import java.util.Locale;
/**
*
@@ -200,5 +201,11 @@
*/
void closeTransaction(TopiaContext transaction);
+ /** set the locale that will be used in business entities
+ * to translate
+ * @param locale new locale
+ */
+ void setLocale(Locale locale);
+ Locale getLocale();
} //WaoContext
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/WaoContextImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/WaoContextImpl.java 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/WaoContextImpl.java 2011-01-25 10:41:14 UTC (rev 941)
@@ -88,6 +88,8 @@
private WaoServiceFactory serviceFactory;
+ protected String i18nBundle = "wao-i18n";
+
@Override
public Date getCurrentDate() {
if (currentDate == null) {
@@ -216,6 +218,14 @@
WaoDAOHelper.getImplementationClassesAsString());
}
+ public String getI18nBundle() {
+ return i18nBundle;
+ }
+
+ public void setI18nBundle(String i18nBundle) {
+ this.i18nBundle = i18nBundle;
+ }
+
/**
* Start of the application. The application configuration will be loaded
* automatically if needed using {@link #loadDefaultConfiguration }. Also
@@ -235,8 +245,8 @@
if (log.isInfoEnabled()) {
log.info("Start Wao");
}
- I18n.setInitializer(new DefaultI18nInitializer("wao-business"));
- I18n.init(Locale.FRANCE);
+ DefaultI18nInitializer defaultI18nInitializer = new DefaultI18nInitializer(getI18nBundle());
+ I18n.init(defaultI18nInitializer, null);
// Set context in WaoProperty enum to use easily method
// getValue() on WaoProperty
@@ -475,4 +485,21 @@
email.setCharset("UTF-8");
return email;
}
+
+ protected ThreadLocal<Locale> threadLocale = new ThreadLocal<Locale>() {
+ @Override
+ protected Locale initialValue() {
+ return Locale.FRENCH;
+ }
+ };
+
+ @Override
+ public void setLocale(Locale locale) {
+ threadLocale.set(locale);
+ }
+
+ @Override
+ public Locale getLocale() {
+ return threadLocale.get();
+ }
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/WaoUtils.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/WaoUtils.java 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/WaoUtils.java 2011-01-25 10:41:14 UTC (rev 941)
@@ -31,7 +31,10 @@
import org.slf4j.LoggerFactory;
import java.util.Date;
+import java.util.Locale;
+import static org.nuiton.i18n.I18n.l_;
+
/**
* Class only used for entities. The entities can't have WaoContext, so
* this utils class can use the current {@link WaoContext} in a static way.
@@ -114,6 +117,8 @@
context.sendEmail(to, subject, msg);
}
-
-
+ public static String translate(String i18nKey, Object... args) {
+ // return l_(context.getLocale(), i18nKey, args);
+ return l_(Locale.FRENCH, i18nKey, args);
+ }
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ContactPieChartConstant.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ContactPieChartConstant.java 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ContactPieChartConstant.java 2011-01-25 10:41:14 UTC (rev 941)
@@ -20,6 +20,8 @@
*/
package fr.ifremer.wao.bean;
+import fr.ifremer.wao.WaoUtils;
+
import static org.nuiton.i18n.I18n.n_;
/**
@@ -52,4 +54,9 @@
public String getColor() {
return color;
}
+
+ @Override
+ public String toString() {
+ return WaoUtils.translate(i18nKey);
+ }
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ContactState.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ContactState.java 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ContactState.java 2011-01-25 10:41:14 UTC (rev 941)
@@ -24,8 +24,7 @@
package fr.ifremer.wao.bean;
-import java.util.ArrayList;
-import java.util.List;
+import fr.ifremer.wao.WaoUtils;
import static org.nuiton.i18n.I18n.n_;
@@ -88,4 +87,9 @@
return null;
}
+ @Override
+ public String toString() {
+ return WaoUtils.translate(i18nKey);
+ }
+
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/bean/DataReliability.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/bean/DataReliability.java 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/bean/DataReliability.java 2011-01-25 10:41:14 UTC (rev 941)
@@ -20,7 +20,8 @@
*/
package fr.ifremer.wao.bean;
-import static org.nuiton.i18n.I18n._;
+import fr.ifremer.wao.WaoUtils;
+
import static org.nuiton.i18n.I18n.n_;
/**
@@ -38,16 +39,19 @@
RELIABLE(n_("DataReliability.RELIABLE")),
/** Data are doubtful (50% trust). */
- DOUBTFUL(n_("DataReliability.RELIABLE")),
+ DOUBTFUL(n_("DataReliability.DOUBTFUL")),
/** Data are not reliable (0% trust). */
- NOT_RELIABLE(n_("DataReliability.RELIABLE")),
+ NOT_RELIABLE(n_("DataReliability.NOT_RELIABLE")),
+ /** When Admin is waiting for a coordinator to correct data */
+ CORRECTION_ASKED(n_("DataReliability.CORRECTION_ASKED")),
+
/** Data reliability has not been evaluated yet (?% trust). */
- UNKNOWN(n_("DataReliability.RELIABLE")),
+ UNKNOWN(n_("DataReliability.UNKNOWN")),
/** Information has not been provided */
- NOT_PROVIDED(n_("DataReliability.RELIABLE"));
+ NOT_PROVIDED(n_("DataReliability.NOT_PROVIDED"));
/** An i18n key to make enumeration printable in logs and UI. */
protected String i18nKey;
@@ -56,10 +60,6 @@
this.i18nKey = i18nKey;
}
- public String getI18nKey() {
- return i18nKey;
- }
-
public static DataReliability valueOf(int ordinal) {
for (DataReliability dataReliability : DataReliability.values()) {
if (dataReliability.ordinal() == ordinal) {
@@ -68,4 +68,9 @@
}
return null;
}
+
+ @Override
+ public String toString() {
+ return WaoUtils.translate(i18nKey);
+ }
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/bean/GlobalIndicatorValue.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/bean/GlobalIndicatorValue.java 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/bean/GlobalIndicatorValue.java 2011-01-25 10:41:14 UTC (rev 941)
@@ -20,6 +20,8 @@
*/
package fr.ifremer.wao.bean;
+import fr.ifremer.wao.WaoUtils;
+
import static org.nuiton.i18n.I18n.n_;
public enum GlobalIndicatorValue {
@@ -40,10 +42,6 @@
this.i18nKey = i18nKey;
}
- public String getI18nKey() {
- return i18nKey;
- }
-
public static GlobalIndicatorValue valueOf(int ordinal) {
for (GlobalIndicatorValue globalIndicatorValue : GlobalIndicatorValue.values()) {
if (globalIndicatorValue.ordinal() == ordinal) {
@@ -52,4 +50,9 @@
}
return null;
}
+
+ @Override
+ public String toString() {
+ return WaoUtils.translate(i18nKey);
+ }
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/bean/LocationType.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/bean/LocationType.java 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/bean/LocationType.java 2011-01-25 10:41:14 UTC (rev 941)
@@ -1,5 +1,7 @@
package fr.ifremer.wao.bean;
+import fr.ifremer.wao.WaoUtils;
+
import static org.nuiton.i18n.I18n.n_;
public enum LocationType {
@@ -23,4 +25,9 @@
}
return null;
}
+
+ @Override
+ public String toString() {
+ return WaoUtils.translate(i18nKey);
+ }
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ObsProgram.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ObsProgram.java 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ObsProgram.java 2011-01-25 10:41:14 UTC (rev 941)
@@ -1,5 +1,7 @@
package fr.ifremer.wao.bean;
+import fr.ifremer.wao.WaoUtils;
+
import static org.nuiton.i18n.I18n.n_;
public enum ObsProgram {
@@ -22,7 +24,8 @@
return null;
}
- public String getI18nKey() {
- return i18nKey;
+ @Override
+ public String toString() {
+ return WaoUtils.translate(i18nKey);
}
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/bean/SamplingStrategy.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/bean/SamplingStrategy.java 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/bean/SamplingStrategy.java 2011-01-25 10:41:14 UTC (rev 941)
@@ -1,5 +1,7 @@
package fr.ifremer.wao.bean;
+import fr.ifremer.wao.WaoUtils;
+
import static org.nuiton.i18n.I18n.n_;
public enum SamplingStrategy {
@@ -9,10 +11,10 @@
SIMULTANEOUS_ALL_SPECIES(n_("SamplingStrategy.SIMULTANEOUS_ALL_SPECIES")),
SPECIFIC_STOCK(n_("SamplingStrategy.SPECIFIC_STOCK"));
- protected String i18nkey;
+ protected String i18nKey;
- SamplingStrategy(String i18nkey) {
- this.i18nkey = i18nkey;
+ SamplingStrategy(String i18nKey) {
+ this.i18nKey = i18nKey;
}
public static SamplingStrategy valueOf(int samplingStrategyOrdinal) {
@@ -23,4 +25,9 @@
}
throw new IllegalArgumentException("ordinal " + samplingStrategyOrdinal);
}
+
+ @Override
+ public String toString() {
+ return WaoUtils.translate(i18nKey);
+ }
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/bean/SynthesisId.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/bean/SynthesisId.java 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/bean/SynthesisId.java 2011-01-25 10:41:14 UTC (rev 941)
@@ -23,6 +23,8 @@
*/
package fr.ifremer.wao.bean;
+import fr.ifremer.wao.WaoUtils;
+
import static org.nuiton.i18n.I18n.n_;
/**
@@ -59,11 +61,6 @@
this.i18nKey = i18nKey;
}
- /** Get a translated name for the current value. */
- public String getI18nKey() {
- return i18nKey;
- }
-
public static SynthesisId valueOf(int ordinal) {
for (SynthesisId synthesisId : SynthesisId.values()) {
if (synthesisId.ordinal() == ordinal) {
@@ -72,4 +69,8 @@
}
return null;
}
+
+ public String toString() {
+ return WaoUtils.translate(i18nKey);
+ }
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/bean/UserRole.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/bean/UserRole.java 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/bean/UserRole.java 2011-01-25 10:41:14 UTC (rev 941)
@@ -24,13 +24,9 @@
package fr.ifremer.wao.bean;
+import fr.ifremer.wao.WaoUtils;
import fr.ifremer.wao.entity.WaoUser;
-import java.util.EnumSet;
-import java.util.HashSet;
-import java.util.Set;
-
-import static org.nuiton.i18n.I18n._;
import static org.nuiton.i18n.I18n.n_;
/**
@@ -59,10 +55,6 @@
this.i18nKey = i18nKey;
}
- public String getI18nKey() {
- return i18nKey;
- }
-
public static UserRole valueOf(int userRoleOrdinal) {
for (UserRole userRole : values()) {
if (userRole.ordinal() == userRoleOrdinal) {
@@ -71,4 +63,8 @@
}
throw new IllegalArgumentException("ordinal " + userRoleOrdinal);
}
+
+ public String toString() {
+ return WaoUtils.translate(i18nKey);
+ }
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/entity/ContactImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/entity/ContactImpl.java 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/entity/ContactImpl.java 2011-01-25 10:41:14 UTC (rev 941)
@@ -33,6 +33,7 @@
import org.slf4j.LoggerFactory;
import java.io.Serializable;
+import java.util.Collection;
import java.util.Date;
/**
@@ -130,4 +131,51 @@
super.setSampleRow(sampleRow);
setObsProgram(sampleRow.getObsProgram());
}
+
+ /** Value is still used but it's no longer written, it's now computed
+ * from the size of observers. */
+ protected void updateNbObservers() {
+ int nbObservers = 0;
+ if (getMainObserver() != null) {
+ nbObservers += 1;
+ }
+ nbObservers += sizeSecondaryObservers();
+ setNbObservants(nbObservers);
+ }
+
+ @Override
+ public void addSecondaryObservers(WaoUser secondaryObservers) {
+ super.addSecondaryObservers(secondaryObservers);
+ updateNbObservers();
+ }
+
+ @Override
+ public void addAllSecondaryObservers(Collection<WaoUser> secondaryObservers) {
+ super.addAllSecondaryObservers(secondaryObservers);
+ updateNbObservers();
+ }
+
+ @Override
+ public void setSecondaryObservers(Collection<WaoUser> secondaryObservers) {
+ super.setSecondaryObservers(secondaryObservers);
+ updateNbObservers();
+ }
+
+ @Override
+ public void removeSecondaryObservers(WaoUser secondaryObservers) {
+ super.removeSecondaryObservers(secondaryObservers);
+ updateNbObservers();
+ }
+
+ @Override
+ public void clearSecondaryObservers() {
+ super.clearSecondaryObservers();
+ updateNbObservers();
+ }
+
+ @Override
+ public void setMainObserver(WaoUser mainObserver) {
+ super.setMainObserver(mainObserver);
+ updateNbObservers();
+ }
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/entity/UserProfileImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/entity/UserProfileImpl.java 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/entity/UserProfileImpl.java 2011-01-25 10:41:14 UTC (rev 941)
@@ -85,7 +85,7 @@
if (getObsProgramOrdinal() == null) {
result.append("<no program>");
} else {
- result.append(getObsProgram().getI18nKey());
+ result.append(getObsProgram().toString());
}
if (getCanWrite() == null) {
result.append("<no write access specified>");
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSynthesisImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSynthesisImpl.java 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSynthesisImpl.java 2011-01-25 10:41:14 UTC (rev 941)
@@ -1084,7 +1084,7 @@
logText += String.format(
"Modification du coefficient de l'indicateur « %s » " +
"(ancienne valeur = %s, nouvelle valeur = %s).\n\n",
- indicator.getSynthesisId().getI18nKey(),
+ indicator.getSynthesisId().toString(),
oldIndicator.getCoefficient(),
indicator.getCoefficient());
@@ -1111,7 +1111,7 @@
if (indicator.getSynthesisId() == null) {
changedIndicatorName = "Bilan de la synthèse globale";
} else {
- changedIndicatorName = indicator.getSynthesisId().getI18nKey();
+ changedIndicatorName = indicator.getSynthesisId().toString();
}
logText += String.format(
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceUserImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceUserImpl.java 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceUserImpl.java 2011-01-25 10:41:14 UTC (rev 941)
@@ -31,15 +31,12 @@
import fr.ifremer.wao.WaoException;
import fr.ifremer.wao.WaoProperty;
import fr.ifremer.wao.WaoQueryHelper;
-import fr.ifremer.wao.bean.BoatFilter;
-import fr.ifremer.wao.bean.BoatFilterImpl;
import fr.ifremer.wao.bean.ConnectedUser;
import fr.ifremer.wao.bean.ConnectedUserImpl;
import fr.ifremer.wao.bean.ObsProgram;
import fr.ifremer.wao.bean.SamplingFilter;
import fr.ifremer.wao.bean.SamplingFilterImpl;
import fr.ifremer.wao.bean.UserRole;
-import fr.ifremer.wao.entity.Boat;
import fr.ifremer.wao.entity.Company;
import fr.ifremer.wao.entity.CompanyDAO;
import fr.ifremer.wao.entity.Contact;
Modified: trunk/wao-business/src/main/resources/i18n/wao-business_en_GB.properties
===================================================================
--- trunk/wao-business/src/main/resources/i18n/wao-business_en_GB.properties 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-business/src/main/resources/i18n/wao-business_en_GB.properties 2011-01-25 10:41:14 UTC (rev 941)
@@ -7,6 +7,7 @@
ContactState.BOAT_REFUSED=Boarding refused
ContactState.BOAT_UNAVAILABLE=Not completed
ContactState.CONTACT_START=Contact started
+DataReliability.CORRECTION_ASKED=Correction asked
DataReliability.DOUBTFUL=Doubtful
DataReliability.NOT_PROVIDED=Not provided
DataReliability.NOT_RELIABLE=Non reliable
Modified: trunk/wao-business/src/main/resources/i18n/wao-business_fr_FR.properties
===================================================================
--- trunk/wao-business/src/main/resources/i18n/wao-business_fr_FR.properties 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-business/src/main/resources/i18n/wao-business_fr_FR.properties 2011-01-25 10:41:14 UTC (rev 941)
@@ -7,6 +7,7 @@
ContactState.BOAT_REFUSED=Refus
ContactState.BOAT_UNAVAILABLE=Non abouti
ContactState.CONTACT_START=Contact pris
+DataReliability.CORRECTION_ASKED=
DataReliability.DOUBTFUL=Douteuse
DataReliability.NOT_PROVIDED=Non contr\u00F4l\u00E9e
DataReliability.NOT_RELIABLE=Non exploitable
Modified: trunk/wao-business/src/test/java/fr/ifremer/wao/TestManager.java
===================================================================
--- trunk/wao-business/src/test/java/fr/ifremer/wao/TestManager.java 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-business/src/test/java/fr/ifremer/wao/TestManager.java 2011-01-25 10:41:14 UTC (rev 941)
@@ -75,6 +75,7 @@
configuration.setOptions(loadFileProperties("WaoTest.properties"));
context.loadConfiguration(configuration);
+ context.setI18nBundle("wao-business");
// Set currentDate to 23/10/2009
Calendar calendar = new GregorianCalendar(2009, 9, 23);
Modified: trunk/wao-ui/pom.xml
===================================================================
--- trunk/wao-ui/pom.xml 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-ui/pom.xml 2011-01-25 10:41:14 UTC (rev 941)
@@ -193,6 +193,15 @@
<bundleOutputName>app</bundleOutputName>
</configuration>
</execution>
+ <execution>
+ <id>make bundle for classpath</id>
+ <goals>
+ <goal>bundle</goal>
+ </goals>
+ <configuration>
+ <bundleOutputName>wao-i18n</bundleOutputName>
+ </configuration>
+ </execution>
</executions>
</plugin>
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/components/Layout.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/components/Layout.java 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/components/Layout.java 2011-01-25 10:41:14 UTC (rev 941)
@@ -35,12 +35,14 @@
import fr.ifremer.wao.ui.services.WaoManager;
import org.apache.tapestry5.BindingConstants;
import org.apache.tapestry5.ComponentResources;
+import org.apache.tapestry5.Link;
import org.apache.tapestry5.annotations.InjectComponent;
import org.apache.tapestry5.annotations.Log;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.annotations.Inject;
+import org.apache.tapestry5.services.PageRenderLinkSource;
import org.apache.tapestry5.services.PersistentLocale;
import org.apache.tapestry5.services.Request;
import org.slf4j.Logger;
@@ -147,6 +149,9 @@
@Inject
private ComponentResources resources;
+ @Inject
+ private PageRenderLinkSource pageRender;
+
public Map getMenuItems() {
if (menuItems == null) {
@@ -165,7 +170,9 @@
Class page = menuEntry.getValue();
if (serviceAuthentication.isAllowed(page)) {
- menuItems.put(page.getSimpleName(), linkName);
+ Link link = pageRender.createPageRenderLinkWithContext(page);
+ String url = link.toAbsoluteURI();
+ menuItems.put(url, linkName);
}
}
}
@@ -214,17 +221,9 @@
return Index.class;
}
- @Inject
- private PersistentLocale localeService;
-
@Log
Object onActionFromChangeLocale() {
- Locale currentLocale = localeService.get();
- if (Locale.FRENCH.equals(currentLocale)) {
- localeService.set(Locale.ENGLISH);
- } else {
- localeService.set(Locale.FRENCH);
- }
+ manager.changeLocale();
return this;
}
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java 2011-01-25 10:41:14 UTC (rev 941)
@@ -616,7 +616,7 @@
}
private OptionModel newUserRoleOption(UserRole role) {
- return new OptionModelImpl(messages.get(role.getI18nKey()), role);
+ return new OptionModelImpl(messages.get(role.toString()), role);
}
@Log
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/AppModule.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/AppModule.java 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/AppModule.java 2011-01-25 10:41:14 UTC (rev 941)
@@ -61,6 +61,7 @@
import org.apache.tapestry5.services.ApplicationStateManager;
import org.apache.tapestry5.services.ComponentRequestFilter;
import org.apache.tapestry5.services.PageRenderLinkSource;
+import org.apache.tapestry5.services.PersistentLocale;
import org.apache.tapestry5.services.Request;
import org.apache.tapestry5.services.RequestFilter;
import org.apache.tapestry5.services.RequestHandler;
@@ -112,8 +113,10 @@
*/
public static void contributeRegistryStartup(
OrderedConfiguration<Runnable> configuration,
- WaoManager manager, ServiceUser serviceUser) {
+ WaoManager manager, ServiceUser serviceUser,
+ PersistentLocale persistentLocale) {
manager.setServiceUser(serviceUser);
+ manager.setLocaleService(persistentLocale);
configuration.add("WaoStartup", manager);
}
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/WaoManager.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/WaoManager.java 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/WaoManager.java 2011-01-25 10:41:14 UTC (rev 941)
@@ -40,7 +40,9 @@
import org.apache.commons.lang.BooleanUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.tapestry5.ioc.Messages;
+import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.ioc.services.RegistryShutdownListener;
+import org.apache.tapestry5.services.PersistentLocale;
import org.nuiton.util.ApplicationConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -48,6 +50,7 @@
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
+import java.util.Locale;
/**
* WaoManager
@@ -65,6 +68,8 @@
private ServiceUser serviceUser;
+ private PersistentLocale localeService;
+
/**
* Constructor of WaoManager. It needs the WaoContext to start and stop.
*
@@ -84,6 +89,10 @@
this.serviceUser = serviceUser;
}
+ public void setLocaleService(PersistentLocale localeService) {
+ this.localeService = localeService;
+ }
+
/**
* Called to start the application.
*/
@@ -280,6 +289,15 @@
return result;
}
-
-
+ public void changeLocale() {
+ Locale currentLocale = localeService.get();
+ Locale newLocale;
+ if (Locale.ENGLISH.equals(currentLocale)) {
+ newLocale = Locale.FRENCH;
+ } else {
+ newLocale = Locale.ENGLISH;
+ }
+ localeService.set(newLocale);
+ context.setLocale(newLocale);
+ }
}
Modified: trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/components/Layout.tml
===================================================================
--- trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/components/Layout.tml 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-ui/src/main/resources/fr/ifremer/wao/ui/components/Layout.tml 2011-01-25 10:41:14 UTC (rev 941)
@@ -88,7 +88,7 @@
<ul class="clearfix" id="so-menu">
<li t:type="loop" source="menuItems.entrySet()" value="menuItem">
- <a href="${contextPath}/${menuItem.key}">${menuItem.value}</a>
+ <a href="${menuItem.key}">${menuItem.value}</a>
</li>
</ul>
Modified: trunk/wao-ui/src/main/resources/i18n/wao-ui_en_GB.properties
===================================================================
--- trunk/wao-ui/src/main/resources/i18n/wao-ui_en_GB.properties 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-ui/src/main/resources/i18n/wao-ui_en_GB.properties 2011-01-25 10:41:14 UTC (rev 941)
@@ -15,6 +15,8 @@
wao.ui.action.deleteContact.confirm=Are you sure you want to delete this contact ?
wao.ui.action.deleteNews=Delete this news
wao.ui.action.deleteNews.confirm=Are you sure you want to delete this news ?
+wao.ui.action.deleteSampleRow=Delete this sample row
+wao.ui.action.deleteSampleRow.confirm=Are you sure your want to delete this sample row ?
wao.ui.action.deleteUser=Delete this user
wao.ui.action.deleteUser.confirm=Are your sure you want to delete this user ?
wao.ui.action.edit=Edit
@@ -50,6 +52,7 @@
wao.ui.disclaimer.boats=Data your provide remains property of your company.Outside your company, only an administrator may access to your data for maintenance purpose. The administrator is someone from Ifremer.
wao.ui.email=e-mail address
wao.ui.entity.Boat=Boat
+wao.ui.entity.Boats=
wao.ui.entity.Company=Company
wao.ui.entity.Contact=Contact
wao.ui.entity.SampleRow=Sample row
@@ -221,7 +224,7 @@
wao.ui.synthesis.dataReliability.description=Percentage of the number of tides providing reliable data in relation to the total number of realized tides.
wao.ui.synthesis.dataReliability.title=Data reliability
wao.ui.synthesis.dataSampling.title=Tides data (realized / expected)
-wao.ui.synthesis.globalSynthesis.globalResult=Resultof the global synthesis
+wao.ui.synthesis.globalSynthesis.globalResult=Result of the global synthesis
wao.ui.synthesis.globalSynthesis.title=Global synthesis
wao.ui.synthesis.globalSynthesis.title.estimated=Global synthesis (according to estimations)
wao.ui.synthesis.log.description=This page show every modifications done since the beginning of the bounds of each levels and the coefficients of each indicators.
Modified: trunk/wao-ui/src/main/resources/i18n/wao-ui_fr_FR.properties
===================================================================
--- trunk/wao-ui/src/main/resources/i18n/wao-ui_fr_FR.properties 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-ui/src/main/resources/i18n/wao-ui_fr_FR.properties 2011-01-25 10:41:14 UTC (rev 941)
@@ -15,6 +15,8 @@
wao.ui.action.deleteContact.confirm=\u00CAtes-vous s\u00FBr de vouloir supprimer d\u00E9finitivement ce contact ?
wao.ui.action.deleteNews=Supprimer la nouvelle
wao.ui.action.deleteNews.confirm=\u00CAtes-vous s\u00FBr de vouloir supprimer d\u00E9finitivement cette nouvelle ?
+wao.ui.action.deleteSampleRow=Supprimer la ligne du plan
+wao.ui.action.deleteSampleRow.confirm=\u00CAtes-vous s\u00FBr de vouloir supprimer la ligne %s du plan ?
wao.ui.action.deleteUser=Supprimer l'utilisateur
wao.ui.action.deleteUser.confirm=\u00CAtes-vous s\u00FBr de vouloir supprimer l'utilisateur ?
wao.ui.action.edit=Modifier
@@ -50,6 +52,7 @@
wao.ui.disclaimer.boats=Les donn\u00E9es saisies dans cette page sont la propri\u00E9t\u00E9 exclusive de la soci\u00E9t\u00E9. En dehors de la soci\u00E9t\u00E9, seul l'administrateur peut les consulter pour des questions de maintenance sur le site. L'administrateur est une personne de l'Ifremer.
wao.ui.email=Adresse e-mail
wao.ui.entity.Boat=Navire
+wao.ui.entity.Boats=Navires
wao.ui.entity.Company=Soci\u00E9t\u00E9
wao.ui.entity.Contact=Contact
wao.ui.entity.SampleRow=Ligne du plan d'\u00E9chantillonnage
Modified: trunk/wao-ui/src/main/webapp/ContactForm.tml
===================================================================
--- trunk/wao-ui/src/main/webapp/ContactForm.tml 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-ui/src/main/webapp/ContactForm.tml 2011-01-25 10:41:14 UTC (rev 941)
@@ -109,10 +109,6 @@
${getLabelForEnum(contact.contactState)}
</div>
<div>
- <label>${message:wao.ui.field.Contact.nbObservants}</label>
- ${contact.nbObservants}
- </div>
- <div>
<label>${message:wao.ui.field.Contact.beginDate}</label>
<t:output value="contact.observationBeginDate" format="dateTimeFormat" />
</div>
@@ -184,10 +180,6 @@
<input t:type="select" t:id="contactState" t:value="contact.contactState" t:validate="required"/>
</div>
<div>
- <label for="nbObservants">${message:wao.ui.field.Contact.nbObservants}</label>
- <input t:type="textfield" t:id="nbObservants" t:value="contact.nbObservants" t:validate="required" size="2" />
- </div>
- <div>
<label for="beginDate">${message:wao.ui.field.Contact.beginDate}</label>
<input t:id="beginDate" value="contact.observationBeginDate" datePattern="${dateTimeFormatPattern}" timePicker="true" timePickerAdjacent="true" use24hrs="true" />
</div>
Modified: trunk/wao-ui/src/main/webapp/SamplingPlan.tml
===================================================================
--- trunk/wao-ui/src/main/webapp/SamplingPlan.tml 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-ui/src/main/webapp/SamplingPlan.tml 2011-01-25 10:41:14 UTC (rev 941)
@@ -299,10 +299,10 @@
<img src="${asset:context:}/img/boat-unavailable-22px.png" alt="Navire impossible" />
</p:else>
</t:if>
+ <a t:type="pagelink" t:page="sampleRowHistoric" t:context="row.code">
+ <img src="${asset:context:}/img/clock-22px.png" alt="Historique" title="Voir historique de la ligne"/>
+ </a>
</t:unless>
- <a t:type="pagelink" t:page="sampleRowHistoric" t:context="row.code">
- <img src="${asset:context:}/img/clock-22px.png" alt="Historique" title="Voir historique de la ligne"/>
- </a>
<t:if t:test="canEditSampleRow()">
<a t:type="pagelink" t:page="sampleRowForm" t:context="row.topiaId">
<img src="${asset:context:}/img/edit.png" alt="Modifier" title="Modifier la ligne"/>
Modified: trunk/wao-ui/src/main/webapp/Synthesis.tml
===================================================================
--- trunk/wao-ui/src/main/webapp/Synthesis.tml 2011-01-24 15:10:30 UTC (rev 940)
+++ trunk/wao-ui/src/main/webapp/Synthesis.tml 2011-01-25 10:41:14 UTC (rev 941)
@@ -396,11 +396,12 @@
<t:loop t:source="globalLevels" t:value="globalLevel">
<t:if test="highlightGlobalLevel()">
<td class="highlight selected">
- ${globalLevel.label}
+ ${getLabelForEnum(globalLevel)}
</td>
<p:else>
<td>
- ${globalLevel.label}
+ ${getLabelForEnum(globalLevel)}
+ ${globalLevel}
</td>
</p:else>
</t:if>
1
0
[Suiviobsmer-commits] r940 - in trunk: wao-business/src/main/java/fr/ifremer/wao/io/csv wao-business/src/main/java/fr/ifremer/wao/service wao-business/src/main/resources/i18n wao-business/src/main/xmi wao-business/src/test/java/fr/ifremer/wao wao-business/src/test/java/fr/ifremer/wao/entity wao-business/src/test/java/fr/ifremer/wao/service wao-ui/src/main/java/fr/ifremer/wao/ui/pages wao-ui/src/main/webapp
by bleny@users.labs.libre-entreprise.org 24 Jan '11
by bleny@users.labs.libre-entreprise.org 24 Jan '11
24 Jan '11
Author: bleny
Date: 2011-01-24 15:10:30 +0000 (Mon, 24 Jan 2011)
New Revision: 940
Log:
import/export for SamplingPlan
Modified:
trunk/wao-business/src/main/java/fr/ifremer/wao/io/csv/WaoCsvHeader.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceReferentialImpl.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java
trunk/wao-business/src/main/resources/i18n/wao-business_en_GB.properties
trunk/wao-business/src/main/resources/i18n/wao-business_fr_FR.properties
trunk/wao-business/src/main/xmi/wao.zargo
trunk/wao-business/src/test/java/fr/ifremer/wao/AbstractServiceTest.java
trunk/wao-business/src/test/java/fr/ifremer/wao/entity/BoatImplTest.java
trunk/wao-business/src/test/java/fr/ifremer/wao/service/ServiceBoatImplTest.java
trunk/wao-business/src/test/java/fr/ifremer/wao/service/ServiceSamplingImplTest.java
trunk/wao-business/src/test/java/fr/ifremer/wao/service/ServiceSynthesisImplTest.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java
trunk/wao-ui/src/main/webapp/SamplingPlan.tml
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/io/csv/WaoCsvHeader.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/io/csv/WaoCsvHeader.java 2011-01-22 18:35:15 UTC (rev 939)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/io/csv/WaoCsvHeader.java 2011-01-24 15:10:30 UTC (rev 940)
@@ -198,7 +198,9 @@
PLAN_DUREE_MOY(15, "Durée moyenne d'une marée (jours)"),
/** SampleRow comment **/
PLAN_COMMENT(17, "Commentaire"),
- PLAN_STRATEGIE(18, "Stratégie d'échantillonage");
+ PLAN_STRATEGIE(18, "Stratégie d'échantillonage"),
+ PLAN_LIEU_CODE(19, "Code quartier maritime"),
+ PLAN_LIEU_NOM(20, "Nom quartier maritime");
private int contactHeader;
@@ -263,7 +265,7 @@
public static int getTotalHeaders() {
// PLAN_COMMENT is the last column
- return PLAN_COMMENT.forSamplingCsv() + 1;
+ return PLAN_LIEU_NOM.forSamplingCsv() + 1;
}
public static SAMPLING getLastHeaderBeforeMonths() {
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceReferentialImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceReferentialImpl.java 2011-01-22 18:35:15 UTC (rev 939)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceReferentialImpl.java 2011-01-24 15:10:30 UTC (rev 940)
@@ -349,4 +349,14 @@
return result;
}
+
+ @Override
+ protected TerrestrialLocation executeGetTerrestrialDistrict(TopiaContext transaction, String districtCode) throws Exception {
+ TerrestrialLocationDAO dao = WaoDAOHelper.getTerrestrialLocationDAO(transaction);
+ Map<String, Object> properties = new HashMap<String, Object>();
+ properties.put(TerrestrialLocation.PROPERTY_LOCATION_TYPE_ORDINAL, null);
+ properties.put(TerrestrialLocation.PROPERTY_DISTRICT_CODE, districtCode);
+ TerrestrialLocation result = dao.findByProperties(properties);
+ return result;
+ }
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java 2011-01-22 18:35:15 UTC (rev 939)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java 2011-01-24 15:10:30 UTC (rev 940)
@@ -61,6 +61,7 @@
import fr.ifremer.wao.entity.SampleRowLogDAO;
import fr.ifremer.wao.entity.SampleRowLogImpl;
import fr.ifremer.wao.entity.TargetSpeciesDCF;
+import fr.ifremer.wao.entity.TerrestrialLocation;
import fr.ifremer.wao.entity.WaoUser;
import fr.ifremer.wao.io.ImportResults;
import fr.ifremer.wao.io.ImportResultsImpl;
@@ -870,6 +871,13 @@
export.record(SAMPLING.PLAN_DUREE_MOY, numberFormat.format(row.getAverageTideTime()));
export.record(SAMPLING.PLAN_COMMENT, String.valueOf(row.getComment()));
export.record(SAMPLING.PLAN_STRATEGIE, row.getSamplingStrategy().name());
+ if (row.getTerrestrialLocation() != null) {
+ if (row.getTerrestrialLocation().getDistrictCode() != null) {
+ export.record(SAMPLING.PLAN_LIEU_CODE, row.getTerrestrialLocation().getDistrictCode());
+ String districtName = row.getTerrestrialLocation().getDistrictName();
+ export.record(SAMPLING.PLAN_LIEU_NOM, districtName == null ? "Autre" : districtName);
+ }
+ }
export.recordMonths(row);
@@ -889,10 +897,9 @@
}
@Override
- public ImportResults executeImportSamplingPlanCsv(TopiaContext transaction,
- List<Object> errorArgs, InputStream input)
- throws WaoBusinessException, IOException,
- TopiaException, ParseException {
+ public ImportResults executeImportSamplingPlanCsv(TopiaContext transaction, List<Object> errorArgs,
+ InputStream input, ObsProgram obsProgram) throws WaoBusinessException, IOException,
+ TopiaException, ParseException {
ImportResults result = new ImportResultsImpl();
int currRow = 0;
@@ -941,6 +948,7 @@
result.incNbRefused(); //nbRefused++;
} else {
row = dao.create(SampleRow.PROPERTY_CODE, code);
+ row.setObsProgram(obsProgram);
String companyName = ImportHelper.read(reader, SAMPLING.SOCIETE_NOM);
@@ -1106,6 +1114,19 @@
sampleRow.setPeriodEnd(period.getThruDate());
sampleRow.setComment(comment);
+ String districtCode = ImportHelper.read(reader, SAMPLING.PLAN_LIEU_CODE);
+ ServiceReferential serviceReferential = context.getServiceFactory().getServiceReferential();
+ if (StringUtils.isBlank(districtCode)) {
+ String districtName = ImportHelper.read(reader, SAMPLING.PLAN_LIEU_NOM);
+ if (districtName != null && districtName.equals("Autre")) {
+ TerrestrialLocation district = serviceReferential.getTerrestrialDistrict(null);
+ sampleRow.setTerrestrialLocation(district);
+ }
+ } else {
+ TerrestrialLocation district = serviceReferential.getTerrestrialDistrict(districtCode);
+ sampleRow.setTerrestrialLocation(district);
+ }
+
String codeDCF5 = ImportHelper.read(reader, SAMPLING.METIER_CODE_DCF5);
codeDCF5 = codeDCF5.trim();
// a trick, nullSampleRow is just intantiated to user the parsing
Modified: trunk/wao-business/src/main/resources/i18n/wao-business_en_GB.properties
===================================================================
--- trunk/wao-business/src/main/resources/i18n/wao-business_en_GB.properties 2011-01-22 18:35:15 UTC (rev 939)
+++ trunk/wao-business/src/main/resources/i18n/wao-business_en_GB.properties 2011-01-24 15:10:30 UTC (rev 940)
@@ -150,6 +150,7 @@
wao.error.serviceReferential.getFishingZones=
wao.error.serviceReferential.getProfessions=
wao.error.serviceReferential.getSectors=
+wao.error.serviceReferential.getTerrestrialDistrict=
wao.error.serviceReferential.importDCFcodes=
wao.error.serviceReferential.importFishingZoneCsv=
wao.error.serviceReferential.importTerrestrialLocations=
Modified: trunk/wao-business/src/main/resources/i18n/wao-business_fr_FR.properties
===================================================================
--- trunk/wao-business/src/main/resources/i18n/wao-business_fr_FR.properties 2011-01-22 18:35:15 UTC (rev 939)
+++ trunk/wao-business/src/main/resources/i18n/wao-business_fr_FR.properties 2011-01-24 15:10:30 UTC (rev 940)
@@ -161,6 +161,7 @@
wao.error.serviceReferential.getFishingZones=Impossible de charger la liste des secteurs de p\u00EAche
wao.error.serviceReferential.getProfessions=Impossible de charger la liste des m\u00E9tiers
wao.error.serviceReferential.getSectors=Impossible de charger la liste des zones de p\u00EAche
+wao.error.serviceReferential.getTerrestrialDistrict=
wao.error.serviceReferential.importDCFcodes=Impossible de cr\u00E9er le r\u00E9f\u00E9rentiel des codes DCF
wao.error.serviceReferential.importFishingZoneCsv=Probl\u00E8me d'import du fichier CSV. V\u00E9rifiez l'en-t\u00EAte du fichier \: [ PECHE_DIVISION,PECHE_ZONE,PECHE_FACADE ]. Voir documentation pour plus de d\u00E9tails.
wao.error.serviceReferential.importTerrestrialLocations=
Modified: trunk/wao-business/src/main/xmi/wao.zargo
===================================================================
(Binary files differ)
Modified: trunk/wao-business/src/test/java/fr/ifremer/wao/AbstractServiceTest.java
===================================================================
--- trunk/wao-business/src/test/java/fr/ifremer/wao/AbstractServiceTest.java 2011-01-22 18:35:15 UTC (rev 939)
+++ trunk/wao-business/src/test/java/fr/ifremer/wao/AbstractServiceTest.java 2011-01-24 15:10:30 UTC (rev 940)
@@ -22,6 +22,7 @@
package fr.ifremer.wao;
import fr.ifremer.wao.bean.ContactState;
+import fr.ifremer.wao.bean.ObsProgram;
import fr.ifremer.wao.bean.UserRole;
import fr.ifremer.wao.entity.Boat;
import fr.ifremer.wao.entity.BoatDAO;
@@ -551,7 +552,7 @@
input = getClass().getResourceAsStream("/import/echantillonnage.csv");
ServiceSampling serviceSampling = manager.getServiceSampling();
- serviceSampling.importSamplingPlanCsv(input);
+ serviceSampling.importSamplingPlanCsv(input, ObsProgram.OBSMER);
SampleRowDAO rowDAO = WaoDAOHelper.getSampleRowDAO(transaction);
SampleRow row = rowDAO.findByCode("2010_0001");
Modified: trunk/wao-business/src/test/java/fr/ifremer/wao/entity/BoatImplTest.java
===================================================================
--- trunk/wao-business/src/test/java/fr/ifremer/wao/entity/BoatImplTest.java 2011-01-22 18:35:15 UTC (rev 939)
+++ trunk/wao-business/src/test/java/fr/ifremer/wao/entity/BoatImplTest.java 2011-01-24 15:10:30 UTC (rev 940)
@@ -118,7 +118,7 @@
ServiceSampling serviceSampling = manager.getServiceSampling();
input = getClass().getResourceAsStream("/import/echantillonnage.csv");
- serviceSampling.importSamplingPlanCsv(input);
+ serviceSampling.importSamplingPlanCsv(input, ObsProgram.OBSMER);
SampleRowDAO rowDAO = WaoDAOHelper.getSampleRowDAO(transaction);
SampleRow row = rowDAO.findByCode("2010_0001");
@@ -211,7 +211,7 @@
ServiceSampling serviceSampling = manager.getServiceSampling();
input = getClass().getResourceAsStream("/import/echantillonnage.csv");
- serviceSampling.importSamplingPlanCsv(input);
+ serviceSampling.importSamplingPlanCsv(input, ObsProgram.OBSMER);
SampleRowDAO rowDAO = WaoDAOHelper.getSampleRowDAO(transaction);
SampleRow row = rowDAO.findByCode("2010_0001");
Modified: trunk/wao-business/src/test/java/fr/ifremer/wao/service/ServiceBoatImplTest.java
===================================================================
--- trunk/wao-business/src/test/java/fr/ifremer/wao/service/ServiceBoatImplTest.java 2011-01-22 18:35:15 UTC (rev 939)
+++ trunk/wao-business/src/test/java/fr/ifremer/wao/service/ServiceBoatImplTest.java 2011-01-24 15:10:30 UTC (rev 940)
@@ -237,7 +237,7 @@
ServiceSampling serviceSampling = manager.getServiceSampling();
input = getClass().getResourceAsStream("/import/echantillonnage.csv");
- serviceSampling.importSamplingPlanCsv(input);
+ serviceSampling.importSamplingPlanCsv(input, ObsProgram.OBSMER);
// Get two SampleRows : 2009_3 & 2010_4
SampleRowDAO rowDAO = WaoDAOHelper.getSampleRowDAO(transaction);
Modified: trunk/wao-business/src/test/java/fr/ifremer/wao/service/ServiceSamplingImplTest.java
===================================================================
--- trunk/wao-business/src/test/java/fr/ifremer/wao/service/ServiceSamplingImplTest.java 2011-01-22 18:35:15 UTC (rev 939)
+++ trunk/wao-business/src/test/java/fr/ifremer/wao/service/ServiceSamplingImplTest.java 2011-01-24 15:10:30 UTC (rev 940)
@@ -414,7 +414,7 @@
transaction.closeContext();
InputStream input = getClass().getResourceAsStream("/import/echantillonnage.csv");
- serviceSampling.importSamplingPlanCsv(input);
+ serviceSampling.importSamplingPlanCsv(input, ObsProgram.OBSMER);
/** EXEC METHOD **/
SamplingFilter filter = new SamplingFilterImpl();
@@ -497,7 +497,7 @@
InputStream input = getClass().getResourceAsStream("/import/echantillonnage.csv");
- serviceSampling.importSamplingPlanCsv(input);
+ serviceSampling.importSamplingPlanCsv(input, ObsProgram.OBSMER);
SampleRowDAO rowDAO = WaoDAOHelper.getSampleRowDAO(transaction);
SampleRow row = rowDAO.findByCode("2010_0001");
@@ -571,7 +571,7 @@
/** EXEC METHOD **/
InputStream input = getClass().getResourceAsStream("/import/echantillonnage.csv");
- ImportResults result = serviceSampling.importSamplingPlanCsv(input);
+ ImportResults result = serviceSampling.importSamplingPlanCsv(input, ObsProgram.OBSMER);
// total imported
assertEquals(12, result.getNbRowsImported());
@@ -638,7 +638,7 @@
transaction.closeContext();
InputStream input = getClass().getResourceAsStream("/import/echantillonnage.csv");
- serviceSampling.importSamplingPlanCsv(input);
+ serviceSampling.importSamplingPlanCsv(input, ObsProgram.OBSMER);
/** EXEC METHOD **/
List<String> programs = serviceSampling.getPrograms(null);
@@ -665,7 +665,7 @@
ServiceSampling serviceSampling = manager.getServiceSampling();
InputStream input = getClass().getResourceAsStream("/import/echantillonnage.csv");
- serviceSampling.importSamplingPlanCsv(input);
+ serviceSampling.importSamplingPlanCsv(input, ObsProgram.OBSMER);
transaction.closeContext();
Modified: trunk/wao-business/src/test/java/fr/ifremer/wao/service/ServiceSynthesisImplTest.java
===================================================================
--- trunk/wao-business/src/test/java/fr/ifremer/wao/service/ServiceSynthesisImplTest.java 2011-01-22 18:35:15 UTC (rev 939)
+++ trunk/wao-business/src/test/java/fr/ifremer/wao/service/ServiceSynthesisImplTest.java 2011-01-24 15:10:30 UTC (rev 940)
@@ -30,6 +30,7 @@
import fr.ifremer.wao.bean.ContactAverageReactivity;
import fr.ifremer.wao.bean.ContactState;
import fr.ifremer.wao.bean.ContactStateStatistics;
+import fr.ifremer.wao.bean.ObsProgram;
import fr.ifremer.wao.bean.SamplingFilter;
import fr.ifremer.wao.bean.SamplingFilterImpl;
import fr.ifremer.wao.entity.Boat;
@@ -142,7 +143,7 @@
input = getClass().getResourceAsStream("/import/echantillonnage.csv");
ServiceSampling serviceSampling = manager.getServiceSampling();
- serviceSampling.importSamplingPlanCsv(input);
+ serviceSampling.importSamplingPlanCsv(input, ObsProgram.OBSMER);
SampleRowDAO rowDAO = WaoDAOHelper.getSampleRowDAO(transaction);
SampleRow row = rowDAO.findByCode("2010_0001");
@@ -232,7 +233,7 @@
input = getClass().getResourceAsStream("/import/echantillonnage.csv");
ServiceSampling serviceSampling = manager.getServiceSampling();
- serviceSampling.importSamplingPlanCsv(input);
+ serviceSampling.importSamplingPlanCsv(input, ObsProgram.OBSMER);
SampleRowDAO rowDAO = WaoDAOHelper.getSampleRowDAO(transaction);
SampleRow row = rowDAO.findByCode("2010_0001");
@@ -514,7 +515,7 @@
input = getClass().getResourceAsStream("/import/echantillonnage.csv");
ServiceSampling serviceSampling = manager.getServiceSampling();
- serviceSampling.importSamplingPlanCsv(input);
+ serviceSampling.importSamplingPlanCsv(input, ObsProgram.OBSMER);
SampleRowDAO rowDAO = WaoDAOHelper.getSampleRowDAO(transaction);
SampleRow row = rowDAO.findByCode("2010_0001");
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java 2011-01-22 18:35:15 UTC (rev 939)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java 2011-01-24 15:10:30 UTC (rev 940)
@@ -206,7 +206,8 @@
@Override
public ImportResults execute(InputStream input)
throws WaoException, WaoBusinessException {
- ImportResults results = serviceSampling.importSamplingPlanCsv(input);
+ ImportResults results = serviceSampling.importSamplingPlanCsv(input,
+ currentUser.getProfile().getObsProgram());
return results;
}
};
Modified: trunk/wao-ui/src/main/webapp/SamplingPlan.tml
===================================================================
--- trunk/wao-ui/src/main/webapp/SamplingPlan.tml 2011-01-22 18:35:15 UTC (rev 939)
+++ trunk/wao-ui/src/main/webapp/SamplingPlan.tml 2011-01-24 15:10:30 UTC (rev 940)
@@ -293,10 +293,10 @@
<t:unless t:test="user.guest">
<t:if t:test="rowNotFinished">
<a t:type="pagelink" t:page="boats" t:context="row.topiaId">
- <img src="${asset:context:}/img/boat.png" alt="Navire" title="Voir les navires éligibles pour cette ligne"/>
+ <img src="${asset:context:}/img/boat.png" alt="${message:wao.ui.entity.Boats}" />
</a>
<p:else>
- <img src="${asset:context:}/img/boat-unavailable-22px.png" alt="Navire impossible" title="Accès aux navires impossible, ligne terminée"/>
+ <img src="${asset:context:}/img/boat-unavailable-22px.png" alt="Navire impossible" />
</p:else>
</t:if>
</t:unless>
@@ -308,12 +308,12 @@
<img src="${asset:context:}/img/edit.png" alt="Modifier" title="Modifier la ligne"/>
</a>
<t:unless t:test="row.hasSampleMonthRealTideTime()">
- <a t:type="actionlink" t:id="deleteSampleRow" t:context="rowIndex" title="Supprimer la ligne d'échantillon"
- t:mixins="nuiton/confirm" t:message="format:sampleRow-delete-confirmMessage=row.code">
- <img src="${asset:context:}/img/delete2.png" alt="Supprimer" title="Supprimer la ligne"/>
+ <a t:type="actionlink" t:id="deleteSampleRow" t:context="rowIndex" title="${message:wao.ui.action.deleteSampleRow}"
+ t:mixins="nuiton/confirm" t:message="${format:wao.ui.action.deleteSampleRow.confirm=row.code}">
+ <img src="${asset:context:}/img/delete2.png" alt="${message:wao.ui.action.deleteSampleRow}" />
</a>
<p:else>
- <img src="${asset:context:}/img/delete-unavailable-22px.png" alt="Supprimer indisponible" title="Suppression de la ligne indisponible"/>
+ <img src="${asset:context:}/img/delete-unavailable-22px.png" alt="${message:wao.ui.unavailableOperation}" />
</p:else>
</t:unless>
</t:if>
1
0
[Suiviobsmer-commits] r939 - trunk/wao-business/src/main/java/fr/ifremer/wao/service
by bleny@users.labs.libre-entreprise.org 22 Jan '11
by bleny@users.labs.libre-entreprise.org 22 Jan '11
22 Jan '11
Author: bleny
Date: 2011-01-22 18:35:15 +0000 (Sat, 22 Jan 2011)
New Revision: 939
Log:
better management of field remanence
Modified:
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactImpl.java
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactImpl.java 2011-01-22 18:06:10 UTC (rev 938)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactImpl.java 2011-01-22 18:35:15 UTC (rev 939)
@@ -258,9 +258,17 @@
properties.put(Contact.PROPERTY_OBS_PROGRAM_ORDINAL, ObsProgram.OBSVENTE.ordinal());
properties.put(Contact.PROPERTY_SAMPLE_ROW, row);
properties.put(Contact.PROPERTY_MAIN_OBSERVER, user);
+ Date now = context.getCurrentDate();
+ Date today = DateUtil.setMinTimeOfDay(now);
+ properties.put(Contact.TOPIA_CREATE_DATE, today);
Contact similarContact = dao.findByProperties(properties);
+
if (similarContact != null) {
+ if (log.isDebugEnabled()) {
+ log.debug("similar contact found to pre-fill values of contact : "
+ + contact.getTopiaId());
+ }
newContact.setObservationBeginDate(similarContact.getObservationBeginDate());
newContact.setObservationEndDate(similarContact.getObservationEndDate());
newContact.setTerrestrialLocation(similarContact.getTerrestrialLocation());
@@ -269,7 +277,7 @@
}
}
- saveContact(newContact, Boolean.FALSE);
+ saveContact(newContact, false);
return newContact;
}
1
0
[Suiviobsmer-commits] r938 - in trunk/wao-ui/src/main: java/fr/ifremer/wao/ui/pages webapp
by bleny@users.labs.libre-entreprise.org 22 Jan '11
by bleny@users.labs.libre-entreprise.org 22 Jan '11
22 Jan '11
Author: bleny
Date: 2011-01-22 18:06:10 +0000 (Sat, 22 Jan 2011)
New Revision: 938
Log:
fix sampleRowForm (submitContext removed)
Modified:
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java
trunk/wao-ui/src/main/webapp/SampleRowForm.tml
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java 2011-01-22 17:36:21 UTC (rev 937)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java 2011-01-22 18:06:10 UTC (rev 938)
@@ -529,20 +529,6 @@
}
}
- @Log
- void onSelectedFromDeleteMonth(int index) throws WaoException {
- // SampleMonth month = getSampleMonths().remove(index);
- List<SampleMonth> sampleMonths = new ArrayList<SampleMonth>(getSampleMonths());
- SampleMonth removedMonth = sampleMonths.get(index);
- sampleMonths.remove(removedMonth);
- removedMonth.removePropertyChangeListener(
- SampleMonth.PROPERTY_EXPECTED_TIDES_VALUE, propertyChange);
-// month.removePropertyChangeListener(
-// SampleMonth.PROPERTY_EXPECTED_TIDES_VALUE, propertyChange);
- this.sampleMonths = sampleMonths;
- edited = true;
- }
-
/*************************** SAMPLE ROW ***********************************/
private String sampleRowId;
@@ -646,6 +632,17 @@
getTerrestrialLocationSelectModel().findObject(terrestrialLocationId));
}
+ // remove sampleMonths with "-1" as value, it should be removed
+ // to mean that no observation should be done this month
+ List<SampleMonth> sampleMonths = new ArrayList<SampleMonth>();
+ for (SampleMonth sampleMonth : getSampleMonths()) {
+ if (sampleMonth.getExpectedTidesValue() != -1) {
+ sampleMonths.add(sampleMonth);
+ }
+ }
+ getSampleRow().clearSampleMonth();
+ getSampleRow().addAllSampleMonth(sampleMonths);
+
try {
// Only for save or periodChanged (refreshMonth)
if (!cancel && !edited) {
Modified: trunk/wao-ui/src/main/webapp/SampleRowForm.tml
===================================================================
--- trunk/wao-ui/src/main/webapp/SampleRowForm.tml 2011-01-22 17:36:21 UTC (rev 937)
+++ trunk/wao-ui/src/main/webapp/SampleRowForm.tml 2011-01-22 18:06:10 UTC (rev 938)
@@ -152,17 +152,7 @@
<tr class="firstRow">
<td t:type="loop" class="acenter" volatile="true" t:source="sampleMonths" t:value="sampleMonth" t:index="monthIndex">
<t:output value="sampleMonth.periodDate" format="dateFormat" />
- <t:unless t:test="sampleMonth.realTidesValue">
- <!--input t:type="submitContext" class="ico16px suppr" t:defer="false" t:id="deleteMonth" value="${message:wao.ui.action.delete}" t:context="monthIndex" /-->
- <input t:type="submit" class="ico16px suppr" t:defer="false" t:id="deleteMonth" value="${message:wao.ui.action.delete}" t:context="monthIndex" />
- <p:else>
- <img src="${asset:context:}/img/suppr-unavailable-16px.png" alt="${message:wao.ui.unavailableOperation}" />
- </p:else>
- </t:unless>
</td>
-<!-- <td t:type="loop" t:source="months" t:value="month" volatile="true">
- <t:output value="month" format="dateFormat" />
- </td>-->
</tr>
<tr>
<td t:type="loop" class="acenter" volatile="true" t:source="sampleMonths" t:value="sampleMonth">
1
0
[Suiviobsmer-commits] r937 - trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services
by bleny@users.labs.libre-entreprise.org 22 Jan '11
by bleny@users.labs.libre-entreprise.org 22 Jan '11
22 Jan '11
Author: bleny
Date: 2011-01-22 17:36:21 +0000 (Sat, 22 Jan 2011)
New Revision: 937
Log:
fix bug in cartography due to a change on how Tapestry manage URL since 5.2.2
Modified:
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/ServiceChartImpl.java
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/ServiceChartImpl.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/ServiceChartImpl.java 2011-01-21 16:45:45 UTC (rev 936)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/ServiceChartImpl.java 2011-01-22 17:36:21 UTC (rev 937)
@@ -56,14 +56,11 @@
Link link = pageRender.createPageRenderLinkWithContext(
PieChart.class, data, size, thumb);
- return getBaseUrl() + link.toAbsoluteURI();
+ String url = link.toAbsoluteURI();
+ if (logger.isDebugEnabled()) {
+ logger.debug("url for piechart : " + url);
+ }
+ return url;
}
- @Override
- protected String getBaseUrl() {
- // Get only the first element in the server_path which is the host name of the server
- String[] res = WaoProperty.SERVER_PATH.getValue().split("/");
- return "http://" + res[0];
- }
-
}
1
0