Wao-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- 2352 discussions
[Suiviobsmer-commits] r163 - in trunk/suiviobsmer-business/src/main: java/fr/ifremer/suiviobsmer java/fr/ifremer/suiviobsmer/bean java/fr/ifremer/suiviobsmer/impl java/fr/ifremer/suiviobsmer/mock xmi
by fdesbois@users.labs.libre-entreprise.org 05 Jan '10
by fdesbois@users.labs.libre-entreprise.org 05 Jan '10
05 Jan '10
Author: fdesbois
Date: 2010-01-05 09:55:40 +0000 (Tue, 05 Jan 2010)
New Revision: 163
Added:
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/ImportHelper.java
Modified:
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/ContactState.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ActivityCalendarImport.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceContactImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceReferentialImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceContactMock.java
trunk/suiviobsmer-business/src/main/xmi/suiviobsmer.zargo
Log:
- Add ImportHelper to simplify CSV headers managment
- Improve imports
- Add import/export for contacts
Added: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/ImportHelper.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/ImportHelper.java (rev 0)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/ImportHelper.java 2010-01-05 09:55:40 UTC (rev 163)
@@ -0,0 +1,235 @@
+
+package fr.ifremer.suiviobsmer;
+
+import org.apache.commons.lang.BooleanUtils;
+import org.apache.commons.lang.time.DurationFormatUtils;
+import org.slf4j.Logger;
+
+/**
+ * ImportHelper
+ *
+ * Created: 4 janv. 2010
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public class ImportHelper {
+
+ /**
+ * CSV headers for Boat
+ */
+ public static enum BOAT {
+ /** Boat immatriculation **/
+ NAVS_COD(19),
+ /** Boat name **/
+ CARN_NOM(20),
+ /** Boat length **/
+ CARN_LONGUEUR_HT(-1),
+ /** Boat build year **/
+ CARN_ANNEE(-1),
+ /** Boat district code **/
+ QUARTIER_IMMA(21),
+ /** ShipOwner code **/
+ PER_COD(-1),
+ /** ShipOwner last name **/
+ PER_NOM(-1),
+ /** ShipOwner first name **/
+ PER_PRENOM(-1),
+ /** Boat active **/
+ NAVS_ACTIVE(-1);
+
+ int contactHeader;
+
+ BOAT(int index) {
+ this.contactHeader = index;
+ }
+
+ public int forContactCsv() {
+ return contactHeader;
+ }
+ }
+
+ /**
+ * CSV headers for SamplingPlan
+ */
+ public static enum SAMPLING {
+ /** SampleRow code **/
+ PLAN_CODE(5),
+ /** Program code **/
+ PROGRAMME_CODE(6),
+ /** Program period begin **/
+ PROGRAMME_DEBUT(7),
+ /** Program period end **/
+ PROGRAMME_FIN(8),
+ /** FishingZone other infos **/
+ PECHE_AUTRE(12),
+ /** Profession code DCF5 **/
+ METIER_CODE_DCF5(13),
+ /** Profession mesh size **/
+ METIER_MAILLAGE(14),
+ /** Profession size **/
+ METIER_TAILLE(15),
+ /** Profession other infos **/
+ METIER_AUTRE(16),
+ /** Profession libelle **/
+ METIER_LIBELLE(17),
+ /** Profession species **/
+ METIER_ESPECES(18),
+ /** SampleRow nb observants **/
+ PLAN_NB_OBSERV(-1),
+ /** SampleRow average tide time **/
+ PLAN_DUREE_MOY(-1);
+
+ int contactHeader;
+
+ SAMPLING(int index) {
+ this.contactHeader = index;
+ }
+
+ public int forContactCsv() {
+ return contactHeader;
+ }
+ }
+
+ /**
+ * CSV headers for FishingZone
+ */
+ public static enum FISHING_ZONE {
+ /** FishingZone facade **/
+ PECHE_FACADE(9),
+ /** FishingZone sector **/
+ PECHE_ZONE(10),
+ /** FishingZone district code **/
+ PECHE_DIVISION(11);
+
+ int contactHeader;
+
+ FISHING_ZONE(int index) {
+ this.contactHeader = index;
+ }
+
+ public int forContactCsv() {
+ return contactHeader;
+ }
+ }
+
+ /**
+ * CSV headers for Contact
+ */
+ public static enum CONTACT {
+ /** Contact create date **/
+ CONT_CREATION(0),
+ /** User id **/
+ OBSERV_ID(1),
+ /** User prenom **/
+ OBSERV_PRENOM(2),
+ /** User nom **/
+ OBSERV_NOM(3),
+ /** Company id **/
+ //SOCIETE_ID,
+ /** Company nom **/
+ SOCIETE_NOM(4),
+ /** Contact state **/
+ CONT_ETAT(22),
+ /** Contact tide begin **/
+ CONT_DEBUT_MAREE(23),
+ /** Contact tide end **/
+ CONT_FIN_MAREE(24),
+ /** Contact nb observants **/
+ CONT_NB_OBSERV(25),
+ /** Contact mammals capture **/
+ CONT_MAM_CAPT(26),
+ /** Contact mammals observation **/
+ CONT_MAM_OBS(27),
+ /** Contact comment **/
+ CONT_COMMENT(28),
+ /** Contact data input **/
+ CONT_ALLEGRO(29),
+ /** Contact company validation **/
+ CONT_SOCIETE_VALID(30),
+ /** Contact program validation **/
+ CONT_PROGRAM_VALID(31);
+
+ int contactHeader;
+
+ CONTACT(int index) {
+ this.contactHeader = index;
+ }
+
+ public int forContactCsv() {
+ return contactHeader;
+ }
+ }
+
+ public static int CONTACT_NB_HEADERS = 31;
+
+ public static String getHeaderForContactCsv(int index) {
+ for (BOAT boatEnum : BOAT.values()) {
+ if (boatEnum.forContactCsv() == index) {
+ return boatEnum.name();
+ }
+ }
+ for (SAMPLING samplingEnum : SAMPLING.values()) {
+ if (samplingEnum.forContactCsv() == index) {
+ return samplingEnum.name();
+ }
+ }
+ for (FISHING_ZONE zoneEnum : FISHING_ZONE.values()) {
+ if (zoneEnum.forContactCsv() == index) {
+ return zoneEnum.name();
+ }
+ }
+ for (CONTACT contactEnum : CONTACT.values()) {
+ if (contactEnum.forContactCsv() == index) {
+ return contactEnum.name();
+ }
+ }
+ return "";
+ }
+
+ public static String formatContactValidation(Boolean validation) {
+ String valid = "";
+ if (validation == null) {
+ valid = "N";
+ } else if (BooleanUtils.isTrue(validation)) {
+ valid = "A";
+ } else {
+ valid = "R";
+ }
+ return valid;
+ }
+//
+// public static Boolean parseContactValidation(String validation) {
+// if (validation.equals("A")) {
+// return Boolean.TRUE;
+// } else if (validation.equals("R")) {
+// return Boolean.FALSE;
+// }
+// return null;
+// }
+
+ public static String formatContactMammals(boolean mammals) {
+ return mammals ? "X" : "";
+ }
+
+ public static boolean parseContactMammals(String mammals) {
+ return mammals.equals("X");
+ }
+
+ public static long logTimeAndMemory(Logger log, long tic1, String msg) {
+ if (log.isInfoEnabled()) {
+ log.info("RUNNING... Import : " + msg);
+ Runtime runtime = Runtime.getRuntime();
+ long mem = (runtime.totalMemory() - runtime.freeMemory()) / 1048576;
+ //long memMega = mem / 1024 / 1024;
+ log.info("Memory : " + mem + " Mo");
+ long tic2 = System.currentTimeMillis();
+ log.info("Time : " + DurationFormatUtils.formatDurationHMS(tic2 - tic1));
+ }
+ return System.currentTimeMillis();
+ }
+
+}
Property changes on: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/ImportHelper.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/ContactState.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/ContactState.java 2010-01-04 11:24:57 UTC (rev 162)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/ContactState.java 2010-01-05 09:55:40 UTC (rev 163)
@@ -21,7 +21,8 @@
package fr.ifremer.suiviobsmer.bean;
-import fr.ifremer.suiviobsmer.bean.states.*;
+import java.util.ArrayList;
+import java.util.List;
/**
* ContactState
@@ -89,4 +90,12 @@
return null;
}
+ public static List<String> availableStates() {
+ List<String> results = new ArrayList<String>();
+ for (ContactState state : values()) {
+ results.add(state.toString());
+ }
+ return results;
+ }
+
}
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ActivityCalendarImport.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ActivityCalendarImport.java 2010-01-04 11:24:57 UTC (rev 162)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ActivityCalendarImport.java 2010-01-05 09:55:40 UTC (rev 163)
@@ -23,6 +23,7 @@
import fr.ifremer.suiviobsmer.*;
import com.csvreader.CsvReader;
+import fr.ifremer.suiviobsmer.ImportHelper.BOAT;
import fr.ifremer.suiviobsmer.entity.ActivityCalendar;
import fr.ifremer.suiviobsmer.entity.ActivityCalendarDAO;
import fr.ifremer.suiviobsmer.entity.ActivityMonth;
@@ -166,7 +167,7 @@
currRow++;
//long firstTic = System.currentTimeMillis();
- int boatImmatriculation = Integer.parseInt(reader.get("NAVS_COD").trim());
+ int boatImmatriculation = Integer.parseInt(reader.get(BOAT.NAVS_COD.name()).trim());
// long tic1 = System.currentTimeMillis();
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImpl.java 2010-01-04 11:24:57 UTC (rev 162)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImpl.java 2010-01-05 09:55:40 UTC (rev 163)
@@ -22,6 +22,8 @@
package fr.ifremer.suiviobsmer.impl;
import com.csvreader.CsvReader;
+import fr.ifremer.suiviobsmer.ImportHelper;
+import fr.ifremer.suiviobsmer.ImportHelper.BOAT;
import fr.ifremer.suiviobsmer.SuiviObsmerBusinessException;
import fr.ifremer.suiviobsmer.SuiviObsmerBusinessException.Type;
import fr.ifremer.suiviobsmer.SuiviObsmerContext;
@@ -42,7 +44,6 @@
import java.io.InputStream;
import java.nio.charset.Charset;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -345,14 +346,14 @@
reader.readHeaders();
long startTime = System.currentTimeMillis();
- long tic1, tic2;
+ long tic;
BoatDAO boatDAO = SuiviObsmerModelDAOHelper.getBoatDAO(transaction);
ShipOwnerDAO shipOwnerDAO = SuiviObsmerModelDAOHelper.getShipOwnerDAO(transaction);
Map<String, ShipOwner> availableShipOwners = new HashMap<String, ShipOwner>();
- tic1 = System.currentTimeMillis();
+ tic = System.currentTimeMillis();
while(reader.readRecord()) {
result[0]++;
@@ -361,15 +362,15 @@
// }
- int immatriculation = Integer.parseInt(reader.get("NAVS_COD").trim());
- String boatName = reader.get("CARN_NOM").trim();
- int boatLength = Integer.parseInt(reader.get("CARN_LONGUEUR_HT").trim());
- int buildYear = Integer.parseInt(reader.get("CARN_ANNEE").trim());
- String districtCode = reader.get("QUARTIER_IMMA").trim();
- String shipOwnerCode = reader.get("PER_COD").trim();
- String shipOwnerLastName = reader.get("PER_NOM").trim();
- String shipOwnerFirstName = reader.get("PER_PRENOM").trim();
- String activeStr = reader.get("NAVS_ACTIVE").trim();
+ int immatriculation = Integer.parseInt(reader.get(BOAT.NAVS_COD.name()).trim());
+ String boatName = reader.get(BOAT.CARN_NOM.name()).trim();
+ int boatLength = Integer.parseInt(reader.get(BOAT.CARN_LONGUEUR_HT.name()).trim());
+ int buildYear = Integer.parseInt(reader.get(BOAT.CARN_ANNEE.name()).trim());
+ String districtCode = reader.get(BOAT.QUARTIER_IMMA.name()).trim();
+ String shipOwnerCode = reader.get(BOAT.PER_COD.name()).trim();
+ String shipOwnerLastName = reader.get(BOAT.PER_NOM.name()).trim();
+ String shipOwnerFirstName = reader.get(BOAT.PER_PRENOM.name()).trim();
+ String activeStr = reader.get(BOAT.NAVS_ACTIVE.name()).trim();
boolean active = !activeStr.equals("I");
@@ -435,16 +436,17 @@
availableShipOwners.clear();
transaction.commitTransaction();
- if (log.isInfoEnabled()) {
- log.info("RUNNING... Import navires ligne " + result[0]);
- Runtime runtime = Runtime.getRuntime();
- long mem = (runtime.totalMemory() - runtime.freeMemory()) / 1048576;
- //long memMega = mem / 1024 / 1024;
- log.info("Memory : " + mem + " Mo");
- tic2 = System.currentTimeMillis();
- log.info("Time : " + DurationFormatUtils.formatDurationHMS(tic2 - tic1));
- tic1 = System.currentTimeMillis();
- }
+ tic = ImportHelper.logTimeAndMemory(log, tic, "navires ligne " + result[0]);
+// if (log.isInfoEnabled()) {
+// log.info("RUNNING... Import navires ligne " + result[0]);
+// Runtime runtime = Runtime.getRuntime();
+// long mem = (runtime.totalMemory() - runtime.freeMemory()) / 1048576;
+// //long memMega = mem / 1024 / 1024;
+// log.info("Memory : " + mem + " Mo");
+// tic2 = System.currentTimeMillis();
+// log.info("Time : " + DurationFormatUtils.formatDurationHMS(tic2 - tic1));
+// tic1 = System.currentTimeMillis();
+// }
}
}
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-04 11:24:57 UTC (rev 162)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceContactImpl.java 2010-01-05 09:55:40 UTC (rev 163)
@@ -21,21 +21,44 @@
package fr.ifremer.suiviobsmer.impl;
+import com.csvreader.CsvReader;
+import com.csvreader.CsvWriter;
+import fr.ifremer.suiviobsmer.ImportHelper;
+import fr.ifremer.suiviobsmer.ImportHelper.*;
+import fr.ifremer.suiviobsmer.SuiviObsmerBusinessException;
+import fr.ifremer.suiviobsmer.SuiviObsmerBusinessException.Type;
import fr.ifremer.suiviobsmer.SuiviObsmerException;
import fr.ifremer.suiviobsmer.SuiviObsmerModelDAOHelper;
import fr.ifremer.suiviobsmer.SuiviObsmerContext;
+import fr.ifremer.suiviobsmer.bean.ContactState;
+import java.io.InputStream;
import org.nuiton.topia.framework.TopiaQuery;
import fr.ifremer.suiviobsmer.bean.states.ContactStateEnum;
import fr.ifremer.suiviobsmer.entity.Boat;
+import fr.ifremer.suiviobsmer.entity.BoatDAO;
import fr.ifremer.suiviobsmer.entity.Company;
+import fr.ifremer.suiviobsmer.entity.CompanyDAO;
import fr.ifremer.suiviobsmer.entity.Contact;
import fr.ifremer.suiviobsmer.entity.ContactDAO;
import fr.ifremer.suiviobsmer.entity.ContactImpl;
+import fr.ifremer.suiviobsmer.entity.FishingZone;
+import fr.ifremer.suiviobsmer.entity.Profession;
+import fr.ifremer.suiviobsmer.entity.Program;
import fr.ifremer.suiviobsmer.entity.SampleRow;
+import fr.ifremer.suiviobsmer.entity.SampleRowDAO;
import fr.ifremer.suiviobsmer.entity.User;
+import fr.ifremer.suiviobsmer.entity.UserDAO;
import fr.ifremer.suiviobsmer.services.ServiceContact;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.OutputStream;
+import java.nio.charset.Charset;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
import java.util.HashMap;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.persistence.TopiaEntity;
@@ -135,4 +158,242 @@
}
}
+ protected static String DATE_TIME_PATTERN = "dd/MM/yyyy HH:mm:ss";
+ protected static String DATE_PATTERN = "dd/MM/yyyy";
+
+ @Override
+ public InputStream exportContactCsv(User user, List<Contact> contacts)
+ throws SuiviObsmerException {
+ TopiaContext transaction = null;
+ InputStream result = null;
+ try {
+ transaction = rootContext.beginTransaction();
+
+ // No contacts from arguments, select all existing from database
+ if (contacts == null) {
+ ContactDAO dao = SuiviObsmerModelDAOHelper.getContactDAO(transaction);
+ if (user.getAdmin()) {
+ contacts = dao.findAll();
+ } else {
+ // Filtered by company for a simple user
+ contacts = dao.createQuery().
+ add("user.company", user.getCompany()).
+ executeToEntityList();
+ }
+ }
+
+ String alea = SuiviObsmerContext.createRandomString(8);
+ FileOutputStream output = new FileOutputStream("/tmp/contact-" + alea + ".csv");
+ CsvWriter writer = new CsvWriter(output, ',', Charset.forName("UTF-8"));
+
+ // Headers
+ for (int i = 0; i < ImportHelper.CONTACT_NB_HEADERS; i++) {
+ String header = ImportHelper.getHeaderForContactCsv(i);
+ writer.write(header);
+ }
+
+ DateFormat dateTimeFormat = new SimpleDateFormat(DATE_TIME_PATTERN, Locale.FRENCH);
+ DateFormat dateFormat = new SimpleDateFormat(DATE_PATTERN, Locale.FRENCH);
+
+ int curr = 0;
+ for (Contact contact : contacts) {
+ curr++;
+ String[] record = new String[ImportHelper.CONTACT_NB_HEADERS];
+
+ // Contact part
+ record[CONTACT.CONT_CREATION.forContactCsv()] = dateTimeFormat.format(contact.getTopiaCreateDate());
+ record[CONTACT.CONT_ETAT.forContactCsv()] = contact.getState();
+ record[CONTACT.CONT_DEBUT_MAREE.forContactCsv()] = dateFormat.format(contact.getTideBeginDate());
+ record[CONTACT.CONT_FIN_MAREE.forContactCsv()] = dateFormat.format(contact.getTideEndDate());
+ record[CONTACT.CONT_NB_OBSERV.forContactCsv()] = String.valueOf(contact.getNbObservants());
+ record[CONTACT.CONT_MAM_CAPT.forContactCsv()] =
+ ImportHelper.formatContactMammals(contact.getMammalsCapture());
+ record[CONTACT.CONT_MAM_OBS.forContactCsv()] =
+ ImportHelper.formatContactMammals(contact.getMammalsObservation());
+ record[CONTACT.CONT_COMMENT.forContactCsv()] = contact.getComment();
+ record[CONTACT.CONT_ALLEGRO.forContactCsv()] = dateFormat.format(contact.getDataInputDate());
+ record[CONTACT.CONT_SOCIETE_VALID.forContactCsv()] =
+ ImportHelper.formatContactValidation(contact.getValidationCompany());
+ record[CONTACT.CONT_PROGRAM_VALID.forContactCsv()] =
+ ImportHelper.formatContactValidation(contact.getValidationProgram());
+
+ // Observer part
+ User observer = contact.getUser();
+ Company company = observer.getCompany();
+ record[CONTACT.OBSERV_ID.forContactCsv()] = observer.getLogin();
+ record[CONTACT.OBSERV_PRENOM.forContactCsv()] = observer.getFirstName();
+ record[CONTACT.OBSERV_NOM.forContactCsv()] = observer.getLastName();
+ record[CONTACT.SOCIETE_NOM.forContactCsv()] = company.getName();
+
+ // SampleRow part
+ SampleRow row = contact.getSampleRow();
+ Program program = row.getProgram();
+ record[SAMPLING.PLAN_CODE.forContactCsv()] = row.getCode();
+ record[SAMPLING.PROGRAMME_CODE.forContactCsv()] = program.getName();
+ record[SAMPLING.PROGRAMME_DEBUT.forContactCsv()] = dateFormat.format(program.getPeriodBegin());
+ record[SAMPLING.PROGRAMME_FIN.forContactCsv()] = dateFormat.format(program.getPeriodEnd());
+ record[SAMPLING.PECHE_AUTRE.forContactCsv()] = row.getFishingZonesInfos();
+
+ // FishingZone part
+ List<FishingZone> zones = row.getFishingZone();
+ String fishingDistrict = "";
+ for (FishingZone zone : zones) {
+ fishingDistrict += zone.getDistrictCode() + " - ";
+ }
+ fishingDistrict = fishingDistrict.substring(fishingDistrict.length() - 3);
+ record[FISHING_ZONE.PECHE_FACADE.forContactCsv()] = zones.get(0).getFacadeName();
+ record[FISHING_ZONE.PECHE_ZONE.forContactCsv()] = zones.get(0).getSectorName();
+ record[FISHING_ZONE.PECHE_DIVISION.forContactCsv()] = fishingDistrict;
+
+ // Profession part
+ Profession profession = row.getProfession();
+ record[SAMPLING.METIER_CODE_DCF5.forContactCsv()] = profession.getCodeDCF5();
+ record[SAMPLING.METIER_MAILLAGE.forContactCsv()] = profession.getMeshSize();
+ record[SAMPLING.METIER_TAILLE.forContactCsv()] = profession.getSize();
+ record[SAMPLING.METIER_AUTRE.forContactCsv()] = profession.getOther();
+ record[SAMPLING.METIER_LIBELLE.forContactCsv()] = profession.getLibelle();
+ record[SAMPLING.METIER_ESPECES.forContactCsv()] = profession.getSpecies();
+
+ // Boat part
+ Boat boat = contact.getBoat();
+ record[BOAT.NAVS_COD.forContactCsv()] = String.valueOf(boat.getImmatriculation());
+ record[BOAT.CARN_NOM.forContactCsv()] = boat.getName();
+ record[BOAT.QUARTIER_IMMA.forContactCsv()] = boat.getDistrictCode();
+
+ writer.writeRecord(record);
+ }
+ writer.close();
+
+ result = new FileInputStream(output.getFD());
+
+ transaction.closeContext();
+ } catch (Exception eee) {
+ SuiviObsmerContext.serviceException(transaction,
+ "Impossible d'exporter les contacts", eee);
+ }
+ return result;
+ }
+
+ @Override
+ public int importContactCsv(InputStream input) throws SuiviObsmerException {
+ TopiaContext transaction = null;
+ int result = 0;
+ try {
+ transaction = rootContext.beginTransaction();
+
+ CsvReader reader = new CsvReader(input, Charset.forName("UTF-8"));
+ reader.readHeaders();
+
+ ContactDAO dao = SuiviObsmerModelDAOHelper.getContactDAO(transaction);
+ UserDAO userDAO = SuiviObsmerModelDAOHelper.getUserDAO(transaction);
+ CompanyDAO companyDAO = SuiviObsmerModelDAOHelper.getCompanyDAO(transaction);
+ SampleRowDAO rowDAO = SuiviObsmerModelDAOHelper.getSampleRowDAO(transaction);
+ BoatDAO boatDAO = SuiviObsmerModelDAOHelper.getBoatDAO(transaction);
+
+ DateFormat dateTimeFormat = new SimpleDateFormat(DATE_TIME_PATTERN, Locale.FRENCH);
+ DateFormat dateFormat = new SimpleDateFormat(DATE_PATTERN, Locale.FRENCH);
+
+ int currRow = 0;
+ long tic;
+ tic = System.currentTimeMillis();
+ while(reader.readRecord()) {
+ currRow++;
+
+ String userId = reader.get(CONTACT.OBSERV_ID.name());
+ String state = reader.get(CONTACT.CONT_ETAT.name());
+
+ ContactState contactState = ContactState.createContactStateEnum(state);
+
+ if (contactState == null) {
+ throw new SuiviObsmerBusinessException(Type.IMPORT_ERROR, this.getClass(),
+ "Erreur ligne " + currRow + " : " +
+ "Etat du contact invalide '" + state + "', valeurs possibles : " +
+ ContactState.availableStates());
+ }
+
+ User user = userDAO.findByLogin(userId);
+ if (user != null) {
+ // FIXME-FD20100104 findContains not optimized in TopiaDAOImpl
+ Company company = companyDAO.findContainsUser(user);
+ if (company != null) {
+ String rowCode = reader.get(SAMPLING.PLAN_CODE.name());
+
+ SampleRow row = rowDAO.findByCode(rowCode);
+
+ if (row != null) {
+ int boatImmatriculation = Integer.parseInt(reader.get(BOAT.NAVS_COD.name()));
+
+ Boat boat = boatDAO.findByImmatriculation(boatImmatriculation);
+
+ if (boat != null) {
+ Date createDate = dateTimeFormat.parse(reader.get(CONTACT.CONT_CREATION.name()));
+
+ Contact contact = dao.createQuery().
+ add(TopiaEntity.TOPIA_CREATE_DATE, createDate).
+ executeToEntity();
+
+ if (contact == null) { // new contact to import
+ contact = dao.create(
+ Contact.USER, user,
+ Contact.SAMPLE_ROW, row,
+ Contact.BOAT, boat);
+ }
+ Date tideBegin = dateFormat.parse(CONTACT.CONT_DEBUT_MAREE.name());
+ Date tideEnd = dateFormat.parse(CONTACT.CONT_FIN_MAREE.name());
+ int nbObservants = Integer.parseInt(reader.get(CONTACT.CONT_NB_OBSERV.name()));
+ boolean mammalsCapture =
+ ImportHelper.parseContactMammals(reader.get(CONTACT.CONT_MAM_CAPT.name()));
+ boolean mammalsObsv =
+ ImportHelper.parseContactMammals(reader.get(CONTACT.CONT_MAM_OBS.name()));
+
+ contact.setState(state);
+ contact.setTideBeginDate(tideBegin);
+ contact.setTideEndDate(tideEnd);
+ contact.setNbObservants(nbObservants);
+ contact.setMammalsCapture(mammalsCapture);
+ contact.setMammalsObservation(mammalsObsv);
+
+ result++;
+
+ } else if (log.isWarnEnabled()) {
+ log.warn("Import contact ligne " + currRow + " : " +
+ "Navire inexistant avec l'immatriculation : " + boatImmatriculation);
+ }
+ } else if (log.isWarnEnabled()) {
+ log.warn("Import contact ligne " + currRow + " : " +
+ "Ligne d'échantillon inexistante avec le code : " + rowCode);
+ }
+ } else if (log.isErrorEnabled()) {
+ log.error("Import contact ligne " + currRow + " : " +
+ "Cette utilisateur n'est lié à aucune société : " + user);
+ }
+ } else if (log.isWarnEnabled()) {
+ log.warn("Import contact ligne " + currRow + " : " +
+ "Utilisateur inexistant avec l'identifiant : " + userId);
+ }
+
+ if (result % 1000 == 0) {
+ transaction.commitTransaction();
+ tic = ImportHelper.logTimeAndMemory(log, tic, "contacts ligne " + currRow);
+// if (log.isInfoEnabled()) {
+// log.info("RUNNING... Import contacts ligne " + currRow);
+// Runtime runtime = Runtime.getRuntime();
+// long mem = (runtime.totalMemory() - runtime.freeMemory()) / 1048576;
+// //long memMega = mem / 1024 / 1024;
+// log.info("Memory : " + mem + " Mo");
+// tic2 = System.currentTimeMillis();
+// log.info("Time : " + DurationFormatUtils.formatDurationHMS(tic2 - tic1));
+// tic1 = System.currentTimeMillis();
+// }
+ }
+ }
+
+ transaction.closeContext();
+ } catch (Exception eee) {
+ SuiviObsmerContext.serviceException(transaction,
+ "Impossible d'exporter les contacts", eee);
+ }
+ return result;
+ }
+
}
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceReferentialImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceReferentialImpl.java 2010-01-04 11:24:57 UTC (rev 162)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceReferentialImpl.java 2010-01-05 09:55:40 UTC (rev 163)
@@ -22,6 +22,7 @@
package fr.ifremer.suiviobsmer.impl;
import com.csvreader.CsvReader;
+import fr.ifremer.suiviobsmer.ImportHelper.FISHING_ZONE;
import fr.ifremer.suiviobsmer.SuiviObsmerException;
import fr.ifremer.suiviobsmer.SuiviObsmerModelDAOHelper;
import fr.ifremer.suiviobsmer.SuiviObsmerContext;
@@ -142,9 +143,9 @@
log.trace(" " + Arrays.asList(reader.getValues()));
}
- String facadeName = reader.get("PECHE_FACADE").trim();
- String sectorName = reader.get("PECHE_ZONE").trim();
- String districtCode = reader.get("PECHE_DIVISION").trim();
+ String facadeName = reader.get(FISHING_ZONE.PECHE_FACADE.name()).trim();
+ String sectorName = reader.get(FISHING_ZONE.PECHE_ZONE.name()).trim();
+ String districtCode = reader.get(FISHING_ZONE.PECHE_DIVISION.name()).trim();
FishingZone zone = dao.findByProperties(
FishingZone.FACADE_NAME, facadeName,
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-04 11:24:57 UTC (rev 162)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImpl.java 2010-01-05 09:55:40 UTC (rev 163)
@@ -22,6 +22,8 @@
package fr.ifremer.suiviobsmer.impl;
import com.csvreader.CsvReader;
+import fr.ifremer.suiviobsmer.ImportHelper.FISHING_ZONE;
+import fr.ifremer.suiviobsmer.ImportHelper.SAMPLING;
import fr.ifremer.suiviobsmer.SuiviObsmerException;
import fr.ifremer.suiviobsmer.SuiviObsmerModelDAOHelper;
import fr.ifremer.suiviobsmer.SuiviObsmerContext;
@@ -48,6 +50,7 @@
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.framework.TopiaQuery;
import org.nuiton.topia.framework.TopiaQuery.Op;
+import org.nuiton.topia.persistence.TopiaEntity;
import org.nuiton.topia.persistence.util.EntityLoador;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -294,12 +297,16 @@
SampleRowDAO dao = SuiviObsmerModelDAOHelper.getSampleRowDAO(transaction);
- result = dao.findByTopiaId(sampleRowId);
+ result = dao.createQuery().add(TopiaEntity.TOPIA_ID, sampleRowId).
+ addLoad("company", "program", "profession").
+ executeToEntity();
- // load data
- result.getCompany();
- result.getProgram();
- result.getProfession();
+// result = dao.findByTopiaId(sampleRowId);
+//
+// // load data
+// result.getCompany();
+// result.getProgram();
+// result.getProfession();
transaction.closeContext();
} catch (Exception eee) {
@@ -390,7 +397,7 @@
log.trace(" " + Arrays.asList(reader.getValues()));
}
- String code = reader.get("PLAN_CODE").trim();
+ String code = reader.get(SAMPLING.PLAN_CODE.name()).trim();
if (StringUtils.isEmpty(code)) {
continue;
@@ -399,10 +406,10 @@
// Replace single number after year by a double one : 2010_1 -> 2010_01
code = code.replaceFirst("_(\\d)$", "_0$1");
- String programName = reader.get("PROGRAMME_CODE").trim();
- int[] programBegin = getMonthAndYear(reader.get("PROGRAMME_DEBUT").trim());
- int[] programEnd = getMonthAndYear(reader.get("PROGRAMME_FIN").trim());
- String districts = reader.get("PECHE_DIVISION");
+ String programName = reader.get(SAMPLING.PROGRAMME_CODE.name()).trim();
+ int[] programBegin = getMonthAndYear(reader.get(SAMPLING.PROGRAMME_DEBUT.name()).trim());
+ int[] programEnd = getMonthAndYear(reader.get(SAMPLING.PROGRAMME_FIN.name()).trim());
+ String districts = reader.get(FISHING_ZONE.PECHE_DIVISION.name());
row = dao.findByCode(code);
// Refuse existing SampleRow
@@ -511,12 +518,12 @@
protected Profession importProfession(TopiaContext transaction, CsvReader reader)
throws IOException, TopiaException {
- String codeDCF5 = reader.get("METIER_CODE_DCF5").trim();
- String maillage = reader.get("METIER_MAILLAGE").trim();
- String taille = reader.get("METIER_TAILLE").trim();
- String autre = reader.get("METIER_AUTRE").trim();
- String libelle = reader.get("METIER_LIBELLE").trim();
- String especes = reader.get("METIER_ESPECES").trim();
+ String codeDCF5 = reader.get(SAMPLING.METIER_CODE_DCF5.name()).trim();
+ String maillage = reader.get(SAMPLING.METIER_MAILLAGE.name()).trim();
+ String taille = reader.get(SAMPLING.METIER_TAILLE.name()).trim();
+ String autre = reader.get(SAMPLING.METIER_AUTRE.name()).trim();
+ String libelle = reader.get(SAMPLING.METIER_LIBELLE.name()).trim();
+ String especes = reader.get(SAMPLING.METIER_ESPECES.name()).trim();
ProfessionDAO dao = SuiviObsmerModelDAOHelper.getProfessionDAO(transaction);
Map<String, Object> existParams = new HashMap<String, Object>();
@@ -589,9 +596,9 @@
protected void updateRow(TopiaContext transaction, SampleRow sampleRow, CsvReader reader)
throws IOException, TopiaException, ParseException {
- String fishingZoneInfos = reader.get("PECHE_AUTRE").trim();
- int nbObservants = Integer.parseInt(reader.get("PLAN_NB_OBSERV").trim());
- String averageStr = reader.get("PLAN_DUREE_MOY").trim();
+ String fishingZoneInfos = reader.get(SAMPLING.PECHE_AUTRE.name()).trim();
+ int nbObservants = Integer.parseInt(reader.get(SAMPLING.PLAN_NB_OBSERV.name()).trim());
+ String averageStr = reader.get(SAMPLING.PLAN_DUREE_MOY.name()).trim();
averageStr = averageStr.replaceAll(",", ".");
double averageTideTime = Double.parseDouble(averageStr);
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceContactMock.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceContactMock.java 2010-01-04 11:24:57 UTC (rev 162)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceContactMock.java 2010-01-05 09:55:40 UTC (rev 163)
@@ -29,6 +29,8 @@
import fr.ifremer.suiviobsmer.entity.SampleRow;
import fr.ifremer.suiviobsmer.entity.User;
import fr.ifremer.suiviobsmer.services.ServiceContact;
+import java.io.InputStream;
+import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -259,6 +261,16 @@
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
+ public InputStream exportContactCsv(User user, List<Contact> contacts) throws SuiviObsmerException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+ @Override
+ public int importContactCsv(InputStream input) throws SuiviObsmerException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+
}
Modified: trunk/suiviobsmer-business/src/main/xmi/suiviobsmer.zargo
===================================================================
(Binary files differ)
1
0
[Suiviobsmer-commits] r162 - in trunk/suiviobsmer-business/src/main: java/fr/ifremer/suiviobsmer java/fr/ifremer/suiviobsmer/entity java/fr/ifremer/suiviobsmer/impl xmi
by fdesbois@users.labs.libre-entreprise.org 04 Jan '10
by fdesbois@users.labs.libre-entreprise.org 04 Jan '10
04 Jan '10
Author: fdesbois
Date: 2010-01-04 11:24:57 +0000 (Mon, 04 Jan 2010)
New Revision: 162
Added:
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ContactDAOImpl.java
Removed:
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/QueryBuilder.java
Modified:
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatInfosImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ProgramImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ActivityCalendarImport.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceContactImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImpl.java
trunk/suiviobsmer-business/src/main/xmi/suiviobsmer.zargo
Log:
- Improve TopiaQuery usage from Topia
- Move queries from QueryBuilder to ContactDAOImpl
Deleted: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/QueryBuilder.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/QueryBuilder.java 2009-12-29 12:17:31 UTC (rev 161)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/QueryBuilder.java 2010-01-04 11:24:57 UTC (rev 162)
@@ -1,105 +0,0 @@
-/*
- * *##%
- * SuiviObsmer :: Business
- * Copyright (C) 2009 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;
-
-import org.nuiton.topia.TopiaException;
-import org.nuiton.topia.framework.TopiaQuery.Op;
-import fr.ifremer.suiviobsmer.bean.ContactState;
-import fr.ifremer.suiviobsmer.entity.Boat;
-import fr.ifremer.suiviobsmer.entity.BoatImpl;
-import fr.ifremer.suiviobsmer.entity.Company;
-import fr.ifremer.suiviobsmer.entity.Contact;
-import java.util.Date;
-import org.hibernate.SQLQuery;
-import org.nuiton.topia.TopiaContext;
-import org.nuiton.topia.framework.TopiaContextImplementor;
-import org.nuiton.topia.framework.TopiaQuery;
-
-/**
- * QueryBuilder
- *
- * Created: 21 déc. 2009
- *
- * @author fdesbois
- * @version $Revision$
- *
- * Mise a jour: $Date$
- * par : $Author$
- */
-public class QueryBuilder {
-
- /**
- * Create the query for the last contact of the boat and company.
- *
- * @param boat the boat concerned by the contact
- * @param company the company concerned by the user who create the contact
- * @return the TopiaQuery created
- */
- public static TopiaQuery createQueryLastContactForBoat(Boat boat, Company company) {
- String contactClassName = Contact.class.getName();
- TopiaQuery query = new TopiaQuery(contactClassName + " C1").
- add("C1.boat", boat).
- add("C1.user.company = :company").
- addParam("company", company);
-
- TopiaQuery subquery = new TopiaQuery(contactClassName + " C2").
- addSelect("MAX(C2.topiaCreateDate)").
- add("C2.boat = C1.boat").
- add("C2.user.company = :company");
-
- query.add("C1.topiaCreateDate = (" + subquery.fullQuery() + ")");
- return query;
- }
-
- /**
- * Create the query for contacts linked with a boat with BoardingDone state since the fromDate.
- * This query is used to get all boarding dones with the boat for all companies.
- * Only the validate contacts by company will be count. The param fromDate can be null,
- * in this case, all contacts will be given (no matter which date then started).
- *
- * @param boat the boat concerned by the contact
- * @param fromDate the date to start
- * @return the TopiaQuery created
- */
- public static TopiaQuery createQueryDoneContactsFromDate(Boat boat, Date fromDate) {
- TopiaQuery query = new TopiaQuery(Contact.class).
- add("boat", boat).
- add("state", ContactState.BOARDING_DONE.toString()).
- add("validationCompany", Boolean.TRUE).
- add("validationProgram IS NULL OR validationProgram = :booleanTrue").
- addParam("booleanTrue", Boolean.TRUE);
-
- if (fromDate != null) {
- query.add("tideBeginDate", Op.GE, fromDate);
- }
- return query;
- }
-
-// public static Boat getBoatByImmatriculation(TopiaContext transaction, int immatriculation) throws TopiaException {
-// TopiaContextImplementor topia = (TopiaContextImplementor)transaction;
-// SQLQuery query = topia.getHibernate().createSQLQuery(
-// "SELECT * FROM boat WHERE immatriculation = " + immatriculation);
-//
-// return (Boat)query.addEntity(BoatImpl.class).uniqueResult();
-// }
-
-}
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatImpl.java 2009-12-29 12:17:31 UTC (rev 161)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatImpl.java 2010-01-04 11:24:57 UTC (rev 162)
@@ -21,10 +21,9 @@
package fr.ifremer.suiviobsmer.entity;
-import fr.ifremer.suiviobsmer.QueryBuilder;
import fr.ifremer.suiviobsmer.SuiviObsmerException;
import fr.ifremer.suiviobsmer.SuiviObsmerContext;
-import org.nuiton.topia.framework.TopiaQuery;
+import fr.ifremer.suiviobsmer.SuiviObsmerModelDAOHelper;
import fr.ifremer.suiviobsmer.bean.ContactState;
import java.io.Serializable;
import org.nuiton.topia.TopiaContext;
@@ -63,8 +62,8 @@
try {
transaction = SuiviObsmerContext.getTopiaRootContext().beginTransaction();
- TopiaQuery query = QueryBuilder.createQueryLastContactForBoat(this, company);
- Contact contact = query.executeToEntity(transaction, Contact.class);
+ ContactDAO dao = SuiviObsmerModelDAOHelper.getContactDAO(transaction);
+ Contact contact = dao.createQueryLastContactForBoat(this, company).executeToEntity();
if (contact != null) {
//boolean validation = contact.getValidationProgram() != null || BooleanUtils.isFalse(contact.getValidationCompany());
ContactState state = ContactState.createContactStateEnum(contact.getState());
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatInfosImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatInfosImpl.java 2009-12-29 12:17:31 UTC (rev 161)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatInfosImpl.java 2010-01-04 11:24:57 UTC (rev 162)
@@ -21,9 +21,9 @@
package fr.ifremer.suiviobsmer.entity;
-import fr.ifremer.suiviobsmer.QueryBuilder;
import fr.ifremer.suiviobsmer.SuiviObsmerContext;
import fr.ifremer.suiviobsmer.SuiviObsmerException;
+import fr.ifremer.suiviobsmer.SuiviObsmerModelDAOHelper;
import org.nuiton.topia.framework.TopiaQuery;
import java.io.Serializable;
import org.nuiton.topia.TopiaContext;
@@ -66,7 +66,9 @@
try {
transaction = SuiviObsmerContext.getTopiaRootContext().beginTransaction();
- TopiaQuery query = QueryBuilder.createQueryDoneContactsFromDate(getBoat(), fromDate);
+ ContactDAO dao = SuiviObsmerModelDAOHelper.getContactDAO(transaction);
+
+ TopiaQuery<Contact> query = dao.createQueryDoneContactsFromDate(getBoat(), fromDate);
result = query.executeCount(transaction);
transaction.closeContext();
@@ -94,12 +96,13 @@
try {
transaction = SuiviObsmerContext.getTopiaRootContext().beginTransaction();
- TopiaQuery query = QueryBuilder.
- createQueryDoneContactsFromDate(getBoat(), fromDate).
- add("user.company", getCompany());
+ ContactDAO dao = SuiviObsmerModelDAOHelper.getContactDAO(transaction);
- result = query.executeCount(transaction);
+ TopiaQuery<Contact> query = dao.createQueryDoneContactsFromDate(getBoat(), fromDate);
+ query.add("user.company", getCompany());
+ result = query.executeCount();
+
transaction.closeContext();
} catch (Exception eee) {
SuiviObsmerContext.serviceException(transaction,
Added: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ContactDAOImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ContactDAOImpl.java (rev 0)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ContactDAOImpl.java 2010-01-04 11:24:57 UTC (rev 162)
@@ -0,0 +1,71 @@
+package fr.ifremer.suiviobsmer.entity;
+
+import fr.ifremer.suiviobsmer.bean.ContactState;
+import java.util.Date;
+import org.nuiton.topia.framework.TopiaQuery;
+import org.nuiton.topia.framework.TopiaQuery.Op;
+
+
+/**
+ * ContactDAOImpl
+ *
+ * Created: 21 déc. 2009
+ *
+ * @param <E>
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public class ContactDAOImpl<E extends Contact> extends ContactDAOAbstract<E> {
+
+ /**
+ * Create the query for the last contact of the boat and company.
+ *
+ * @param boat the boat concerned by the contact
+ * @param company the company concerned by the user who create the contact
+ * @return the TopiaQuery created
+ */
+ @Override
+ public TopiaQuery<E> createQueryLastContactForBoat(Boat boat, Company company) {
+ TopiaQuery<E> query = createQuery("C1").
+ add("C1.boat", boat).
+ add("C1.user.company = :company").
+ addParam("company", company);
+
+ TopiaQuery<E> subquery = createQuery("C2").
+ addSelect("MAX(C2.topiaCreateDate)").
+ add("C2.boat = C1.boat").
+ add("C2.user.company = :company");
+
+ query.add("C1.topiaCreateDate = (" + subquery.fullQuery() + ")");
+ return query;
+ }
+
+ /**
+ * Create the query for contacts linked with a boat with BoardingDone state since the fromDate.
+ * This query is used to get all boarding dones with the boat for all companies.
+ * Only the validate contacts by company will be count. The param fromDate can be null,
+ * in this case, all contacts will be given (no matter which date then started).
+ *
+ * @param boat the boat concerned by the contact
+ * @param fromDate the date to start
+ * @return the TopiaQuery created
+ */
+ @Override
+ public TopiaQuery<E> createQueryDoneContactsFromDate(Boat boat, Date fromDate) {
+ TopiaQuery<E> query = createQuery().
+ add("boat", boat).
+ add("state", ContactState.BOARDING_DONE.toString()).
+ add("validationCompany", Boolean.TRUE).
+ add("validationProgram IS NULL OR validationProgram = :booleanTrue").
+ addParam("booleanTrue", Boolean.TRUE);
+
+ if (fromDate != null) {
+ query.add("tideBeginDate", Op.GE, fromDate);
+ }
+ return query;
+ }
+
+} //ContactDAOImpl<E extends Contact>
Property changes on: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ContactDAOImpl.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL"
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ProgramImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ProgramImpl.java 2009-12-29 12:17:31 UTC (rev 161)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ProgramImpl.java 2010-01-04 11:24:57 UTC (rev 162)
@@ -23,10 +23,10 @@
import fr.ifremer.suiviobsmer.SuiviObsmerContext;
import fr.ifremer.suiviobsmer.SuiviObsmerException;
+import fr.ifremer.suiviobsmer.SuiviObsmerModelDAOHelper;
import org.nuiton.topia.framework.TopiaQuery;
import org.nuiton.topia.framework.TopiaQuery.Op;
import java.io.Serializable;
-import java.text.NumberFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
@@ -124,12 +124,12 @@
Calendar begin = getCalendarBegin();
int year = begin.get(Calendar.YEAR);
-
- TopiaQuery query = new TopiaQuery(SampleRow.class).
- add(SampleRow.CODE, Op.LIKE, year + "_%");
- String maxCode = query.executeToString(transaction, "MAX(" + SampleRow.CODE + ")");
+ SampleRowDAO dao = SuiviObsmerModelDAOHelper.getSampleRowDAO(transaction);
+ TopiaQuery<SampleRow> query = dao.createQuery().add(SampleRow.CODE, Op.LIKE, year + "_%");
+ String maxCode = query.executeToString("MAX(" + SampleRow.CODE + ")");
+
if (log.isDebugEnabled()) {
log.debug("Max code found : " + maxCode);
}
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ActivityCalendarImport.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ActivityCalendarImport.java 2009-12-29 12:17:31 UTC (rev 161)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ActivityCalendarImport.java 2010-01-04 11:24:57 UTC (rev 162)
@@ -25,7 +25,6 @@
import com.csvreader.CsvReader;
import fr.ifremer.suiviobsmer.entity.ActivityCalendar;
import fr.ifremer.suiviobsmer.entity.ActivityCalendarDAO;
-import fr.ifremer.suiviobsmer.entity.ActivityCalendarImpl;
import fr.ifremer.suiviobsmer.entity.ActivityMonth;
import fr.ifremer.suiviobsmer.entity.ActivityMonthDAO;
import fr.ifremer.suiviobsmer.entity.ActivityProfession;
@@ -33,6 +32,7 @@
import fr.ifremer.suiviobsmer.entity.ActivityZone;
import fr.ifremer.suiviobsmer.entity.ActivityZoneDAO;
import fr.ifremer.suiviobsmer.entity.Boat;
+import fr.ifremer.suiviobsmer.entity.BoatDAO;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
@@ -49,10 +49,7 @@
import java.util.Map;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.time.DurationFormatUtils;
-import org.hibernate.SQLQuery;
import org.nuiton.topia.TopiaContext;
-import org.nuiton.topia.framework.TopiaContextImplementor;
-import org.nuiton.topia.framework.TopiaQuery;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -159,7 +156,7 @@
Map<ActivityCalendarKey, ActivityCalendar> availableCalendars = new HashMap<ActivityCalendarKey, ActivityCalendar>();
- //BoatDAO boatDAO = SuiviObsmerModelDAOHelper.getBoatDAO(transaction);
+ BoatDAO boatDAO = SuiviObsmerModelDAOHelper.getBoatDAO(transaction);
ActivityCalendarDAO calendarDAO = SuiviObsmerModelDAOHelper.getActivityCalendarDAO(transaction);
ActivityMonthDAO monthDAO = SuiviObsmerModelDAOHelper.getActivityMonthDAO(transaction);
ActivityProfessionDAO professionDAO = SuiviObsmerModelDAOHelper.getActivityProfessionDAO(transaction);
@@ -179,7 +176,7 @@
// "SELECT * FROM boat WHERE immatriculation = " + boatImmatriculation);
//
// Boat boat = (Boat)query.addEntity(BoatImpl.class).uniqueResult();
- Boat boat = new TopiaQuery(Boat.class).add(Boat.IMMATRICULATION, boatImmatriculation).executeToEntity(transaction);
+ Boat boat = boatDAO.findByImmatriculation(boatImmatriculation); //.add(Boat.IMMATRICULATION, boatImmatriculation).executeToEntity(transaction);
// long tic2 = System.currentTimeMillis();
// log.info("findByImmatriculation : " + (tic2 - tic1));
@@ -201,10 +198,9 @@
//
// calendar = (ActivityCalendar)query.addEntity(ActivityCalendarImpl.class).uniqueResult();
- calendar = new TopiaQuery(ActivityCalendar.class).
- add(ActivityCalendar.BOAT, boat).
- add(ActivityCalendar.YEAR, year).
- executeToEntity(transaction);
+ calendar = calendarDAO.findByProperties(
+ ActivityCalendar.BOAT, boat,
+ ActivityCalendar.YEAR, year);
// Create it if not exist in Database
if (calendar == null) {
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImpl.java 2009-12-29 12:17:31 UTC (rev 161)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImpl.java 2010-01-04 11:24:57 UTC (rev 162)
@@ -22,7 +22,6 @@
package fr.ifremer.suiviobsmer.impl;
import com.csvreader.CsvReader;
-import fr.ifremer.suiviobsmer.QueryBuilder;
import fr.ifremer.suiviobsmer.SuiviObsmerBusinessException;
import fr.ifremer.suiviobsmer.SuiviObsmerBusinessException.Type;
import fr.ifremer.suiviobsmer.SuiviObsmerContext;
@@ -83,7 +82,8 @@
try {
transaction = rootContext.beginTransaction();
- TopiaQuery query = new TopiaQuery(Boat.class.getName() + " B").addSelect("B");
+ BoatDAO dao = SuiviObsmerModelDAOHelper.getBoatDAO(transaction);
+ TopiaQuery<Boat> query = dao.createQuery("B");
// Immatriculation
if (filter.getBoatImmatriculation() != null) {
@@ -108,7 +108,7 @@
// Add join for ElligibleBoat
if (sampleRowFiltered) {
String elligibleBoatClassName = ElligibleBoat.class.getName();
- query.addFrom(elligibleBoatClassName + " E").add("E.boat = B");
+ query.addSelect("B").addFrom(elligibleBoatClassName + " E").add("E.boat = B");
}
// SampleRowCode
if (sampleRowCodeFiltered) {
@@ -128,7 +128,7 @@
addParam("booleanTrue", Boolean.TRUE);
}
- results = query.executeToEntityMap(transaction, Boat.class, Boat.IMMATRICULATION, Integer.class);
+ results = query.executeToEntityMap(Boat.IMMATRICULATION, Integer.class);
transaction.closeContext();
} catch (Exception eee) {
@@ -197,9 +197,10 @@
}
// Last contact
- TopiaQuery query = QueryBuilder.createQueryLastContactForBoat(boat, company).
- addLoad(Contact.SAMPLE_ROW, Contact.USER);
- Contact contact = query.executeToEntity(transaction, Contact.class);
+ ContactDAO contactDAO = SuiviObsmerModelDAOHelper.getContactDAO(transaction);
+ Contact contact = contactDAO.createQueryLastContactForBoat(boat, company).
+ addLoad(Contact.SAMPLE_ROW, Contact.USER).
+ executeToEntity();
if (contact != null) {
result.setLastContact(contact);
@@ -377,7 +378,7 @@
//
// long tic1 = System.currentTimeMillis();
-// boatDAO.findByImmatriculation(immatriculation);
+ Boat boat = boatDAO.findByImmatriculation(immatriculation);
// long tic2 = System.currentTimeMillis();
// if (log.isDebugEnabled()) {
// log.debug("findByImmatriculation : " + (tic2 - tic1));
@@ -391,7 +392,7 @@
// }
// tic1 = System.currentTimeMillis();
- Boat boat = new TopiaQuery(Boat.class).add(Boat.IMMATRICULATION, immatriculation).executeToEntity(transaction);
+ //Boat boat = new TopiaQuery(Boat.class).add(Boat.IMMATRICULATION, immatriculation).executeToEntity(transaction);
// tic2 = System.currentTimeMillis();
// if (log.isDebugEnabled()) {
// log.debug("findByImmatriculation TopiaQuery : " + (tic2 - tic1));
@@ -414,7 +415,8 @@
// If not available, select it from database
if (shipOwner == null) {
- shipOwner = new TopiaQuery(ShipOwner.class).add(ShipOwner.CODE, shipOwnerCode).executeToEntity(transaction);
+ //shipOwner = new TopiaQuery(ShipOwner.class).add(ShipOwner.CODE, shipOwnerCode).executeToEntity(transaction);
+ shipOwner = shipOwnerDAO.findByCode(shipOwnerCode);
// If not exist yet, create it
if (shipOwner == null) {
@@ -488,11 +490,12 @@
try {
transaction = rootContext.beginTransaction();
- String activityCalendarClassName = ActivityCalendar.class.getName();
- TopiaQuery query = new TopiaQuery(activityCalendarClassName + " A").
+ ActivityCalendarDAO dao = SuiviObsmerModelDAOHelper.getActivityCalendarDAO(transaction);
+
+ TopiaQuery<ActivityCalendar> query = dao.createQuery("A").
add("A.boat", boat);
- TopiaQuery subquery = new TopiaQuery(activityCalendarClassName + " B").
+ TopiaQuery<ActivityCalendar> subquery = dao.createQuery("B").
addSelect("MAX(B.year)").
add("B.boat = A.boat").
addGroup("B.boat");
@@ -500,7 +503,7 @@
query.add("A.year = (" + subquery.fullQuery() + ")");
query.addLoad(ActivityCalendar.BOAT);
- result = query.executeToEntity(transaction, ActivityCalendar.class);
+ result = query.executeToEntity(transaction);
// load other complex data from collections
List<ActivityMonth> months = result.getActivityMonth();
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 2009-12-29 12:17:31 UTC (rev 161)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceContactImpl.java 2010-01-04 11:24:57 UTC (rev 162)
@@ -70,14 +70,15 @@
try {
transaction = rootContext.beginTransaction();
- TopiaQuery query = new TopiaQuery(Contact.class).addOrderDesc(TopiaEntity.TOPIA_CREATE_DATE);
+ ContactDAO dao = SuiviObsmerModelDAOHelper.getContactDAO(transaction);
+ TopiaQuery<Contact> query = dao.createQuery().addOrderDesc(TopiaEntity.TOPIA_CREATE_DATE);
if (company != null) {
query.add("user.company", company);
}
query.addLoad("user.company", "sampleRow.program", "sampleRow.profession", "sampleRow.company");
- results = query.executeToEntityMap(transaction, Contact.class);
+ results = query.executeToEntityMap();
transaction.closeContext();
} catch (Exception eee) {
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 2009-12-29 12:17:31 UTC (rev 161)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImpl.java 2010-01-04 11:24:57 UTC (rev 162)
@@ -237,14 +237,15 @@
Date current = SuiviObsmerContext.getCurrentDate();
+ SampleRowDAO dao = SuiviObsmerModelDAOHelper.getSampleRowDAO(transaction);
// Only rows which are not finished will be kept
- TopiaQuery query = new TopiaQuery(SampleRow.class).add("program.periodEnd", Op.GE, current);
+ TopiaQuery<SampleRow> query = dao.createQuery().add("program.periodEnd", Op.GE, current);
if (!user.getAdmin()) {
query.add(SampleRow.COMPANY, user.getCompany());
}
- results = query.executeToEntityList(transaction, SampleRow.class);
+ results = query.executeToEntityList();
// SampleRowDAO dao = SuiviObsmerModelDAOHelper.getSampleRowDAO(transaction);
//
Modified: trunk/suiviobsmer-business/src/main/xmi/suiviobsmer.zargo
===================================================================
(Binary files differ)
1
0
[Suiviobsmer-commits] r161 - in trunk: suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl suiviobsmer-ui/src/main/resources
by fdesbois@users.labs.libre-entreprise.org 29 Dec '09
by fdesbois@users.labs.libre-entreprise.org 29 Dec '09
29 Dec '09
Author: fdesbois
Date: 2009-12-29 12:17:31 +0000 (Tue, 29 Dec 2009)
New Revision: 161
Removed:
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/TopiaQuery.java
Modified:
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/QueryBuilder.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatInfosImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ProgramImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/SampleRowImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ActivityCalendarImport.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceContactImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceUserImpl.java
trunk/suiviobsmer-ui/src/main/resources/log4j.properties
Log:
- Move TopiaQuery to ToPIA
- Improve activityCalendar import and boat import
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/QueryBuilder.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/QueryBuilder.java 2009-12-24 15:57:38 UTC (rev 160)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/QueryBuilder.java 2009-12-29 12:17:31 UTC (rev 161)
@@ -21,12 +21,18 @@
package fr.ifremer.suiviobsmer;
-import fr.ifremer.suiviobsmer.TopiaQuery.Op;
+import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.framework.TopiaQuery.Op;
import fr.ifremer.suiviobsmer.bean.ContactState;
import fr.ifremer.suiviobsmer.entity.Boat;
+import fr.ifremer.suiviobsmer.entity.BoatImpl;
import fr.ifremer.suiviobsmer.entity.Company;
import fr.ifremer.suiviobsmer.entity.Contact;
import java.util.Date;
+import org.hibernate.SQLQuery;
+import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.framework.TopiaContextImplementor;
+import org.nuiton.topia.framework.TopiaQuery;
/**
* QueryBuilder
@@ -88,4 +94,12 @@
return query;
}
+// public static Boat getBoatByImmatriculation(TopiaContext transaction, int immatriculation) throws TopiaException {
+// TopiaContextImplementor topia = (TopiaContextImplementor)transaction;
+// SQLQuery query = topia.getHibernate().createSQLQuery(
+// "SELECT * FROM boat WHERE immatriculation = " + immatriculation);
+//
+// return (Boat)query.addEntity(BoatImpl.class).uniqueResult();
+// }
+
}
Deleted: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/TopiaQuery.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/TopiaQuery.java 2009-12-24 15:57:38 UTC (rev 160)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/TopiaQuery.java 2009-12-29 12:17:31 UTC (rev 161)
@@ -1,583 +0,0 @@
-/*
- * *##%
- * SuiviObsmer :: Business
- * Copyright (C) 2009 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;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Level;
-import org.apache.commons.beanutils.PropertyUtils;
-import org.apache.commons.lang.StringUtils;
-import org.nuiton.topia.TopiaContext;
-import org.nuiton.topia.TopiaException;
-import org.nuiton.topia.persistence.TopiaEntity;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * TopiaQuery
- *
- * Created: 21 déc. 2009
- *
- * @author fdesbois
- * @version $Revision$
- *
- * Mise a jour: $Date$
- * par : $Author$
- */
-public class TopiaQuery {
-
- private static final Logger log = LoggerFactory.getLogger(TopiaQuery.class);
-
- /** Params for HQL query **/
- protected List<Object> params;
-
- /** Select part of the query **/
- protected String select;
-
- /** From part of the query **/
- protected String from;
-
- /** Where part of the query **/
- protected String where;
-
- /** Order By part of the query **/
- protected String orderBy;
-
- /** Group By part of the query **/
- protected String groupBy;
-
- /** Used to determine if parentheses are needed for Where input **/
- protected boolean parentheses;
-
- protected List<String> propertiesToLoad;
-
- /**
- * Enum to simmplify using operation in query
- */
- public static enum Op {
- /** EQUALS **/
- EQ("="),
- /** GREATER THAN **/
- GT(">"),
- /** GREATER OR EQUALS **/
- GE(">="),
- /** LIKE for String manipulation **/
- LIKE("LIKE"),
- /** LESS THAN **/
- LT("<"),
- /** LESS OR EQUALS **/
- LE("<="),
- /** IS NOT NULL **/
- NOT_NULL("IS NOT NULL");
-
- protected String value;
-
- /**
- * Constructor of the Op Enum.
- *
- * @param value corresponding to the String for the query
- */
- Op(String value) {
- this.value = value;
- }
-
- @Override
- public String toString() {
- return this.value;
- }
- }
-
- /**
- * Constructor of TopiaQuery with entityClass initialization.
- *
- * @param entityClass Class for an entity Query
- */
- public TopiaQuery(Class<? extends TopiaEntity> entityClass) {
- this(entityClass.getName());
- }
-
- /**
- * Constructor of TopiaQuery with String form initialization.
- *
- * @param from From part for the Query
- */
- public TopiaQuery(String from) {
- this.from = " FROM " + from;
- parentheses = true;
- }
-
- @Override
- public String toString() {
- return fullQuery();
- }
-
- /**
- * Get the full query.
- *
- * @return a String corresponding to the full query.
- */
- public String fullQuery() {
- String result = "";
- if (select != null) {
- result = select;
- }
- result += from;
- if (where != null) {
- result += where;
- }
- if (groupBy != null) {
- result += groupBy;
- }
- if (orderBy != null) {
- result += orderBy;
- }
- return result.trim();
- }
-
- /**
- * Add a HQL parameter to the Query.
- *
- * @param id identification of the param in the query
- * @param e value of the param
- * @return the TopiaQuery
- */
- public TopiaQuery addParam(String id, Object e) {
- if (params == null) {
- params = new ArrayList<Object>();
- }
- params.add(id);
- params.add(e);
- return this;
- }
-
- /**
- * Add a property to load when query is executed.
- * Used to avoid LazyInitializationException for property needed after closing context.
- * The property is a string like those in HQL query.
- * <pre>
- * Exemples :
- * - "person.company" (Property TopiaEntity person linked to the result entity in query and company linked to person)
- * --> calling myEntity.getPerson().getCompany();
- * - "partyRoles" (Property Collection partyRoles linked to the result entity in query)
- * --> calling myEntity.getPartyRoles().size();
- * </pre>
- *
- * @param properties
- * @return
- */
- public TopiaQuery addLoad(String... properties) {
- getPropertiesToLoad().addAll(Arrays.asList(properties));
- return this;
- }
-
- protected List<String> getPropertiesToLoad() {
- if (propertiesToLoad == null) {
- propertiesToLoad = new ArrayList<String>();
- }
- return propertiesToLoad;
- }
-
- /**
- * Add a where element to the Query. Could be anything.
- * Parentheses are added automatically (even if there are not needed).
- *
- * @param where element to add
- * @return the TopiaQuery
- */
- public TopiaQuery add(String where) {
- if (this.where == null) {
- this.where = " WHERE ";
- } else {
- this.where += " AND ";
- }
- if (parentheses) {
- this.where += "(";
- }
- this.where += where;
- if (parentheses) {
- this.where += ")";
- }
- parentheses = true;
- return this;
- }
-
- /**
- * Add an element to the query. The parameter will be automatically added.
- * The constraint is needed to determine what type of operation it is.
- *
- * @param paramName the name of the parameter in the query (attribute of the entity)
- * @param constraint the operation concerned
- * @param paramValue the value of the parameter (an other entity, a String, ...)
- * @return the TopiaQuery
- */
- public TopiaQuery add(String paramName, Op constraint, Object paramValue) {
- int dot = paramName.lastIndexOf(".");
- String valueName = paramName;
- if (dot != -1) {
- valueName = paramName.substring(dot+1);
- }
- parentheses = false;
- return add(paramName + " " + constraint + " :" + valueName).addParam(valueName, paramValue);
- }
-
- /**
- * Add an element to the query with the constraint Not null.
- *
- * @param paramName name of the parameter in the query
- * @return the TopiaQuery
- */
- public TopiaQuery addNotNull(String paramName) {
- return add(paramName + " " + Op.NOT_NULL);
- }
-
- /**
- * Add an element to the query. The parameter will be automatically added.
- * The default constrainst operation is Op.EQ for EQUALS.
- * Ex : add("boat", boat) means -> boat = :boat.
- *
- * @param paramName name of the parameter in the query
- * @param paramValue value of the parameter
- * @return the TopiaQuery
- * @see #add(java.lang.String, fr.ifremer.suiviobsmer.TopiaQuery.Op, java.lang.Object)
- */
- public TopiaQuery add(String paramName, Object paramValue) {
- return add(paramName, Op.EQ, paramValue);
- }
-
- /**
- * Add an element to the from in the query. Used to add some other data in the query or for join.
- *
- * @param str the element to add
- * @return the TopiaQuery
- */
- public TopiaQuery addFrom(String str) {
- from += ", " + str;
- return this;
- }
-
- /**
- * Add an element to the select in the query. Used to add some parameters for the return of query.
- *
- * @param select element to add
- * @return the TopiaQuery
- */
- public TopiaQuery addSelect(String select) {
- if (this.select == null) {
- this.select = "SELECT ";
- } else {
- this.select += ", ";
- }
- this.select += select;
- return this;
- }
-
- /**
- * Add an element to the order in the query. Used to add some parameters to order by.
- *
- * @param order element to add
- * @return the TopiaQuery
- */
- public TopiaQuery addOrder(String order) {
- if (orderBy == null) {
- orderBy = " ORDER BY ";
- } else {
- orderBy += ", ";
- }
- orderBy += order;
- return this;
- }
-
- public TopiaQuery addOrderDesc(String order) {
- return addOrder(order + " DESC");
- }
-
- /**
- * Add an element to the group of the query. Used to add some paramters to group by.
- *
- * @param group element to add
- * @return the TopiaQuery
- */
- public TopiaQuery addGroup(String group) {
- if (groupBy == null) {
- groupBy = " GROUP BY ";
- } else {
- groupBy += ", ";
- }
- groupBy += group;
- return this;
- }
-
- /**
- * Simple execution of the query. This method use directly the find method in TopiaContext interface.
- *
- * @param transaction the TopiaContext to use for execution
- * @return a List of results
- * @throws TopiaException
- * @see org.nuiton.topia.TopiaContext#find(java.lang.String, java.lang.Object[])
- */
- public List execute(TopiaContext transaction) throws TopiaException {
- if (log.isTraceEnabled()) {
- log.trace("# QUERY : " + fullQuery());
- if (params != null) {
- log.trace("# PARAMS : " + Arrays.toString(params.toArray()));
- }
- }
- if (params == null) {
- return transaction.find(fullQuery());
- }
- return transaction.find(fullQuery(), params.toArray());
- }
-
- /**
- * Execute the query and get a List of entity. Some properties will be loaded if they are
- * prealably set using ${@link #addLoad(java.lang.String[]) }.
- *
- * @param <T> the type of TopiaEntity to return
- * @param transaction the TopiaContext to use for execution
- * @param entityClass the class of the TopiaEntity used for return type
- * @return a List of TopiaEntity corresponding to the entityClass in argument
- * @throws TopiaException
- * @throws ClassCastException
- */
- public <T extends TopiaEntity> List<T> executeToEntityList(TopiaContext transaction, Class<T> entityClass)
- throws TopiaException, ClassCastException {
- List res = execute(transaction);
- if (log.isTraceEnabled()) {
- log.trace("Properties to load : " + getPropertiesToLoad());
- }
- List<T> results = new ArrayList<T>();
- for (Object o : res) {
- if (o != null && !entityClass.isAssignableFrom(o.getClass())) {
- throw new ClassCastException("Invalid cast for " + entityClass.getName());
- }
- T entity = (T)o;
- if (!getPropertiesToLoad().isEmpty()) {
- loadProperties(entity);
- }
- results.add(entity);
- }
- return results;
- }
-
- /**
- * Load all properties for the entity.
- *
- * @param <T> type of the entity extends TopiaEntity
- * @param entity used to load properties
- * @throws TopiaException
- */
- protected <T extends TopiaEntity> void loadProperties(T entity) throws TopiaException {
- for (String prop : getPropertiesToLoad()) {
- if (log.isTraceEnabled()) {
- log.trace("load property " + prop + " ...");
- }
- List<String> str = Arrays.asList(prop.split("\\."));
- Iterator<String> it = str.iterator();
- TopiaEntity currEntity = entity;
- while (it.hasNext()) {
- String s = it.next();
- if (log.isTraceEnabled()) {
- log.trace("Current entity : " + currEntity.getClass().getSimpleName());
- log.trace("Current loading : " + s);
- }
- if (it.hasNext()) {
- currEntity = loadEntityProperty(currEntity, s);
- } else {
- loadProperty(currEntity, s);
- }
- }
- }
- }
-
- /**
- * Load a property of type TopiaEntity from an other entity.
- *
- * @param <T> type of the entity extends TopiaEntity
- * @param entity used to load the property
- * @param property name of the property in the entity
- * @return a TopiaEntity corresponding to the property loaded
- * @throws TopiaException
- */
- protected <T extends TopiaEntity> TopiaEntity loadEntityProperty(T entity, String property) throws TopiaException {
- return (TopiaEntity)loadProperty(entity, property);
- }
-
- /**
- * Load a property from an entity.
- *
- * @param <T> type of the entity extends TopiaEntity
- * @param entity used to load the property
- * @param property name of the property in the entity
- * @return an Object corresponding to the property loaded
- * @throws TopiaException
- */
- protected <T extends TopiaEntity> Object loadProperty(T entity, String property) throws TopiaException {
- try {
- Object res = PropertyUtils.getProperty(entity, property);
- if (log.isTraceEnabled()) {
- log.trace("load property '" + property + "' for '" + entity.getClass().getSimpleName() + "'");
- }
- if (Collection.class.isAssignableFrom(res.getClass())) {
- Collection list = (Collection) res;
- list.size();
- }
- return res;
- } catch (IllegalAccessException eee) {
- throw new TopiaException("Illegal access on property " + property + " from entity " + entity.getClass().getName(), eee);
- } catch (InvocationTargetException eee) {
- throw new TopiaException("Invocation error on entity " + entity.getClass().getName() + " for property " + property, eee);
- } catch (NoSuchMethodException eee) {
- throw new TopiaException("Getter method does not exist for property " + property + " from entity " + entity.getClass().getName(), eee);
- }
- }
-
- /**
- * Execute the query and get a Map of entity with key type in argument. Some properties will be loaded if they are
- * prealably set using ${@link #addLoad(java.lang.String[]) }.
- *
- * @param <K> the type of the map key
- * @param <T> the type of entity, value of the map
- * @param transaction the TopiaContext to use for execution
- * @param entityClass the class of the TopiaEntity used for return
- * @param keyName the property name of the key in the entity
- * @param keyClass the key class for the result map
- * @return a Map with the key type defined and the entity in value
- * @throws TopiaException
- * @throws ClassCastException
- */
- public <K, T extends TopiaEntity> Map<K, T> executeToEntityMap(TopiaContext transaction, Class<T> entityClass, String keyName, Class<K> keyClass)
- throws TopiaException, ClassCastException {
-
- Map<K, T> results = new HashMap<K, T>();
- //for (PropertyDescriptor)
- for (T elmt : executeToEntityList(transaction, entityClass)) {
- Object value = loadProperty(elmt, keyName);
- if (value != null && !keyClass.isAssignableFrom(value.getClass())) {
- throw new ClassCastException("Invalid cast for " + keyClass.getName());
- }
- results.put((K)value, elmt);
- }
- return results;
- }
-
- /**
- * Execute the query and get a Map of entity with topiaId in key. Some properties will be loaded if they are
- * prealably set using ${@link #addLoad(java.lang.String[]) }.
- *
- * @param <T> the type of entity, value of the map
- * @param transaction the TopiaContext to use for execution
- * @param entityClass the class of the TopiaEntity used for return
- * @return a Map with the key type defined and the entity in value
- * @throws TopiaException
- * @throws ClassCastException
- */
- public <T extends TopiaEntity> Map<String, T> executeToEntityMap(TopiaContext transaction, Class<T> entityClass)
- throws TopiaException, ClassCastException {
- return executeToEntityMap(transaction, entityClass, TopiaEntity.TOPIA_ID, String.class);
- }
-
- /**
- * Execute the query and get the first result entity. Some properties will be loaded if they are
- * prealably set using ${@link #addLoad(java.lang.String[]) }.
- *
- * @param <T> the type of TopiaEntity to return
- * @param transaction the TopiaContext to use for execution
- * @param entityClass the class of the TopiaEntity used for return type
- * @return a TopiaEntity corresponding to the entityClass in argument
- * @throws TopiaException
- * @throws ClassCastException
- */
- public <T extends TopiaEntity> T executeToEntity(TopiaContext transaction, Class<T> entityClass)
- throws TopiaException, ClassCastException {
- List<T> results = executeToEntityList(transaction, entityClass);
- return !results.isEmpty() ? results.get(0) : null;
- }
-
- /**
- * Execute the query and get an Integer for result. Used for query with COUNT or SUM, ...
- * The select is overriden to get only the right value for return.
- *
- * @param transaction the TopiaContext to use for execution
- * @param select the Select overriden (ex : SUM(myParam))
- * @return an Integer
- * @throws TopiaException
- */
- public int executeToInteger(TopiaContext transaction, String select) throws TopiaException {
- Long res = (Long)executeToObject(transaction, select);
- return res != null ? res.intValue() : 0;
- }
-
- /**
- * Execute the query and get a String for result. Used for query with MAX, ...
- * The select is overriden to get only the right value for return.
- *
- * @param transaction the TopiaContext to use for execution
- * @param select the Select overriden (ex : MAX(myParam))
- * @return a String
- * @throws TopiaException
- */
- public String executeToString(TopiaContext transaction, String select) throws TopiaException {
- Object res = executeToObject(transaction, select);
- return res != null ? (String)res : "";
- }
-
- /**
- * Execute the query and get an Object for result.
- * The select is overriden to get only the right value for return.
- *
- * @param transaction the TopiaContext to use for execution
- * @param select the Select overriden
- * @return an Object
- * @throws TopiaException
- */
- public Object executeToObject(TopiaContext transaction, String select) throws TopiaException {
- String oldValue = this.select;
- if (!StringUtils.isEmpty(select)) {
- this.select = "SELECT " + select;
- }
- Object result = null;
- List results = execute(transaction);
- if (!results.isEmpty()) {
- result = results.get(0);
- }
- this.select = oldValue;
- return result;
- }
-
- /**
- * Execute a simple count on the query, i.e. the number of results get from the query.
- *
- * @param transaction the TopiaContext to use for execution
- * @return an int corresponding to the number of result in the query
- * @throws TopiaException
- */
- public int executeCount(TopiaContext transaction) throws TopiaException {
- return executeToInteger(transaction, "COUNT(*)");
- }
-
-}
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatImpl.java 2009-12-24 15:57:38 UTC (rev 160)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatImpl.java 2009-12-29 12:17:31 UTC (rev 161)
@@ -24,7 +24,7 @@
import fr.ifremer.suiviobsmer.QueryBuilder;
import fr.ifremer.suiviobsmer.SuiviObsmerException;
import fr.ifremer.suiviobsmer.SuiviObsmerContext;
-import fr.ifremer.suiviobsmer.TopiaQuery;
+import org.nuiton.topia.framework.TopiaQuery;
import fr.ifremer.suiviobsmer.bean.ContactState;
import java.io.Serializable;
import org.nuiton.topia.TopiaContext;
@@ -63,18 +63,6 @@
try {
transaction = SuiviObsmerContext.getTopiaRootContext().beginTransaction();
-// String contactClassName = Contact.class.getName();
-// // Return the last contact for this boat and company
-// List results = transaction.find(
-// "FROM " + contactClassName + " C1" +
-// " WHERE C1.user.company = :company" +
-// " AND C1.boat = :boat" +
-// " AND C1.topiaCreateDate = " +
-// " (SELECT MAX(C2.topiaCreateDate) FROM " + contactClassName + " C2" +
-// " WHERE C2.user.company = :company AND C2.boat = C1.boat)",
-// "company", company,
-// "boat", this);
-
TopiaQuery query = QueryBuilder.createQueryLastContactForBoat(this, company);
Contact contact = query.executeToEntity(transaction, Contact.class);
if (contact != null) {
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatInfosImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatInfosImpl.java 2009-12-24 15:57:38 UTC (rev 160)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatInfosImpl.java 2009-12-29 12:17:31 UTC (rev 161)
@@ -24,7 +24,7 @@
import fr.ifremer.suiviobsmer.QueryBuilder;
import fr.ifremer.suiviobsmer.SuiviObsmerContext;
import fr.ifremer.suiviobsmer.SuiviObsmerException;
-import fr.ifremer.suiviobsmer.TopiaQuery;
+import org.nuiton.topia.framework.TopiaQuery;
import java.io.Serializable;
import org.nuiton.topia.TopiaContext;
import java.util.Date;
@@ -109,53 +109,4 @@
}
return result;
}
-
- /**
- * Execute the HQL query for counting contact with BoardingDone state since the fromDate.
- * This query is used to get all boarding dones on this boat for all companies or only for the
- * current one. Only the validate contacts by company will be count. The param fromDate can be null,
- * in this case, all contacts will be counted (not matter which date then started).
- *
- * @param transaction TopiaContext to execute the query
- * @param fromDate the date to start calcul
- * @param companyOnly boolean used to filter by the current company or not
- * @return the number of boarding done since fromDate
- * @throws TopiaException
- */
-// protected int countDoneContactsFromDate(TopiaContext transaction, Date fromDate, boolean companyOnly) throws TopiaException {
-// int result = 0;
-//
-// List<Object> params = new ArrayList<Object>();
-// String contactClassName = Contact.class.getName();
-// String query = "SELECT COUNT(*)" +
-// " FROM " + contactClassName +
-// " WHERE boat = :boat AND state = :boardingDone" +
-// " AND validationCompany = :booleanTrue" +
-// " AND (validationProgram IS NULL OR validationProgram = :booleanTrue)";
-//
-// params.add("boat"); params.add(getBoat());
-// params.add("boardingDone"); params.add(ContactState.BOARDING_DONE.toString());
-// params.add("booleanTrue"); params.add(Boolean.TRUE);
-//
-// if (fromDate != null) {
-// query += " AND tideBeginDate >= :fromDate";
-// params.add("fromDate");
-// params.add(fromDate);
-// }
-//
-// if (companyOnly) {
-// query+= " AND user.company = :company";
-// params.add("company");
-// params.add(getCompany());
-// }
-//
-// List results = transaction.find(query, params.toArray());
-//
-// if (!results.isEmpty()) {
-// Long tmp = (Long) results.get(0);
-// result += tmp.intValue();
-// }
-//
-// return result;
-// }
}
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ProgramImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ProgramImpl.java 2009-12-24 15:57:38 UTC (rev 160)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ProgramImpl.java 2009-12-29 12:17:31 UTC (rev 161)
@@ -23,8 +23,8 @@
import fr.ifremer.suiviobsmer.SuiviObsmerContext;
import fr.ifremer.suiviobsmer.SuiviObsmerException;
-import fr.ifremer.suiviobsmer.TopiaQuery;
-import fr.ifremer.suiviobsmer.TopiaQuery.Op;
+import org.nuiton.topia.framework.TopiaQuery;
+import org.nuiton.topia.framework.TopiaQuery.Op;
import java.io.Serializable;
import java.text.NumberFormat;
import java.util.Calendar;
@@ -91,19 +91,11 @@
Calendar refBegin = new GregorianCalendar();
refBegin.setTime(begin);
refBegin.set(Calendar.DAY_OF_MONTH, 1);
- /*refBegin.set(Calendar.HOUR, 0);
- refBegin.set(Calendar.MINUTE, 0);
- refBegin.set(Calendar.SECOND, 0);
- refBegin.set(Calendar.MILLISECOND, 0);*/
Calendar refEnd = new GregorianCalendar();
refEnd.setTime(end);
int max = refEnd.getActualMaximum(Calendar.DAY_OF_MONTH);
refEnd.set(Calendar.DAY_OF_MONTH, max);
- /*refBegin.set(Calendar.HOUR, 0);
- refBegin.set(Calendar.MINUTE, 0);
- refBegin.set(Calendar.SECOND, 0);
- refBegin.set(Calendar.MILLISECOND, 0);*/
return ! (refEnd.before(getCalendarBegin()) || refBegin.after(getCalendarEnd()));
}
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/SampleRowImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/SampleRowImpl.java 2009-12-24 15:57:38 UTC (rev 160)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/SampleRowImpl.java 2009-12-29 12:17:31 UTC (rev 161)
@@ -201,11 +201,4 @@
month.addRealTideTime(-nbDays);
}
-// protected int getDifferenceDays(Contact contact) {
-// int nbDays = DateUtils.getDifferenceInDays(contact.getTideBeginDate(), contact.getTideEndDate());
-// // difference nbDays + 1 for the first day
-// nbDays++;
-// return nbDays;
-// }
-
}
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ActivityCalendarImport.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ActivityCalendarImport.java 2009-12-24 15:57:38 UTC (rev 160)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ActivityCalendarImport.java 2009-12-29 12:17:31 UTC (rev 161)
@@ -25,6 +25,7 @@
import com.csvreader.CsvReader;
import fr.ifremer.suiviobsmer.entity.ActivityCalendar;
import fr.ifremer.suiviobsmer.entity.ActivityCalendarDAO;
+import fr.ifremer.suiviobsmer.entity.ActivityCalendarImpl;
import fr.ifremer.suiviobsmer.entity.ActivityMonth;
import fr.ifremer.suiviobsmer.entity.ActivityMonthDAO;
import fr.ifremer.suiviobsmer.entity.ActivityProfession;
@@ -32,7 +33,6 @@
import fr.ifremer.suiviobsmer.entity.ActivityZone;
import fr.ifremer.suiviobsmer.entity.ActivityZoneDAO;
import fr.ifremer.suiviobsmer.entity.Boat;
-import fr.ifremer.suiviobsmer.entity.BoatDAO;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
@@ -43,11 +43,16 @@
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Date;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.time.DurationFormatUtils;
+import org.hibernate.SQLQuery;
import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.framework.TopiaContextImplementor;
+import org.nuiton.topia.framework.TopiaQuery;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -70,6 +75,54 @@
private static final Logger log = LoggerFactory.getLogger(ActivityCalendarImport.class);
+ private static final boolean DISABLED = false;
+
+ // CREATE UNIQUE INDEX boat_immatriculation_idx ON BOAT(IMMATRICULATION)
+ // CREATE UNIQUE INDEX activitycalendar_idx ON ACTIVITYCALENDAR (BOAT, YEAR)
+ // CREATE UNIQUE INDEX shipowner_idx ON SHIPOWNER (CODE)
+
+ public class ActivityCalendarKey {
+
+ private Boat _boat;
+ private String _boatId;
+ private int _year;
+
+ public ActivityCalendarKey(Boat boat, int year) {
+ _boatId = boat.getTopiaId();
+ _year = year;
+ _boat = boat;
+ }
+
+ public String boatId() {
+ return _boatId;
+ }
+
+ public Boat boat() {
+ return _boat;
+ }
+
+ public int year() {
+ return _year;
+ }
+
+ @Override
+ public boolean equals(Object key) {
+ if (!ActivityCalendarKey.class.isAssignableFrom(key.getClass())) {
+ throw new ClassCastException("Unable to cast object " + key.getClass() + " to " + this.getClass().getName());
+ }
+ ActivityCalendarKey calendarKey = (ActivityCalendarKey)key;
+ return _year == calendarKey.year() && _boatId.equals(calendarKey.boatId());
+ }
+
+ @Override
+ public int hashCode() {
+ int hash = 7;
+ hash = 61 * hash + (this._boatId != null ? this._boatId.hashCode() : 0);
+ hash = 61 * hash + this._year;
+ return hash;
+ }
+ }
+
public ActivityCalendarImport(InputStream input) throws IOException {
super();
this.input = input;
@@ -100,67 +153,105 @@
int result = 0;
+ long firstTic = startTime;
+
+ long tic1, tic2;
+
+ Map<ActivityCalendarKey, ActivityCalendar> availableCalendars = new HashMap<ActivityCalendarKey, ActivityCalendar>();
+
+ //BoatDAO boatDAO = SuiviObsmerModelDAOHelper.getBoatDAO(transaction);
+ ActivityCalendarDAO calendarDAO = SuiviObsmerModelDAOHelper.getActivityCalendarDAO(transaction);
+ ActivityMonthDAO monthDAO = SuiviObsmerModelDAOHelper.getActivityMonthDAO(transaction);
+ ActivityProfessionDAO professionDAO = SuiviObsmerModelDAOHelper.getActivityProfessionDAO(transaction);
+ ActivityZoneDAO zoneDAO = SuiviObsmerModelDAOHelper.getActivityZoneDAO(transaction);
+
while(reader.readRecord()) {
currRow++;
- String timeLog = "";
- long firstTic = System.currentTimeMillis();
- //result[0]++;
-
-// if (log.isTraceEnabled()) {
-// log.trace(" " + Arrays.asList(reader.getValues()));
-// }
+ //long firstTic = System.currentTimeMillis();
int boatImmatriculation = Integer.parseInt(reader.get("NAVS_COD").trim());
- BoatDAO boatDAO = SuiviObsmerModelDAOHelper.getBoatDAO(transaction);
+// long tic1 = System.currentTimeMillis();
- Boat boat = boatDAO.findByImmatriculation(boatImmatriculation);
+ //Boat boat = boatDAO.findByImmatriculation(boatImmatriculation);
+// TopiaContextImplementor topia = (TopiaContextImplementor)transaction;
+// SQLQuery query = topia.getHibernate().createSQLQuery(
+// "SELECT * FROM boat WHERE immatriculation = " + boatImmatriculation);
+//
+// Boat boat = (Boat)query.addEntity(BoatImpl.class).uniqueResult();
+ Boat boat = new TopiaQuery(Boat.class).add(Boat.IMMATRICULATION, boatImmatriculation).executeToEntity(transaction);
+
+// long tic2 = System.currentTimeMillis();
+// log.info("findByImmatriculation : " + (tic2 - tic1));
if (boat != null) {
+
+ int year = Integer.parseInt(reader.get("SYNA_AN").trim());
- ActivityCalendarDAO dao = SuiviObsmerModelDAOHelper.getActivityCalendarDAO(transaction);
+ ActivityCalendarKey key = new ActivityCalendarKey(boat, year);
+ ActivityCalendar calendar = availableCalendars.get(key);
- int year = Integer.parseInt(reader.get("SYNA_AN").trim());
+// tic1 = System.currentTimeMillis();
- ActivityCalendar calendar = dao.findByProperties(
- ActivityCalendar.BOAT, boat,
- ActivityCalendar.YEAR, year);
-
+ // If not available select it from Database
if (calendar == null) {
- int fiability = Integer.parseInt(reader.get("INDQ_COD").trim());
+// TopiaContextImplementor topia = (TopiaContextImplementor)transaction;
+// SQLQuery query = topia.getHibernate().createSQLQuery(
+// "SELECT * FROM activityCalendar WHERE boat = '" + key.boatId() + "' AND year = " + key.year());
+//
+// calendar = (ActivityCalendar)query.addEntity(ActivityCalendarImpl.class).uniqueResult();
- calendar = dao.create(
- ActivityCalendar.BOAT, boat,
- ActivityCalendar.YEAR, year,
- ActivityCalendar.FIABILITY, fiability);
+ calendar = new TopiaQuery(ActivityCalendar.class).
+ add(ActivityCalendar.BOAT, boat).
+ add(ActivityCalendar.YEAR, year).
+ executeToEntity(transaction);
- calendar.setActivityMonth(new ArrayList<ActivityMonth>());
+ // Create it if not exist in Database
+ if (calendar == null) {
+ int fiability = Integer.parseInt(reader.get("INDQ_COD").trim());
- if (log.isDebugEnabled()) {
- info("Création d'un calendrier " + year +
- " pour le navire immatriculé " + boatImmatriculation, currRow);
+ calendar = calendarDAO.create(
+ ActivityCalendar.BOAT, key.boat(),
+ ActivityCalendar.YEAR, key.year(),
+ ActivityCalendar.FIABILITY, fiability);
+
+ calendar.setActivityMonth(new ArrayList<ActivityMonth>());
+
+ if (log.isDebugEnabled()) {
+ info("Création d'un calendrier " + year +
+ " pour le navire immatriculé " + boatImmatriculation, currRow);
+ }
}
+ availableCalendars.put(key, calendar);
}
+
+// ActivityCalendar calendar = calendarDAO.findByProperties(
+// ActivityCalendar.BOAT, boat,
+// ActivityCalendar.YEAR, year);
+
+// tic2 = System.currentTimeMillis();
+// log.info("calendar.findByProperties : " + (tic2 - tic1));
+
+
String calendarCode = "[ calendrier " + year + ", navire " + boatImmatriculation + " ]";
int monthNum = Integer.parseInt(reader.get("SYNA_MOI").trim());
String harbourCode = reader.get("SYNA_POR_COD").trim();
boolean active = !harbourCode.equals("INA");
+
ActivityMonth month = calendar.getActivityMonth(monthNum);
if (month == null) {
-
- ActivityMonthDAO monthDAO = SuiviObsmerModelDAOHelper.getActivityMonthDAO(transaction);
month = monthDAO.create(
ActivityMonth.ACTIVITY_CALENDAR, calendar,
ActivityMonth.MONTH, monthNum);
month.setActivityProfession(new ArrayList<ActivityProfession>());
- if (log.isDebugEnabled()) {
- info("Création du mois " + monthNum + " actif(" + active + ") " + calendarCode, currRow);
- }
+// if (log.isDebugEnabled()) {
+// info("Création du mois " + monthNum + " actif(" + active + ") " + calendarCode, currRow);
+// }
calendar.addActivityMonth(month);
}
@@ -180,9 +271,11 @@
Integer nbBoardingPersons = !nbBoardingPersonsString.equals("NA") ?
Integer.valueOf(nbBoardingPersonsString) : null;
- int harbourId = Integer.parseInt(reader.get("SYNA_TPOR_COD").trim());
+ String harbourIdString = reader.get("SYNA_TPOR_COD").trim();
+ int harbourId = !harbourIdString.equals("NA") ? Integer.parseInt(harbourIdString) : -1;
String harbourLibelle = reader.get("SYNA_POR_LIB").trim();
- //String harbourCode = reader.get("SYNA_POR_COD").trim();
+ harbourLibelle = !harbourLibelle.equals("NA") ? harbourLibelle : null;
+ harbourCode = !harbourCode.equals("NA") ? harbourCode : null;
month.setHarbourId(harbourId);
month.setHarbourCode(harbourCode);
@@ -195,24 +288,21 @@
String professionCode = reader.get("MET_COD").trim();
int professionId = Integer.parseInt(reader.get("MET_ID").trim());
String professionLibelle = reader.get("MET_LIB").trim();
-
ActivityProfession profession = month.getActivityProfession(professionOrder);
if (profession == null) {
- ActivityProfessionDAO professionDAO =
- SuiviObsmerModelDAOHelper.getActivityProfessionDAO(transaction);
profession = professionDAO.create(
ActivityProfession.ACTIVITY_MONTH, month,
ActivityProfession.PROFESSION_ORDER, professionOrder);
profession.setActivityZone(new ArrayList<ActivityZone>());
- if (log.isDebugEnabled()) {
- info("Création du métier " + professionOrder + " code(" + professionCode + ") " +
- "[ mois " + monthNum + " ] " +
- calendarCode, currRow);
- }
+// if (log.isDebugEnabled()) {
+// info("Création du métier " + professionOrder + " code(" + professionCode + ") " +
+// "[ mois " + monthNum + " ] " +
+// calendarCode, currRow);
+// }
month.addActivityProfession(profession);
}
@@ -226,29 +316,26 @@
String gradiantLibelle = reader.get("GRA_LIB").trim();
int zoneId = Integer.parseInt(reader.get("TSECT_COD").trim());
String zoneLibelle = reader.get("SECT_LIB").trim();
+
ActivityZone zone = profession.getActivityZone(zoneCode);
if (zone == null) {
-
- ActivityZoneDAO zoneDAO =
- SuiviObsmerModelDAOHelper.getActivityZoneDAO(transaction);
-
zone = zoneDAO.create(
ActivityZone.ZONE_CODE, zoneCode,
ActivityZone.ACTIVITY_PROFESSION, profession);
- if (log.isDebugEnabled()) {
- info("Création de la zone " + zoneCode + " [ mois " + monthNum + " ] " +
- calendarCode, currRow);
- }
+// if (log.isDebugEnabled()) {
+// info("Création de la zone " + zoneCode + " [ mois " + monthNum + " ] " +
+// calendarCode, currRow);
+// }
profession.addActivityZone(zone);
} else {
- if (log.isDebugEnabled()) {
- info("Ecrasement de la zone " + zoneCode + " [ mois " + monthNum + " ] " +
- calendarCode, currRow);
- }
+// if (log.isDebugEnabled()) {
+// info("Ecrasement de la zone " + zoneCode + " [ mois " + monthNum + " ] " +
+// calendarCode, currRow);
+// }
//warn("Zone déjà existante [" + zoneCode + "] ! :: " + Arrays.toString(reader.getValues()), currRow);
}
@@ -264,18 +351,37 @@
warn("Navire inexistant dans le référentiel : " + boatImmatriculation, currRow);
}
- if (log.isDebugEnabled()) {
- long tic = System.currentTimeMillis();
- log.debug("Time : " + DurationFormatUtils.formatDurationHMS(tic - firstTic));
- }
+// if (log.isDebugEnabled()) {
+// long tic = System.currentTimeMillis();
+// log.debug("Time : " + DurationFormatUtils.formatDurationHMS(tic - firstTic));
+// }
- if (result%500 == 0 && log.isInfoEnabled()) {
- log.info("RUNNING... Import calendrier d'activité ligne " + currRow);
+ if (result % 1000 == 0) {
+ tic1 = System.currentTimeMillis();
+
+ transaction.commitTransaction();
+ availableCalendars.clear();
+
+ tic2 = System.currentTimeMillis();
+ if (log.isDebugEnabled()) {
+ log.debug("commit : " + (tic2 - tic1));
+ }
+ if (log.isInfoEnabled()) {
+ log.info("RUNNING... Import calendrier d'activité ligne " + currRow);
+ Runtime runtime = Runtime.getRuntime();
+ long mem = runtime.totalMemory() - runtime.freeMemory();
+ long memMega = mem / 1024 / 1024;
+ log.info("Memory : " + memMega + " Mo");
+ long tic = System.currentTimeMillis();
+ log.info("Time : " + DurationFormatUtils.formatDurationHMS(tic - firstTic));
+ firstTic = System.currentTimeMillis();
+ }
}
-
- transaction.commitTransaction();
}
+ // For the last rows
+ transaction.commitTransaction();
+
long stopTime = System.currentTimeMillis();
String execTime = DurationFormatUtils.formatDurationHMS(stopTime - startTime);
@@ -314,8 +420,11 @@
}
protected void log(String message, int numRow) throws IOException {
+ if (DISABLED) {
+ return;
+ }
Date date = new Date();
- DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
+ DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss", Locale.FRENCH);
String dateString = dateFormat.format(date);
String ligne = numRow != -1 ? "Ligne (" + numRow + ") : " : "";
String msg = "[" + dateString + "] " + ligne + message;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImpl.java 2009-12-24 15:57:38 UTC (rev 160)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImpl.java 2009-12-29 12:17:31 UTC (rev 161)
@@ -28,8 +28,8 @@
import fr.ifremer.suiviobsmer.SuiviObsmerContext;
import fr.ifremer.suiviobsmer.SuiviObsmerException;
import fr.ifremer.suiviobsmer.SuiviObsmerModelDAOHelper;
-import fr.ifremer.suiviobsmer.TopiaQuery;
-import fr.ifremer.suiviobsmer.TopiaQuery.Op;
+import org.nuiton.topia.framework.TopiaQuery;
+import org.nuiton.topia.framework.TopiaQuery.Op;
import fr.ifremer.suiviobsmer.bean.BoatFilter;
import fr.ifremer.suiviobsmer.bean.CompanyBoatInfos;
import fr.ifremer.suiviobsmer.bean.CompanyBoatInfosImpl;
@@ -50,6 +50,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.time.DurationFormatUtils;
import org.nuiton.topia.TopiaContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -71,8 +72,6 @@
protected TopiaContext rootContext;
- // CREATE UNIQUE INDEX boat_immatriculation_idx ON BOAT(IMMATRICULATION)
-
public ServiceBoatImpl() throws SuiviObsmerException {
rootContext = SuiviObsmerContext.getTopiaRootContext();
}
@@ -344,13 +343,23 @@
CsvReader reader = new CsvReader(input, Charset.forName("UTF-8"));
reader.readHeaders();
+ long startTime = System.currentTimeMillis();
+ long tic1, tic2;
+
+ BoatDAO boatDAO = SuiviObsmerModelDAOHelper.getBoatDAO(transaction);
+ ShipOwnerDAO shipOwnerDAO = SuiviObsmerModelDAOHelper.getShipOwnerDAO(transaction);
+
+ Map<String, ShipOwner> availableShipOwners = new HashMap<String, ShipOwner>();
+
+ tic1 = System.currentTimeMillis();
while(reader.readRecord()) {
result[0]++;
- if (log.isTraceEnabled()) {
- log.trace(" " + Arrays.asList(reader.getValues()));
- }
+// if (log.isTraceEnabled()) {
+// log.trace(" " + Arrays.asList(reader.getValues()));
+// }
+
int immatriculation = Integer.parseInt(reader.get("NAVS_COD").trim());
String boatName = reader.get("CARN_NOM").trim();
int boatLength = Integer.parseInt(reader.get("CARN_LONGUEUR_HT").trim());
@@ -362,10 +371,32 @@
String activeStr = reader.get("NAVS_ACTIVE").trim();
boolean active = !activeStr.equals("I");
- BoatDAO boatDAO = SuiviObsmerModelDAOHelper.getBoatDAO(transaction);
+
// Find existing boat with immatriculation
- Boat boat = boatDAO.findByImmatriculation(immatriculation);
+ //
+
+// long tic1 = System.currentTimeMillis();
+// boatDAO.findByImmatriculation(immatriculation);
+// long tic2 = System.currentTimeMillis();
+// if (log.isDebugEnabled()) {
+// log.debug("findByImmatriculation : " + (tic2 - tic1));
+// }
+//
+// tic1 = System.currentTimeMillis();
+// Boat boat = QueryBuilder.getBoatByImmatriculation(transaction, immatriculation);
+// tic2 = System.currentTimeMillis();
+// if (log.isDebugEnabled()) {
+// log.debug("findByImmatriculation SQL : " + (tic2 - tic1));
+// }
+
+// tic1 = System.currentTimeMillis();
+ Boat boat = new TopiaQuery(Boat.class).add(Boat.IMMATRICULATION, immatriculation).executeToEntity(transaction);
+// tic2 = System.currentTimeMillis();
+// if (log.isDebugEnabled()) {
+// log.debug("findByImmatriculation TopiaQuery : " + (tic2 - tic1));
+// }
+
if (boat == null) {
boat = boatDAO.create(Boat.IMMATRICULATION, immatriculation);
result[1]++;
@@ -376,19 +407,56 @@
boat.setBoatLength(boatLength);
boat.setActive(active);
- ShipOwnerDAO shipOwnerDAO = SuiviObsmerModelDAOHelper.getShipOwnerDAO(transaction);
// Find existing shipOwner with code
- ShipOwner shipOwner = shipOwnerDAO.findByCode(shipOwnerCode);
+ //ShipOwner shipOwner = shipOwnerDAO.findByCode(shipOwnerCode);
+
+ ShipOwner shipOwner = availableShipOwners.get(shipOwnerCode);
+
+ // If not available, select it from database
if (shipOwner == null) {
- shipOwner = shipOwnerDAO.create(ShipOwner.CODE, shipOwnerCode);
+ shipOwner = new TopiaQuery(ShipOwner.class).add(ShipOwner.CODE, shipOwnerCode).executeToEntity(transaction);
+
+ // If not exist yet, create it
+ if (shipOwner == null) {
+ shipOwner = shipOwnerDAO.create(ShipOwner.CODE, shipOwnerCode);
+ }
+
+ availableShipOwners.put(shipOwnerCode, shipOwner);
}
shipOwner.setFirstName(shipOwnerFirstName);
shipOwner.setLastName(shipOwnerLastName);
boat.setShipOwner(shipOwner);
- transaction.commitTransaction();
+ //transaction.commitTransaction();
+
+ if (result[0] % 1000 == 0) {
+ availableShipOwners.clear();
+
+ transaction.commitTransaction();
+ if (log.isInfoEnabled()) {
+ log.info("RUNNING... Import navires ligne " + result[0]);
+ Runtime runtime = Runtime.getRuntime();
+ long mem = (runtime.totalMemory() - runtime.freeMemory()) / 1048576;
+ //long memMega = mem / 1024 / 1024;
+ log.info("Memory : " + mem + " Mo");
+ tic2 = System.currentTimeMillis();
+ log.info("Time : " + DurationFormatUtils.formatDurationHMS(tic2 - tic1));
+ tic1 = System.currentTimeMillis();
+ }
+ }
}
+ // For the last rows
+ transaction.commitTransaction();
+
+ long stopTime = System.currentTimeMillis();
+
+ String execTime = DurationFormatUtils.formatDurationHMS(stopTime - startTime);
+
+ if (log.isInfoEnabled()) {
+ log.info("Durée de l'import : " + execTime);
+ }
+
transaction.closeContext();
} catch (Exception eee) {
SuiviObsmerContext.serviceException(transaction,
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 2009-12-24 15:57:38 UTC (rev 160)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceContactImpl.java 2009-12-29 12:17:31 UTC (rev 161)
@@ -24,7 +24,7 @@
import fr.ifremer.suiviobsmer.SuiviObsmerException;
import fr.ifremer.suiviobsmer.SuiviObsmerModelDAOHelper;
import fr.ifremer.suiviobsmer.SuiviObsmerContext;
-import fr.ifremer.suiviobsmer.TopiaQuery;
+import org.nuiton.topia.framework.TopiaQuery;
import fr.ifremer.suiviobsmer.bean.states.ContactStateEnum;
import fr.ifremer.suiviobsmer.entity.Boat;
import fr.ifremer.suiviobsmer.entity.Company;
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 2009-12-24 15:57:38 UTC (rev 160)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImpl.java 2009-12-29 12:17:31 UTC (rev 161)
@@ -41,12 +41,13 @@
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.framework.TopiaQuery;
+import org.nuiton.topia.framework.TopiaQuery.Op;
import org.nuiton.topia.persistence.util.EntityLoador;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -233,31 +234,42 @@
List<SampleRow> results = new ArrayList<SampleRow>();
try {
transaction = rootContext.beginTransaction();
-
- SampleRowDAO dao = SuiviObsmerModelDAOHelper.getSampleRowDAO(transaction);
+ Date current = SuiviObsmerContext.getCurrentDate();
+
+ // Only rows which are not finished will be kept
+ TopiaQuery query = new TopiaQuery(SampleRow.class).add("program.periodEnd", Op.GE, current);
+
if (!user.getAdmin()) {
- if (log.isDebugEnabled()) {
- log.debug("User company : " + user.getCompany().getName());
- }
- results = dao.findAllByCompany(user.getCompany());
- } else {
- results = dao.findAll();
+ query.add(SampleRow.COMPANY, user.getCompany());
}
- Iterator<SampleRow> it = results.iterator();
- while (it.hasNext()) {
- SampleRow row = it.next();
- // Only rows which are not finished will be kept
- if (row.getProgram().isFinished()) {
- it.remove();
- }/* else {
- // load data
- row.getProgram();
- row.getCompany();
- row.getProfession();
- }*/
- }
+ results = query.executeToEntityList(transaction, SampleRow.class);
+
+// SampleRowDAO dao = SuiviObsmerModelDAOHelper.getSampleRowDAO(transaction);
+//
+// if (!user.getAdmin()) {
+// if (log.isDebugEnabled()) {
+// log.debug("User company : " + user.getCompany().getName());
+// }
+// results = dao.findAllByCompany(user.getCompany());
+// } else {
+// results = dao.findAll();
+// }
+//
+// Iterator<SampleRow> it = results.iterator();
+// while (it.hasNext()) {
+// SampleRow row = it.next();
+// // Only rows which are not finished will be kept
+// if (row.getProgram().isFinished()) {
+// it.remove();
+// }/* else {
+// // load data
+// row.getProgram();
+// row.getCompany();
+// row.getProfession();
+// }*/
+// }
transaction.closeContext();
} catch (Exception eee) {
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceUserImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceUserImpl.java 2009-12-24 15:57:38 UTC (rev 160)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceUserImpl.java 2009-12-29 12:17:31 UTC (rev 161)
@@ -148,13 +148,6 @@
CompanyDAO dao = SuiviObsmerModelDAOHelper.getCompanyDAO(transaction);
- /*for (Company company : dao.findAll()) {
- results.add(company);
- // load users collection and call size() method to avoid LazyInitializationException from Hibernate
- List<User> users = (List<User>)company.getUser();
- users.size();
- }*/
-
if (activeOnly) {
results = dao.findAllByActive(activeOnly);
} else {
Modified: trunk/suiviobsmer-ui/src/main/resources/log4j.properties
===================================================================
--- trunk/suiviobsmer-ui/src/main/resources/log4j.properties 2009-12-24 15:57:38 UTC (rev 160)
+++ trunk/suiviobsmer-ui/src/main/resources/log4j.properties 2009-12-29 12:17:31 UTC (rev 161)
@@ -8,7 +8,7 @@
log4j.appender.console.Threshold=INFO
log4j.appender.globalfile=org.apache.log4j.RollingFileAppender
-log4j.appender.globalfile.File=${user.home}/.local/suiviobsmer/log/suiviobsmer.log
+log4j.appender.globalfile.File=/var/log/suiviobsmer/suiviobsmer.log
log4j.appender.globalfile.MaxFileSize=500KB
log4j.appender.globalfile.Append=true
log4j.appender.globalfile.MaxBackupIndex=10
1
0
[Suiviobsmer-commits] r160 - 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-business/src/test/java/fr/ifremer/suiviobsmer/impl
by fdesbois@users.labs.libre-entreprise.org 24 Dec '09
by fdesbois@users.labs.libre-entreprise.org 24 Dec '09
24 Dec '09
Author: fdesbois
Date: 2009-12-24 15:57:38 +0000 (Thu, 24 Dec 2009)
New Revision: 160
Removed:
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/DataLoader.java
Modified:
trunk/pom.xml
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/QueryBuilder.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/TopiaQuery.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceContactImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImpl.java
trunk/suiviobsmer-business/src/main/xmi/suiviobsmer.zargo
trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImplTest.java
trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImplTest.java
Log:
- Use topia SNAPSHOT for on topiaCreateDate type
- Improve queries + add property loading managment
- Use EntityLoador for getNewProfession
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-12-23 17:52:56 UTC (rev 159)
+++ trunk/pom.xml 2009-12-24 15:57:38 UTC (rev 160)
@@ -239,7 +239,7 @@
<!-- libraries version -->
<nuitonutils.version>1.1.2</nuitonutils.version>
- <topia.version>2.3.0-beta-2</topia.version>
+ <topia.version>2.3.0-beta-3-SNAPSHOT</topia.version>
<license.version>2.0.0</license.version>
<helper.version>1.1.0</helper.version>
<eugene.version>2.0.0-beta-2</eugene.version>
Deleted: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/DataLoader.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/DataLoader.java 2009-12-23 17:52:56 UTC (rev 159)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/DataLoader.java 2009-12-24 15:57:38 UTC (rev 160)
@@ -1,76 +0,0 @@
-/*
- * *##%
- * SuiviObsmer :: Business
- * Copyright (C) 2009 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;
-
-import fr.ifremer.suiviobsmer.entity.ActivityCalendar;
-import fr.ifremer.suiviobsmer.entity.ActivityMonth;
-import fr.ifremer.suiviobsmer.entity.ActivityProfession;
-import fr.ifremer.suiviobsmer.entity.ActivityZone;
-import fr.ifremer.suiviobsmer.entity.Contact;
-import fr.ifremer.suiviobsmer.entity.SampleRow;
-import java.util.List;
-
-/**
- * DataLoader
- *
- * Created: 3 déc. 2009
- *
- * @author fdesbois
- * @version $Revision$
- *
- * Used to load data to avoid LazyInitializationException
- *
- * Mise a jour: $Date$
- * par : $Author$
- */
-public class DataLoader {
-
- public static void loadContactForFindByFilters(Contact contact) {
- // load data
- contact.getUser().getCompany();
- SampleRow row = contact.getSampleRow();
- row.getProgram();
- row.getProfession();
- row.getCompany();
- //row.getFishingZone().size(); lazy=false
- }
-
- public static void loadActivityCalendar(ActivityCalendar calendar) {
- calendar.getBoat();
- List<ActivityMonth> months = calendar.getActivityMonth();
- for (ActivityMonth month : months) {
- if (month.getActive()) {
- List<ActivityProfession> professions = month.getActivityProfession();
- for (ActivityProfession profession : professions) {
- List<ActivityZone> zones = profession.getActivityZone();
- zones.size();
- }
- }
- }
- }
-
- public static void loadContactForBoatInfos(Contact contact) {
- contact.getSampleRow();
- contact.getUser();
- }
-
-}
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/QueryBuilder.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/QueryBuilder.java 2009-12-23 17:52:56 UTC (rev 159)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/QueryBuilder.java 2009-12-24 15:57:38 UTC (rev 160)
@@ -50,17 +50,17 @@
*/
public static TopiaQuery createQueryLastContactForBoat(Boat boat, Company company) {
String contactClassName = Contact.class.getName();
+ TopiaQuery query = new TopiaQuery(contactClassName + " C1").
+ add("C1.boat", boat).
+ add("C1.user.company = :company").
+ addParam("company", company);
+
TopiaQuery subquery = new TopiaQuery(contactClassName + " C2").
addSelect("MAX(C2.topiaCreateDate)").
add("C2.boat = C1.boat").
add("C2.user.company = :company");
- TopiaQuery query = new TopiaQuery(contactClassName + " C1").
- add("C1.boat", boat).
- add("C1.user.company = :company").
- addParam("company", company).
- add("C1.topiaCreateDate = (" + subquery.fullQuery() + ")");
-
+ query.add("C1.topiaCreateDate = (" + subquery.fullQuery() + ")");
return query;
}
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/TopiaQuery.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/TopiaQuery.java 2009-12-23 17:52:56 UTC (rev 159)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/TopiaQuery.java 2009-12-24 15:57:38 UTC (rev 160)
@@ -21,9 +21,16 @@
package fr.ifremer.suiviobsmer;
+import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
+import java.util.Map;
+import java.util.logging.Level;
+import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.lang.StringUtils;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
@@ -67,6 +74,8 @@
/** Used to determine if parentheses are needed for Where input **/
protected boolean parentheses;
+ protected List<String> propertiesToLoad;
+
/**
* Enum to simmplify using operation in query
*/
@@ -167,6 +176,33 @@
}
/**
+ * Add a property to load when query is executed.
+ * Used to avoid LazyInitializationException for property needed after closing context.
+ * The property is a string like those in HQL query.
+ * <pre>
+ * Exemples :
+ * - "person.company" (Property TopiaEntity person linked to the result entity in query and company linked to person)
+ * --> calling myEntity.getPerson().getCompany();
+ * - "partyRoles" (Property Collection partyRoles linked to the result entity in query)
+ * --> calling myEntity.getPartyRoles().size();
+ * </pre>
+ *
+ * @param properties
+ * @return
+ */
+ public TopiaQuery addLoad(String... properties) {
+ getPropertiesToLoad().addAll(Arrays.asList(properties));
+ return this;
+ }
+
+ protected List<String> getPropertiesToLoad() {
+ if (propertiesToLoad == null) {
+ propertiesToLoad = new ArrayList<String>();
+ }
+ return propertiesToLoad;
+ }
+
+ /**
* Add a where element to the Query. Could be anything.
* Parentheses are added automatically (even if there are not needed).
*
@@ -276,6 +312,10 @@
return this;
}
+ public TopiaQuery addOrderDesc(String order) {
+ return addOrder(order + " DESC");
+ }
+
/**
* Add an element to the group of the query. Used to add some paramters to group by.
*
@@ -314,34 +354,166 @@
}
/**
- * Execute the query and get a List of entity.
+ * Execute the query and get a List of entity. Some properties will be loaded if they are
+ * prealably set using ${@link #addLoad(java.lang.String[]) }.
*
* @param <T> the type of TopiaEntity to return
* @param transaction the TopiaContext to use for execution
* @param entityClass the class of the TopiaEntity used for return type
* @return a List of TopiaEntity corresponding to the entityClass in argument
* @throws TopiaException
+ * @throws ClassCastException
*/
- public <T extends TopiaEntity> List<T> executeToEntityList(TopiaContext transaction, Class<T> entityClass) throws TopiaException {
+ public <T extends TopiaEntity> List<T> executeToEntityList(TopiaContext transaction, Class<T> entityClass)
+ throws TopiaException, ClassCastException {
List res = execute(transaction);
-// List<T> results = new ArrayList<T>();
-// for (Object o : res) {
-// T entity = (T)o;
-// results.add(entity);
-// }
- return (List<T>)res;
+ if (log.isTraceEnabled()) {
+ log.trace("Properties to load : " + getPropertiesToLoad());
+ }
+ List<T> results = new ArrayList<T>();
+ for (Object o : res) {
+ if (o != null && !entityClass.isAssignableFrom(o.getClass())) {
+ throw new ClassCastException("Invalid cast for " + entityClass.getName());
+ }
+ T entity = (T)o;
+ if (!getPropertiesToLoad().isEmpty()) {
+ loadProperties(entity);
+ }
+ results.add(entity);
+ }
+ return results;
}
/**
- * Execute the query and get the first result entity.
+ * Load all properties for the entity.
*
+ * @param <T> type of the entity extends TopiaEntity
+ * @param entity used to load properties
+ * @throws TopiaException
+ */
+ protected <T extends TopiaEntity> void loadProperties(T entity) throws TopiaException {
+ for (String prop : getPropertiesToLoad()) {
+ if (log.isTraceEnabled()) {
+ log.trace("load property " + prop + " ...");
+ }
+ List<String> str = Arrays.asList(prop.split("\\."));
+ Iterator<String> it = str.iterator();
+ TopiaEntity currEntity = entity;
+ while (it.hasNext()) {
+ String s = it.next();
+ if (log.isTraceEnabled()) {
+ log.trace("Current entity : " + currEntity.getClass().getSimpleName());
+ log.trace("Current loading : " + s);
+ }
+ if (it.hasNext()) {
+ currEntity = loadEntityProperty(currEntity, s);
+ } else {
+ loadProperty(currEntity, s);
+ }
+ }
+ }
+ }
+
+ /**
+ * Load a property of type TopiaEntity from an other entity.
+ *
+ * @param <T> type of the entity extends TopiaEntity
+ * @param entity used to load the property
+ * @param property name of the property in the entity
+ * @return a TopiaEntity corresponding to the property loaded
+ * @throws TopiaException
+ */
+ protected <T extends TopiaEntity> TopiaEntity loadEntityProperty(T entity, String property) throws TopiaException {
+ return (TopiaEntity)loadProperty(entity, property);
+ }
+
+ /**
+ * Load a property from an entity.
+ *
+ * @param <T> type of the entity extends TopiaEntity
+ * @param entity used to load the property
+ * @param property name of the property in the entity
+ * @return an Object corresponding to the property loaded
+ * @throws TopiaException
+ */
+ protected <T extends TopiaEntity> Object loadProperty(T entity, String property) throws TopiaException {
+ try {
+ Object res = PropertyUtils.getProperty(entity, property);
+ if (log.isTraceEnabled()) {
+ log.trace("load property '" + property + "' for '" + entity.getClass().getSimpleName() + "'");
+ }
+ if (Collection.class.isAssignableFrom(res.getClass())) {
+ Collection list = (Collection) res;
+ list.size();
+ }
+ return res;
+ } catch (IllegalAccessException eee) {
+ throw new TopiaException("Illegal access on property " + property + " from entity " + entity.getClass().getName(), eee);
+ } catch (InvocationTargetException eee) {
+ throw new TopiaException("Invocation error on entity " + entity.getClass().getName() + " for property " + property, eee);
+ } catch (NoSuchMethodException eee) {
+ throw new TopiaException("Getter method does not exist for property " + property + " from entity " + entity.getClass().getName(), eee);
+ }
+ }
+
+ /**
+ * Execute the query and get a Map of entity with key type in argument. Some properties will be loaded if they are
+ * prealably set using ${@link #addLoad(java.lang.String[]) }.
+ *
+ * @param <K> the type of the map key
+ * @param <T> the type of entity, value of the map
+ * @param transaction the TopiaContext to use for execution
+ * @param entityClass the class of the TopiaEntity used for return
+ * @param keyName the property name of the key in the entity
+ * @param keyClass the key class for the result map
+ * @return a Map with the key type defined and the entity in value
+ * @throws TopiaException
+ * @throws ClassCastException
+ */
+ public <K, T extends TopiaEntity> Map<K, T> executeToEntityMap(TopiaContext transaction, Class<T> entityClass, String keyName, Class<K> keyClass)
+ throws TopiaException, ClassCastException {
+
+ Map<K, T> results = new HashMap<K, T>();
+ //for (PropertyDescriptor)
+ for (T elmt : executeToEntityList(transaction, entityClass)) {
+ Object value = loadProperty(elmt, keyName);
+ if (value != null && !keyClass.isAssignableFrom(value.getClass())) {
+ throw new ClassCastException("Invalid cast for " + keyClass.getName());
+ }
+ results.put((K)value, elmt);
+ }
+ return results;
+ }
+
+ /**
+ * Execute the query and get a Map of entity with topiaId in key. Some properties will be loaded if they are
+ * prealably set using ${@link #addLoad(java.lang.String[]) }.
+ *
+ * @param <T> the type of entity, value of the map
+ * @param transaction the TopiaContext to use for execution
+ * @param entityClass the class of the TopiaEntity used for return
+ * @return a Map with the key type defined and the entity in value
+ * @throws TopiaException
+ * @throws ClassCastException
+ */
+ public <T extends TopiaEntity> Map<String, T> executeToEntityMap(TopiaContext transaction, Class<T> entityClass)
+ throws TopiaException, ClassCastException {
+ return executeToEntityMap(transaction, entityClass, TopiaEntity.TOPIA_ID, String.class);
+ }
+
+ /**
+ * Execute the query and get the first result entity. Some properties will be loaded if they are
+ * prealably set using ${@link #addLoad(java.lang.String[]) }.
+ *
* @param <T> the type of TopiaEntity to return
* @param transaction the TopiaContext to use for execution
* @param entityClass the class of the TopiaEntity used for return type
* @return a TopiaEntity corresponding to the entityClass in argument
* @throws TopiaException
+ * @throws ClassCastException
*/
- public <T extends TopiaEntity> T executeToEntity(TopiaContext transaction, Class<T> entityClass) throws TopiaException {
+ public <T extends TopiaEntity> T executeToEntity(TopiaContext transaction, Class<T> entityClass)
+ throws TopiaException, ClassCastException {
List<T> results = executeToEntityList(transaction, entityClass);
return !results.isEmpty() ? results.get(0) : null;
}
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImpl.java 2009-12-23 17:52:56 UTC (rev 159)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImpl.java 2009-12-24 15:57:38 UTC (rev 160)
@@ -22,7 +22,6 @@
package fr.ifremer.suiviobsmer.impl;
import com.csvreader.CsvReader;
-import fr.ifremer.suiviobsmer.DataLoader;
import fr.ifremer.suiviobsmer.QueryBuilder;
import fr.ifremer.suiviobsmer.SuiviObsmerBusinessException;
import fr.ifremer.suiviobsmer.SuiviObsmerBusinessException.Type;
@@ -72,6 +71,8 @@
protected TopiaContext rootContext;
+ // CREATE UNIQUE INDEX boat_immatriculation_idx ON BOAT(IMMATRICULATION)
+
public ServiceBoatImpl() throws SuiviObsmerException {
rootContext = SuiviObsmerContext.getTopiaRootContext();
}
@@ -128,10 +129,7 @@
addParam("booleanTrue", Boolean.TRUE);
}
- List<Boat> boats = query.executeToEntityList(transaction, Boat.class);
- for (Boat boat : boats) {
- results.put(boat.getImmatriculation(), boat);
- }
+ results = query.executeToEntityMap(transaction, Boat.class, Boat.IMMATRICULATION, Integer.class);
transaction.closeContext();
} catch (Exception eee) {
@@ -200,11 +198,11 @@
}
// Last contact
- TopiaQuery query = QueryBuilder.createQueryLastContactForBoat(boat, company);
+ TopiaQuery query = QueryBuilder.createQueryLastContactForBoat(boat, company).
+ addLoad(Contact.SAMPLE_ROW, Contact.USER);
Contact contact = query.executeToEntity(transaction, Contact.class);
if (contact != null) {
- DataLoader.loadContactForBoatInfos(contact);
result.setLastContact(contact);
}
@@ -422,15 +420,6 @@
try {
transaction = rootContext.beginTransaction();
-// String activityCalendarClassName = ActivityCalendar.class.getName();
-// List results = transaction.find(
-// "FROM " + activityCalendarClassName + " A WHERE A.boat = :boat AND A.year = " +
-// "(SELECT MAX(B.year) FROM " + activityCalendarClassName + " B " +
-// " WHERE B.boat = A.boat GROUP BY B.boat)",
-// "boat", boat);
-//
-// result = (ActivityCalendar) results.get(0);
-
String activityCalendarClassName = ActivityCalendar.class.getName();
TopiaQuery query = new TopiaQuery(activityCalendarClassName + " A").
add("A.boat", boat);
@@ -442,9 +431,21 @@
query.add("A.year = (" + subquery.fullQuery() + ")");
+ query.addLoad(ActivityCalendar.BOAT);
result = query.executeToEntity(transaction, ActivityCalendar.class);
- DataLoader.loadActivityCalendar(result);
+ // load other complex data from collections
+ List<ActivityMonth> months = result.getActivityMonth();
+ for (ActivityMonth month : months) {
+ if (month.getActive()) {
+ List<ActivityProfession> professions = month.getActivityProfession();
+ for (ActivityProfession profession : professions) {
+ List<ActivityZone> zones = profession.getActivityZone();
+ zones.size();
+ }
+ }
+ }
+
transaction.closeContext();
} catch (Exception eee) {
SuiviObsmerContext.serviceException(transaction,
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 2009-12-23 17:52:56 UTC (rev 159)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceContactImpl.java 2009-12-24 15:57:38 UTC (rev 160)
@@ -21,10 +21,10 @@
package fr.ifremer.suiviobsmer.impl;
-import fr.ifremer.suiviobsmer.DataLoader;
import fr.ifremer.suiviobsmer.SuiviObsmerException;
import fr.ifremer.suiviobsmer.SuiviObsmerModelDAOHelper;
import fr.ifremer.suiviobsmer.SuiviObsmerContext;
+import fr.ifremer.suiviobsmer.TopiaQuery;
import fr.ifremer.suiviobsmer.bean.states.ContactStateEnum;
import fr.ifremer.suiviobsmer.entity.Boat;
import fr.ifremer.suiviobsmer.entity.Company;
@@ -38,6 +38,7 @@
import java.util.List;
import java.util.Map;
import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.persistence.TopiaEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -69,23 +70,15 @@
try {
transaction = rootContext.beginTransaction();
- ContactDAO dao = SuiviObsmerModelDAOHelper.getContactDAO(transaction);
+ TopiaQuery query = new TopiaQuery(Contact.class).addOrderDesc(TopiaEntity.TOPIA_CREATE_DATE);
- if (company == null) {
- for (Contact contact : dao.findAll()) {
- DataLoader.loadContactForFindByFilters(contact);
- results.put(contact.getTopiaId(), contact);
- }
- } else {
- List list = transaction.find("FROM ContactImpl WHERE user.company = :company",
- "company", company);
- for (Object o : list) {
- Contact contact = (Contact)o;
- DataLoader.loadContactForFindByFilters(contact);
- results.put(contact.getTopiaId(), contact);
- }
+ if (company != null) {
+ query.add("user.company", company);
}
+ query.addLoad("user.company", "sampleRow.program", "sampleRow.profession", "sampleRow.company");
+ results = query.executeToEntityMap(transaction, Contact.class);
+
transaction.closeContext();
} catch (Exception eee) {
SuiviObsmerContext.serviceException(transaction,
@@ -122,6 +115,10 @@
ContactDAO dao = SuiviObsmerModelDAOHelper.getContactDAO(transaction);
+ if (log.isDebugEnabled()) {
+ log.debug("Create date : " + contact.getTopiaCreateDate());
+ }
+
SuiviObsmerContext.prepareTopiaId(Contact.class, contact);
if (delete) {
dao.delete(contact);
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 2009-12-23 17:52:56 UTC (rev 159)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImpl.java 2009-12-24 15:57:38 UTC (rev 160)
@@ -44,11 +44,10 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import org.apache.commons.lang.StringUtils;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.persistence.util.EntityLoador;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -348,12 +347,9 @@
@Override
public Profession getNewProfession(Profession profession) {
Profession newProfession = new ProfessionImpl();
- newProfession.setCodeDCF5(profession.getCodeDCF5());
- newProfession.setLibelle(profession.getLibelle());
- newProfession.setOther(profession.getOther());
- newProfession.setMeshSize(profession.getMeshSize());
- newProfession.setSize(profession.getSize());
- newProfession.setSpecies(profession.getSpecies());
+ EntityLoador<Profession> loador = EntityLoador.newEntityLoador(Profession.class,
+ Profession.CODE_DCF5, Profession.LIBELLE, Profession.MESH_SIZE, Profession.OTHER, Profession.SIZE, Profession.SPECIES);
+ loador.load(profession, newProfession, false);
return newProfession;
}
Modified: trunk/suiviobsmer-business/src/main/xmi/suiviobsmer.zargo
===================================================================
(Binary files differ)
Modified: trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImplTest.java
===================================================================
--- trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImplTest.java 2009-12-23 17:52:56 UTC (rev 159)
+++ trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImplTest.java 2009-12-24 15:57:38 UTC (rev 160)
@@ -51,6 +51,7 @@
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.junit.After;
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 2009-12-23 17:52:56 UTC (rev 159)
+++ trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImplTest.java 2009-12-24 15:57:38 UTC (rev 160)
@@ -54,6 +54,7 @@
import java.util.List;
import org.junit.After;
import org.junit.AfterClass;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -359,6 +360,37 @@
}
@Test
+ public void testGetNewProfession() throws Exception {
+ log.info("getNewProfession");
+
+ /** PREPARE DATA **/
+
+ TopiaContext transaction = SuiviObsmerContext.getTopiaRootContext().beginTransaction();
+
+ ProfessionDAO dao = SuiviObsmerModelDAOHelper.getProfessionDAO(transaction);
+
+ Profession profession = dao.create(
+ Profession.CODE_DCF5, "OBR",
+ Profession.LIBELLE, "Fileyage en barre",
+ Profession.MESH_SIZE, "< 80",
+ Profession.OTHER, "90mm",
+ Profession.SPECIES, "barre, lieu noir, saumon des plages");
+
+ transaction.commitTransaction();
+ transaction.closeContext();
+
+ /** EXEC METHOD **/
+ Profession newProfession = service.getNewProfession(profession);
+ Assert.assertNotSame(profession, newProfession);
+ Assert.assertEquals("OBR", newProfession.getCodeDCF5());
+ Assert.assertEquals("Fileyage en barre", newProfession.getLibelle());
+ Assert.assertEquals("< 80", newProfession.getMeshSize());
+ Assert.assertEquals("90mm", newProfession.getOther());
+ Assert.assertEquals("barre, lieu noir, saumon des plages", newProfession.getSpecies());
+
+ }
+
+ @Test
public void testDeleteSampleRow() throws Exception {
log.info("deleteSampleRow");
1
0
[Suiviobsmer-commits] r159 - in trunk: . suiviobsmer-business suiviobsmer-ui
by fdesbois@users.labs.libre-entreprise.org 23 Dec '09
by fdesbois@users.labs.libre-entreprise.org 23 Dec '09
23 Dec '09
Author: fdesbois
Date: 2009-12-23 17:52:56 +0000 (Wed, 23 Dec 2009)
New Revision: 159
Modified:
trunk/pom.xml
trunk/suiviobsmer-business/pom.xml
trunk/suiviobsmer-ui/pom.xml
Log:
[maven-release-plugin] prepare for next development iteration
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-12-23 17:52:53 UTC (rev 158)
+++ trunk/pom.xml 2009-12-23 17:52:56 UTC (rev 159)
@@ -15,7 +15,7 @@
<groupId>fr.ifremer</groupId>
<artifactId>suiviobsmer</artifactId>
- <version>0.0.1-alpha-2</version>
+ <version>0.0.1-alpha-3-SNAPSHOT</version>
<modules>
<module>suiviobsmer-ui</module>
@@ -256,9 +256,9 @@
<scm>
- <connection>scm:svn:svn://anonymous at labs.libre-entreprise.org/svnroot/suiviobsmer/tags/suiviobsmer-0.0.1-alpha-2</connection>
- <developerConnection>scm:svn:svn+ssh://fdesbois at labs.libre-entreprise.org/svnroot/suiviobsmer/tags/suiviobsmer-0.0.1-alpha-2</developerConnection>
- <url>http://labs.libre-entreprise.org/scm/viewvc.php/tags/suiviobsmer-0.0.1-alph…</url>
+ <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>
+ <url>http://labs.libre-entreprise.org/scm/viewvc.php/trunk/?root=suiviobsmer</url>
</scm>
<build>
Modified: trunk/suiviobsmer-business/pom.xml
===================================================================
--- trunk/suiviobsmer-business/pom.xml 2009-12-23 17:52:53 UTC (rev 158)
+++ trunk/suiviobsmer-business/pom.xml 2009-12-23 17:52:56 UTC (rev 159)
@@ -10,7 +10,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>suiviobsmer</artifactId>
- <version>0.0.1-alpha-2</version>
+ <version>0.0.1-alpha-3-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.suiviobsmer</groupId>
@@ -120,9 +120,9 @@
</build>
<scm>
- <url>http://labs.libre-entreprise.org/scm/viewvc.php/tags/suiviobsmer-0.0.1-alph…</url>
- <connection>scm:svn:svn://anonymous at labs.libre-entreprise.org/svnroot/suiviobsmer/tags/suiviobsmer-0.0.1-alpha-…</connection>
- <developerConnection>scm:svn:svn+ssh://fdesbois at labs.libre-entreprise.org/svnroot/suiviobsmer/tags/suiviobsmer-0.0.1-alpha-…</developerConnection>
+ <url>http://labs.libre-entreprise.org/scm/viewvc.php/trunk/suiviobsmer-business/…</url>
+ <connection>scm:svn:svn://anonymous at labs.libre-entreprise.org/svnroot/suiviobsmer/trunk/suiviobsmer-business</connection>
+ <developerConnection>scm:svn:svn+ssh://fdesbois at labs.libre-entreprise.org/svnroot/suiviobsmer/trunk/suiviobsmer-business</developerConnection>
</scm>
</project>
Modified: trunk/suiviobsmer-ui/pom.xml
===================================================================
--- trunk/suiviobsmer-ui/pom.xml 2009-12-23 17:52:53 UTC (rev 158)
+++ trunk/suiviobsmer-ui/pom.xml 2009-12-23 17:52:56 UTC (rev 159)
@@ -10,7 +10,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>suiviobsmer</artifactId>
- <version>0.0.1-alpha-2</version>
+ <version>0.0.1-alpha-3-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.suiviobsmer</groupId>
@@ -122,9 +122,9 @@
</build>
<scm>
- <url>http://labs.libre-entreprise.org/scm/viewvc.php/tags/suiviobsmer-0.0.1-alph…</url>
- <connection>scm:svn:svn://anonymous at labs.libre-entreprise.org/svnroot/suiviobsmer/tags/suiviobsmer-0.0.1-alpha-…</connection>
- <developerConnection>scm:svn:svn+ssh://fdesbois at labs.libre-entreprise.org/svnroot/suiviobsmer/tags/suiviobsmer-0.0.1-alpha-…</developerConnection>
+ <url>http://labs.libre-entreprise.org/scm/viewvc.php/trunk/suiviobsmer-ui/?root=…</url>
+ <connection>scm:svn:svn://anonymous at labs.libre-entreprise.org/svnroot/suiviobsmer/trunk/suiviobsmer-ui</connection>
+ <developerConnection>scm:svn:svn+ssh://fdesbois at labs.libre-entreprise.org/svnroot/suiviobsmer/trunk/suiviobsmer-ui</developerConnection>
</scm>
</project>
1
0
Author: fdesbois
Date: 2009-12-23 17:52:53 +0000 (Wed, 23 Dec 2009)
New Revision: 158
Added:
tags/suiviobsmer-0.0.1-alpha-2/
Log:
[maven-scm] copy for tag suiviobsmer-0.0.1-alpha-2
1
0
[Suiviobsmer-commits] r157 - in trunk: . suiviobsmer-business suiviobsmer-ui
by fdesbois@users.labs.libre-entreprise.org 23 Dec '09
by fdesbois@users.labs.libre-entreprise.org 23 Dec '09
23 Dec '09
Author: fdesbois
Date: 2009-12-23 17:52:50 +0000 (Wed, 23 Dec 2009)
New Revision: 157
Modified:
trunk/pom.xml
trunk/suiviobsmer-business/pom.xml
trunk/suiviobsmer-ui/pom.xml
Log:
[maven-release-plugin] prepare release suiviobsmer-0.0.1-alpha-2
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-12-23 17:31:44 UTC (rev 156)
+++ trunk/pom.xml 2009-12-23 17:52:50 UTC (rev 157)
@@ -15,7 +15,7 @@
<groupId>fr.ifremer</groupId>
<artifactId>suiviobsmer</artifactId>
- <version>0.0.1-alpha-2-SNAPSHOT</version>
+ <version>0.0.1-alpha-2</version>
<modules>
<module>suiviobsmer-ui</module>
@@ -256,9 +256,9 @@
<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>
- <url>http://labs.libre-entreprise.org/scm/viewvc.php/trunk/?root=suiviobsmer</url>
+ <connection>scm:svn:svn://anonymous at labs.libre-entreprise.org/svnroot/suiviobsmer/tags/suiviobsmer-0.0.1-alpha-2</connection>
+ <developerConnection>scm:svn:svn+ssh://fdesbois at labs.libre-entreprise.org/svnroot/suiviobsmer/tags/suiviobsmer-0.0.1-alpha-2</developerConnection>
+ <url>http://labs.libre-entreprise.org/scm/viewvc.php/tags/suiviobsmer-0.0.1-alph…</url>
</scm>
<build>
Modified: trunk/suiviobsmer-business/pom.xml
===================================================================
--- trunk/suiviobsmer-business/pom.xml 2009-12-23 17:31:44 UTC (rev 156)
+++ trunk/suiviobsmer-business/pom.xml 2009-12-23 17:52:50 UTC (rev 157)
@@ -10,7 +10,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>suiviobsmer</artifactId>
- <version>0.0.1-alpha-2-SNAPSHOT</version>
+ <version>0.0.1-alpha-2</version>
</parent>
<groupId>fr.ifremer.suiviobsmer</groupId>
@@ -120,9 +120,9 @@
</build>
<scm>
- <url>http://labs.libre-entreprise.org/scm/viewvc.php/trunk/suiviobsmer-business/…</url>
- <connection>scm:svn:svn://anonymous at labs.libre-entreprise.org/svnroot/suiviobsmer/trunk/suiviobsmer-business</connection>
- <developerConnection>scm:svn:svn+ssh://fdesbois at labs.libre-entreprise.org/svnroot/suiviobsmer/trunk/suiviobsmer-business</developerConnection>
+ <url>http://labs.libre-entreprise.org/scm/viewvc.php/tags/suiviobsmer-0.0.1-alph…</url>
+ <connection>scm:svn:svn://anonymous at labs.libre-entreprise.org/svnroot/suiviobsmer/tags/suiviobsmer-0.0.1-alpha-…</connection>
+ <developerConnection>scm:svn:svn+ssh://fdesbois at labs.libre-entreprise.org/svnroot/suiviobsmer/tags/suiviobsmer-0.0.1-alpha-…</developerConnection>
</scm>
</project>
Modified: trunk/suiviobsmer-ui/pom.xml
===================================================================
--- trunk/suiviobsmer-ui/pom.xml 2009-12-23 17:31:44 UTC (rev 156)
+++ trunk/suiviobsmer-ui/pom.xml 2009-12-23 17:52:50 UTC (rev 157)
@@ -10,7 +10,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>suiviobsmer</artifactId>
- <version>0.0.1-alpha-2-SNAPSHOT</version>
+ <version>0.0.1-alpha-2</version>
</parent>
<groupId>fr.ifremer.suiviobsmer</groupId>
@@ -122,9 +122,9 @@
</build>
<scm>
- <url>http://labs.libre-entreprise.org/scm/viewvc.php/trunk/suiviobsmer-ui/?root=…</url>
- <connection>scm:svn:svn://anonymous at labs.libre-entreprise.org/svnroot/suiviobsmer/trunk/suiviobsmer-ui</connection>
- <developerConnection>scm:svn:svn+ssh://fdesbois at labs.libre-entreprise.org/svnroot/suiviobsmer/trunk/suiviobsmer-ui</developerConnection>
+ <url>http://labs.libre-entreprise.org/scm/viewvc.php/tags/suiviobsmer-0.0.1-alph…</url>
+ <connection>scm:svn:svn://anonymous at labs.libre-entreprise.org/svnroot/suiviobsmer/tags/suiviobsmer-0.0.1-alpha-…</connection>
+ <developerConnection>scm:svn:svn+ssh://fdesbois at labs.libre-entreprise.org/svnroot/suiviobsmer/tags/suiviobsmer-0.0.1-alpha-…</developerConnection>
</scm>
</project>
1
0
[Suiviobsmer-commits] r156 - in trunk: suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity suiviobsmer-business/src/main/xmi suiviobsmer-ui/src/main/resources/fr/ifremer/suiviobsmer/ui/pages suiviobsmer-ui/src/main/webapp
by fdesbois@users.labs.libre-entreprise.org 23 Dec '09
by fdesbois@users.labs.libre-entreprise.org 23 Dec '09
23 Dec '09
Author: fdesbois
Date: 2009-12-23 17:31:44 +0000 (Wed, 23 Dec 2009)
New Revision: 156
Modified:
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ContactImpl.java
trunk/suiviobsmer-business/src/main/xmi/suiviobsmer.zargo
trunk/suiviobsmer-ui/src/main/resources/fr/ifremer/suiviobsmer/ui/pages/Boats.properties
trunk/suiviobsmer-ui/src/main/webapp/Boats.tml
Log:
Add getReferenceDate for contact
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ContactImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ContactImpl.java 2009-12-23 15:51:25 UTC (rev 155)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ContactImpl.java 2009-12-23 17:31:44 UTC (rev 156)
@@ -72,4 +72,20 @@
}
}
+ /**
+ * Get the reference date for the contact. It depends on existence of tideBeginDate.
+ *
+ * @return the tideBeginDate if exists or the topiaCreateDate if not
+ */
+ @Override
+ public Date getReferenceDate() {
+ if (log.isDebugEnabled()) {
+ log.debug("topia " + getTopiaCreateDate());
+ }
+ if (getTideBeginDate() != null) {
+ return getTideBeginDate();
+ }
+ return getTopiaCreateDate();
+ }
+
}
Modified: trunk/suiviobsmer-business/src/main/xmi/suiviobsmer.zargo
===================================================================
(Binary files differ)
Modified: trunk/suiviobsmer-ui/src/main/resources/fr/ifremer/suiviobsmer/ui/pages/Boats.properties
===================================================================
--- trunk/suiviobsmer-ui/src/main/resources/fr/ifremer/suiviobsmer/ui/pages/Boats.properties 2009-12-23 15:51:25 UTC (rev 155)
+++ trunk/suiviobsmer-ui/src/main/resources/fr/ifremer/suiviobsmer/ui/pages/Boats.properties 2009-12-23 17:31:44 UTC (rev 156)
@@ -17,7 +17,7 @@
boatLength-label: Longueur
# BOAT INFOS
-topiaCreateDate-label: Date
+referenceDate-label: Date
state-label: Etat
createdBy-label: Observateur
sampleRowCode-label: Code plan
Modified: trunk/suiviobsmer-ui/src/main/webapp/Boats.tml
===================================================================
--- trunk/suiviobsmer-ui/src/main/webapp/Boats.tml 2009-12-23 15:51:25 UTC (rev 155)
+++ trunk/suiviobsmer-ui/src/main/webapp/Boats.tml 2009-12-23 17:31:44 UTC (rev 156)
@@ -190,18 +190,13 @@
</div>
</t:unless>
- <!-- BODY - armateur, contact -->
-<!-- <fieldset id="so-boats-boat-infos-shipowner">
- <legend>Armateur</legend>
- <div t:type="beandisplay" t:id="boatInfosShipOwner" t:object="boatInfos.boat.shipOwner"
- t:include="firstName, lastName" />
- </fieldset>-->
+ <!-- BODY - lastContact -->
<t:if t:test="companyBoatInfos.lastContact">
<fieldset id="so-boats-boat-infos-lastcontact">
<legend>Dernier contact avec le navire pour votre société</legend>
<div class="${lastContactClass}">
<dl t:type="beandisplay" t:id="boatInfosLastContact" t:object="companyBoatInfos.lastContact"
- t:include="topiaCreateDate, state" t:add="createdBy, sampleRowCode">
+ t:include="referenceDate, state" t:add="createdBy, sampleRowCode">
<p:createdBy>
${companyBoatInfos.lastContact.user.fullName}
</p:createdBy>
@@ -212,6 +207,7 @@
</div>
</fieldset>
</t:if>
+ <!-- BODY - contact (person to contact) -->
<fieldset id="so-boats-boat-infos-contact">
<legend>Contact</legend>
<div t:type="beandisplay" t:id="boatInfosContact" t:object="boatInfos"
1
0
[Suiviobsmer-commits] r153 - trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages
by fdesbois@users.labs.libre-entreprise.org 23 Dec '09
by fdesbois@users.labs.libre-entreprise.org 23 Dec '09
23 Dec '09
Author: fdesbois
Date: 2009-12-23 14:47:12 +0000 (Wed, 23 Dec 2009)
New Revision: 153
Modified:
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Contacts.java
Log:
Add condition for tideEndDate
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 2009-12-23 14:45:03 UTC (rev 152)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Contacts.java 2009-12-23 14:47:12 UTC (rev 153)
@@ -21,6 +21,7 @@
package fr.ifremer.suiviobsmer.ui.pages;
+import fr.ifremer.suiviobsmer.SuiviObsmerContext;
import fr.ifremer.suiviobsmer.SuiviObsmerException;
import fr.ifremer.suiviobsmer.bean.ContactState;
import fr.ifremer.suiviobsmer.entity.Boat;
@@ -360,9 +361,15 @@
}
if (begin != null && end != null && end.before(begin)) {
- contactsForm.recordError(endDate, "La date de fin de la marée ne peut être antérieure à celle de début");
+ contactsForm.recordError(endDate, "La date de fin de la marée ne peut pas être antérieure à celle de début");
}
+ Date current = SuiviObsmerContext.getCurrentDate();
+
+ if (end != null && end.after(current)) {
+ contactsForm.recordError(endDate, "La date de fin de la marée ne peut pas être postérieure à la date du jour");
+ }
+
// Non abouti, Refus ou Refus Définitif
if (contactState.isUnfinishedState()) {
if (!StringUtils.isEmpty(contact.getComment())) {
1
0
23 Dec '09
Author: fdesbois
Date: 2009-12-23 14:45:03 +0000 (Wed, 23 Dec 2009)
New Revision: 152
Added:
trunk/suiviobsmer-ui/src/main/webapp/favicon.png
trunk/suiviobsmer-ui/src/main/webapp/img/logo-wao-48px.png
Removed:
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/war/
Modified:
trunk/README.txt
trunk/pom.xml
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/DataLoader.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/QueryBuilder.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerBusinessException.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerContext.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerException.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerGlobal.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerRunner.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerRunnerImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/TopiaQuery.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/BoatFilterImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/CompanyBoatInfosImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/ContactState.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactContext.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactContextImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactState.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateBoardingDone.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateBoardingExpected.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateBoatDefinitiveRefused.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateBoatRefused.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateBoatUnavailable.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateCompanyAccepted.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateCompanyLocked.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateCompanyRefused.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateCompanyUnlocked.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateEnum.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateException.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateProgramAccepted.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateProgramLocked.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateProgramRefused.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateProgramUnlocked.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateStart.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateUnfinished.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ActivityCalendarImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ActivityMonthImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ActivityProfessionImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatInfosImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/CompanyImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ContactImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/FishingZoneImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ProfessionImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ProgramImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/SampleMonthImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/SampleRowImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/UserImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ActivityCalendarImport.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceContactImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceReferentialImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceUserImpl.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceBoatMock.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceContactMock.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceNewsMock.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceReferentialMock.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceSamplingMock.java
trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceUserMock.java
trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/SuiviObsmerGlobalTest.java
trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/SuiviObsmerUtilsTest.java
trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/bean/states/ContactContextTest.java
trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/business/SuiviObsmerRunnerTest.java
trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/entity/BoatImplTest.java
trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/entity/BoatInfosImplTest.java
trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/entity/ProgramImplTest.java
trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/entity/SampleRowImplTest.java
trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ActivityCalendarImportTest.java
trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImplTest.java
trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ServiceReferentialImplTest.java
trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImplTest.java
trunk/suiviobsmer-ui/pom.xml
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/BusinessUtils.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/GenericSelectModel.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/SuiviObsmerPage.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/components/BooleanImage.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/components/FeedBack.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/components/Layout.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/components/SubmitContext.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/data/SuiviObsmerPropertyChangeListener.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/mixins/Confirm.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Administration.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/BoatActivityCalendar.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/Index.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/SampleRowForm.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/SamplingHistoric.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/SamplingPlan.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Synthesis.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/UserProfile.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/services/AppModule.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/services/ContactModelFactory.java
trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/services/SuiviObsmerManager.java
Log:
- Use WinstoneLauncher from nuiton-utils 1.1.2
- Update license-header
Modified: trunk/README.txt
===================================================================
--- trunk/README.txt 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/README.txt 2009-12-23 14:45:03 UTC (rev 152)
@@ -3,6 +3,8 @@
java -jar suiviobsmer-XXX.war
+Note : chargement un peu long...
+
Default admin user
------------------
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/pom.xml 2009-12-23 14:45:03 UTC (rev 152)
@@ -238,7 +238,7 @@
<labs.id>154</labs.id>
<!-- libraries version -->
- <nuitonutils.version>1.1.2-SNAPSHOT</nuitonutils.version>
+ <nuitonutils.version>1.1.2</nuitonutils.version>
<topia.version>2.3.0-beta-2</topia.version>
<license.version>2.0.0</license.version>
<helper.version>1.1.0</helper.version>
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/DataLoader.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/DataLoader.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/DataLoader.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/QueryBuilder.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/QueryBuilder.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/QueryBuilder.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerBusinessException.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerBusinessException.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerBusinessException.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerContext.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerContext.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerContext.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/**
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerException.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerException.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerException.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerGlobal.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerGlobal.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerGlobal.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerRunner.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerRunner.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerRunner.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerRunnerImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerRunnerImpl.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/SuiviObsmerRunnerImpl.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/TopiaQuery.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/TopiaQuery.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/TopiaQuery.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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;
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 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/BoatFilterImpl.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/CompanyBoatInfosImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/CompanyBoatInfosImpl.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/CompanyBoatInfosImpl.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/ContactState.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/ContactState.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/ContactState.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactContext.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactContext.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactContext.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.states;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactContextImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactContextImpl.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactContextImpl.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.states;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactState.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactState.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactState.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.states;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateBoardingDone.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateBoardingDone.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateBoardingDone.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.states;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateBoardingExpected.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateBoardingExpected.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateBoardingExpected.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.states;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateBoatDefinitiveRefused.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateBoatDefinitiveRefused.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateBoatDefinitiveRefused.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.states;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateBoatRefused.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateBoatRefused.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateBoatRefused.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.states;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateBoatUnavailable.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateBoatUnavailable.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateBoatUnavailable.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.states;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateCompanyAccepted.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateCompanyAccepted.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateCompanyAccepted.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.states;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateCompanyLocked.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateCompanyLocked.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateCompanyLocked.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.states;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateCompanyRefused.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateCompanyRefused.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateCompanyRefused.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.states;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateCompanyUnlocked.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateCompanyUnlocked.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateCompanyUnlocked.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.states;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateEnum.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateEnum.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateEnum.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateException.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateException.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateException.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.states;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateProgramAccepted.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateProgramAccepted.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateProgramAccepted.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.states;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateProgramLocked.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateProgramLocked.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateProgramLocked.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.states;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateProgramRefused.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateProgramRefused.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateProgramRefused.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.states;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateProgramUnlocked.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateProgramUnlocked.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateProgramUnlocked.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.states;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateStart.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateStart.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateStart.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.states;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateUnfinished.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateUnfinished.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/bean/states/ContactStateUnfinished.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.states;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ActivityCalendarImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ActivityCalendarImpl.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ActivityCalendarImpl.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.entity;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ActivityMonthImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ActivityMonthImpl.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ActivityMonthImpl.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.entity;
import java.io.Serializable;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ActivityProfessionImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ActivityProfessionImpl.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ActivityProfessionImpl.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.entity;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatImpl.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatImpl.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatInfosImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatInfosImpl.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/BoatInfosImpl.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/CompanyImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/CompanyImpl.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/CompanyImpl.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ContactImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ContactImpl.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ContactImpl.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.entity;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/FishingZoneImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/FishingZoneImpl.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/FishingZoneImpl.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ProfessionImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ProfessionImpl.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ProfessionImpl.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ProgramImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ProgramImpl.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/ProgramImpl.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
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 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/SampleMonthImpl.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/SampleRowImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/SampleRowImpl.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/SampleRowImpl.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/UserImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/UserImpl.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/entity/UserImpl.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ActivityCalendarImport.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ActivityCalendarImport.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ActivityCalendarImport.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.impl;
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImpl.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImpl.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
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 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceContactImpl.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceReferentialImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceReferentialImpl.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceReferentialImpl.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
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 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImpl.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceUserImpl.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceUserImpl.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/impl/ServiceUserImpl.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceBoatMock.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceBoatMock.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceBoatMock.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceContactMock.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceContactMock.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceContactMock.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceNewsMock.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceNewsMock.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceNewsMock.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceReferentialMock.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceReferentialMock.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceReferentialMock.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceSamplingMock.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceSamplingMock.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceSamplingMock.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceUserMock.java
===================================================================
--- trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceUserMock.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/main/java/fr/ifremer/suiviobsmer/mock/ServiceUserMock.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/SuiviObsmerGlobalTest.java
===================================================================
--- trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/SuiviObsmerGlobalTest.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/SuiviObsmerGlobalTest.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
@@ -102,4 +102,4 @@
}
-}
\ No newline at end of file
+}
Modified: trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/SuiviObsmerUtilsTest.java
===================================================================
--- trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/SuiviObsmerUtilsTest.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/SuiviObsmerUtilsTest.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
@@ -136,4 +136,4 @@
log.debug("topiaId for Company : " + company.getTopiaId());
}
-}
\ No newline at end of file
+}
Modified: trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/bean/states/ContactContextTest.java
===================================================================
--- trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/bean/states/ContactContextTest.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/bean/states/ContactContextTest.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.states;
Modified: trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/business/SuiviObsmerRunnerTest.java
===================================================================
--- trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/business/SuiviObsmerRunnerTest.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/business/SuiviObsmerRunnerTest.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/entity/BoatImplTest.java
===================================================================
--- trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/entity/BoatImplTest.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/entity/BoatImplTest.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.entity;
Modified: trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/entity/BoatInfosImplTest.java
===================================================================
--- trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/entity/BoatInfosImplTest.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/entity/BoatInfosImplTest.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.entity;
Modified: trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/entity/ProgramImplTest.java
===================================================================
--- trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/entity/ProgramImplTest.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/entity/ProgramImplTest.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
@@ -206,4 +206,4 @@
}
-}
\ No newline at end of file
+}
Modified: trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/entity/SampleRowImplTest.java
===================================================================
--- trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/entity/SampleRowImplTest.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/entity/SampleRowImplTest.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
@@ -190,4 +190,4 @@
assertEquals(5, result.getRealTidesValue());
}
-}
\ No newline at end of file
+}
Modified: trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ActivityCalendarImportTest.java
===================================================================
--- trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ActivityCalendarImportTest.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ActivityCalendarImportTest.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Business
+ * Copyright (C) 2009 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.impl;
Modified: trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImplTest.java
===================================================================
--- trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImplTest.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ServiceBoatImplTest.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
@@ -404,4 +404,4 @@
Assert.assertEquals(2009, result.getYear());
}
-}
\ No newline at end of file
+}
Modified: trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ServiceReferentialImplTest.java
===================================================================
--- trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ServiceReferentialImplTest.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ServiceReferentialImplTest.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
@@ -116,4 +116,4 @@
assertEquals(6, result);
}
-}
\ No newline at end of file
+}
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 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-business/src/test/java/fr/ifremer/suiviobsmer/impl/ServiceSamplingImplTest.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Business
+ * SuiviObsmer :: Business
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
@@ -466,4 +466,4 @@
transaction.closeContext();
}
-}
\ No newline at end of file
+}
Modified: trunk/suiviobsmer-ui/pom.xml
===================================================================
--- trunk/suiviobsmer-ui/pom.xml 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-ui/pom.xml 2009-12-23 14:45:03 UTC (rev 152)
@@ -86,41 +86,40 @@
<!-- ************************************************************* -->
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
- <build>
+ <build>
<!-- call result war : suiviobsmer-xxx.war -->
- <finalName>suiviobsmer-${project.version}</finalName>
+ <finalName>suiviobsmer-${project.version}</finalName>
<!-- Add main class into war to make it executable -->
- <plugins>
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- <version>2.1-beta-1</version>
- <configuration>
- <webResources>
- <resource>
- <directory>${basedir}/target/classes</directory>
- <includes>
- <include>**/war/*</include>
- </includes>
- </resource>
- </webResources>
- <!-- for putting Main-Class into war -->
- <archive>
- <manifest>
- <mainClass>fr.ifremer.suiviobsmer.ui.war.SuiviObsmerWarLauncher</mainClass>
- </manifest>
- </archive>
- <overlays>
- <overlay>
- <groupId>org.jvnet.hudson.winstone</groupId>
- <artifactId>winstone</artifactId>
- <type>jar</type>
- </overlay>
- </overlays>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.1-beta-1</version>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>org.nuiton.util.war.WinstoneLauncher</mainClass>
+ </manifest>
+ </archive>
+ <overlays>
+ <overlay>
+ <groupId>org.nuiton</groupId>
+ <artifactId>nuiton-utils</artifactId>
+ <type>jar</type>
+ <includes>
+ <include>**/war/Winstone*</include>
+ </includes>
+ </overlay>
+ <overlay>
+ <groupId>org.jvnet.hudson.winstone</groupId>
+ <artifactId>winstone</artifactId>
+ <type>jar</type>
+ </overlay>
+ </overlays>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
<scm>
<url>http://labs.libre-entreprise.org/scm/viewvc.php/trunk/suiviobsmer-ui/?root=…</url>
Modified: 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 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/BusinessUtils.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Web Interface
+ * SuiviObsmer :: Web Interface
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/GenericSelectModel.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/GenericSelectModel.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/GenericSelectModel.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/**
* *##%
- * SuiviObsmer Web Interface
+ * SuiviObsmer :: Web Interface
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/SuiviObsmerPage.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/SuiviObsmerPage.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/base/SuiviObsmerPage.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Web Interface
+ * SuiviObsmer :: Web Interface
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/components/BooleanImage.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/components/BooleanImage.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/components/BooleanImage.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Web Interface
+ * SuiviObsmer :: Web Interface
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
@@ -18,63 +18,63 @@
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* ##%*
*/
-
-package fr.ifremer.suiviobsmer.ui.components;
-
-import org.apache.tapestry5.BindingConstants;
-import org.apache.tapestry5.annotations.Log;
-import org.apache.tapestry5.annotations.Parameter;
-import org.apache.tapestry5.ioc.annotations.Inject;
-import org.slf4j.Logger;
-
-/**
- * BooleanImage
- *
- * Created: 18 nov. 2009
- *
- * @author fdesbois
- * @version $Revision$
- *
- * Mise a jour: $Date$
- * par : $Author$
- */
-public class BooleanImage {
-
- @Inject
- private Logger log;
-
- @Parameter(required = true)
- private Boolean value;
-
- @Parameter
- private boolean empty;
-
- @Parameter(defaultPrefix = BindingConstants.LITERAL)
- private String trueTitle;
-
- @Parameter(defaultPrefix = BindingConstants.LITERAL)
- private String falseTitle;
-
- @Parameter(defaultPrefix = BindingConstants.LITERAL)
- private String emptyTitle;
-
- public Boolean getValue() {
- return value;
- }
-
- public boolean isEmpty() {
- return empty;
- }
-
- public String getTrueTitle() {
- return trueTitle == null ? "yes" : trueTitle;
- }
-
- public String getFalseTitle() {
- return falseTitle == null ? "no" : falseTitle;
- }
-
- public String getEmptyTitle() {
- return emptyTitle == null ? "empty" : emptyTitle;
- }
-}
+
+package fr.ifremer.suiviobsmer.ui.components;
+
+import org.apache.tapestry5.BindingConstants;
+import org.apache.tapestry5.annotations.Log;
+import org.apache.tapestry5.annotations.Parameter;
+import org.apache.tapestry5.ioc.annotations.Inject;
+import org.slf4j.Logger;
+
+/**
+ * BooleanImage
+ *
+ * Created: 18 nov. 2009
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+public class BooleanImage {
+
+ @Inject
+ private Logger log;
+
+ @Parameter(required = true)
+ private Boolean value;
+
+ @Parameter
+ private boolean empty;
+
+ @Parameter(defaultPrefix = BindingConstants.LITERAL)
+ private String trueTitle;
+
+ @Parameter(defaultPrefix = BindingConstants.LITERAL)
+ private String falseTitle;
+
+ @Parameter(defaultPrefix = BindingConstants.LITERAL)
+ private String emptyTitle;
+
+ public Boolean getValue() {
+ return value;
+ }
+
+ public boolean isEmpty() {
+ return empty;
+ }
+
+ public String getTrueTitle() {
+ return trueTitle == null ? "yes" : trueTitle;
+ }
+
+ public String getFalseTitle() {
+ return falseTitle == null ? "no" : falseTitle;
+ }
+
+ public String getEmptyTitle() {
+ return emptyTitle == null ? "empty" : emptyTitle;
+ }
+}
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/components/FeedBack.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/components/FeedBack.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/components/FeedBack.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,5 +1,5 @@
/* *##%
- * SuiviObsmer Web Interface
+ * SuiviObsmer :: Web Interface
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
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 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/components/Layout.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Web Interface
+ * SuiviObsmer :: Web Interface
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/components/SubmitContext.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/components/SubmitContext.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/components/SubmitContext.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Web Interface
+ * SuiviObsmer :: Web Interface
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/data/SuiviObsmerPropertyChangeListener.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/data/SuiviObsmerPropertyChangeListener.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/data/SuiviObsmerPropertyChangeListener.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Web Interface
+ * SuiviObsmer :: Web Interface
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/mixins/Confirm.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/mixins/Confirm.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/mixins/Confirm.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,7 @@
/**
- * *##% Ca$h Web Interface
- * Copyright (C) 2009 CodeLutin
+ * *##%
+ * SuiviObsmer :: Web Interface
+ * Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -14,7 +15,8 @@
*
* 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>. ##%*
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * ##%*
*/
package fr.ifremer.suiviobsmer.ui.mixins;
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Administration.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Administration.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Administration.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Web Interface
+ * SuiviObsmer :: Web Interface
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/BoatActivityCalendar.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/BoatActivityCalendar.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/BoatActivityCalendar.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,3 +1,23 @@
+/*
+ * *##%
+ * SuiviObsmer :: Web Interface
+ * Copyright (C) 2009 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.pages;
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 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Boats.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Web Interface
+ * SuiviObsmer :: Web Interface
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
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 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Contacts.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Web Interface
+ * SuiviObsmer :: Web Interface
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Index.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Index.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Index.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Web Interface
+ * SuiviObsmer :: Web Interface
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
@@ -18,74 +18,74 @@
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* ##%*
*/
-
-package fr.ifremer.suiviobsmer.ui.pages;
-
-import fr.ifremer.suiviobsmer.SuiviObsmerException;
-import fr.ifremer.suiviobsmer.dto.News;
-import fr.ifremer.suiviobsmer.services.ServiceNews;
-import fr.ifremer.suiviobsmer.ui.base.SuiviObsmerPage;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.List;
-import org.apache.tapestry5.annotations.IncludeStylesheet;
-import org.apache.tapestry5.annotations.Log;
-import org.apache.tapestry5.annotations.Persist;
-import org.apache.tapestry5.annotations.Property;
-import org.apache.tapestry5.ioc.annotations.Inject;
-
-/**
- * Index
- *
- * Created: 9 nov. 2009
- *
- * @author fdesbois
- * @version $Revision$
- *
- * Mise a jour: $Date$
- * par : $Author$
- */
- at IncludeStylesheet("context:css/news.css")
-public class Index implements SuiviObsmerPage {
-
- @Override
- public boolean isOnlyForAdmin() {
- return false;
- }
-
- @Inject
- private ServiceNews serviceNews;
-
- @Persist
- private List<News> newsList;
-
- @Property
- private News news;
-
- private DateFormat dateFormat;
-
- @Log
- void setupRender() {
- newsList = null;
- getNewsList();
- }
-
- public List<News> getNewsList() {
- if (newsList == null) {
- try {
- newsList = serviceNews.getNews();
- } catch (SuiviObsmerException eee) {
- // error db, ...
- }
- }
- return newsList;
- }
-
- public DateFormat getDateFormat() {
- if (dateFormat == null) {
- dateFormat = new SimpleDateFormat("dd/MM/yyyy");
- }
- return dateFormat;
- }
-
-}
+
+package fr.ifremer.suiviobsmer.ui.pages;
+
+import fr.ifremer.suiviobsmer.SuiviObsmerException;
+import fr.ifremer.suiviobsmer.dto.News;
+import fr.ifremer.suiviobsmer.services.ServiceNews;
+import fr.ifremer.suiviobsmer.ui.base.SuiviObsmerPage;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.List;
+import org.apache.tapestry5.annotations.IncludeStylesheet;
+import org.apache.tapestry5.annotations.Log;
+import org.apache.tapestry5.annotations.Persist;
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.ioc.annotations.Inject;
+
+/**
+ * Index
+ *
+ * Created: 9 nov. 2009
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+ at IncludeStylesheet("context:css/news.css")
+public class Index implements SuiviObsmerPage {
+
+ @Override
+ public boolean isOnlyForAdmin() {
+ return false;
+ }
+
+ @Inject
+ private ServiceNews serviceNews;
+
+ @Persist
+ private List<News> newsList;
+
+ @Property
+ private News news;
+
+ private DateFormat dateFormat;
+
+ @Log
+ void setupRender() {
+ newsList = null;
+ getNewsList();
+ }
+
+ public List<News> getNewsList() {
+ if (newsList == null) {
+ try {
+ newsList = serviceNews.getNews();
+ } catch (SuiviObsmerException eee) {
+ // error db, ...
+ }
+ }
+ return newsList;
+ }
+
+ public DateFormat getDateFormat() {
+ if (dateFormat == null) {
+ dateFormat = new SimpleDateFormat("dd/MM/yyyy");
+ }
+ return dateFormat;
+ }
+
+}
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/SampleRowForm.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/SampleRowForm.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/SampleRowForm.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Web Interface
+ * SuiviObsmer :: Web Interface
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/SamplingHistoric.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/SamplingHistoric.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/SamplingHistoric.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Web Interface
+ * SuiviObsmer :: Web Interface
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
@@ -18,59 +18,59 @@
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* ##%*
*/
-
-package fr.ifremer.suiviobsmer.ui.pages;
-
-import fr.ifremer.suiviobsmer.SuiviObsmerException;
-import fr.ifremer.suiviobsmer.dto.SamplingHistoricRow;
-import fr.ifremer.suiviobsmer.services.ServiceSampling;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.List;
-import org.apache.tapestry5.annotations.IncludeStylesheet;
-import org.apache.tapestry5.annotations.Property;
-import org.apache.tapestry5.ioc.annotations.Inject;
-
-/**
- * SamplingHistoric
- *
- * Created: 13 nov. 2009
- *
- * @author fdesbois
- * @version $Revision$
- *
- * Mise a jour: $Date$
- * par : $Author$
- */
- at IncludeStylesheet("context:css/sampling.css")
-public class SamplingHistoric {
-
- @Inject
- private ServiceSampling serviceSampling;
-
- private List<SamplingHistoricRow> historic;
-
- @Property
- private SamplingHistoricRow historicRow;
-
- private DateFormat dateFormat;
-
- public List<SamplingHistoricRow> getHistoric() {
- if (historic == null) {
- try {
- historic = serviceSampling.getHistoric();
- } catch (SuiviObsmerException eee) {
- // errors
- }
- }
- return historic;
- }
-
- public DateFormat getDateFormat() {
- if (dateFormat == null) {
- dateFormat = new SimpleDateFormat("dd/MM/yyyy");
- }
- return dateFormat;
- }
-
-}
+
+package fr.ifremer.suiviobsmer.ui.pages;
+
+import fr.ifremer.suiviobsmer.SuiviObsmerException;
+import fr.ifremer.suiviobsmer.dto.SamplingHistoricRow;
+import fr.ifremer.suiviobsmer.services.ServiceSampling;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.List;
+import org.apache.tapestry5.annotations.IncludeStylesheet;
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.ioc.annotations.Inject;
+
+/**
+ * SamplingHistoric
+ *
+ * Created: 13 nov. 2009
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+ at IncludeStylesheet("context:css/sampling.css")
+public class SamplingHistoric {
+
+ @Inject
+ private ServiceSampling serviceSampling;
+
+ private List<SamplingHistoricRow> historic;
+
+ @Property
+ private SamplingHistoricRow historicRow;
+
+ private DateFormat dateFormat;
+
+ public List<SamplingHistoricRow> getHistoric() {
+ if (historic == null) {
+ try {
+ historic = serviceSampling.getHistoric();
+ } catch (SuiviObsmerException eee) {
+ // errors
+ }
+ }
+ return historic;
+ }
+
+ public DateFormat getDateFormat() {
+ if (dateFormat == null) {
+ dateFormat = new SimpleDateFormat("dd/MM/yyyy");
+ }
+ return dateFormat;
+ }
+
+}
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/SamplingPlan.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/SamplingPlan.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/SamplingPlan.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Web Interface
+ * SuiviObsmer :: Web Interface
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
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 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/Synthesis.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Web Interface
+ * SuiviObsmer :: Web Interface
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
@@ -18,29 +18,29 @@
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* ##%*
*/
-
-package fr.ifremer.suiviobsmer.ui.pages;
-
-import fr.ifremer.suiviobsmer.ui.base.SuiviObsmerPage;
-import org.apache.tapestry5.annotations.IncludeStylesheet;
-
-/**
- * Synthesis
- *
- * Created: 9 nov. 2009
- *
- * @author fdesbois
- * @version $Revision$
- *
- * Mise a jour: $Date$
- * par : $Author$
- */
- at IncludeStylesheet("context:css/synthesis.css")
-public class Synthesis implements SuiviObsmerPage {
-
- @Override
- public boolean isOnlyForAdmin() {
- return false;
- }
-
-}
+
+package fr.ifremer.suiviobsmer.ui.pages;
+
+import fr.ifremer.suiviobsmer.ui.base.SuiviObsmerPage;
+import org.apache.tapestry5.annotations.IncludeStylesheet;
+
+/**
+ * Synthesis
+ *
+ * Created: 9 nov. 2009
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+ at IncludeStylesheet("context:css/synthesis.css")
+public class Synthesis implements SuiviObsmerPage {
+
+ @Override
+ public boolean isOnlyForAdmin() {
+ return false;
+ }
+
+}
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/UserProfile.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/UserProfile.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/pages/UserProfile.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Web Interface
+ * SuiviObsmer :: Web Interface
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
@@ -18,92 +18,92 @@
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* ##%*
*/
-
-package fr.ifremer.suiviobsmer.ui.pages;
-
-import fr.ifremer.suiviobsmer.SuiviObsmerException;
-import fr.ifremer.suiviobsmer.entity.User;
-import fr.ifremer.suiviobsmer.services.ServiceUser;
-import fr.ifremer.suiviobsmer.ui.base.SuiviObsmerPage;
-import fr.ifremer.suiviobsmer.ui.components.Layout;
-import org.apache.commons.lang.StringUtils;
-import org.apache.tapestry5.annotations.IncludeStylesheet;
-import org.apache.tapestry5.annotations.InjectComponent;
-import org.apache.tapestry5.annotations.Property;
-import org.apache.tapestry5.annotations.SessionState;
-import org.apache.tapestry5.corelib.components.BeanEditForm;
-import org.apache.tapestry5.ioc.annotations.Inject;
-import org.slf4j.Logger;
-
-/**
- * UserProfile
- *
- * Created: 10 nov. 2009
- *
- * @author fdesbois
- * @version $Revision$
- *
- * Mise a jour: $Date$
- * par : $Author$
- */
- at IncludeStylesheet("context:css/userProfile.css")
-public class UserProfile implements SuiviObsmerPage {
-
- @Override
- public boolean isOnlyForAdmin() {
- return false;
- }
-
- @Inject
- private Logger log;
-
- @Inject
- private ServiceUser serviceUser;
-
- @InjectComponent
- private Layout layout;
-
- @SessionState
- private User user;
-
- private User userEditable;
-
- @InjectComponent
- private BeanEditForm userForm;
-
- @Property
- private String password;
-
- @Property
- private String password2;
-
- public User getUserEditable() {
- if (userEditable == null) {
- userEditable = user;
- }
- return userEditable;
- }
-
- void onSuccessFromUserForm() {
-
- if (password != null && !password.equals(password2)) {
- userForm.recordError("Les deux password ne sont pas identiques, vérifiez la saisie !");
- } else {
- try {
- if (!StringUtils.isEmpty(password)) {
- userEditable.setPassword(password);
- }
- serviceUser.createUpdateUser(userEditable, false);
- layout.getFeedBack().addInfo("Modifications enregistrées avec succès !");
- } catch (SuiviObsmerException eee) {
- userForm.recordError(eee.getMessage());
- if (log.isErrorEnabled()) {
- log.error("Error during user save", eee);
- }
- }
- }
- }
-
-
-
-}
+
+package fr.ifremer.suiviobsmer.ui.pages;
+
+import fr.ifremer.suiviobsmer.SuiviObsmerException;
+import fr.ifremer.suiviobsmer.entity.User;
+import fr.ifremer.suiviobsmer.services.ServiceUser;
+import fr.ifremer.suiviobsmer.ui.base.SuiviObsmerPage;
+import fr.ifremer.suiviobsmer.ui.components.Layout;
+import org.apache.commons.lang.StringUtils;
+import org.apache.tapestry5.annotations.IncludeStylesheet;
+import org.apache.tapestry5.annotations.InjectComponent;
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.annotations.SessionState;
+import org.apache.tapestry5.corelib.components.BeanEditForm;
+import org.apache.tapestry5.ioc.annotations.Inject;
+import org.slf4j.Logger;
+
+/**
+ * UserProfile
+ *
+ * Created: 10 nov. 2009
+ *
+ * @author fdesbois
+ * @version $Revision$
+ *
+ * Mise a jour: $Date$
+ * par : $Author$
+ */
+ at IncludeStylesheet("context:css/userProfile.css")
+public class UserProfile implements SuiviObsmerPage {
+
+ @Override
+ public boolean isOnlyForAdmin() {
+ return false;
+ }
+
+ @Inject
+ private Logger log;
+
+ @Inject
+ private ServiceUser serviceUser;
+
+ @InjectComponent
+ private Layout layout;
+
+ @SessionState
+ private User user;
+
+ private User userEditable;
+
+ @InjectComponent
+ private BeanEditForm userForm;
+
+ @Property
+ private String password;
+
+ @Property
+ private String password2;
+
+ public User getUserEditable() {
+ if (userEditable == null) {
+ userEditable = user;
+ }
+ return userEditable;
+ }
+
+ void onSuccessFromUserForm() {
+
+ if (password != null && !password.equals(password2)) {
+ userForm.recordError("Les deux password ne sont pas identiques, vérifiez la saisie !");
+ } else {
+ try {
+ if (!StringUtils.isEmpty(password)) {
+ userEditable.setPassword(password);
+ }
+ serviceUser.createUpdateUser(userEditable, false);
+ layout.getFeedBack().addInfo("Modifications enregistrées avec succès !");
+ } catch (SuiviObsmerException eee) {
+ userForm.recordError(eee.getMessage());
+ if (log.isErrorEnabled()) {
+ log.error("Error during user save", eee);
+ }
+ }
+ }
+ }
+
+
+
+}
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 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/services/AppModule.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,5 +1,5 @@
/* *##%
- * SuiviObsmer Web Interface
+ * SuiviObsmer :: Web Interface
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/services/ContactModelFactory.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/services/ContactModelFactory.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/services/ContactModelFactory.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Web Interface
+ * SuiviObsmer :: Web Interface
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Modified: trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/services/SuiviObsmerManager.java
===================================================================
--- trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/services/SuiviObsmerManager.java 2009-12-23 11:08:07 UTC (rev 151)
+++ trunk/suiviobsmer-ui/src/main/java/fr/ifremer/suiviobsmer/ui/services/SuiviObsmerManager.java 2009-12-23 14:45:03 UTC (rev 152)
@@ -1,6 +1,6 @@
/*
* *##%
- * SuiviObsmer Web Interface
+ * SuiviObsmer :: Web Interface
* Copyright (C) 2009 Ifremer
*
* This program is free software: you can redistribute it and/or modify
Added: trunk/suiviobsmer-ui/src/main/webapp/favicon.png
===================================================================
(Binary files differ)
Property changes on: trunk/suiviobsmer-ui/src/main/webapp/favicon.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/suiviobsmer-ui/src/main/webapp/img/logo-wao-48px.png
===================================================================
(Binary files differ)
Property changes on: trunk/suiviobsmer-ui/src/main/webapp/img/logo-wao-48px.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
1
0