Commit 1dfaada7 authored by LAVENIER's avatar LAVENIER
Browse files

Merge branch 'release/1.8.3'

parents 087923e4 9bc53939
......@@ -3,7 +3,7 @@
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>1.8.2</version>
<version>1.8.3</version>
<packaging>pom</packaging>
<name>SUMARiS</name>
<description>SUMARiS :: Maven parent</description>
......@@ -654,16 +654,6 @@
<artifactId>hibernate-tools</artifactId>
<version>${hibernate-tools.version}</version>
</dependency>
<!--<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-orm</artifactId>
<version>${hibernate-search.version}</version>
</dependency>-->
<!--<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-elasticsearch</artifactId>
<version>${hibernate-search.version}</version>
</dependency>-->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-envers</artifactId>
......
......@@ -37,7 +37,7 @@ SUMARiS tools comes with:
## Documentation
- User manual: [A quick start guide](doc/user-manual/index.md) (EN);
- User manual: [A quick start guide](doc/user-manual/index.md) ([EN](doc/user-manual/index.md) | [FR](doc/user-manual/index_fr.md));
- [Functional use cases](doc/use-case/index_en.md) ([EN](doc/use-case/index_en.md) | [FR](doc/use-case/index.md));
- [Database conceptual model](doc/use-case/index_en.md);
- [Database conceptual model](doc/model/index.md) of the database;
......@@ -82,4 +82,4 @@ SUMARiS tools have been developed by the following consortium:
[![](./images/logos/logo-nausicaa.png)](https://www.nausicaa.fr)
[![](./images/logos/logo-fromnord.png)](http://www.fromnord.fr)
[![](./images/logos/logo-redercentrale.png)](https://www.rederscentrale.be/)
[![](./images/logos/logo-lpdb.png)](https://www.pecheursdebretagne.eu)
\ No newline at end of file
[![](./images/logos/logo-lpdb.png)](https://www.pecheursdebretagne.eu)
{
"colors": {
"white": "255:255:255",
"black": "0:0:0",
"mddgrey": "128:128:128",
"AliceBlue": "F0F8FF",
"AntiqueWhite": "FAEBD7",
"Aqua": "00FFFF",
"Aquamarine": "7FFFD4",
"Azure": "F0FFFF",
"Beige": "F5F5DC",
"Bisque": "FFE4C4",
"Black": "000000",
"BlanchedAlmond": "FFEBCD",
"Blue": "0000FF",
"BlueViolet": "8A2BE2",
"Brown": "A52A2A",
"BurlyWood": "DEB887",
"CadetBlue": "5F9EA0",
"Chartreuse": "7FFF00",
"Chocolate": "D2691E",
"Coral": "FF7F50",
"CornflowerBlue": "6495ED",
"Cornsilk": "FFF8DC",
"Crimson": "DC143C",
"Cyan": "00FFFF",
"DarkBlue": "00008B",
"DarkCyan": "008B8B",
"DarkGoldenRod": "B8860B",
"DarkGray": "A9A9A9",
"DarkGreen": "006400",
"DarkKhaki": "BDB76B",
"DarkMagenta": "8B008B",
"DarkOliveGreen": "556B2F",
"DarkOrange": "FF8C00",
"DarkOrchid": "9932CC",
"DarkRed": "8B0000",
"DarkSalmon": "E9967A",
"DarkSeaGreen": "8FBC8F",
"DarkSlateBlue": "483D8B",
"DarkSlateGray": "2F4F4F",
"DarkTurquoise": "00CED1",
"DarkViolet": "9400D3",
"DeepPink": "FF1493",
"DeepSkyBlue": "00BFFF",
"DimGray": "696969",
"DodgerBlue": "1E90FF",
"FireBrick": "B22222",
"FloralWhite": "FFFAF0",
"ForestGreen": "228B22",
"Fuchsia": "FF00FF",
"Gainsboro": "DCDCDC",
"GhostWhite": "F8F8FF",
"Gold": "FFD700",
"GoldenRod": "DAA520",
"Gray": "808080",
"Green": "008000",
"GreenYellow": "ADFF2F",
"HoneyDew": "F0FFF0",
"HotPink": "FF69B4",
"IndianRed": "CD5C5C",
"Indigo": "4B0082",
"Ivory": "FFFFF0",
"Khaki": "F0E68C",
"Lavender": "E6E6FA",
"LavenderBlush": "FFF0F5",
"LawnGreen": "7CFC00",
"LemonChiffon": "FFFACD",
"LightBlue": "ADD8E6",
"LightCoral": "F08080",
"LightCyan": "E0FFFF",
"LightGoldenRodYellow": "FAFAD2",
"LightGray": "D3D3D3",
"LightGreen": "90EE90",
"LightPink": "FFB6C1",
"LightSalmon": "FFA07A",
"LightSeaGreen": "20B2AA",
"LightSkyBlue": "87CEFA",
"LightSlateGray": "778899",
"LightSteelBlue": "B0C4DE",
"LightYellow": "FFFFE0",
"Lime": "00FF00",
"LimeGreen": "32CD32",
"Linen": "FAF0E6",
"Magenta": "FF00FF",
"Maroon": "800000",
"MediumAquaMarine": "66CDAA",
"MediumBlue": "0000CD",
"MediumOrchid": "BA55D3",
"MediumPurple": "9370DB",
"MediumSeaGreen": "3CB371",
"MediumSlateBlue": "7B68EE",
"MediumSpringGreen": "00FA9A",
"MediumTurquoise": "48D1CC",
"MediumVioletRed": "C71585",
"MidnightBlue": "191970",
"MintCream": "F5FFFA",
"MistyRose": "FFE4E1",
"Moccasin": "FFE4B5",
"NavajoWhite": "FFDEAD",
"Navy": "000080",
"OldLace": "FDF5E6",
"Olive": "808000",
"OliveDrab": "6B8E23",
"Orange": "FFA500",
"OrangeRed": "FF4500",
"Orchid": "DA70D6",
"PaleGoldenRod": "EEE8AA",
"PaleGreen": "98FB98",
"PaleTurquoise": "AFEEEE",
"PaleVioletRed": "DB7093",
"PapayaWhip": "FFEFD5",
"PeachPuff": "FFDAB9",
"Peru": "CD853F",
"Pink": "FFC0CB",
"Plum": "DDA0DD",
"PowderBlue": "B0E0E6",
"Purple": "800080",
"RebeccaPurple": "663399",
"Red": "FF0000",
"RosyBrown": "BC8F8F",
"RoyalBlue": "4169E1",
"SaddleBrown": "8B4513",
"Salmon": "FA8072",
"SandyBrown": "F4A460",
"SeaGreen": "2E8B57",
"SeaShell": "FFF5EE",
"Sienna": "A0522D",
"Silver": "C0C0C0",
"SkyBlue": "87CEEB",
"SlateBlue": "6A5ACD",
"SlateGray": "708090",
"Snow": "FFFAFA",
"SpringGreen": "00FF7F",
"SteelBlue": "4682B4",
"Tan": "D2B48C",
"Teal": "008080",
"Thistle": "D8BFD8",
"Tomato": "FF6347",
"Turquoise": "40E0D0",
"Violet": "EE82EE",
"Wheat": "F5DEB3",
"White": "FFFFFF",
"WhiteSmoke": "F5F5F5",
"Yellow": "FFFF00",
"YellowGreen": "9ACD32"
},
"document":{
"family": "HELVETICA",
"color":"Black",
"size":12,
"leftMargin": "1cm",
"rightMargin": "1cm",
"topMargin": "2cm",
"bottomMargin": "2cm",
"paragraphSpace": "10pt",
"image":{
"imgAlign": "MIDDLE"
},
"front_page": {
"color": "0:0:0",
"background": "255:255:255",
"family": "HELVETICA",
"size": 15,
"style": "NORMAL",
"title": {
"size": 25,
"style": "UNDERLINE"
}
},
"toc": {
"color": "0:0:0",
"background": "255:255:255",
"family": "HELVETICA",
"size": 12,
"style": "NORMAL",
"h1": {
"size":14,
"style": "BOLD",
"color":"SteelBlue"
},
"h2": {
"style": "BOLD",
"color":"SteelBlue"
}
},
"pages":{
"h1":{
"size":18,
"color":"SteelBlue"
},
"h2":{
"size":16,
"color":"SteelBlue"
},
"h3":{
"size":14,
"style":"BOLD"
},
"h4":{
"style": "UNDERLINE"
},
"block_quote": {
"background": "LightGray",
"style": "ITALIC",
"color": "mddgrey"
},
"emphasis": {
"style": "ITALIC"
},
"strong": {
"style": "BOLD"
}
}
}
}
var language = document.location.href.includes("_fr") ? "fr" : "en";
/** Table of content management **/
injectToc();
function injectToc(){
if(!$("#bodyColumn").text().includes(getTitleToc())) {
var divToc = document.createElement("div");
divToc.id = "toc";
var titre = document.createElement("h2");
titre.innerText = getTitleToc();
divToc.append(titre);
var toc = populateUl("bodyColumn", 2);
if(toc.children.length > 0){
divToc.append(toc);
$("#bodyColumn > h1").after(divToc);
}
}
}
function populateUl(parentSelector, titleLevel){
var ul = document.createElement("ul");
$("#" +parentSelector + " h" + titleLevel).each((i, elem)=> {
var li = document.createElement("li");
var link = document.createElement("a");
link.href = "#" + $("#" +parentSelector + " h" + titleLevel + ":eq(" + i +") a")[0].name;
link.text = elem.innerText;
li.append(link);
var sections = $("#" + parentSelector + " section:eq(" + i + ") section");
if(sections.length > 0){
li.append(populateUl(parentSelector + " section:eq(" + i + ") section", titleLevel+1));
}
ul.append(li);
});
return ul;
}
function getTitleToc(){
var title;
if (language === "fr"){
title = "Table des matières";
}
else{
title = "Table of content";
}
return title
}
if($(window).width() > 1200){
$(".tab").hide();
setActiveButton("pc");
}
else{
$(".pc").hide();
setActiveButton("tab");
}
$("a[href=#pc]").click(()=>{
$(".tab").hide();
$(".pc").show();
setActiveButton("pc");
});
$("a[href=#tab]").click(()=>{
$(".tab").show();
$(".pc").hide();
setActiveButton("tab");
})
$("a[href=#both]").click(()=>{
$(".tab").show();
$(".pc").show();
setActiveButton("both");
})
function setActiveButton(btntarget){
$("a").css("color", "#08c");
$("a[href=#" + btntarget + "]").css("color", "purple");
}
......@@ -64,7 +64,6 @@
</poweredBy>
<body>
<links>
<item name="SUMARiS portal" href="https://www.sumaris.net"/>
<item name="EIS" href="http://www.e-is.pro"/>
......@@ -81,6 +80,7 @@
<menu name="User documentation" inherit="top">
<item name="Quick start guide" href="doc/user-manual/index.html"/>
<!-- <item name="Guide de démarrage rapide" href="doc/user-manual/index_fr.html"/>-->
<item name="Use cases" href="doc/use-case/index_en.html"/>
</menu>
......@@ -91,7 +91,7 @@
</menu>
<menu name="Other languages" inherit="top">
<item name="Français" href="./fr/index.html"/>
<item name="Français" href="fr/index.html"/>
</menu>
<menu name="Community" inherit="bottom">
......@@ -102,6 +102,8 @@
</menu>
<menu ref="reports" inherit="bottom"/>
<footer>
<![CDATA[<script src="/sumaris-pod/target/site/js/doc.js" type="text/javascript"></script>]]>
</footer>
</body>
</project>
......@@ -41,13 +41,13 @@
<bannerLeft>
<name>${project.name}</name>
<href>./index.html</href>
<href>./index_fr.html</href>
</bannerLeft>
<bannerRight>
<name>${project.name}</name>
<src>images/logos/logo_sumaris-banner.png</src>
<href>./index.html</href>
<href>./index_fr.html</href>
</bannerRight>
<publishDate position="right" format="yyyy-MM-dd"/>
......@@ -70,7 +70,7 @@
</links>
<breadcrumbs>
<item name="${project.name}" href="./index.html"/>
<item name="${project.name}" href="./index_fr.html"/>
</breadcrumbs>
<menu name="${project.name}" inherit="top">
......@@ -79,7 +79,7 @@
</menu>
<menu name="Documentation utilisateur" inherit="top">
<item name="Manuel utilisateur (EN)" href="doc/user-manual/index.html"/>
<item name="Manuel utilisateur" href="doc/user-manual/index_fr.html"/>
<item name="Cas d'utilisation" href="doc/use-case/index.html"/>
</menu>
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>net.sumaris</groupId>
<artifactId>sumaris-pod</artifactId>
<version>1.8.2</version>
<version>1.8.3</version>
</parent>
<artifactId>sumaris-core-extraction</artifactId>
......
......@@ -103,14 +103,15 @@ public class ExtractionPmfmTripDaoImpl<C extends ExtractionRdbTripContextVO, F e
// Inject Pmfm columns
injectPmfmColumns(context, xmlQuery,
getTripProgramLabels(context),
AcquisitionLevelEnum.OPERATION,
// Excluded PMFM (already exists as RDB format columns)
PmfmEnum.SMALLER_MESH_GAUGE_MM.getId(),
PmfmEnum.GEAR_DEPTH_M.getId(),
PmfmEnum.BOTTOM_DEPTH_M.getId(),
PmfmEnum.SELECTIVITY_DEVICE.getId(),
PmfmEnum.TRIP_PROGRESS.getId());
getTripProgramLabels(context),
AcquisitionLevelEnum.OPERATION,
// Excluded PMFM (already exists as RDB format columns)
PmfmEnum.SMALLER_MESH_GAUGE_MM.getId(),
PmfmEnum.GEAR_DEPTH_M.getId(),
PmfmEnum.BOTTOM_DEPTH_M.getId(),
PmfmEnum.SELECTIVITY_DEVICE.getId(),
PmfmEnum.TRIP_PROGRESS.getId()
);
return xmlQuery;
}
......@@ -150,8 +151,8 @@ public class ExtractionPmfmTripDaoImpl<C extends ExtractionRdbTripContextVO, F e
XMLQuery xmlQuery,
List<String> programLabels,
AcquisitionLevelEnum acquisitionLevel,
Integer... excludedPmfmIds
) {
Integer... excludedPmfmIds) {
// Load PMFM columns to inject
List<ExtractionPmfmColumnVO> pmfmColumns = loadPmfmColumns(context, programLabels, acquisitionLevel);
......
......@@ -49,7 +49,9 @@ import net.sumaris.core.service.administration.programStrategy.StrategyService;
import net.sumaris.core.util.Beans;
import net.sumaris.core.util.StringUtils;
import net.sumaris.core.util.TimeUtils;
import net.sumaris.core.vo.administration.programStrategy.*;
import net.sumaris.core.vo.administration.programStrategy.DenormalizedPmfmStrategyVO;
import net.sumaris.core.vo.administration.programStrategy.PmfmStrategyFetchOptions;
import net.sumaris.core.vo.administration.programStrategy.StrategyFetchOptions;
import net.sumaris.core.vo.filter.PmfmStrategyFilterVO;
import net.sumaris.core.vo.filter.StrategyFilterVO;
import net.sumaris.core.vo.referential.PmfmValueType;
......@@ -544,6 +546,13 @@ public class ExtractionRdbTripDaoImpl<C extends ExtractionRdbTripContextVO, F ex
PmfmStrategyFetchOptions.builder().withCompleteName(false).build()
).stream())
.map(pmfmStrategy -> toPmfmColumnVO(pmfmStrategy, null))
// Group by pmfmId
.collect(Collectors.toMap(ExtractionPmfmColumnVO::getPmfmId, ps -> ps))
.values().stream()
// Sort by label
.sorted(Comparator.comparing(ExtractionPmfmColumnVO::getLabel, String::compareTo))
.collect(Collectors.toList());
// save result into the context map
......
......@@ -736,8 +736,7 @@ public class ExtractionServiceImpl implements ExtractionService {
}
else {
log.info("Cleaning extraction #{}-{}", context.getRawFormatLabel(), context.getId());
log.warn("TODO enable CLEAN !!");
//getDao(context.getFormat()).clean(context);
getDao(context.getFormat()).clean(context);
}
}
......
<?xml version="1.0" encoding="UTF-8"?>
<query type="select">
<!-- double -->
<select alias="&amp;pmfmLabel%pmfmAlias%" group="double%pmfmAlias%" type="number">
(SELECT NUMERICAL_VALUE
FROM VESSEL_USE_MEASUREMENT VUM
WHERE VUM.TRIP_FK=O.ID and VUM.PMFM_FK=&amp;pmfmId%pmfmAlias%)
</select>
<!-- integer -->
<select alias="&amp;pmfmLabel%pmfmAlias%" group="integer%pmfmAlias%" type="number">
(SELECT
CAST(NUMERICAL_VALUE AS INT)
FROM VESSEL_USE_MEASUREMENT VUM
WHERE VUM.OPERATION_FK=O.ID and VUM.PMFM_FK=&amp;pmfmId%pmfmAlias%)
</select>
<!-- text -->
<select alias="&amp;pmfmLabel%pmfmAlias%" group="string%pmfmAlias%" type="text">(SELECT ALPHANUMERICAL_VALUE FROM VESSEL_USE_MEASUREMENT VUM WHERE VUM.OPERATION_FK=O.ID and VUM.PMFM_FK=&amp;pmfmId%pmfmAlias%)</select>
<!-- qualitative value -->
<select alias="&amp;pmfmLabel%pmfmAlias%" group="qualitative_value%pmfmAlias%" type="text">
(SELECT QV.LABEL || ' - ' || QV.NAME
FROM VESSEL_USE_MEASUREMENT VUM
INNER JOIN QUALITATIVE_VALUE QV on QV.ID = VUM.QUALITATIVE_VALUE_FK
WHERE VUM.OPERATION_FK=O.ID and VUM.PMFM_FK=&amp;pmfmId%pmfmAlias%)
</select>
<!-- boolean -->
<select alias="&amp;pmfmLabel%pmfmAlias%" group="boolean%pmfmAlias%" type="text">
(SELECT DECODE(VUM.NUMERICAL_VALUE, 1, 'Y', 0, 'N')
FROM VESSEL_USE_MEASUREMENT VUM
WHERE VUM.OPERATION_FK=O.ID and VUM.PMFM_FK=&amp;pmfmId%pmfmAlias%)
</select>
<!-- date -->
<select alias="&amp;pmfmLabel%pmfmAlias%" group="date%pmfmAlias%" type="text"><![CDATA[
(SELECT
TO_CHAR(TIMESTAMP(REPLACE(REPLACE(VUM.ALPHANUMERICAL_VALUE, 'T', ' '), 'Z', '')), 'YYYY-DD-MM')
FROM VESSEL_USE_MEASUREMENT VUM
WHERE VUM.OPERATION_FK=O.ID and VUM.PMFM_FK=&amp;pmfmId%pmfmAlias%)
]]>
</select>
</query>
<?xml version="1.0" encoding="UTF-8"?>
<query type="select">
<!-- double -->
<select alias="&amp;pmfmLabel%pmfmAlias%" group="double%pmfmAlias%" type="number">(SELECT NUMERICAL_VALUE FROM VESSEL_USE_MEASUREMENT VUM WHERE VUM.TRIP_FK=T.ID and VUM.PMFM_FK=&amp;pmfmId%pmfmAlias%)</select>
<!-- integer -->
<select alias="&amp;pmfmLabel%pmfmAlias%" group="integer%pmfmAlias%" type="number">
(SELECT
CAST(NUMERICAL_VALUE AS INT)
FROM VESSEL_USE_MEASUREMENT VUM
WHERE VUM.TRIP_FK=T.ID and VUM.PMFM_FK=&amp;pmfmId%pmfmAlias%)
</select>
<!-- text -->
<select alias="&amp;pmfmLabel%pmfmAlias%" group="string%pmfmAlias%" type="text">(SELECT ALPHANUMERICAL_VALUE FROM VESSEL_USE_MEASUREMENT VUM WHERE VUM.TRIP_FK=T.ID and VUM.PMFM_FK=&amp;pmfmId%pmfmAlias%)</select>
<!-- qualitative value -->
<select alias="&amp;pmfmLabel%pmfmAlias%" group="qualitative_value%pmfmAlias%" type="text">
(SELECT QV.LABEL || ' - ' || QV.NAME
FROM VESSEL_USE_MEASUREMENT VUM
INNER JOIN QUALITATIVE_VALUE QV on QV.ID = VUM.QUALITATIVE_VALUE_FK
WHERE VUM.TRIP_FK=T.ID and VUM.PMFM_FK=&amp;pmfmId%pmfmAlias%)
</select>
<!-- boolean -->
<select alias="&amp;pmfmLabel%pmfmAlias%" group="boolean%pmfmAlias%" type="text">
(SELECT DECODE(VUM.NUMERICAL_VALUE, 1, 'Y', 0, 'N')
FROM VESSEL_USE_MEASUREMENT VUM
WHERE VUM.TRIP_FK=T.ID and VUM.PMFM_FK=&amp;pmfmId%pmfmAlias%)
</select>
<!-- date -->
<select alias="&amp;pmfmLabel%pmfmAlias%" group="date%pmfmAlias%" type="text"><![CDATA[
(SELECT
TO_CHAR(TIMESTAMP(REPLACE(REPLACE(VUM.ALPHANUMERICAL_VALUE, 'T', ' '), 'Z', '')), 'YYYY-DD-MM')
FROM VESSEL_USE_MEASUREMENT VUM
WHERE VUM.TRIP_FK=T.ID and VUM.PMFM_FK=&amp;pmfmId%pmfmAlias%)
]]>
</select>
</query>
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
Dali :: Core
%%
Copyright (C) 2017 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/>.