Wao-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
April 2014
- 5 participants
- 162 discussions
r1847 - in trunk: wao-services/src/main/java/fr/ifremer/wao/services/service wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer wao-web/src/main/java/fr/ifremer/wao/web/converter wao-web/src/main/webapp/bootstrap-2.3.1 wao-web/src/main/webapp/moment-js-2.5.1 wao-web/src/main/webapp/select2-3.4.5 wao-web/src/main/webapp/spin.js-2.0.0
by tchemit@users.forge.codelutin.com 06 Apr '14
by tchemit@users.forge.codelutin.com 06 Apr '14
06 Apr '14
Author: tchemit
Date: 2014-04-06 19:05:20 +0200 (Sun, 06 Apr 2014)
New Revision: 1847
Url: http://forge.codelutin.com/projects/wao/repository/revisions/1847
Log:
fix license header (add ignore license on outcoming code please)
Modified:
trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactNotUpdatableException.java
trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/UpdateContactCommand.java
trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/EditContactAction.java
trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/BooleanSetConverter.java
trunk/wao-web/src/main/webapp/bootstrap-2.3.1/bootstrap-tooltip.js
trunk/wao-web/src/main/webapp/moment-js-2.5.1/moment-with-langs.js
trunk/wao-web/src/main/webapp/select2-3.4.5/select2-bootstrap.css
trunk/wao-web/src/main/webapp/select2-3.4.5/select2.css
trunk/wao-web/src/main/webapp/select2-3.4.5/select2.js
trunk/wao-web/src/main/webapp/select2-3.4.5/select2.min.js
trunk/wao-web/src/main/webapp/select2-3.4.5/select2_locale_fr.js
trunk/wao-web/src/main/webapp/spin.js-2.0.0/jquery.spin.js
trunk/wao-web/src/main/webapp/spin.js-2.0.0/spin.js
Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactNotUpdatableException.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactNotUpdatableException.java 2014-04-06 17:00:34 UTC (rev 1846)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactNotUpdatableException.java 2014-04-06 17:05:20 UTC (rev 1847)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.services.service;
+/*
+ * #%L
+ * Wao :: Services
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import fr.ifremer.wao.WaoException;
/**
Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/UpdateContactCommand.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/UpdateContactCommand.java 2014-04-06 17:00:34 UTC (rev 1846)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/UpdateContactCommand.java 2014-04-06 17:05:20 UTC (rev 1847)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.services.service;
+/*
+ * #%L
+ * Wao :: Services
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import com.google.common.base.Preconditions;
import fr.ifremer.wao.entity.Contact;
import fr.ifremer.wao.entity.DataReliability;
Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/EditContactAction.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/EditContactAction.java 2014-04-06 17:00:34 UTC (rev 1846)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/EditContactAction.java 2014-04-06 17:05:20 UTC (rev 1847)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.web.action.obsmer;
+/*
+ * #%L
+ * Wao :: Web
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import com.google.common.base.Optional;
import com.google.common.base.Strings;
import com.opensymphony.xwork2.Preparable;
Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/BooleanSetConverter.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/BooleanSetConverter.java 2014-04-06 17:00:34 UTC (rev 1846)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/BooleanSetConverter.java 2014-04-06 17:05:20 UTC (rev 1847)
@@ -10,12 +10,12 @@
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
@@ -94,4 +94,4 @@
return str;
}
-}
\ No newline at end of file
+}
Modified: trunk/wao-web/src/main/webapp/bootstrap-2.3.1/bootstrap-tooltip.js
===================================================================
--- trunk/wao-web/src/main/webapp/bootstrap-2.3.1/bootstrap-tooltip.js 2014-04-06 17:00:34 UTC (rev 1846)
+++ trunk/wao-web/src/main/webapp/bootstrap-2.3.1/bootstrap-tooltip.js 2014-04-06 17:05:20 UTC (rev 1847)
@@ -1,5 +1,5 @@
/* ===========================================================
- * bootstrap-tooltip.js v2.3.1
+ * bootstrap-tooltip.js v2.3.1 %%Ignore-License
* http://twitter.github.com/bootstrap/javascript.html#tooltips
* Inspired by the original jQuery.tipsy by Jason Frame
* ===========================================================
Modified: trunk/wao-web/src/main/webapp/moment-js-2.5.1/moment-with-langs.js
===================================================================
--- trunk/wao-web/src/main/webapp/moment-js-2.5.1/moment-with-langs.js 2014-04-06 17:00:34 UTC (rev 1846)
+++ trunk/wao-web/src/main/webapp/moment-js-2.5.1/moment-with-langs.js 2014-04-06 17:05:20 UTC (rev 1847)
@@ -1,24 +1,4 @@
-/*
- * #%L
- * Wao :: Web
- * %%
- * Copyright (C) 2009 - 2014 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-//! moment.js
+//! moment.js %%Ignore-License
//! version : 2.5.1
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
Modified: trunk/wao-web/src/main/webapp/select2-3.4.5/select2-bootstrap.css
===================================================================
--- trunk/wao-web/src/main/webapp/select2-3.4.5/select2-bootstrap.css 2014-04-06 17:00:34 UTC (rev 1846)
+++ trunk/wao-web/src/main/webapp/select2-3.4.5/select2-bootstrap.css 2014-04-06 17:05:20 UTC (rev 1847)
@@ -1,23 +1,4 @@
-/*
- * #%L
- * Wao :: Web
- * %%
- * Copyright (C) 2009 - 2014 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
+/* %%Ignore-License */
.form-control .select2-choice {
border: 0;
border-radius: 2px;
Modified: trunk/wao-web/src/main/webapp/select2-3.4.5/select2.css
===================================================================
--- trunk/wao-web/src/main/webapp/select2-3.4.5/select2.css 2014-04-06 17:00:34 UTC (rev 1846)
+++ trunk/wao-web/src/main/webapp/select2-3.4.5/select2.css 2014-04-06 17:05:20 UTC (rev 1847)
@@ -1,24 +1,4 @@
-/*
- * #%L
- * Wao :: Web
- * %%
- * Copyright (C) 2009 - 2014 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-/*
+/* %%Ignore-License
Version: 3.4.5 Timestamp: Mon Nov 4 08:22:42 PST 2013
*/
.select2-container {
Modified: trunk/wao-web/src/main/webapp/select2-3.4.5/select2.js
===================================================================
--- trunk/wao-web/src/main/webapp/select2-3.4.5/select2.js 2014-04-06 17:00:34 UTC (rev 1846)
+++ trunk/wao-web/src/main/webapp/select2-3.4.5/select2.js 2014-04-06 17:05:20 UTC (rev 1847)
@@ -1,24 +1,4 @@
-/*
- * #%L
- * Wao :: Web
- * %%
- * Copyright (C) 2009 - 2014 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-/*
+/* %%Ignore-License
Copyright 2012 Igor Vaynberg
Version: 3.4.5 Timestamp: Mon Nov 4 08:22:42 PST 2013
Modified: trunk/wao-web/src/main/webapp/select2-3.4.5/select2.min.js
===================================================================
--- trunk/wao-web/src/main/webapp/select2-3.4.5/select2.min.js 2014-04-06 17:00:34 UTC (rev 1846)
+++ trunk/wao-web/src/main/webapp/select2-3.4.5/select2.min.js 2014-04-06 17:05:20 UTC (rev 1847)
@@ -1,25 +1,5 @@
/*
- * #%L
- * Wao :: Web
- * %%
- * Copyright (C) 2009 - 2014 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-/*
-Copyright 2012 Igor Vaynberg
+Copyright 2012 Igor Vaynberg %%Ignore-License
Version: 3.4.5 Timestamp: Mon Nov 4 08:22:42 PST 2013
Modified: trunk/wao-web/src/main/webapp/select2-3.4.5/select2_locale_fr.js
===================================================================
--- trunk/wao-web/src/main/webapp/select2-3.4.5/select2_locale_fr.js 2014-04-06 17:00:34 UTC (rev 1846)
+++ trunk/wao-web/src/main/webapp/select2-3.4.5/select2_locale_fr.js 2014-04-06 17:05:20 UTC (rev 1847)
@@ -1,24 +1,4 @@
-/*
- * #%L
- * Wao :: Web
- * %%
- * Copyright (C) 2009 - 2014 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-/**
+/** %%Ignore-License
* Select2 French translation
*/
(function ($) {
Modified: trunk/wao-web/src/main/webapp/spin.js-2.0.0/jquery.spin.js
===================================================================
--- trunk/wao-web/src/main/webapp/spin.js-2.0.0/jquery.spin.js 2014-04-06 17:00:34 UTC (rev 1846)
+++ trunk/wao-web/src/main/webapp/spin.js-2.0.0/jquery.spin.js 2014-04-06 17:05:20 UTC (rev 1847)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* Copyright (c) 2011-2013 Felix Gnass
* Licensed under the MIT license
*/
Modified: trunk/wao-web/src/main/webapp/spin.js-2.0.0/spin.js
===================================================================
--- trunk/wao-web/src/main/webapp/spin.js-2.0.0/spin.js 2014-04-06 17:00:34 UTC (rev 1846)
+++ trunk/wao-web/src/main/webapp/spin.js-2.0.0/spin.js 2014-04-06 17:05:20 UTC (rev 1847)
@@ -1,4 +1,4 @@
-/**
+/** %%Ignore-License
* Copyright (c) 2011-2014 Felix Gnass
* Licensed under the MIT license
*/
1
0
r1846 - in trunk: wao-services/src/main/java/fr/ifremer/wao/services/service wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer wao-web/src/main/java/fr/ifremer/wao/web/converter wao-web/src/main/resources/i18n wao-web/src/main/webapp/WEB-INF/content/obsmer wao-web/src/main/webapp/WEB-INF/decorators wao-web/src/main/webapp/bootstrap-2.3.1
by tchemit@users.forge.codelutin.com 06 Apr '14
by tchemit@users.forge.codelutin.com 06 Apr '14
06 Apr '14
Author: tchemit
Date: 2014-04-06 19:00:34 +0200 (Sun, 06 Apr 2014)
New Revision: 1846
Url: http://forge.codelutin.com/projects/wao/repository/revisions/1846
Log:
refs #4487 begin of update contact code
Added:
trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactNotUpdatableException.java
trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/UpdateContactCommand.java
trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/EditContactAction.java
trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ValidateContactJsonAction.java
trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/edit-contact-input.jsp
Removed:
trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ValidateContact.java
Modified:
trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsService.java
trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/DeleteContactAction.java
trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/BooleanSetConverter.java
trunk/wao-web/src/main/resources/i18n/wao-web_en_GB.properties
trunk/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties
trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/contacts.jsp
trunk/wao-web/src/main/webapp/WEB-INF/decorators/layout.jsp
trunk/wao-web/src/main/webapp/bootstrap-2.3.1/bootstrap-popover.js
Added: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactNotUpdatableException.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactNotUpdatableException.java (rev 0)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactNotUpdatableException.java 2014-04-06 17:00:34 UTC (rev 1846)
@@ -0,0 +1,15 @@
+package fr.ifremer.wao.services.service;
+
+import fr.ifremer.wao.WaoException;
+
+/**
+ * When a user try to update a contact with not enough rights.
+ * <p/>
+ * Created on 4/6/14.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 4.0
+ */
+public class ContactNotUpdatableException extends WaoException {
+ private static final long serialVersionUID = 1L;
+}
Property changes on: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactNotUpdatableException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsService.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsService.java 2014-04-06 10:01:28 UTC (rev 1845)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsService.java 2014-04-06 17:00:34 UTC (rev 1846)
@@ -22,11 +22,14 @@
*/
import com.google.common.base.Charsets;
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableSet;
import fr.ifremer.wao.ContactsFilter;
import fr.ifremer.wao.WaoTechnicalException;
import fr.ifremer.wao.entity.Boat;
import fr.ifremer.wao.entity.Contact;
+import fr.ifremer.wao.entity.ContactImpl;
import fr.ifremer.wao.entity.ContactState;
import fr.ifremer.wao.entity.ContactStateMotif;
import fr.ifremer.wao.entity.ContactTopiaDao;
@@ -46,21 +49,18 @@
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.BooleanUtils;
-import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.commons.mail.EmailException;
import org.nuiton.csv.Export;
import org.nuiton.csv.ExportModel;
import org.nuiton.csv.Import;
import org.nuiton.csv.ImportModel;
import org.nuiton.csv.ImportRuntimeException;
+import org.nuiton.topia.persistence.TopiaEntity;
import org.nuiton.topia.persistence.pager.TopiaPagerBean;
import org.nuiton.util.DateUtil;
-import org.nuiton.util.beans.Binder;
-import org.nuiton.util.beans.BinderFactory;
import java.io.InputStream;
import java.util.Calendar;
@@ -69,6 +69,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
+import java.util.Map;
import static org.nuiton.i18n.I18n.l;
@@ -166,6 +167,45 @@
}
+ public UpdateContactCommand newUpdateContactCommand(AuthenticatedWaoUser authenticatedWaoUser, Optional<String> optionalContactId) {
+
+ //FIXME Should we apply some security rules (can create, update, import) ?
+ //Preconditions.checkState(authenticatedWaoUser.isAuthorizedToCreateSampleRow());
+
+ UpdateContactCommand updateContactCommand = new UpdateContactCommand();
+
+ updateContactCommand.setAdmin(authenticatedWaoUser.isAdmin());
+
+ if (optionalContactId.isPresent()) {
+
+ String contactId = optionalContactId.get();
+
+ Contact contact = getContact(contactId);
+
+ updateContactCommand.setContact(contact);
+
+ updateContactCommand.setCreation(false);
+
+ } else {
+
+ //TODO
+ Contact contact = new ContactImpl();
+
+ contact.setObsProgram(ObsProgram.OBSMER);
+ contact.setDataReliability(DataReliability.UNKNOWN);
+
+ updateContactCommand.setContact(contact);
+
+ updateContactCommand.setCreation(true);
+ }
+
+ return updateContactCommand;
+ }
+
+ public Contact getContact(String contactId) {
+ return getContactDao().forTopiaIdEquals(contactId).findUnique();
+ }
+
public InputStream exportContacts(ContactsFilter filter) {
ContactTopiaDao dao = getContactDao();
@@ -214,7 +254,25 @@
for (Contact contact : contactImport) {
- createOrUpdateContact(authenticatedWaoUser, contact);
+ String contactId = contact.getTopiaId();
+
+ Optional<String> optionalContactId = Optional.fromNullable(contactId);
+ UpdateContactCommand updateContactCommand = newUpdateContactCommand(authenticatedWaoUser,
+ optionalContactId);
+
+ //FIXME Apply imported contact...
+// updateContactCommand.setContact(contact);
+
+ try {
+ preValidate(authenticatedWaoUser, updateContactCommand, false);
+ } catch (ContactNotUpdatableException e) {
+ if (log.isWarnEnabled()) {
+ log.warn("Can't update contact: " + contactId);
+ }
+ continue;
+ }
+
+ save0(updateContactCommand);
}
} catch (ImportRuntimeException e) {
@@ -228,136 +286,269 @@
commit();
}
- public void save(AuthenticatedWaoUser authenticatedWaoUser, Contact contact)
- throws EmailException, ContactNotValidException, NullSampleMonthException {
+ public void preValidate(AuthenticatedWaoUser authenticatedWaoUser,
+ UpdateContactCommand updateContactCommand,
+ boolean needUpdate) throws ContactNotUpdatableException, ContactNotValidException {
- ContactTopiaDao dao = getContactDao();
- Contact contactFound = dao.findByTopiaId(contact.getTopiaId());
+ if (needUpdate) {
+ Preconditions.checkState(!updateContactCommand.isCreation());
+ }
- notifyUsersForMammalsObservation(contactFound, contact);
+ //FIXME Do some security checks about authenticatedWaoUser
- // createOrUpdateContact(transaction, contactFound, contact, true);
- createOrUpdateContact(authenticatedWaoUser, contact);
+ // Check if contact can be updated
+ boolean canUpdateContact = updateContactCommand.canUpdateContact(authenticatedWaoUser);
+ if (!canUpdateContact) {
+ throw new ContactNotUpdatableException();
+ }
- commit();
- }
+ // Check if a validation controls are required
+ boolean mustValidateContact = updateContactCommand.mustValidateContact();
- public void delete(Contact contact) throws NullSampleMonthException {
+ if (mustValidateContact) {
- ContactTopiaDao dao = getContactDao();
- Contact contactFound = dao.findByTopiaId(contact.getTopiaId());
+ // Pass validation controls
+ Contact contact = updateContactCommand.getContact();
- // Need to decrement estimated value if contactFound has
- // OBSERVATION_DONE state and may be real value (normally not allowed)
- updateSampleMonthTidesValue(contactFound, null, true);
+ Locale l = serviceContext.getLocale();
- // Execute delete
- dao.delete(contactFound);
+ if (contact.getMainObserver() == null) {
+ throw new ContactNotValidException(l(l, "wao.import.contact.failure.missing.main.observer"));
+ }
- commit();
- }
+ if (contact.isSecondaryObserversNotEmpty() && contact.getSecondaryObservers().contains(contact.getMainObserver())) {
+ throw new ContactNotValidException(l(l, "wao.import.contact.failure.mainObserver.cant.be.secondaryObserver"));
+ }
- /**
- * The goal of this method is to put in common code that will be executed
- * while updating a single contact (from UI) and while updating multiple
- * contacts (from import).
- *
- * @param connectedUser user who is modifying the contact
- * @param contact the contact to save or create
- * @return true if the contact was successfully updated, false if contact
- * was not updated due to insufficient right (modifying data as
- * observer after a validation by administrator)
- */
- protected boolean createOrUpdateContact(AuthenticatedWaoUser connectedUser,
- Contact contact) throws ContactNotValidException, NullSampleMonthException {
+ for (WaoUser observer : contact.getAllObservers()) {
+ boolean observerWorksForCompanyInSampleRow = observer.getCompany().equals(contact.getSampleRow().getCompany());
+ if (!observerWorksForCompanyInSampleRow) {
+ throw new ContactNotValidException(l(l, "wao.import.contact.failure.invalid.company.for.observer",
+ observer.getLogin(), contact.getSampleRow().getCompany().getName()));
+ }
+ }
- validateContact(contact);
+ // Validation for saving contact depends on contactState
+ ContactState contactState = contact.getContactState();
+ Date observationBeginDate = contact.getObservationBeginDate();
+ if (log.isDebugEnabled()) {
+ log.debug("For state : " + contactState + " and observation begin date " + observationBeginDate);
+ }
- ContactTopiaDao dao = getContactDao();
- Contact contactFound = null;
- if (contact.getTopiaId() != null) {
- contactFound = dao.findByTopiaId(contact.getTopiaId());
- }
+ // need the sample months to be loaded, it's never the case :-(
+ // boolean operationBeginDateIsValid = contact.getSampleRow().isValid(observationBeginDate);
- // Prevent that someone who is not admin change data that only admin
- // must be able to modify
- if (!connectedUser.isAdmin()) {
- if (contactFound == null) {
- contact.setCommentAdmin(null);
- contact.setValidationProgram(null);
- contact.setDataReliability(DataReliability.UNKNOWN);
- } else {
- contact.setCommentAdmin(contactFound.getCommentAdmin());
- contact.setValidationProgram(contactFound.getValidationProgram());
- contact.setDataReliability(contactFound.getDataReliability());
+ String sampleRowCode = contact.getSampleRow().getCode();
+ SampleRow sampleRow = getSampleRowDao().forCodeEquals(sampleRowCode).findAny();
+
+ SampleMonth month = sampleRow.getSampleMonth(observationBeginDate);
+ boolean operationBeginDateIsValid = month != null;
+
+ if (log.isDebugEnabled()) {
+ log.debug("operation begin data is valid : " + operationBeginDateIsValid);
}
- }
- boolean contactCanBeUpdated = true;
- if (contactFound != null && connectedUser.isCoordinatorOrObserver()) {
- contactCanBeUpdated = contactFound.getValidationProgram() == null;
- }
+ if (observationBeginDate != null && !operationBeginDateIsValid) {
+ throw new ContactNotValidException(l(l, "wao.import.contact.failure.invalid.trip.beginDate",
+ contact.getSampleRow().getCode()));
+ }
- if (contactCanBeUpdated) {
+ Date observationEndDate = contact.getObservationEndDate();
+ if (observationBeginDate != null && observationEndDate != null
+ && observationEndDate.before(observationBeginDate)) {
+ throw new ContactNotValidException(l(l, "wao.import.contact.failure.invalid.observation.endDate"));
+ }
- updateElligibleBoatForContact(contact);
- updateSampleMonthTidesValue(contactFound, contact, true);
+ Date dataInputDate = contact.getDataInputDate();
+ // Here, we check that the date input date is after the end of the
+ // observation. Since the first is a day (at 00:00) and the second
+ // is date-time, there may be a bug if the data input day is the same
+ // as the end of observation
+ boolean observationEndDateIsBeforeDataInputDate =
+ observationEndDate == null
+ || dataInputDate == null
+ || observationEndDate.before(DateUtil.setMaxTimeOfDay(dataInputDate));
- if (contactFound == null) {
- if (contact.getCreationDate() == null) {
- contact.setCreationDate(serviceContext.getNow());
+ if (log.isDebugEnabled()) {
+ log.debug("observationEndDate = " + observationEndDate +
+ ", dateInputDate = " + dataInputDate + ", observationEndDateIsBeforeDataInputDate = "
+ + observationEndDateIsBeforeDataInputDate);
+ }
+ if (!observationEndDateIsBeforeDataInputDate) {
+ throw new ContactNotValidException(l(l, "wao.import.contact.failure.invalid.observation.end"));
+ }
+
+ Date currentDate = serviceContext.getNow();
+ if (observationEndDate != null && observationEndDate.after(currentDate)) {
+ throw new ContactNotValidException(l(l, "wao.import.contact.failure.invalid.trip.endDate"));
+ }
+
+ if (dataInputDate != null && dataInputDate.after(currentDate)) {
+ throw new ContactNotValidException(l(l, "wao.import.contact.failure.invalid.observation.end2"));
+ }
+
+ // Non abouti
+ if (contactState == ContactState.OBSERVATION_CANCELLED && StringUtils.isBlank(contact.getComment())) {
+ throw new ContactNotValidException(l(l, "wao.business.contact.validation.commentMissingForState",
+ contact.getContactState().toString()));
+ // Observation réalisée
+ } else if (contactState.equals(ContactState.OBSERVATION_DONE)) {
+
+ if (observationBeginDate == null) {
+ throw new ContactNotValidException(l(l, "wao.import.contact.failure.missing.trip.beginDate", contactState));
}
- dao.create(contact);
- } else {
- Binder<Contact, Contact> contactBinder = BinderFactory.newBinder(Contact.class);
- contactBinder.copyExcluding(contact, contactFound,
- Contact.PROPERTY_TOPIA_ID,
- Contact.PROPERTY_TOPIA_VERSION,
- Contact.PROPERTY_TOPIA_CREATE_DATE,
- Contact.PROPERTY_SAMPLE_ROW);
-// contactFound.clearSecondaryObservers();
-// if (contact.getSecondaryObservers() != null) {
-// contactFound.addAllSecondaryObservers(contact.getSecondaryObservers());
-// }
- dao.update(contactFound);
+ if (observationEndDate == null) {
+ throw new ContactNotValidException(l(l, "wao.import.contact.failure.missing.observation.endDate", contactState));
+ }
+ if (contact.getNbObservants() == 0) {
+ throw new ContactNotValidException(l(l, "wao.import.contact.failure.invalid.observer.state", contactState));
+ }
+ if (contact.getObsProgram() == ObsProgram.OBSVENTE) {
+ if (contact.getTerrestrialLocation() == null) {
+ throw new ContactNotValidException(l(l, "wao.import.contact.failure.missing.observationArea"));
+ }
+ }
}
- }
- return contactCanBeUpdated;
- }
+ boolean contactMustHaveAMotif = contact.getObsProgram() == ObsProgram.OBSMER
+ && (contactState == ContactState.CONTACT_REFUSED
+ || contactState == ContactState.CONTACT_DEFINITELY_REFUSED);
+ if (contactMustHaveAMotif && contact.getContactStateMotif() == null) {
+ throw new ContactNotValidException(l(l, "wao.business.contact.validation.contactStateMotifMissing"));
+ }
- protected void notifyUsersForMammalsObservation(Contact contactFound, Contact contact) {
+ if (!contactMustHaveAMotif && contact.getContactStateMotif() != null) {
+ throw new ContactNotValidException(l(l, "wao.business.contact.validation.contactStateMotifUnwanted"));
+ }
- boolean sendNotification = false;
+ if (log.isDebugEnabled()) {
+ log.debug("validationProgram = " + contact.getValidationProgram());
+ }
- // we send notifications if there is mammals Capture and
- // we prevent re-send of multiple identical messages
- if (contact.isMammalsCapture()) {
- String oldMessage = null;
- if (contactFound != null) {
- oldMessage = contactFound.getMammalsInfo();
+ if (BooleanUtils.isTrue(contact.getValidationCompany())) {
+ // Pour valider un contact société, il faut que le contact aie une date de transmission
+ if (contact.getContactState() == ContactState.OBSERVATION_DONE && contact.getObservedDataControl() == null) {
+ throw new ContactNotValidException(l(l, "wao.business.contact.validation.observedDataControlMissingForValidation"));
+ }
+ if (contact.getObservedDataControl() == ObservedDataControl.ACCEPTED && contact.getRestitution() == null) {
+ throw new ContactNotValidException(l(l, "wao.business.contact.validation.restitutionMissingForValidation"));
+ }
+ if (contact.getDataInputDate() == null && contact.getRestitution() != null) {
+ throw new ContactNotValidException(l(l, "wao.import.contact.failure.missing.observationDate"));
+ }
+ if (contact.getDataInputDate() != null && contact.getRestitution() != null && contact.getRestitution().before(contact.getDataInputDate())) {
+ throw new ContactNotValidException(l(l, "wao.import.contact.failure.invalid.transmissionDate"));
+ }
}
- boolean messageChanged = ObjectUtils.notEqual(contact.getMammalsInfo(), oldMessage);
- if (messageChanged) {
- sendNotification = true;
+
+ if (BooleanUtils.isTrue(contact.getValidationProgram())) {
+ // it's an admin validation, data-reliability field must be filled
+ if (log.isDebugEnabled()) {
+ log.debug("field data reliability is " + contact.getDataReliability());
+ }
+
+ if (contact.getDataReliability() == null ||
+ contact.getDataReliability() == DataReliability.UNKNOWN) {
+ throw new ContactNotValidException(l(l, "wao.business.contact.validation.dataReliabilityMissingForValidation"));
+ } else if (contact.getDataReliability() != DataReliability.RELIABLE
+ && StringUtils.isEmpty(contact.getCommentAdmin())) {
+ throw new ContactNotValidException(l(l, "wao.business.contact.validation.commentAdminNecessaryForDataReliability",
+ contact.getDataReliability().toString()));
+ }
}
}
+ }
- if (sendNotification) {
+ public void save(UpdateContactCommand updateContactCommand,
+ boolean needUpdate) throws ContactNotValidException, ContactNotUpdatableException, NullSampleMonthException {
- MammalsObservationEmail email = new MammalsObservationEmail(getLocale());
- email.setContact(contact);
+ if (needUpdate) {
+ Preconditions.checkState(!updateContactCommand.isCreation());
+ }
- // now trying to find to what user we need to send the mail
- WaoUserTopiaDao userDao = getWaoUserDao();
- // users contains all the user we need to notify for the capture
- List<WaoUser> waoUsers = userDao.forMammalsNotificationsEquals(true).findAll();
+ save0(updateContactCommand);
- for (WaoUser waoUser : waoUsers) {
- email.addTo(waoUser);
+ commit();
+ }
+
+ public void delete(String contactId) throws IllegalDeletionException {
+
+ Contact contact = getContact(contactId);
+
+ // Execute delete
+ ContactTopiaDao dao = getContactDao();
+
+ Map<Class<? extends TopiaEntity>, List<? extends TopiaEntity>> allUsages = dao.findAllUsages(contact);
+
+ if (!allUsages.isEmpty()) {
+ throw new IllegalDeletionException(allUsages);
+ }
+
+ //FIXME
+// updateSampleMonthTidesValue(contact, null, true);
+
+ dao.delete(contact);
+
+ commit();
+ }
+
+ protected void save0(UpdateContactCommand updateContactCommand) throws NullSampleMonthException {
+
+ // Get contact to validate (must exist)
+ Contact contact = updateContactCommand.getContact();
+
+ ContactTopiaDao dao = getContactDao();
+
+ if (updateContactCommand.isCreation()) {
+
+ //Update the elligible boat depends on contact creation. The
+ //{@code contact} reference can only be created for a sampleRow and a
+ //boat if both are linked with an elligibleBoat. So this method is
+ //used to create the link if needed during contacts import. This
+ //elligibleBoat is needed for the contact owned by a company, so
+ //the companyActive property of ElligibleBoat will be set to TRUE. No
+ //admin has decided to explicitly create this link.
+
+ ElligibleBoatTopiaDao elligibleDAO = getElligibleBoatDao();
+ ElligibleBoat elligible = elligibleDAO.findUniqueOrNull(contact);
+
+ if (elligible == null) {
+ // Create new elligible boat not active in a global way
+ elligible = elligibleDAO.create(contact);
}
+ elligible.setCompanyActive(Boolean.TRUE);
- getEmailService().send(email);
+ //FIXME Recompute for the hole sample row?
+// updateSampleMonthTidesValue(null, contact, true);
+
+ if (contact.getCreationDate() == null) {
+ contact.setCreationDate(serviceContext.getNow());
+ }
+
+ dao.create(contact);
+
+ } else {
+
+ //FIXME Recompute for the hole sample row?
+// updateSampleMonthTidesValue(contactFound, contact, true);
+
+ if (updateContactCommand.isMammalsInfosChanged()) {
+
+ MammalsObservationEmail email = new MammalsObservationEmail(getLocale());
+ email.setContact(contact);
+
+ // now trying to find to what user we need to send the mail
+ WaoUserTopiaDao userDao = getWaoUserDao();
+ // users contains all the user we need to notify for the capture
+ List<WaoUser> waoUsers = userDao.forMammalsNotificationsEquals(true).findAll();
+
+ for (WaoUser waoUser : waoUsers) {
+ email.addTo(waoUser);
+ }
+
+ getEmailService().send(email);
+ }
+ dao.update(contact);
}
}
@@ -486,197 +677,4 @@
}
}
}
-
- protected void validateContact(Contact contact) throws ContactNotValidException {
-
- Locale l = serviceContext.getLocale();
-
- Contact oldContact = null;
- if (contact.getTopiaId() != null) {
- oldContact = getContactDao().findByTopiaId(contact.getTopiaId());
- }
-
- // S'il s'agit de dé-valider pour le coordinateur ou l'administrateur
- // on ne fait aucun contrôle
- boolean skip = oldContact != null
- && oldContact.getValidationProgram() != null &&
- contact.getValidationProgram() == null;
-
- if (skip) {
- return;
- }
-
- if (contact.getMainObserver() == null) {
- throw new ContactNotValidException(l(l, "wao.import.contact.failure.missing.main.observer"));
- }
-
- if (contact.getSecondaryObservers() != null &&
- contact.getSecondaryObservers().contains(contact.getMainObserver())) {
- throw new ContactNotValidException(l(l, "wao.import.contact.failure.mainObserver.cant.be.secondaryObserver"));
- }
-
- for (WaoUser observer : contact.getAllObservers()) {
- boolean observerWorksForCompanyInSampleRow = observer.getCompany().equals(contact.getSampleRow().getCompany());
- if (!observerWorksForCompanyInSampleRow) {
- throw new ContactNotValidException(l(l, "wao.import.contact.failure.invalid.company.for.observer",
- observer.getLogin(), contact.getSampleRow().getCompany().getName()));
- }
- }
-
- // Validation for saving contact depends on contactState
- ContactState contactState = contact.getContactState();
- Date observationBeginDate = contact.getObservationBeginDate();
- if (log.isDebugEnabled()) {
- log.debug("For state : " + contactState + " and observation begin date " + observationBeginDate);
- }
-
- // need the sample months to be loaded, it's never the case :-(
- // boolean operationBeginDateIsValid = contact.getSampleRow().isValid(observationBeginDate);
-
- String sampleRowCode = contact.getSampleRow().getCode();
- SampleRow sampleRow = getSampleRowDao().forCodeEquals(sampleRowCode).findAny();
-
- SampleMonth month = sampleRow.getSampleMonth(observationBeginDate);
- boolean operationBeginDateIsValid = month != null;
-
- if (log.isDebugEnabled()) {
- log.debug("operation begin data is valid : " + operationBeginDateIsValid);
- }
-
- if (observationBeginDate != null && !operationBeginDateIsValid) {
- throw new ContactNotValidException(l(l, "wao.import.contact.failure.invalid.trip.beginDate",
- contact.getSampleRow().getCode()));
- }
-
- Date observationEndDate = contact.getObservationEndDate();
- if (observationBeginDate != null && observationEndDate != null
- && observationEndDate.before(observationBeginDate)) {
- throw new ContactNotValidException(l(l, "wao.import.contact.failure.invalid.observation.endDate"));
- }
-
- Date dataInputDate = contact.getDataInputDate();
- // Here, we check that the date input date is after the end of the
- // observation. Since the first is a day (at 00:00) and the second
- // is date-time, there may be a bug if the data input day is the same
- // as the end of observation
- boolean observationEndDateIsBeforeDataInputDate =
- observationEndDate == null
- || dataInputDate == null
- || observationEndDate.before(DateUtil.setMaxTimeOfDay(dataInputDate));
-
- if (log.isDebugEnabled()) {
- log.debug("observationEndDate = " + observationEndDate +
- ", dateInputDate = " + dataInputDate + ", observationEndDateIsBeforeDataInputDate = "
- + observationEndDateIsBeforeDataInputDate);
- }
- if (!observationEndDateIsBeforeDataInputDate) {
- throw new ContactNotValidException(l(l, "wao.import.contact.failure.invalid.observation.end"));
- }
-
- Date currentDate = serviceContext.getNow();
- if (observationEndDate != null && observationEndDate.after(currentDate)) {
- throw new ContactNotValidException(l(l, "wao.import.contact.failure.invalid.trip.endDate"));
- }
-
- if (dataInputDate != null && dataInputDate.after(currentDate)) {
- throw new ContactNotValidException(l(l, "wao.import.contact.failure.invalid.observation.end2"));
- }
-
- // Non abouti
- if (contactState == ContactState.OBSERVATION_CANCELLED && StringUtils.isBlank(contact.getComment())) {
- throw new ContactNotValidException(l(l, "wao.business.contact.validation.commentMissingForState",
- contact.getContactState().toString()));
- // Observation réalisée
- } else if (contactState.equals(ContactState.OBSERVATION_DONE)) {
-
- if (observationBeginDate == null) {
- throw new ContactNotValidException(l(l, "wao.import.contact.failure.missing.trip.beginDate", contactState));
- }
- if (observationEndDate == null) {
- throw new ContactNotValidException(l(l, "wao.import.contact.failure.missing.observation.endDate", contactState));
- }
- if (contact.getNbObservants() == 0) {
- throw new ContactNotValidException(l(l, "wao.import.contact.failure.invalid.observer.state", contactState));
- }
- if (contact.getObsProgram() == ObsProgram.OBSVENTE) {
- if (contact.getTerrestrialLocation() == null) {
- throw new ContactNotValidException(l(l, "wao.import.contact.failure.missing.observationArea"));
- }
- }
- }
-
- // Ici, les contrôle spécifique à ObsMer
- if (contact.getObsProgram() == ObsProgram.OBSMER) {
-
- boolean contactMustHaveAMotif = contact.getObsProgram() == ObsProgram.OBSMER
- && (contactState == ContactState.CONTACT_REFUSED
- || contactState == ContactState.CONTACT_DEFINITELY_REFUSED);
- if (contactMustHaveAMotif && contact.getContactStateMotif() == null) {
- throw new ContactNotValidException(l(l, "wao.business.contact.validation.contactStateMotifMissing"));
- }
-
- if (!contactMustHaveAMotif && contact.getContactStateMotif() != null) {
- throw new ContactNotValidException(l(l, "wao.business.contact.validation.contactStateMotifUnwanted"));
- }
-
- if (log.isDebugEnabled()) {
- log.debug("validationProgram = " + contact.getValidationProgram());
- }
-
- if (BooleanUtils.isTrue(contact.getValidationCompany())) {
- // Pour valider un contact société, il faut que le contact aie une date de transmission
- if (contact.getContactState() == ContactState.OBSERVATION_DONE && contact.getObservedDataControl() == null) {
- throw new ContactNotValidException(l(l, "wao.business.contact.validation.observedDataControlMissingForValidation"));
- }
- if (contact.getObservedDataControl() == ObservedDataControl.ACCEPTED && contact.getRestitution() == null) {
- throw new ContactNotValidException(l(l, "wao.business.contact.validation.restitutionMissingForValidation"));
- }
- if (contact.getDataInputDate() == null && contact.getRestitution() != null) {
- throw new ContactNotValidException(l(l, "wao.import.contact.failure.missing.observationDate"));
- }
- if (contact.getDataInputDate() != null && contact.getRestitution() != null && contact.getRestitution().before(contact.getDataInputDate())) {
- throw new ContactNotValidException(l(l, "wao.import.contact.failure.invalid.transmissionDate"));
- }
- }
-
- if (BooleanUtils.isTrue(contact.getValidationProgram())) {
- // it's an admin validation, data-reliability field must be filled
- if (log.isDebugEnabled()) {
- log.debug("field data reliability is " + contact.getDataReliability());
- }
-
- if (contact.getDataReliability() == null ||
- contact.getDataReliability() == DataReliability.UNKNOWN) {
- throw new ContactNotValidException(l(l, "wao.business.contact.validation.dataReliabilityMissingForValidation"));
- } else if (contact.getDataReliability() != DataReliability.RELIABLE
- && StringUtils.isEmpty(contact.getCommentAdmin())) {
- throw new ContactNotValidException(l(l, "wao.business.contact.validation.commentAdminNecessaryForDataReliability",
- contact.getDataReliability().toString()));
- }
- }
- }
- }
-
- /**
- * Update the elligible boat depends on contact creation. The
- * {@code contact} reference can only be created for a sampleRow and a
- * boat if both are linked with an elligibleBoat. So this method is
- * used to create the link if needed during contacts import. This
- * elligibleBoat is needed for the contact owned by a company, so
- * the companyActive property of ElligibleBoat will be set to TRUE. No
- * admin has decided to explicitly create this link.
- *
- * @param contact which contains sampleRow and boat to link
- */
- protected void updateElligibleBoatForContact(Contact contact) {
-
- ElligibleBoatTopiaDao elligibleDAO = getElligibleBoatDao();
- ElligibleBoat elligible = elligibleDAO.findUniqueOrNull(contact);
-
- if (elligible == null) {
- // Create new elligible boat not active in a global way
- elligible = elligibleDAO.create(contact);
- }
- elligible.setCompanyActive(Boolean.TRUE);
- }
}
Added: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/UpdateContactCommand.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/UpdateContactCommand.java (rev 0)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/UpdateContactCommand.java 2014-04-06 17:00:34 UTC (rev 1846)
@@ -0,0 +1,140 @@
+package fr.ifremer.wao.services.service;
+
+import com.google.common.base.Preconditions;
+import fr.ifremer.wao.entity.Contact;
+import fr.ifremer.wao.entity.DataReliability;
+import fr.ifremer.wao.services.AuthenticatedWaoUser;
+import org.apache.commons.lang3.ObjectUtils;
+
+import java.io.Serializable;
+
+/**
+ * Created on 4/6/14.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 4.0
+ */
+public class UpdateContactCommand implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ protected boolean admin;
+
+ protected boolean creation;
+
+ protected Contact contact;
+
+ protected Boolean oldValidationCompany;
+
+ protected Boolean oldValidationProgram;
+
+ protected String oldMammalsInfo;
+
+ public boolean isCreation() {
+ return creation;
+ }
+
+ public void setCreation(boolean creation) {
+ this.creation = creation;
+ }
+
+ public boolean isAdmin() {
+ return admin;
+ }
+
+ public void setAdmin(boolean admin) {
+ this.admin = admin;
+ }
+
+ public Contact getContact() {
+ return contact;
+ }
+
+ public void setContact(Contact contact) {
+ this.contact = contact;
+ this.oldValidationCompany = contact.getValidationCompany();
+ this.oldValidationProgram = contact.getValidationProgram();
+ this.oldMammalsInfo = contact.getMammalsInfo();
+ }
+
+ public Boolean getValidationCompany() {
+ return contact.getValidationCompany();
+ }
+
+ public void setValidationCompany(Boolean validationCompany) {
+ contact.setValidationCompany(validationCompany);
+ }
+
+ public Boolean getValidationProgram() {
+ return contact.getValidationProgram();
+ }
+
+ public void setValidationProgram(Boolean validationProgram) {
+ Preconditions.checkState(isAdmin(), "cannot change 'validationProgram' if you are not admin");
+ contact.setValidationProgram(validationProgram);
+ }
+
+ public void setCommentAdmin(String commentAdmin) {
+ Preconditions.checkState(isAdmin(), "cannot change 'commentAdmin' if you are not admin");
+ contact.setCommentAdmin(commentAdmin);
+ }
+
+ public void setDataReliability(DataReliability dataReliability) {
+ Preconditions.checkState(isAdmin(), "cannot change 'dataReliability' if you are not admin");
+ contact.setDataReliability(dataReliability);
+ }
+
+ public void setMammalsInfo(String mammalsInfo) {
+ contact.setMammalsInfo(mammalsInfo);
+ }
+
+ /**
+ * Check if the contact can be updated by the given connected user.
+ *
+ * @param authenticatedWaoUser the user who want to update the contact
+ * @return {@code true} if contact can be updated
+ */
+ public boolean canUpdateContact(AuthenticatedWaoUser authenticatedWaoUser) {
+ boolean contactCanBeUpdated = true;
+ if (!isCreation() && authenticatedWaoUser.isCoordinatorOrObserver()) {
+ contactCanBeUpdated = oldValidationProgram == null;
+ }
+ return contactCanBeUpdated;
+ }
+
+ /**
+ * Check if the contact need to pass validation controls.
+ *
+ * @return {@code true} if the contact must be validated
+ */
+ public boolean mustValidateContact() {
+ boolean needValidation = isCreation() || // new contact
+ oldValidationProgram == null || // want to unvalidate a contact
+ getValidationProgram() != null; // want to validate a contact
+ return needValidation;
+ }
+
+ /**
+ * Check if mammals informations has changed.
+ *
+ * @return {@code true} if mammal informations changed
+ */
+ public boolean isMammalsInfosChanged() {
+
+ boolean mammalsInfosChanged = false;
+
+ // we send notifications if there is mammals Capture and
+ // we prevent re-send of multiple identical messages
+ if (contact.isMammalsCapture()) {
+ String oldMessage = null;
+ if (!isCreation()) {
+ oldMessage = oldMammalsInfo;
+ }
+ boolean messageChanged = ObjectUtils.notEqual(contact.getMammalsInfo(), oldMessage);
+ if (messageChanged) {
+ mammalsInfosChanged = true;
+ }
+ }
+ return mammalsInfosChanged;
+ }
+}
Property changes on: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/UpdateContactCommand.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/DeleteContactAction.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/DeleteContactAction.java 2014-04-06 10:01:28 UTC (rev 1845)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/DeleteContactAction.java 2014-04-06 17:00:34 UTC (rev 1846)
@@ -21,8 +21,12 @@
* #L%
*/
-import fr.ifremer.wao.services.service.ObsMerSamplingPlanService;
+import fr.ifremer.wao.entity.Contact;
+import fr.ifremer.wao.services.service.IllegalDeletionException;
+import fr.ifremer.wao.services.service.ObsMerContactsService;
import fr.ifremer.wao.web.WaoJspActionSupport;
+import org.apache.struts2.convention.annotation.Result;
+import org.apache.struts2.convention.annotation.Results;
/**
* Created on 4/3/14.
@@ -30,15 +34,19 @@
* @author Tony Chemit <chemit(a)codelutin.com>
* @since 4.0
*/
+@Results({
+ @Result(name = "error", type = "redirectAction", params = {"actionName", "edit-contact!input", "contactId", "%{contactId}"}),
+ @Result(name = "success", type = "redirectAction", params = {"actionName", "contacts"})
+ })
public class DeleteContactAction extends WaoJspActionSupport {
private static final long serialVersionUID = 1L;
protected String contactId;
- protected transient ObsMerSamplingPlanService service;
+ protected transient ObsMerContactsService service;
- public void setService(ObsMerSamplingPlanService service) {
+ public void setService(ObsMerContactsService service) {
this.service = service;
}
@@ -46,6 +54,31 @@
this.contactId = contactId;
}
- //TODO
+ public String getContactId() {
+ return contactId;
+ }
+ @Override
+ public String execute() throws Exception {
+
+ Contact contact = service.getContact(contactId);
+ String contactCode = contact.getMainObserver().getFullName();
+
+ String result;
+ try {
+ service.delete(contactId);
+
+ session.addMessage(t("wao.ui.action.deleteContact.success", contactCode));
+
+ result = SUCCESS;
+
+ } catch (IllegalDeletionException e) {
+
+ session.addErrorMessages(t("wao.ui.action.deleteContact.failure", contactCode));
+ session.addErrorMessages(e.getExplanation(getLocale()));
+
+ result = ERROR;
+ }
+ return result;
+ }
}
Added: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/EditContactAction.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/EditContactAction.java (rev 0)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/EditContactAction.java 2014-04-06 17:00:34 UTC (rev 1846)
@@ -0,0 +1,83 @@
+package fr.ifremer.wao.web.action.obsmer;
+
+import com.google.common.base.Optional;
+import com.google.common.base.Strings;
+import com.opensymphony.xwork2.Preparable;
+import fr.ifremer.wao.services.AuthenticatedWaoUser;
+import fr.ifremer.wao.services.service.ContactNotUpdatableException;
+import fr.ifremer.wao.services.service.ContactNotValidException;
+import fr.ifremer.wao.services.service.ObsMerContactsService;
+import fr.ifremer.wao.services.service.UpdateContactCommand;
+import fr.ifremer.wao.web.WaoJspActionSupport;
+import org.apache.struts2.convention.annotation.Result;
+import org.apache.struts2.convention.annotation.Results;
+
+/**
+ * Created on 4/6/14.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 4.0
+ */
+@Results({@Result(name = "success", type = "redirectAction", params = {"actionName", "contacts"})})
+public class EditContactAction extends WaoJspActionSupport implements Preparable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Id of contact to edit.
+ */
+ protected Optional<String> optionalContactId = Optional.absent();
+
+ protected transient ObsMerContactsService service;
+
+ protected UpdateContactCommand updateContactCommand;
+
+ public void setService(ObsMerContactsService service) {
+ this.service = service;
+ }
+
+ public void setContactId(String contactId) {
+ this.optionalContactId = Optional.fromNullable(Strings.emptyToNull(contactId));
+ }
+
+ public String getContactId() {
+ return optionalContactId.orNull();
+ }
+
+ public UpdateContactCommand getUpdateContactCommand() {
+ if (updateContactCommand == null) {
+ prepare();
+ }
+ return updateContactCommand;
+ }
+
+ @Override
+ public void prepare() {
+
+ updateContactCommand = service.newUpdateContactCommand(getAuthenticatedWaoUser(), optionalContactId);
+ }
+
+ @Override
+ public void validate() {
+
+ AuthenticatedWaoUser authenticatedWaoUser = session.getAuthenticatedWaoUser();
+
+ try {
+ service.preValidate(authenticatedWaoUser, updateContactCommand, true);
+ } catch (ContactNotUpdatableException e) {
+ addActionError(t("wao.ui.contacts.validation.failure.not.updatable", e.getMessage()));
+ } catch (ContactNotValidException e) {
+ addActionError(t("wao.ui.contacts.validation.failure.not.valid", e.getMessage()));
+ }
+ }
+
+ @Override
+ public String execute() throws Exception {
+
+ service.save(updateContactCommand, false);
+
+ session.addMessage(t("wao.ui.form.updateContactCommand.success",
+ updateContactCommand.getContact().getMainObserver().getFullName()));
+ return SUCCESS;
+ }
+}
\ No newline at end of file
Property changes on: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/EditContactAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Deleted: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ValidateContact.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ValidateContact.java 2014-04-06 10:01:28 UTC (rev 1845)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ValidateContact.java 2014-04-06 17:00:34 UTC (rev 1846)
@@ -1,54 +0,0 @@
-package fr.ifremer.wao.web.action.obsmer;
-
-/*
- * #%L
- * Wao :: Web
- * %%
- * Copyright (C) 2009 - 2014 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import fr.ifremer.wao.services.service.ObsMerSamplingPlanService;
-import fr.ifremer.wao.web.WaoJspActionSupport;
-
-/**
- * Created on 4/3/14.
- *
- * @author Tony Chemit <chemit(a)codelutin.com>
- * @since 4.0
- */
-public class ValidateContact extends WaoJspActionSupport {
-
- private static final long serialVersionUID = 1L;
-
- protected String contactId;
-
- protected Boolean validationState;
-
- protected transient ObsMerSamplingPlanService service;
-
- public void setService(ObsMerSamplingPlanService service) {
- this.service = service;
- }
-
- public void setContactId(String contactId) {
- this.contactId = contactId;
- }
-
- public void setValidationState(Boolean validationState) {
- this.validationState = validationState;
- }
-}
Copied: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ValidateContactJsonAction.java (from rev 1840, trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ValidateContact.java)
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ValidateContactJsonAction.java (rev 0)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ValidateContactJsonAction.java 2014-04-06 17:00:34 UTC (rev 1846)
@@ -0,0 +1,178 @@
+package fr.ifremer.wao.web.action.obsmer;
+
+/*
+ * #%L
+ * Wao :: Web
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+import com.opensymphony.xwork2.Preparable;
+import fr.ifremer.wao.services.AuthenticatedWaoUser;
+import fr.ifremer.wao.services.service.ContactNotUpdatableException;
+import fr.ifremer.wao.services.service.ContactNotValidException;
+import fr.ifremer.wao.services.service.ObsMerContactsService;
+import fr.ifremer.wao.services.service.UpdateContactCommand;
+import fr.ifremer.wao.web.WaoJsonActionSupport;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Created on 4/3/14.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 4.0
+ */
+public class ValidateContactJsonAction extends WaoJsonActionSupport implements Preparable {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(ValidateContactJsonAction.class);
+
+ /**
+ * Id of contact to treat.
+ */
+ protected String contactId;
+
+ /**
+ * New validation state.
+ */
+ protected Boolean validationState;
+
+ /**
+ * Success message
+ */
+ protected String successMessage;
+
+ /**
+ * Error message if validation, or any was wrong while update.
+ */
+ protected String errorMessage;
+
+ /**
+ * To update contact validation actions.
+ */
+ protected boolean canValidateContact;
+
+ /**
+ * To update contact validation actions.
+ */
+ protected boolean canUnvalidateContact;
+
+ protected transient ObsMerContactsService service;
+
+ protected UpdateContactCommand updateContactCommand;
+
+ public void setService(ObsMerContactsService service) {
+ this.service = service;
+ }
+
+ public void setContactId(String contactId) {
+ this.contactId = contactId;
+ }
+
+ public void setValidationState(Boolean validationState) {
+ this.validationState = validationState;
+ }
+
+ public String getContactId() {
+ return contactId;
+ }
+
+ public Boolean getValidationState() {
+ return validationState;
+ }
+
+ public String getSuccessMessage() {
+ return successMessage;
+ }
+
+ public String getErrorMessage() {
+ return errorMessage;
+ }
+
+ public boolean isCanValidateContact() {
+ return canValidateContact;
+ }
+
+ public boolean isCanUnvalidateContact() {
+ return canUnvalidateContact;
+ }
+
+ public boolean isSuccessful() {
+ return errorMessage == null;
+ }
+
+ @Override
+ public void prepare() {
+
+ Preconditions.checkState(StringUtils.isNotEmpty(contactId));
+
+ AuthenticatedWaoUser authenticatedWaoUser = session.getAuthenticatedWaoUser();
+
+ updateContactCommand = service.newUpdateContactCommand(
+ session.getAuthenticatedWaoUser(),
+ Optional.of(contactId));
+
+ if (authenticatedWaoUser.isAdmin()) {
+ updateContactCommand.setValidationProgram(validationState);
+ } else {
+ updateContactCommand.setValidationCompany(validationState);
+ }
+ }
+
+ @Override
+ public String execute() throws Exception {
+
+ AuthenticatedWaoUser authenticatedWaoUser = session.getAuthenticatedWaoUser();
+
+ try {
+ service.preValidate(authenticatedWaoUser, updateContactCommand, true);
+ } catch (ContactNotUpdatableException e) {
+ errorMessage = t("wao.ui.contacts.validation.failure.not.updatable", e.getMessage());
+ } catch (ContactNotValidException e) {
+ errorMessage = t("wao.ui.contacts.validation.failure.not.valid", e.getMessage());
+ } catch (Exception e) {
+ if (log.isErrorEnabled()) {
+ log.error(e);
+ }
+ errorMessage = t("wao.ui.contacts.validation.failure", e.getMessage());
+ }
+
+ if (isSuccessful()) {
+
+ service.save(updateContactCommand, true);
+ if (validationState == null) {
+ successMessage = t("wao.ui.contacts.validation.to.unvalidate.state.success");
+ } else if (validationState) {
+ successMessage = t("wao.ui.contacts.validation.to.accept.state.success");
+ } else {
+ successMessage = t("wao.ui.contacts.validation.to.reject.state.success");
+ }
+
+ canValidateContact = authenticatedWaoUser.isAuthorizedToValidateContact(updateContactCommand.getContact());
+
+ canUnvalidateContact = authenticatedWaoUser.isAuthorizedToUnvalidateContact(updateContactCommand.getContact());
+ }
+
+ return SUCCESS;
+ }
+}
Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/BooleanSetConverter.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/BooleanSetConverter.java 2014-04-06 10:01:28 UTC (rev 1845)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/BooleanSetConverter.java 2014-04-06 17:00:34 UTC (rev 1846)
@@ -49,7 +49,7 @@
for (String string : strings) {
Boolean aBoolean;
- if (StringUtils.isEmpty(string)) {
+ if (StringUtils.isEmpty(string) || "null".equals(string)) {
aBoolean = null;
} else {
aBoolean = Boolean.valueOf(string);
Modified: trunk/wao-web/src/main/resources/i18n/wao-web_en_GB.properties
===================================================================
--- trunk/wao-web/src/main/resources/i18n/wao-web_en_GB.properties 2014-04-06 10:01:28 UTC (rev 1845)
+++ trunk/wao-web/src/main/resources/i18n/wao-web_en_GB.properties 2014-04-06 17:00:34 UTC (rev 1846)
@@ -40,6 +40,8 @@
wao.ui.action.deleteCompany.success=Company deleted successfully
wao.ui.action.deleteContact=Delete contact
wao.ui.action.deleteContact.confirm=Are you sure you want to delete this contact ?
+wao.ui.action.deleteContact.failure=The contact cannot be deleted
+wao.ui.action.deleteContact.success=Contact deleted successfully
wao.ui.action.deleteNews=Delete this news
wao.ui.action.deleteNews.confirm=Are you sure you want to delete this news ?
wao.ui.action.deleteSampleRow=Delete this sample row
@@ -51,6 +53,7 @@
wao.ui.action.deleteWaoUser.failure=The user cannot be deleted
wao.ui.action.deleteWaoUser.success=User deleted successfully
wao.ui.action.edit=Edit
+wao.ui.action.editOrDeleteContact=Edit or delete contact
wao.ui.action.editOrDeleteSampleRow=Edit or delete sample row
wao.ui.action.enlargeView=Enlarge view
wao.ui.action.exportBoats=Export boats with private infos
@@ -110,15 +113,30 @@
wao.ui.chart.numberObservations=No. observations
wao.ui.chart.numberOfBoatsWithBoardings=Number of boats with x observations
wao.ui.chooseUserProfile=Choose your user profile
+wao.ui.contact.creation=Creation of a contact
+wao.ui.contact.edition=Edtion of contact %s
wao.ui.contact.lastContact=Last observation with this boat for your company
+wao.ui.contacts.FishingZone.facadeName=Fishing zone Facade
+wao.ui.contacts.FishingZone.sectorName=Fishing zone Sector
+wao.ui.contacts.Profession.libelle=Profession Libelle
+wao.ui.contacts.Profession.species=Profession species
+wao.ui.contacts.boatName=Boat
wao.ui.contacts.createFromBoat=Create a new contact for this boat and this sample row
wao.ui.contacts.createFromBoat.fail=Contact creation failed
wao.ui.contacts.createFromBoat.warn=Warning \:this sample-row is out of date, are your sure you want to create a new contact ?
-wao.ui.contacts.division=Division
-wao.ui.contacts.observations=Accidental catches and observations
-wao.ui.contacts.observers=Observers
+wao.ui.contacts.district=Boat District Code
+wao.ui.contacts.division=Fishing Zone Division
+wao.ui.contacts.immatriculation=Boat Immatriculation
+wao.ui.contacts.observations=Mammals
+wao.ui.contacts.observers=Main observer
wao.ui.contacts.title=%s contacts found
wao.ui.contacts.validation=Validation
+wao.ui.contacts.validation.failure=An error occurs %s
+wao.ui.contacts.validation.failure.not.updatable=You can not modify this contact\: %s
+wao.ui.contacts.validation.failure.not.valid=Contact is not valid\: %s
+wao.ui.contacts.validation.to.accept.state.success=Contact was accepted successful
+wao.ui.contacts.validation.to.reject.state.success=Contact was rejected successful
+wao.ui.contacts.validation.to.unvalidate.state.success=Contact was unvalidated successful
wao.ui.disclaimer=The website "SUIVI DU REALISE DU PLAN D'ECHANTILLONNAGE DES OBSERVATIONS A LA MER" is declared to the CNIL with the number \: 1414476
wao.ui.disclaimer.boats=Data your provide remains property of your company.Outside your company, only an administrator may access to your data for maintenance purpose. The administrator is someone from Ifremer.
wao.ui.email=e-mail address
@@ -161,30 +179,30 @@
wao.ui.field.Company.name=Name
wao.ui.field.Company.phoneNumber=Phone number
wao.ui.field.Company.postalCode=Post code
-wao.ui.field.Contact.beginDate=Observation start
+wao.ui.field.Contact.beginDate=Observation Begin Date
wao.ui.field.Contact.boat=Boat
-wao.ui.field.Contact.comment=Observer comment
-wao.ui.field.Contact.commentAdmin=Program comment
-wao.ui.field.Contact.commentCompany=Company Comment
+wao.ui.field.Contact.comment=Comment
+wao.ui.field.Contact.commentAdmin=Comment Admin
+wao.ui.field.Contact.commentCompany=Comment Coordinator
wao.ui.field.Contact.commentCoordinator=Coordinator comment
wao.ui.field.Contact.completeSampling=Complete sampling
-wao.ui.field.Contact.contactState=Contact state
-wao.ui.field.Contact.contactStateMotif=Refusal motif
+wao.ui.field.Contact.contactState=State
+wao.ui.field.Contact.contactStateMotif=Contact State Motif
wao.ui.field.Contact.contactStateMotifs=Refusal motives
-wao.ui.field.Contact.creationDate=Contact creation date
+wao.ui.field.Contact.creationDate=Creation date
wao.ui.field.Contact.dataInputDate=Data input date
-wao.ui.field.Contact.dataReliability=Data reliability
-wao.ui.field.Contact.endDate=Observation end
+wao.ui.field.Contact.dataReliability=Data Reliability
+wao.ui.field.Contact.endDate=Observation Begin Date
wao.ui.field.Contact.landingDate=Landing date and time
wao.ui.field.Contact.mainObserver=Main observer
wao.ui.field.Contact.mammalsCapture=Accidental capture
wao.ui.field.Contact.mammalsInfo=Scientific names and number of captured species
wao.ui.field.Contact.mammalsObservation=Exceptional observation
-wao.ui.field.Contact.nbObservants=Observers number
+wao.ui.field.Contact.nbObservants=Nb Observants
wao.ui.field.Contact.obsDebCode=Profession
wao.ui.field.Contact.observationType=Observation type
-wao.ui.field.Contact.observedDataControl=Observed data control
-wao.ui.field.Contact.restitution=Restitution forwarding date
+wao.ui.field.Contact.observedDataControl=Observed Data control
+wao.ui.field.Contact.restitution=Restitution
wao.ui.field.Contact.sampleRow=Sample row
wao.ui.field.Contact.samplingStrategy=Sampling strategy followed
wao.ui.field.Contact.secondaryObservers=Observers
@@ -193,7 +211,6 @@
wao.ui.field.Contact.validationProgram=Program validation
wao.ui.field.FishingZone.facadeName=Facade
wao.ui.field.FishingZone.sectorName=Sector
-wao.ui.field.Profression.libelle=Libellé métier
wao.ui.field.SampleRow.appliedCoverageRate=Applied coverage rate
wao.ui.field.SampleRow.averageTideTime=Average tide time
wao.ui.field.SampleRow.boat=Boat
@@ -305,6 +322,7 @@
wao.ui.form.repeatPassword=Repeat password
wao.ui.form.roles=Roles
wao.ui.form.sortByTideBegin=Sort by observation begin date
+wao.ui.form.updateContactCommand.success=Modifications about contact successfully saved
wao.ui.form.updateSampleRowCommand.success=Modifications about sample row %s successfully saved
wao.ui.form.updateWaoUserCommand.admin=Administrator
wao.ui.form.updateWaoUserCommand.adminReadOnly=Administrator (read-only)
@@ -487,3 +505,4 @@
wao.ui.userList=Users list
wao.ui.userMustAcceptCgu=You must accept the terms of use
wao.ui.validLogin=Valid identifier
+wao.ui.validation.validation.contacts.failure.not.valid=Could not validate contact\: %s
Modified: trunk/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties
===================================================================
--- trunk/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties 2014-04-06 10:01:28 UTC (rev 1845)
+++ trunk/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties 2014-04-06 17:00:34 UTC (rev 1846)
@@ -40,6 +40,8 @@
wao.ui.action.deleteCompany.success=La société a bien été supprimée
wao.ui.action.deleteContact=Supprimer le contact
wao.ui.action.deleteContact.confirm=Êtes-vous sûr de vouloir supprimer définitivement ce contact ?
+wao.ui.action.deleteContact.failure=La suppression du contact a échoué
+wao.ui.action.deleteContact.success=Le contact a bien été supprimé
wao.ui.action.deleteNews=Supprimer la nouvelle
wao.ui.action.deleteNews.confirm=Êtes-vous sûr de vouloir supprimer définitivement cette nouvelle ?
wao.ui.action.deleteSampleRow=Supprimer la ligne du plan
@@ -51,6 +53,7 @@
wao.ui.action.deleteWaoUser.failure=La suppression de l'utilisateur a échoué
wao.ui.action.deleteWaoUser.success=L'utilisateur a bien été supprimé
wao.ui.action.edit=Modifier
+wao.ui.action.editOrDeleteContact=Modifier ou supprimer le contact
wao.ui.action.editOrDeleteSampleRow=Modifier ou supprimer la ligne
wao.ui.action.enlargeView=Agrandir la vue
wao.ui.action.exportBoats=Exporter les $s navires avec leurs informations privées
@@ -110,15 +113,30 @@
wao.ui.chart.numberObservations=Nb observations
wao.ui.chart.numberOfBoatsWithBoardings=Nombre de navires avec x embarquements
wao.ui.chooseUserProfile=Choisissez votre rôle
+wao.ui.contact.creation=Création d'u contact
+wao.ui.contact.edition=Modification du contact %s
wao.ui.contact.lastContact=Dernière observation concernant ce navire pour votre société (tous programmes confondus)
+wao.ui.contacts.FishingZone.facadeName=Façade
+wao.ui.contacts.FishingZone.sectorName=Zone
+wao.ui.contacts.Profession.libelle=Libellé métier
+wao.ui.contacts.Profession.species=Espèces cibles
+wao.ui.contacts.boatName=Navire
wao.ui.contacts.createFromBoat=Créer un nouveau contact pour ce navire et cette ligne du plan
wao.ui.contacts.createFromBoat.fail=Création d'un nouveau contact impossible
wao.ui.contacts.createFromBoat.warn=Attention \: cette ligne du plan est arrivée à échéance, êtes-vous sûr de vouloir créer un nouveau contact ?
+wao.ui.contacts.district=CQ
wao.ui.contacts.division=Division
+wao.ui.contacts.immatriculation=N°
wao.ui.contacts.observations=Observations et captures accidentelles
wao.ui.contacts.observers=Observateurs
wao.ui.contacts.title=%s contacts trouvés
-wao.ui.contacts.validation=Validation
+wao.ui.contacts.validation=Validations
+wao.ui.contacts.validation.failure=Une erreur est survenue %s
+wao.ui.contacts.validation.failure.not.updatable=Vous n'avez pas les droits pour modifier ce contact \: %s
+wao.ui.contacts.validation.failure.not.valid=Le contact n'a pas pu être validé pour la raison suivante \: %s
+wao.ui.contacts.validation.to.accept.state.success=Le contact a été accepté avec succès
+wao.ui.contacts.validation.to.reject.state.success=Le contact a été rejeté avec succès
+wao.ui.contacts.validation.to.unvalidate.state.success=Le contact a été invalidé avec succès
wao.ui.disclaimer=Le site de « SUIVI DU REALISE DU PLAN D'ECHANTILLONNAGE DES OBSERVATIONS A LA MER » a fait l'objet d'une déclaration à la CNIL sous le numéro suivant \: 1414476
wao.ui.disclaimer.boats=Les données saisies dans cette page sont la propriété exclusive de la société. En dehors de la société, seul l'administrateur peut les consulter pour des questions de maintenance sur le site. L'administrateur est une personne de l'Ifremer.
wao.ui.email=Adresse e-mail
@@ -161,26 +179,26 @@
wao.ui.field.Company.name=Nom
wao.ui.field.Company.phoneNumber=N° de téléphone
wao.ui.field.Company.postalCode=Code postal
-wao.ui.field.Contact.beginDate=Début d'observation
+wao.ui.field.Contact.beginDate=Début de l'observation
wao.ui.field.Contact.boat=Navire
wao.ui.field.Contact.comment=Commentaire observateur
wao.ui.field.Contact.commentAdmin=Commentaire programme
wao.ui.field.Contact.commentCompany=Commentaire société
wao.ui.field.Contact.commentCoordinator=Commentaire coordinateur
wao.ui.field.Contact.completeSampling=Échantillonnage complet
-wao.ui.field.Contact.contactState=État du contact
-wao.ui.field.Contact.contactStateMotif=Motif du refus
+wao.ui.field.Contact.contactState=État
+wao.ui.field.Contact.contactStateMotif=Motif de refus
wao.ui.field.Contact.contactStateMotifs=Motifs de refus
-wao.ui.field.Contact.creationDate=Date de création du contact
-wao.ui.field.Contact.dataInputDate=Saisie des données
-wao.ui.field.Contact.dataReliability=Qualité des données
-wao.ui.field.Contact.endDate=Fin d'observation
+wao.ui.field.Contact.creationDate=Création
+wao.ui.field.Contact.dataInputDate=Saisie des données observées
+wao.ui.field.Contact.dataReliability=Qualité de la donnée
+wao.ui.field.Contact.endDate=Fin de l'observation
wao.ui.field.Contact.landingDate=Date et heure de débarquement
wao.ui.field.Contact.mainObserver=Observateur référent
wao.ui.field.Contact.mammalsCapture=Capture accidentelle
wao.ui.field.Contact.mammalsInfo=Noms scientifiques et nombres d'individus des espèces capturées
wao.ui.field.Contact.mammalsObservation=Observation exceptionnelle
-wao.ui.field.Contact.nbObservants=Nombre d'observateurs
+wao.ui.field.Contact.nbObservants=Nb obs.
wao.ui.field.Contact.obsDebCode=Métier
wao.ui.field.Contact.observationType=Type d'observation
wao.ui.field.Contact.observedDataControl=Contrôle des données observées
@@ -193,7 +211,6 @@
wao.ui.field.Contact.validationProgram=Validation programme
wao.ui.field.FishingZone.facadeName=Façade
wao.ui.field.FishingZone.sectorName=Zone
-wao.ui.field.Profression.libelle=Libellé métier
wao.ui.field.SampleRow.appliedCoverageRate=Taux de couverture appliqué
wao.ui.field.SampleRow.averageTideTime=Durée moyenne d'une marée
wao.ui.field.SampleRow.boat=Navire
@@ -305,6 +322,7 @@
wao.ui.form.repeatPassword=Répéter le mot de passe
wao.ui.form.roles=Rôles
wao.ui.form.sortByTideBegin=Trier par date de début d'observation (du plus récent au plus ancien)
+wao.ui.form.updateContactCommand.success=Les informations concernant le contact ont bien été enregistrées
wao.ui.form.updateSampleRowCommand.success=Les informations concernant la ligne %s ont bien été enregistrées
wao.ui.form.updateWaoUserCommand.admin=Administrateur
wao.ui.form.updateWaoUserCommand.adminReadOnly=Administrateur (lecture seule)
Modified: trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/contacts.jsp
===================================================================
--- trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/contacts.jsp 2014-04-06 10:01:28 UTC (rev 1845)
+++ trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/contacts.jsp 2014-04-06 17:00:34 UTC (rev 1846)
@@ -44,6 +44,26 @@
contactsFilterController.reset();
});
+ $('.validation-action').click(function() {
+ var $action = $(this);
+ var url = $action.attr('data');
+ var successCallback = function (data) {
+ var succesful = data['successful'];
+
+ if (!succesful) {
+ var error = data['errorMessage'];
+ WAO.notifications.error(error);
+ } else {
+ var success = data['successMessage'];
+ WAO.notifications.success(success);
+ //TODO Update line and data actions
+ }
+ };
+ WAO.get(url, null, successCallback);
+ });
+
+ // Do not expose any struts internal input fields
+ $('input[type="hidden"][id^="__"]').prop('disabled', true);
});
</script>
@@ -71,7 +91,7 @@
<fieldset>
<s:select name="filter.boatFilter.boatIds"
- label="%{getText('wao.ui.field.Boat.name')}"
+ label="%{getText('wao.ui.contacts.boatName')}"
list="filterValues.boatNames"
listKey="value"
listValue="label"
@@ -116,7 +136,7 @@
listKey="value"
listValue="label"
multiple="true"
- dataBinding="programNames"/>
+ dataBinding="sampleRowsFilterValues.programNames"/>
</fieldset>
@@ -211,7 +231,6 @@
<s:checkbox name="filter.mammalsCaptureOnly"
label="%{getText('wao.ui.field.Contact.mammalsCapture')}"/>
- <br/>
<s:checkbox name="filter.commentDefinedOnly"
label="%{getText('wao.ui.field.Contact.comment')}"/>
@@ -318,19 +337,19 @@
<thead>
<tr>
<th><s:text name="wao.ui.field.Contact.creationDate"/></th>
- <th class="only-in-full-view"><s:text name="wao.ui.contacts.observers"/></th>
+ <th><s:text name="wao.ui.contacts.observers"/></th>
<th class="only-in-full-view"><s:text name="wao.ui.field.SampleRow.company"/></th>
<th><s:text name="wao.ui.field.Contact.sampleRow"/></th>
<th class="only-in-full-view"><s:text name="wao.ui.field.SampleRow.programName"/></th>
<th class="only-in-full-view"><s:text name="wao.ui.field.SampleRow.professionCode"/></th>
- <th class="only-in-full-view"><s:text name="wao.ui.field.Profression.libelle"/></th>
- <th class="only-in-full-view"><s:text name="wao.ui.field.SampleRow.species"/></th>
- <th class="only-in-full-view"><s:text name="wao.ui.field.FishingZone.facadeName"/></th>
- <th class="only-in-full-view"><s:text name="wao.ui.field.FishingZone.sectorName"/></th>
+ <th class="only-in-full-view"><s:text name="wao.ui.contacts.Profession.libelle"/></th>
+ <th class="only-in-full-view"><s:text name="wao.ui.contacts.Profession.species"/></th>
+ <th class="only-in-full-view"><s:text name="wao.ui.contacts.FishingZone.facadeName"/></th>
+ <th class="only-in-full-view"><s:text name="wao.ui.contacts.FishingZone.sectorName"/></th>
<th class="only-in-full-view"><s:text name="wao.ui.contacts.division"/></th>
- <th class="only-in-full-view"><s:text name="wao.ui.field.Boat.name"/></th>
- <th class="only-in-full-view"><s:text name="wao.ui.field.Boat.immatriculation"/></th>
- <th class="only-in-full-view"><s:text name="wao.ui.field.Boat.district"/></th>
+ <th><s:text name="wao.ui.contacts.boatName"/></th>
+ <th class="only-in-full-view"><s:text name="wao.ui.contacts.immatriculation"/></th>
+ <th class="only-in-full-view"><s:text name="wao.ui.contacts.district"/></th>
<th><s:text name="wao.ui.field.Contact.contactState"/></th>
<th><s:text name="wao.ui.field.Contact.contactStateMotif"/></th>
<th><s:text name="wao.ui.field.Contact.beginDate"/></th>
@@ -355,7 +374,7 @@
<td>
<s:property value="%{formatDate(creationDate)}"/>
</td>
-<td class="only-in-full-view">
+<td>
<s:if test="secondaryObserversEmpty">
<s:property value="mainObserver.fullName"/>
</s:if>
@@ -504,53 +523,43 @@
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
- <s:if test="authenticatedWaoUser.isAuthorizedToEditContact(#contact)">
+ <s:if test="authenticatedWaoUser.isAuthorizedToEditContact(#contact) || authenticatedWaoUser.isAuthorizedToDeleteContact(#contact)">
<li>
<s:url action="edit-contact!input" id="editContactUrl">
<s:param name="contactId" value="topiaId"/>
</s:url>
<s:a href="%{editContactUrl}">
- <i class="icon-edit"></i> <s:text name="wao.ui.action.edit"/>
+ <i class="icon-edit"></i> <s:text name="wao.ui.action.editOrDeleteContact"/>
</s:a>
</li>
</s:if>
- <s:if test="authenticatedWaoUser.isAuthorizedToDeleteContact(#contact)">
- <li>
- <s:url action="delete-contact!input" id="deleteContactUrl">
- <s:param name="contactId" value="topiaId"/>
- </s:url>
- <s:a href="%{deleteContactUrl}">
- <i class="icon-delete"></i> <s:text name="wao.ui.action.delete"/>
- </s:a>
- </li>
- </s:if>
<s:if test="authenticatedWaoUser.authorizedToValidateContacts">
<s:if test="authenticatedWaoUser.isAuthorizedToValidateContact(#contact)">
<li>
- <s:url action="validate-contact!input" id="acceptContactUrl">
+ <s:url action="validate-contact-json" id="acceptContactUrl" escapeAmp="false">
<s:param name="contactId" value="topiaId"/>
- <s:param name="validateState" value="true"/>
+ <s:param name="validationState">true</s:param>
</s:url>
- <s:a href="%{acceptContactUrl}">
+ <s:a cssClass='validation-action' href="#notifications" data="%{acceptContactUrl}">
<s:text name="wao.ui.action.acceptContact"/>
</s:a>
</li>
<li>
- <s:url action="validate-contact!input" id="refuseContactUrl">
+ <s:url action="validate-contact-json" id="refuseContactUrl" escapeAmp="false">
<s:param name="contactId" value="topiaId"/>
- <s:param name="validateState" value="false"/>
+ <s:param name="validationState">false</s:param>
</s:url>
- <s:a href="%{refuseContactUrl}">
+ <s:a cssClass='validation-action' href="#notifications" data="%{refuseContactUrl}">
<s:text name="wao.ui.action.refuseContact"/>
</s:a>
</li>
</s:if>
<s:if test="authenticatedWaoUser.isAuthorizedToUnvalidateContact(#contact)">
<li>
- <s:url action="validate-contact!input" id="unvalidateContactUrl">
+ <s:url action="validate-contact-json" id="unvalidateContactUrl">
<s:param name="contactId" value="topiaId"/>
</s:url>
- <s:a href="%{unvalidateContactUrl}">
+ <s:a cssClass='validation-action' href="#notifications" data="%{unvalidateContactUrl}">
<s:text name="wao.ui.action.unvalidateContact"/>
</s:a>
</li>
Added: trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/edit-contact-input.jsp
===================================================================
--- trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/edit-contact-input.jsp (rev 0)
+++ trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/edit-contact-input.jsp 2014-04-06 17:00:34 UTC (rev 1846)
@@ -0,0 +1,112 @@
+<%--
+ #%L
+ Wao :: Web
+ %%
+ Copyright (C) 2009 - 2014 Ifremer
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
+<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
+<%@taglib uri="/struts-tags" prefix="s" %>
+
+<html>
+<head>
+ <title>
+ <s:if test="updateContactCommand.creation">
+ <s:text name="wao.ui.sampleRow.creation" />
+ </s:if>
+ <s:else>
+ <s:text name="wao.ui.contact.edition">
+ <s:param value="updateContactCommand.contact.mainObserver.fullName"/>
+ </s:text>
+ </s:else>
+ </title>
+ <script>
+
+ $(document).ready(function() {
+
+ });
+
+ </script>
+</head>
+
+
+<h1>
+ <s:if test="updateContactCommand.creation">
+ <s:text name="wao.ui.contact.creation" />
+ </s:if>
+ <s:else>
+ <s:text name="wao.ui.contact.edition">
+ <s:param value="updateContactCommand.contact.mainObserver.fullName"/>
+ </s:text>
+ </s:else>
+</h1>
+
+<s:if test="updateContactCommand.observationAlreadyStarted">
+ <div class="alert">
+ <s:text name="wao.ui.form.SampleRow.warn.observationAlreadyStarted" />
+ </div>
+</s:if>
+
+<s:form>
+
+ <s:hidden name="sampleRowId" value="%{sampleRowId}" />
+
+ <fieldset>
+
+ <legend><s:text name="wao.ui.field.SampleRow.profession" /></legend>
+
+
+ </fieldset>
+
+ <s:if test=" ! updateContactCommand.creation">
+
+ <fieldset>
+
+ <legend><s:text name="wao.ui.form.editComment" /></legend>
+
+ <s:text name="wao.ui.form.editionAuthor" /> <s:property value="updateContactCommand.sampleRowLog.author.fullName" />
+
+ <s:textarea name="updateContactCommand.contact.comment" label="%{getText('wao.ui.form.editComment')}" requiredLabel="true" />
+
+ </fieldset>
+
+ </s:if>
+
+ <div class="form-actions">
+ <s:url action="contacts" id="contactsUrl" />
+ <s:a href="%{contactsUrl}" cssClass="btn">
+ <i class="icon-chevron-left"></i> <s:text name="wao.ui.action.cancel" />
+ </s:a>
+ <s:if test=" authenticatedWaoUser.isAuthorizedToEditContact(updateContactCommand.contact)">
+ <s:submit type="button" cssClass="btn">
+ <i class="icon-hdd"></i> <s:text name="wao.ui.action.save" />
+ </s:submit>
+ </s:if>
+
+ <s:if test=" ! updateContactCommand.creation && authenticatedWaoUser.isAuthorizedToDeleteContact(updateContactCommand.contact)">
+ <s:url action="delete-contact" id="deleteContactUrl">
+ <s:param name="contactId" value="contactId" />
+ </s:url>
+ <s:a href="%{deleteContactUrl}" cssClass="btn pull-right">
+ <i class="icon-trash"></i> <s:text name="wao.ui.action.deleteContact" />
+ </s:a>
+ </s:if>
+ </div>
+
+</s:form>
+
+</html>
+
Property changes on: trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/edit-contact-input.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/wao-web/src/main/webapp/WEB-INF/decorators/layout.jsp
===================================================================
--- trunk/wao-web/src/main/webapp/WEB-INF/decorators/layout.jsp 2014-04-06 10:01:28 UTC (rev 1845)
+++ trunk/wao-web/src/main/webapp/WEB-INF/decorators/layout.jsp 2014-04-06 17:00:34 UTC (rev 1846)
@@ -178,7 +178,7 @@
<s:actionerror theme="bootstrap" />
<s:actionmessage theme="bootstrap" />
<s:fielderror theme="bootstrap" />
- <div id="notifications"></div>
+ <div id="notifications"><a href="#notifications"></a></div>
<decorator:body />
</main>
@@ -194,13 +194,13 @@
<%@include file="version.jsp" %>
</a>
</li>
- <t:if test="obsMer">
+ <s:if test="obsMer">
<li>
<a href="mailto:harmonie@ifremer.fr" title="Contacter un responsable Obsmer">
Obsmer
</a>
</li>
- </t:if>
+ </s:if>
<li>
<a href="http://sih.ifremer.fr/" title="Page d'accueil du SIH" target="_blank">
Ifremer SIH
Modified: trunk/wao-web/src/main/webapp/bootstrap-2.3.1/bootstrap-popover.js
===================================================================
--- trunk/wao-web/src/main/webapp/bootstrap-2.3.1/bootstrap-popover.js 2014-04-06 10:01:28 UTC (rev 1845)
+++ trunk/wao-web/src/main/webapp/bootstrap-2.3.1/bootstrap-popover.js 2014-04-06 17:00:34 UTC (rev 1846)
@@ -1,5 +1,5 @@
/* ===========================================================
- * bootstrap-popover.js v2.3.1
+ * bootstrap-popover.js v2.3.1 %%Ignore-License
* http://twitter.github.com/bootstrap/javascript.html#popovers
* ===========================================================
* Copyright 2012 Twitter, Inc.
1
0
r1845 - trunk/wao-web/src/main/java/fr/ifremer/wao/web
by tchemit@users.forge.codelutin.com 06 Apr '14
by tchemit@users.forge.codelutin.com 06 Apr '14
06 Apr '14
Author: tchemit
Date: 2014-04-06 12:01:28 +0200 (Sun, 06 Apr 2014)
New Revision: 1845
Url: http://forge.codelutin.com/projects/wao/repository/revisions/1845
Log:
remove redundant method
Modified:
trunk/wao-web/src/main/java/fr/ifremer/wao/web/WaoActionSupport.java
Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/WaoActionSupport.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/WaoActionSupport.java 2014-04-06 10:00:50 UTC (rev 1844)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/WaoActionSupport.java 2014-04-06 10:01:28 UTC (rev 1845)
@@ -22,7 +22,6 @@
*/
import fr.ifremer.wao.WaoApplicationConfig;
-import org.nuiton.i18n.I18n;
import org.nuiton.web.struts2.BaseAction;
public class WaoActionSupport extends BaseAction {
@@ -45,8 +44,4 @@
this.session = session;
}
- public String t(String key, Object... args) {
- return I18n.l(getLocale(), key, args);
- }
-
}
1
0
Author: tchemit
Date: 2014-04-06 12:00:50 +0200 (Sun, 06 Apr 2014)
New Revision: 1844
Url: http://forge.codelutin.com/projects/wao/repository/revisions/1844
Log:
do not include in filter form any of the '__' fields
Modified:
trunk/wao-web/src/main/webapp/wao.js
Modified: trunk/wao-web/src/main/webapp/wao.js
===================================================================
--- trunk/wao-web/src/main/webapp/wao.js 2014-04-06 09:55:25 UTC (rev 1843)
+++ trunk/wao-web/src/main/webapp/wao.js 2014-04-06 10:00:50 UTC (rev 1844)
@@ -54,6 +54,9 @@
this.$selects.each(function (index, select) {
var $select = $(select);
var parameterName = $select.prop('name');
+ if (parameterName.indexOf('__') == 0) {
+ return;
+ }
var parameterValues = [];
$select.find('option:selected').each(function (index, option) {
parameterValues.push($(option).prop('value'));
@@ -63,6 +66,9 @@
this.$inputs.each(function (index, input) {
var $input = $(input);
var parameterName = $input.prop('name');
+ if (parameterName.indexOf('__') == 0) {
+ return;
+ }
var parameterValue;
if ($input.attr('type') == 'checkbox') {
parameterValue = $input.prop('checked');
1
0
r1843 - in trunk/wao-web/src/main: java/fr/ifremer/wao/web java/fr/ifremer/wao/web/action java/fr/ifremer/wao/web/converter resources/fr/ifremer/wao resources/fr/ifremer/wao/entity
by tchemit@users.forge.codelutin.com 06 Apr '14
by tchemit@users.forge.codelutin.com 06 Apr '14
06 Apr '14
Author: tchemit
Date: 2014-04-06 11:55:25 +0200 (Sun, 06 Apr 2014)
New Revision: 1843
Url: http://forge.codelutin.com/projects/wao/repository/revisions/1843
Log:
add BooleanSet converter + introduce converter package
Added:
trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/
trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/BooleanSetConverter.java
trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/MonthConverter.java
trunk/wao-web/src/main/resources/fr/ifremer/wao/ContactsFilter-conversion.properties
Removed:
trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/MonthConverter.java
Modified:
trunk/wao-web/src/main/resources/fr/ifremer/wao/SampleRowsFilter-conversion.properties
trunk/wao-web/src/main/resources/fr/ifremer/wao/entity/SampleRow-conversion.properties
Deleted: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/MonthConverter.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/MonthConverter.java 2014-04-06 09:06:57 UTC (rev 1842)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/MonthConverter.java 2014-04-06 09:55:25 UTC (rev 1843)
@@ -1,126 +0,0 @@
-package fr.ifremer.wao.web.action;
-
-/*
- * #%L
- * Wao :: Web
- * %%
- * Copyright (C) 2009 - 2014 Ifremer
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import com.google.common.base.Preconditions;
-import com.opensymphony.xwork2.ActionContext;
-import com.opensymphony.xwork2.conversion.TypeConversionException;
-import fr.ifremer.wao.WaoUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.struts2.util.StrutsTypeConverter;
-
-import java.text.ParseException;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.Locale;
-import java.util.Map;
-
-public class MonthConverter extends StrutsTypeConverter {
-
- /** Logger. */
- private static final Log log = LogFactory.getLog(MonthConverter.class);
-
- @Override
- public Date convertFromString(Map map, String[] strings, Class aClass) {
-
- if (strings.length == 1) {
-
- String string = strings[0];
-
- Date parsedValue;
-
- if (StringUtils.isEmpty(string)) {
-
- parsedValue = null;
-
- } else {
-
- Locale locale = (Locale) map.get(ActionContext.LOCALE);
- Preconditions.checkNotNull(locale, "No locale found in ActionContext");
-
- parsedValue = parseDate(locale, string, strings, true);
-
- if (parsedValue == null) {
-
- //FIXME If action is changing language, then date are not in good format
- //FIXME Let's try why other locale...
- if (Locale.FRENCH.equals(locale)) {
- locale = Locale.ENGLISH;
- } else {
- locale = Locale.FRENCH;
- }
- parsedValue = parseDate(locale, string, strings, false);
- }
- }
-
- return parsedValue;
-
- } else {
- throw new TypeConversionException("strings=" + Arrays.toString(strings));
- }
- }
-
- protected Date parseDate(Locale locale, String string, String[] strings, boolean swallonError) {
- Preconditions.checkNotNull(locale);
- try {
- return WaoUtils.parseMonth(locale, string);
- } catch (ParseException e) {
- if (swallonError) {
- return null;
- }
- //FIXME See why we don't see the error
- if (log.isErrorEnabled()) {
- log.error("Could not format parse date " + string, e);
- }
- throw new TypeConversionException("strings=" + Arrays.toString(strings));
- }
- }
-
- @Override
- public String convertToString(Map map, Object o) {
-
- String str;
-
- if (o == null) {
-
- str = StringUtils.EMPTY;
-
- } else {
-
- if (o instanceof Date) {
-
- Date date = (Date) o;
-
- Locale locale = (Locale) map.get(ActionContext.LOCALE);
- Preconditions.checkNotNull(locale, "No locale found in ActionContext");
- str = WaoUtils.formatMonth(locale, date);
- } else {
- throw new UnsupportedOperationException("cannot convert to month " + o);
- }
- }
-
- return str;
-
- }
-}
Added: trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/BooleanSetConverter.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/BooleanSetConverter.java (rev 0)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/BooleanSetConverter.java 2014-04-06 09:55:25 UTC (rev 1843)
@@ -0,0 +1,97 @@
+package fr.ifremer.wao.web.converter;
+
+/*
+ * #%L
+ * Wao :: Web
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.google.common.base.Joiner;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.struts2.util.StrutsTypeConverter;
+
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * To convert a set of Boolean to string (string empty value means {@code null} value).
+ * <p/>
+ * Created on 4/6/14.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 4.0
+ */
+public class BooleanSetConverter extends StrutsTypeConverter {
+
+ @Override
+ public Set<Boolean> convertFromString(Map map, String[] strings, Class aClass) {
+
+ Set<Boolean> result = new HashSet<>();
+
+ if (strings.length > 0) {
+
+ for (String string : strings) {
+ Boolean aBoolean;
+
+ if (StringUtils.isEmpty(string)) {
+ aBoolean = null;
+ } else {
+ aBoolean = Boolean.valueOf(string);
+ }
+ result.add(aBoolean);
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public String convertToString(Map map, Object o) {
+
+ String str;
+
+ if (o == null) {
+
+ str = StringUtils.EMPTY;
+
+ } else {
+
+ if (o instanceof Set) {
+
+ Set<Boolean> booleans = (Set<Boolean>) o;
+ Set<String> strings = new HashSet<>();
+ for (Boolean aBoolean : booleans) {
+ String string;
+ if (aBoolean == null) {
+ string = "";
+ } else {
+ string = aBoolean.toString();
+ }
+ strings.add(string);
+ }
+
+ str = Joiner.on(',').join(strings);
+ } else {
+ throw new UnsupportedOperationException("cannot convert to set of Boolean " + o);
+ }
+ }
+
+ return str;
+
+ }
+}
\ No newline at end of file
Property changes on: trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/BooleanSetConverter.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Copied: trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/MonthConverter.java (from rev 1839, trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/MonthConverter.java)
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/MonthConverter.java (rev 0)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/MonthConverter.java 2014-04-06 09:55:25 UTC (rev 1843)
@@ -0,0 +1,135 @@
+package fr.ifremer.wao.web.converter;
+
+/*
+ * #%L
+ * Wao :: Web
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.google.common.base.Preconditions;
+import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.conversion.TypeConversionException;
+import fr.ifremer.wao.WaoUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.struts2.util.StrutsTypeConverter;
+
+import java.text.ParseException;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.Locale;
+import java.util.Map;
+
+
+/**
+ * To convert a date as a month.
+ *
+ * FIXME-tchemit 2014-04-06 When user change his locale, we could have in parameters some date formatted with the previous
+ * FIXME-tchemit 2014-04-06 locale, we need then to try with previous locale date pattern.
+ *
+ * @since 4.0
+ */
+public class MonthConverter extends StrutsTypeConverter {
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(MonthConverter.class);
+
+ @Override
+ public Date convertFromString(Map map, String[] strings, Class aClass) {
+
+ if (strings.length == 1) {
+
+ String string = strings[0];
+
+ Date parsedValue;
+
+ if (StringUtils.isEmpty(string)) {
+
+ parsedValue = null;
+
+ } else {
+
+ Locale locale = (Locale) map.get(ActionContext.LOCALE);
+ Preconditions.checkNotNull(locale, "No locale found in ActionContext");
+
+ parsedValue = parseDate(locale, string, strings, true);
+
+ if (parsedValue == null) {
+
+ //FIXME If action is changing language, then date are not in good format
+ //FIXME Let's try why other locale...
+ if (Locale.FRENCH.equals(locale)) {
+ locale = Locale.ENGLISH;
+ } else {
+ locale = Locale.FRENCH;
+ }
+ parsedValue = parseDate(locale, string, strings, false);
+ }
+ }
+
+ return parsedValue;
+
+ } else {
+ throw new TypeConversionException("strings=" + Arrays.toString(strings));
+ }
+ }
+
+ protected Date parseDate(Locale locale, String string, String[] strings, boolean swallonError) {
+ Preconditions.checkNotNull(locale);
+ try {
+ return WaoUtils.parseMonth(locale, string);
+ } catch (ParseException e) {
+ if (swallonError) {
+ return null;
+ }
+ //FIXME See why we don't see the error
+ if (log.isErrorEnabled()) {
+ log.error("Could not format parse date " + string, e);
+ }
+ throw new TypeConversionException("strings=" + Arrays.toString(strings));
+ }
+ }
+
+ @Override
+ public String convertToString(Map map, Object o) {
+
+ String str;
+
+ if (o == null) {
+
+ str = StringUtils.EMPTY;
+
+ } else {
+
+ if (o instanceof Date) {
+
+ Date date = (Date) o;
+
+ Locale locale = (Locale) map.get(ActionContext.LOCALE);
+ Preconditions.checkNotNull(locale, "No locale found in ActionContext");
+ str = WaoUtils.formatMonth(locale, date);
+ } else {
+ throw new UnsupportedOperationException("cannot convert to month " + o);
+ }
+ }
+
+ return str;
+
+ }
+}
Added: trunk/wao-web/src/main/resources/fr/ifremer/wao/ContactsFilter-conversion.properties
===================================================================
--- trunk/wao-web/src/main/resources/fr/ifremer/wao/ContactsFilter-conversion.properties (rev 0)
+++ trunk/wao-web/src/main/resources/fr/ifremer/wao/ContactsFilter-conversion.properties 2014-04-06 09:55:25 UTC (rev 1843)
@@ -0,0 +1,22 @@
+###
+# #%L
+# Wao :: Web
+# %%
+# Copyright (C) 2009 - 2014 Ifremer
+# %%
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# #L%
+###
+companyAcceptations=fr.ifremer.wao.web.converter.BooleanSetConverter
+programAcceptations=fr.ifremer.wao.web.converter.BooleanSetConverter
\ No newline at end of file
Property changes on: trunk/wao-web/src/main/resources/fr/ifremer/wao/ContactsFilter-conversion.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/wao-web/src/main/resources/fr/ifremer/wao/SampleRowsFilter-conversion.properties
===================================================================
--- trunk/wao-web/src/main/resources/fr/ifremer/wao/SampleRowsFilter-conversion.properties 2014-04-06 09:06:57 UTC (rev 1842)
+++ trunk/wao-web/src/main/resources/fr/ifremer/wao/SampleRowsFilter-conversion.properties 2014-04-06 09:55:25 UTC (rev 1843)
@@ -18,5 +18,5 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# #L%
###
-periodFrom=fr.ifremer.wao.web.action.MonthConverter
-periodTo=fr.ifremer.wao.web.action.MonthConverter
+periodFrom=fr.ifremer.wao.web.converter.MonthConverter
+periodTo=fr.ifremer.wao.web.converter.MonthConverter
Modified: trunk/wao-web/src/main/resources/fr/ifremer/wao/entity/SampleRow-conversion.properties
===================================================================
--- trunk/wao-web/src/main/resources/fr/ifremer/wao/entity/SampleRow-conversion.properties 2014-04-06 09:06:57 UTC (rev 1842)
+++ trunk/wao-web/src/main/resources/fr/ifremer/wao/entity/SampleRow-conversion.properties 2014-04-06 09:55:25 UTC (rev 1843)
@@ -18,5 +18,5 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# #L%
###
-periodBegin=fr.ifremer.wao.web.action.MonthConverter
-periodEnd=fr.ifremer.wao.web.action.MonthConverter
+periodBegin=fr.ifremer.wao.web.converter.MonthConverter
+periodEnd=fr.ifremer.wao.web.converter.MonthConverter
1
0
Author: tchemit
Date: 2014-04-06 11:06:57 +0200 (Sun, 06 Apr 2014)
New Revision: 1842
Url: http://forge.codelutin.com/projects/wao/repository/revisions/1842
Log:
fix filter for checkbox inputs + fix statements end (please stop using different code styles at the same time)
Modified:
trunk/wao-web/src/main/webapp/wao.js
Modified: trunk/wao-web/src/main/webapp/wao.js
===================================================================
--- trunk/wao-web/src/main/webapp/wao.js 2014-04-06 09:04:23 UTC (rev 1841)
+++ trunk/wao-web/src/main/webapp/wao.js 2014-04-06 09:06:57 UTC (rev 1842)
@@ -40,11 +40,11 @@
};
-var FilterView = function (sampleRowsFilterModel, $filtersForm) {
+var FilterView = function (filterModel, $filtersForm) {
var self = this;
- this.model = sampleRowsFilterModel;
+ this.model = filterModel;
this.$filtersForm = $filtersForm;
this.$selects = $filtersForm.find('select');
this.$inputs = $filtersForm.find('input');
@@ -63,7 +63,12 @@
this.$inputs.each(function (index, input) {
var $input = $(input);
var parameterName = $input.prop('name');
- var parameterValue = $input.prop('value');
+ var parameterValue;
+ if ($input.attr('type') == 'checkbox') {
+ parameterValue = $input.prop('checked');
+ } else {
+ parameterValue = $input.prop('value');
+ }
filter[parameterName] = parameterValue;
});
return filter;
@@ -103,9 +108,12 @@
var $input = $(input);
var parameterName = $input.prop('name');
var parameterValue = filter[parameterName];
- var parameterValue = $input.prop('value', parameterValue);
+ $input.prop('value', parameterValue);
+ if ($input.attr('type') == 'checkbox') {
+ $input.prop('checked', parameterValue);
+ }
});
- }
+ };
$(this.model).on('updated', function () {
self.refreshFilterValues();
@@ -147,7 +155,7 @@
this.view.$inputs.mouseleave(updateFilterValuesIfValueChanged);
this.initialFilter = this.view.getFilter();
- }
+ };
this.reset = function () {
this.view.selectOptions(this.initialFilter);
@@ -202,11 +210,11 @@
} else {
this.$spinner.spin();
}
- }
+ };
this.stopSpinner = function () {
this.$spinner.spin(false);
- }
+ };
this.getData = function(path, data) {
return path.split('.').reduce(function(prev, prop){
@@ -220,7 +228,7 @@
var result = successCallback.apply(this, arguments);
self.stopSpinner();
return result;
- }
+ };
$.get(url, data, stopSpinningAfterCallingSuccessCallback);
}
1
0
r1841 - trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity
by tchemit@users.forge.codelutin.com 06 Apr '14
by tchemit@users.forge.codelutin.com 06 Apr '14
06 Apr '14
Author: tchemit
Date: 2014-04-06 11:04:23 +0200 (Sun, 06 Apr 2014)
New Revision: 1841
Url: http://forge.codelutin.com/projects/wao/repository/revisions/1841
Log:
fix deprecated method
Modified:
trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/SeaboardGeoPoint.java
Modified: trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/SeaboardGeoPoint.java
===================================================================
--- trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/SeaboardGeoPoint.java 2014-04-05 18:22:17 UTC (rev 1840)
+++ trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/SeaboardGeoPoint.java 2014-04-06 09:04:23 UTC (rev 1841)
@@ -23,7 +23,7 @@
*/
package fr.ifremer.wao.entity;
-import org.apache.commons.lang3.ObjectUtils;
+import java.util.Objects;
/**
* Adapteur pour avoir un GeoPoint correspondant à une façade maritime
@@ -72,7 +72,7 @@
@Override
public boolean equals(Object obj) {
return obj != null && obj instanceof SeaboardGeoPoint &&
- ObjectUtils.equals(getCode(), ((SeaboardGeoPoint) obj).getCode());
+ Objects.equals(getCode(), ((SeaboardGeoPoint) obj).getCode());
}
@Override
1
0
05 Apr '14
Author: tchemit
Date: 2014-04-05 20:22:17 +0200 (Sat, 05 Apr 2014)
New Revision: 1840
Url: http://forge.codelutin.com/projects/wao/repository/revisions/1840
Log:
add license headers
Modified:
trunk/wao-persistence/src/main/java/fr/ifremer/wao/BoatsFilter.java
trunk/wao-persistence/src/main/java/fr/ifremer/wao/ContactsFilter.java
trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/BoatTopiaDao.java
trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ContactTopiaDao.java
trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ElligibleBoatTopiaDao.java
trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/I18nAble.java
trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleMonthTopiaDao.java
trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleMonths.java
trunk/wao-services/src/main/java/fr/ifremer/wao/services/WaoCacheElement.java
trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/BoatDetails.java
trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/BoatsFilterValues.java
trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactNotValidException.java
trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsFilterValues.java
trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/FilterOption.java
trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/NullSampleMonthException.java
trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerBoatsList.java
trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerBoatsService.java
trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsList.java
trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsService.java
trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/PaginationBean.java
trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/SampleRowsFilterValues.java
trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/mail/MammalsObservationEmail.java
trunk/wao-services/src/test/java/fr/ifremer/wao/services/service/ObsMerBoatsServiceTest.java
trunk/wao-services/src/test/java/fr/ifremer/wao/services/service/ObsMerContactsServiceTest.java
trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/BoatDetailsAction.java
trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/BoatsAction.java
trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/BoatsFilterValuesJsonAction.java
trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ContactsAction.java
trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ContactsFilterValuesJsonAction.java
trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/DeleteContactAction.java
trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/DeleteSampleRowAction.java
trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ExportBoatsAction.java
trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ExportContactsAction.java
trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ImportContactsAction.java
trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/SampleRowsFilterValuesJsonAction.java
trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ValidateContact.java
trunk/wao-web/src/main/resources/fr/ifremer/wao/SampleRowsFilter-conversion.properties
trunk/wao-web/src/main/resources/template/bootstrap/simple/select.ftl
trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/boat-details.jsp
trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/import-contacts-input.jsp
trunk/wao-web/src/main/webapp/enpoints-js.jsp
trunk/wao-web/src/main/webapp/wao-screen.css
Modified: trunk/wao-persistence/src/main/java/fr/ifremer/wao/BoatsFilter.java
===================================================================
--- trunk/wao-persistence/src/main/java/fr/ifremer/wao/BoatsFilter.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-persistence/src/main/java/fr/ifremer/wao/BoatsFilter.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao;
+/*
+ * #%L
+ * Wao :: Persistence
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import java.io.Serializable;
Modified: trunk/wao-persistence/src/main/java/fr/ifremer/wao/ContactsFilter.java
===================================================================
--- trunk/wao-persistence/src/main/java/fr/ifremer/wao/ContactsFilter.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-persistence/src/main/java/fr/ifremer/wao/ContactsFilter.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao;
+/*
+ * #%L
+ * Wao :: Persistence
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import fr.ifremer.wao.entity.ContactState;
import fr.ifremer.wao.entity.DataReliability;
import fr.ifremer.wao.entity.ObservationType;
Modified: trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/BoatTopiaDao.java
===================================================================
--- trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/BoatTopiaDao.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/BoatTopiaDao.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,6 +1,27 @@
package fr.ifremer.wao.entity;
+/*
+ * #%L
+ * Wao :: Persistence
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import com.google.common.collect.ImmutableMap;
import fr.ifremer.wao.BoatsFilter;
import org.apache.commons.collections4.CollectionUtils;
Modified: trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ContactTopiaDao.java
===================================================================
--- trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ContactTopiaDao.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ContactTopiaDao.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.entity;
+/*
+ * #%L
+ * Wao :: Persistence
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Sets;
import fr.ifremer.wao.ContactsFilter;
Modified: trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ElligibleBoatTopiaDao.java
===================================================================
--- trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ElligibleBoatTopiaDao.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ElligibleBoatTopiaDao.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.entity;
+/*
+ * #%L
+ * Wao :: Persistence
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
public class ElligibleBoatTopiaDao extends AbstractElligibleBoatTopiaDao<ElligibleBoat> {
public ElligibleBoat findUniqueOrNull(Contact contact) {
Modified: trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/I18nAble.java
===================================================================
--- trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/I18nAble.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/I18nAble.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.entity;
+/*
+ * #%L
+ * Wao :: Persistence
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
/**
* Created on 3/26/14.
*
Modified: trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleMonthTopiaDao.java
===================================================================
--- trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleMonthTopiaDao.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleMonthTopiaDao.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.entity;
+/*
+ * #%L
+ * Wao :: Persistence
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import com.google.common.collect.ImmutableMap;
import org.nuiton.topia.persistence.HqlAndParametersBuilder;
import org.nuiton.topia.persistence.TopiaNoResultException;
Modified: trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleMonths.java
===================================================================
--- trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleMonths.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleMonths.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.entity;
+/*
+ * #%L
+ * Wao :: Persistence
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/WaoCacheElement.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/WaoCacheElement.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/WaoCacheElement.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.services;
+/*
+ * #%L
+ * Wao :: Services
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import java.io.Serializable;
public interface WaoCacheElement extends Serializable {
Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/BoatDetails.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/BoatDetails.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/BoatDetails.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.services.service;
+/*
+ * #%L
+ * Wao :: Services
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import fr.ifremer.wao.entity.BoatInfos;
import fr.ifremer.wao.entity.Contact;
Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/BoatsFilterValues.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/BoatsFilterValues.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/BoatsFilterValues.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.services.service;
+/*
+ * #%L
+ * Wao :: Services
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import fr.ifremer.wao.BoatsFilter;
import fr.ifremer.wao.entity.Boat;
import fr.ifremer.wao.entity.ElligibleBoat;
Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactNotValidException.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactNotValidException.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactNotValidException.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.services.service;
+/*
+ * #%L
+ * Wao :: Services
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import fr.ifremer.wao.WaoException;
/**
Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsFilterValues.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsFilterValues.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsFilterValues.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.services.service;
+/*
+ * #%L
+ * Wao :: Services
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import fr.ifremer.wao.entity.Boat;
import fr.ifremer.wao.entity.Contact;
import fr.ifremer.wao.entity.ContactState;
Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/FilterOption.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/FilterOption.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/FilterOption.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.services.service;
+/*
+ * #%L
+ * Wao :: Services
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import com.google.common.collect.Ordering;
import fr.ifremer.wao.entity.I18nAble;
Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/NullSampleMonthException.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/NullSampleMonthException.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/NullSampleMonthException.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.services.service;
+/*
+ * #%L
+ * Wao :: Services
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import fr.ifremer.wao.WaoException;
/**
Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerBoatsList.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerBoatsList.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerBoatsList.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.services.service;
+/*
+ * #%L
+ * Wao :: Services
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import fr.ifremer.wao.entity.Boat;
import java.io.Serializable;
Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerBoatsService.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerBoatsService.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerBoatsService.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.services.service;
+/*
+ * #%L
+ * Wao :: Services
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import com.google.common.base.Charsets;
import com.google.common.base.Optional;
import com.google.common.collect.Sets;
Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsList.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsList.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsList.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.services.service;
+/*
+ * #%L
+ * Wao :: Services
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import fr.ifremer.wao.entity.Contact;
import java.io.Serializable;
Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsService.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsService.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsService.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.services.service;
+/*
+ * #%L
+ * Wao :: Services
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import com.google.common.base.Charsets;
import com.google.common.collect.ImmutableSet;
import fr.ifremer.wao.ContactsFilter;
Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/PaginationBean.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/PaginationBean.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/PaginationBean.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.services.service;
+/*
+ * #%L
+ * Wao :: Services
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import org.nuiton.topia.persistence.pager.TopiaPagerBean;
import java.io.Serializable;
Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/SampleRowsFilterValues.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/SampleRowsFilterValues.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/SampleRowsFilterValues.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.services.service;
+/*
+ * #%L
+ * Wao :: Services
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import fr.ifremer.wao.entity.Company;
import fr.ifremer.wao.entity.DCF5Code;
import fr.ifremer.wao.entity.FishingGearDCF;
Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/mail/MammalsObservationEmail.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/mail/MammalsObservationEmail.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/mail/MammalsObservationEmail.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.services.service.mail;
+/*
+ * #%L
+ * Wao :: Services
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import fr.ifremer.wao.WaoUtils;
import fr.ifremer.wao.entity.Contact;
import fr.ifremer.wao.entity.FishingZone;
Modified: trunk/wao-services/src/test/java/fr/ifremer/wao/services/service/ObsMerBoatsServiceTest.java
===================================================================
--- trunk/wao-services/src/test/java/fr/ifremer/wao/services/service/ObsMerBoatsServiceTest.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-services/src/test/java/fr/ifremer/wao/services/service/ObsMerBoatsServiceTest.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.services.service;
+/*
+ * #%L
+ * Wao :: Services
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import fr.ifremer.wao.BoatsFilter;
import fr.ifremer.wao.services.AbstractWaoServiceTest;
import fr.ifremer.wao.services.ObsMerFixtures;
Modified: trunk/wao-services/src/test/java/fr/ifremer/wao/services/service/ObsMerContactsServiceTest.java
===================================================================
--- trunk/wao-services/src/test/java/fr/ifremer/wao/services/service/ObsMerContactsServiceTest.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-services/src/test/java/fr/ifremer/wao/services/service/ObsMerContactsServiceTest.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.services.service;
+/*
+ * #%L
+ * Wao :: Services
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import fr.ifremer.wao.ContactsFilter;
import fr.ifremer.wao.services.AbstractWaoServiceTest;
import fr.ifremer.wao.services.ObsMerFixtures;
Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/BoatDetailsAction.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/BoatDetailsAction.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/BoatDetailsAction.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.web.action.obsmer;
+/*
+ * #%L
+ * Wao :: Web
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import com.google.common.base.Preconditions;
import fr.ifremer.wao.services.service.BoatDetails;
import fr.ifremer.wao.services.service.ObsMerBoatsService;
Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/BoatsAction.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/BoatsAction.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/BoatsAction.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.web.action.obsmer;
+/*
+ * #%L
+ * Wao :: Web
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import com.opensymphony.xwork2.Preparable;
import fr.ifremer.wao.BoatsFilter;
import fr.ifremer.wao.entity.Boat;
Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/BoatsFilterValuesJsonAction.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/BoatsFilterValuesJsonAction.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/BoatsFilterValuesJsonAction.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.web.action.obsmer;
+/*
+ * #%L
+ * Wao :: Web
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import com.opensymphony.xwork2.Preparable;
import fr.ifremer.wao.BoatsFilter;
import fr.ifremer.wao.services.service.BoatsFilterValues;
Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ContactsAction.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ContactsAction.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ContactsAction.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.web.action.obsmer;
+/*
+ * #%L
+ * Wao :: Web
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import com.opensymphony.xwork2.Preparable;
import fr.ifremer.wao.ContactsFilter;
import fr.ifremer.wao.entity.Boat;
Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ContactsFilterValuesJsonAction.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ContactsFilterValuesJsonAction.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ContactsFilterValuesJsonAction.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.web.action.obsmer;
+/*
+ * #%L
+ * Wao :: Web
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import com.opensymphony.xwork2.Preparable;
import fr.ifremer.wao.ContactsFilter;
import fr.ifremer.wao.services.service.ContactsFilterValues;
Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/DeleteContactAction.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/DeleteContactAction.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/DeleteContactAction.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.web.action.obsmer;
+/*
+ * #%L
+ * Wao :: Web
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import fr.ifremer.wao.services.service.ObsMerSamplingPlanService;
import fr.ifremer.wao.web.WaoJspActionSupport;
Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/DeleteSampleRowAction.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/DeleteSampleRowAction.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/DeleteSampleRowAction.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.web.action.obsmer;
+/*
+ * #%L
+ * Wao :: Web
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import fr.ifremer.wao.services.service.IllegalDeletionException;
import fr.ifremer.wao.services.service.ObsMerSamplingPlanService;
import fr.ifremer.wao.web.WaoJspActionSupport;
Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ExportBoatsAction.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ExportBoatsAction.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ExportBoatsAction.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.web.action.obsmer;
+/*
+ * #%L
+ * Wao :: Web
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import com.opensymphony.xwork2.Preparable;
import fr.ifremer.wao.BoatsFilter;
import fr.ifremer.wao.services.service.ObsMerBoatsService;
Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ExportContactsAction.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ExportContactsAction.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ExportContactsAction.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.web.action.obsmer;
+/*
+ * #%L
+ * Wao :: Web
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import com.opensymphony.xwork2.Preparable;
import fr.ifremer.wao.ContactsFilter;
import fr.ifremer.wao.services.service.ObsMerContactsService;
Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ImportContactsAction.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ImportContactsAction.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ImportContactsAction.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.web.action.obsmer;
+/*
+ * #%L
+ * Wao :: Web
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import fr.ifremer.wao.services.service.ImportErrorException;
import fr.ifremer.wao.services.service.ObsMerContactsService;
import fr.ifremer.wao.web.action.AbstractImportCsvAction;
Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/SampleRowsFilterValuesJsonAction.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/SampleRowsFilterValuesJsonAction.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/SampleRowsFilterValuesJsonAction.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.web.action.obsmer;
+/*
+ * #%L
+ * Wao :: Web
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import com.opensymphony.xwork2.Preparable;
import fr.ifremer.wao.SampleRowsFilter;
import fr.ifremer.wao.services.service.ObsMerSamplingPlan;
Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ValidateContact.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ValidateContact.java 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ValidateContact.java 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,5 +1,26 @@
package fr.ifremer.wao.web.action.obsmer;
+/*
+ * #%L
+ * Wao :: Web
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
import fr.ifremer.wao.services.service.ObsMerSamplingPlanService;
import fr.ifremer.wao.web.WaoJspActionSupport;
Modified: trunk/wao-web/src/main/resources/fr/ifremer/wao/SampleRowsFilter-conversion.properties
===================================================================
--- trunk/wao-web/src/main/resources/fr/ifremer/wao/SampleRowsFilter-conversion.properties 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-web/src/main/resources/fr/ifremer/wao/SampleRowsFilter-conversion.properties 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,2 +1,22 @@
+###
+# #%L
+# Wao :: Web
+# %%
+# Copyright (C) 2009 - 2014 Ifremer
+# %%
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# #L%
+###
periodFrom=fr.ifremer.wao.web.action.MonthConverter
periodTo=fr.ifremer.wao.web.action.MonthConverter
Modified: trunk/wao-web/src/main/resources/template/bootstrap/simple/select.ftl
===================================================================
--- trunk/wao-web/src/main/resources/template/bootstrap/simple/select.ftl 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-web/src/main/resources/template/bootstrap/simple/select.ftl 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,4 +1,24 @@
<#--
+ #%L
+ Wao :: Web
+ %%
+ Copyright (C) 2009 - 2014 Ifremer
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+-->
+<#--
/*
* $Id$
*
Modified: trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/boat-details.jsp
===================================================================
--- trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/boat-details.jsp 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/boat-details.jsp 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,3 +1,23 @@
+<%--
+ #%L
+ Wao :: Web
+ %%
+ Copyright (C) 2009 - 2014 Ifremer
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@taglib uri="/struts-tags" prefix="s" %>
Modified: trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/import-contacts-input.jsp
===================================================================
--- trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/import-contacts-input.jsp 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/import-contacts-input.jsp 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,3 +1,23 @@
+<%--
+ #%L
+ Wao :: Web
+ %%
+ Copyright (C) 2009 - 2014 Ifremer
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@taglib uri="/struts-tags" prefix="s" %>
Modified: trunk/wao-web/src/main/webapp/enpoints-js.jsp
===================================================================
--- trunk/wao-web/src/main/webapp/enpoints-js.jsp 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-web/src/main/webapp/enpoints-js.jsp 2014-04-05 18:22:17 UTC (rev 1840)
@@ -1,3 +1,23 @@
+<%--
+ #%L
+ Wao :: Web
+ %%
+ Copyright (C) 2009 - 2014 Ifremer
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
<%@ page language="java" contentType="text/javascript; charset=utf-8" pageEncoding="utf-8"%><%@ taglib uri="/struts-tags" prefix="s" %>
<%
// allow this page to be cached by browser
Modified: trunk/wao-web/src/main/webapp/wao-screen.css
===================================================================
--- trunk/wao-web/src/main/webapp/wao-screen.css 2014-04-05 17:48:39 UTC (rev 1839)
+++ trunk/wao-web/src/main/webapp/wao-screen.css 2014-04-05 18:22:17 UTC (rev 1840)
@@ -0,0 +1,20 @@
+/*
+ * #%L
+ * Wao :: Web
+ * %%
+ * Copyright (C) 2009 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
1
0
r1839 - in trunk/wao-services/src/main: java/fr/ifremer/wao/services/service java/fr/ifremer/wao/services/service/mail resources/email
by tchemit@users.forge.codelutin.com 05 Apr '14
by tchemit@users.forge.codelutin.com 05 Apr '14
05 Apr '14
Author: tchemit
Date: 2014-04-05 19:48:39 +0200 (Sat, 05 Apr 2014)
New Revision: 1839
Url: http://forge.codelutin.com/projects/wao/repository/revisions/1839
Log:
refs #4487 use modern EmailService
Added:
trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/mail/MammalsObservationEmail.java
trunk/wao-services/src/main/resources/email/MammalsObservationEmail_en.mustache
trunk/wao-services/src/main/resources/email/MammalsObservationEmail_fr.mustache
Removed:
trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/EmailService.java
Modified:
trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsService.java
Deleted: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/EmailService.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/EmailService.java 2014-04-04 16:15:57 UTC (rev 1838)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/EmailService.java 2014-04-05 17:48:39 UTC (rev 1839)
@@ -1,51 +0,0 @@
-package fr.ifremer.wao.services.service;
-
-import com.google.common.base.Charsets;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.commons.mail.EmailException;
-import org.apache.commons.mail.SimpleEmail;
-
-/**
- * //TODO remove this and use the {@link fr.ifremer.wao.services.service.mail.EmailService}.
- * Created on 4/4/14.
- *
- * @author Tony Chemit <chemit(a)codelutin.com>
- * @since 4.0
- */
-public class EmailService extends WaoServiceSupport {
-
- /** Logger. */
- private static final Log log = LogFactory.getLog(EmailService.class);
-
- public void sendEmail(String to, String subject, String msg)
- throws EmailException {
- if (log.isInfoEnabled()) {
- log.info("Send an email to " + to + " : " + subject);
- }
- SimpleEmail email = prepareEmail(to, subject, msg);
- if (getApplicationConfig().isDevMode()) {
- log.debug("send email to " + to + " subject " + subject + " msg " + msg);
- } else {
- email.send();
- }
- }
-
- public SimpleEmail prepareEmail(String to, String subject, String msg)
- throws EmailException {
-
- String smtpFrom = getApplicationConfig().getSmtpFrom();
- int smtpPort = getApplicationConfig().getSmtpPort();
- String smtpHost = getApplicationConfig().getSmtpHost();
-
- SimpleEmail email = new SimpleEmail();
- email.setHostName(smtpHost);
- email.setSmtpPort(smtpPort);
- email.setFrom(smtpFrom);
- email.addTo(to);
- email.setSubject(subject);
- email.setMsg(msg);
- email.setCharset(Charsets.UTF_8.toString());
- return email;
- }
-}
Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsService.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsService.java 2014-04-04 16:15:57 UTC (rev 1838)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsService.java 2014-04-05 17:48:39 UTC (rev 1839)
@@ -4,7 +4,6 @@
import com.google.common.collect.ImmutableSet;
import fr.ifremer.wao.ContactsFilter;
import fr.ifremer.wao.WaoTechnicalException;
-import fr.ifremer.wao.WaoUtils;
import fr.ifremer.wao.entity.Boat;
import fr.ifremer.wao.entity.Contact;
import fr.ifremer.wao.entity.ContactState;
@@ -13,7 +12,6 @@
import fr.ifremer.wao.entity.DataReliability;
import fr.ifremer.wao.entity.ElligibleBoat;
import fr.ifremer.wao.entity.ElligibleBoatTopiaDao;
-import fr.ifremer.wao.entity.FishingZone;
import fr.ifremer.wao.entity.ObsProgram;
import fr.ifremer.wao.entity.ObservedDataControl;
import fr.ifremer.wao.entity.SampleMonth;
@@ -23,6 +21,7 @@
import fr.ifremer.wao.entity.WaoUserTopiaDao;
import fr.ifremer.wao.services.AuthenticatedWaoUser;
import fr.ifremer.wao.services.service.csv.ObsMerContactImportExportModel;
+import fr.ifremer.wao.services.service.mail.MammalsObservationEmail;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.BooleanUtils;
@@ -39,12 +38,10 @@
import org.nuiton.csv.ImportRuntimeException;
import org.nuiton.topia.persistence.pager.TopiaPagerBean;
import org.nuiton.util.DateUtil;
-import org.nuiton.util.StringUtil;
import org.nuiton.util.beans.Binder;
import org.nuiton.util.beans.BinderFactory;
import java.io.InputStream;
-import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
@@ -327,85 +324,19 @@
if (sendNotification) {
- // we will send a mail with a body like
- //Bonjour,
- //
- //Un observateur du programme Obsmer a renseigné dans WAO l'information suivante :
- //
- //Marée : 25/10/2010 00:00 - 26/10/2010 00:00
- //Métier : 2010_0037 Manche Ouest (Manche, Mer du Nord) Secteur Brest Granville centré autour de St malo OTB_DEF 80-90 Chalutage de fond côtier sole, seiche
- //
- //Capture accidentelle :
- //deux tritons et une sirène
- //
- //Cordialement,
- //
- //Le programme Obsmer
- //http://www.ifremer.fr/wao
+ MammalsObservationEmail email = new MammalsObservationEmail(getLocale());
+ email.setContact(contact);
- Locale locale = serviceContext.getLocale();
-
- String object = l(locale, "wao.business.mammalsCapture.mail.subject");
-
- // building 2 string, components of the body
-
- // the time of the capture (it's between tide begin and end)
- String time = "";
- if (contact.getObservationBeginDate() != null) {
- time = WaoUtils.formatDateTime(locale, contact.getObservationBeginDate()) + " ";
- }
- if (contact.getObservationEndDate() != null) {
- time += WaoUtils.formatDateTime(locale, contact.getObservationEndDate());
- }
-
- // some details from the sample row, facade, etc.
- SampleRow sampleRow = contact.getSampleRow();
- List<String> facadesNames = new ArrayList<String>();
- for (FishingZone fishingZone : sampleRow.getFishingZone()) {
- facadesNames.add(fishingZone.getSectorName() + " (" + fishingZone.getFacadeName() + ")");
- }
- String profession = sampleRow.getCode() + " "
- + " " + StringUtil.join(facadesNames, ", ", true)
- + " " + sampleRow.getFishingZonesInfos()
- + " " + sampleRow.getProfessionDescription()
- + " " + sampleRow.getProfession().getLibelle()
- + " " + sampleRow.getProfession().getSpecies();
-
- // constructing the whole mail
- String body = l(locale, "wao.business.mammalsCapture.mail.message",
- time, profession, contact.getMammalsInfo());
-
- if (log.isInfoEnabled()) {
- log.info("will send email with object '" + object + "' and body \n" + body);
- }
-
// now trying to find to what user we need to send the mail
WaoUserTopiaDao userDao = getWaoUserDao();
// users contains all the user we need to notify for the capture
List<WaoUser> waoUsers = userDao.forMammalsNotificationsEquals(true).findAll();
- if (log.isDebugEnabled()) {
- log.debug("notification will be sent to " + waoUsers.size() + " users");
- }
-
- //TODO remove this and use the {@link fr.ifremer.wao.services.service.mail.EmailService}.
- // sending the same e-mail to all of them
for (WaoUser waoUser : waoUsers) {
- String userLogin = waoUser.getLogin();
- if (StringUtil.isEmail(userLogin)) {
- try {
- EmailService emailService = newService(EmailService.class);
- emailService.sendEmail(userLogin, object, body);
- if (log.isInfoEnabled()) {
- log.info("email sent to " + userLogin);
- }
- } catch (EmailException e) {
- if (log.isErrorEnabled()) {
- log.error("unable to send email to " + userLogin, e);
- }
- }
- }
+ email.addTo(waoUser);
}
+
+ getEmailService().send(email);
}
}
Added: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/mail/MammalsObservationEmail.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/mail/MammalsObservationEmail.java (rev 0)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/mail/MammalsObservationEmail.java 2014-04-05 17:48:39 UTC (rev 1839)
@@ -0,0 +1,67 @@
+package fr.ifremer.wao.services.service.mail;
+
+import fr.ifremer.wao.WaoUtils;
+import fr.ifremer.wao.entity.Contact;
+import fr.ifremer.wao.entity.FishingZone;
+import fr.ifremer.wao.entity.SampleRow;
+import org.nuiton.i18n.I18n;
+import org.nuiton.util.StringUtil;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * Created on 4/5/14.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 4.0
+ */
+public class MammalsObservationEmail extends WaoMail {
+
+ private Contact contact;
+
+ public MammalsObservationEmail(Locale locale) {
+ super(locale);
+ }
+
+ @Override
+ public String getSubject() {
+ return I18n.l(locale, "wao.business.mammalsCapture.mail.subject");
+ }
+
+ public void setContact(Contact contact) {
+ this.contact = contact;
+ }
+
+ public Contact getContact() {
+ return contact;
+ }
+
+ public SampleRow getSampleRow() {
+ return contact.getSampleRow();
+ }
+
+ public String getTime() {
+ // the time of the capture (it's between tide begin and end)
+
+ String time = "";
+ if (contact.getObservationBeginDate() != null) {
+ time = WaoUtils.formatDateTime(locale, contact.getObservationBeginDate()) + " ";
+ }
+ if (contact.getObservationEndDate() != null) {
+ time += WaoUtils.formatDateTime(locale, contact.getObservationEndDate());
+ }
+ return time;
+ }
+
+ public String getFacadeNames() {
+
+ List<String> facadesNames = new ArrayList<>();
+ for (FishingZone fishingZone : getSampleRow().getFishingZone()) {
+ facadesNames.add(fishingZone.getSectorName() + " (" + fishingZone.getFacadeName() + ")");
+ }
+
+ return StringUtil.join(facadesNames, ", ", true);
+ }
+}
Property changes on: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/mail/MammalsObservationEmail.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/wao-services/src/main/resources/email/MammalsObservationEmail_en.mustache
===================================================================
--- trunk/wao-services/src/main/resources/email/MammalsObservationEmail_en.mustache (rev 0)
+++ trunk/wao-services/src/main/resources/email/MammalsObservationEmail_en.mustache 2014-04-05 17:48:39 UTC (rev 1839)
@@ -0,0 +1,13 @@
+Hello,
+
+An observer of the ObsMer program provided to WAO the following information:
+
+Tide: {{time}}
+Profession: {{sampleRow.code}} {{facadeNames}} {{sampleRow.fishingZonesInfos}} {{sampleRow.professionDescription}} {{sampleRow.profession.getLibelle}} {{sampleRow.profession.species}}
+
+Accidental capture:
+{{contact.mammalsInfo}}
+
+Best regards,
+
+Obsmer program http://www.ifremer.fr/wao
\ No newline at end of file
Added: trunk/wao-services/src/main/resources/email/MammalsObservationEmail_fr.mustache
===================================================================
--- trunk/wao-services/src/main/resources/email/MammalsObservationEmail_fr.mustache (rev 0)
+++ trunk/wao-services/src/main/resources/email/MammalsObservationEmail_fr.mustache 2014-04-05 17:48:39 UTC (rev 1839)
@@ -0,0 +1,13 @@
+Bonjour,
+
+Un observateur du programme Obsmer a renseigné dans WAO l'information suivante :
+
+Marée : {{time}}
+Métier : {{sampleRow.code}} {{facadeNames}} {{sampleRow.fishingZonesInfos}} {{sampleRow.professionDescription}} {{sampleRow.profession.getLibelle}} {{sampleRow.profession.species}}
+
+Capture accidentelle :
+{{contact.mammalsInfo}}
+
+Cordialement,
+
+Le programme Obsmer http://www.ifremer.fr/wao
\ No newline at end of file
1
0
Jenkins build is back to normal : wao-nightly #25
by admin+ci-codelutin.com@codelutin.com 04 Apr '14
by admin+ci-codelutin.com@codelutin.com 04 Apr '14
04 Apr '14