Commit 79fd3b2f authored by PECQUOT's avatar PECQUOT

[fix] RuleControl: The model can be valid if control is valid (Mantis #50538)

ready to release 3.9.1
Signed-off-by: PECQUOT's avatarlp1ee9d <ludovic.pecquot@e-is.pro>
parent 5a5eec91
......@@ -10,7 +10,7 @@
<groupId>fr.ifremer.reefdb</groupId>
<artifactId>reefdb</artifactId>
<version>3.9.1-SNAPSHOT</version>
<version>3.9.1</version>
<packaging>pom</packaging>
<name>Reef DB</name>
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>fr.ifremer.reefdb</groupId>
<artifactId>reefdb</artifactId>
<version>3.9.1-SNAPSHOT</version>
<version>3.9.1</version>
</parent>
<artifactId>reefdb-core</artifactId>
......
......@@ -35,8 +35,11 @@
# Please fill the missing licenses for dependencies :
#
#
#Fri Feb 09 17:30:26 CET 2018
#Fri Jan 31 17:16:46 CET 2020
com.oracle--ojdbc7--12.1.0.2.0=OTN license
commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
dom4j--dom4j--1.6.1=BSD License
junit-addons--junit-addons--1.4=
org.hibernate--hibernate-spatial--4.3-20140213=Lesser General Public License (LGPL)
xerces--xercesImpl--2.6.2=
xerces--xmlParserAPIs--2.6.2=
......@@ -291,10 +291,11 @@ reefdb.service.common.progression=%s \: traitement de %s/%s
reefdb.service.control=Contrôle
reefdb.service.controlRule.invalid.message=La règle de contrôle '%s' n'est pas respectée
reefdb.service.extraction.error=Une erreur s'est produite lors de l'extration.
reefdb.service.extraction.fieldName.TAXON_NAME_ID=${reefdb.service.extraction.fieldNamePrefix.MEAS}_Identifiant_interne_TAXON_NAME_ID
reefdb.service.extraction.fieldName.TAXON_NAME_NM=Taxon_saisi
reefdb.service.extraction.fieldName.MEAS_CM=${reefdb.service.extraction.fieldNamePrefix.MEAS}_Commentaires
reefdb.service.extraction.fieldName.INPUT_TAXON_NAME_ID=
reefdb.service.extraction.fieldName.INPUT_TAXON_NAME_NM=
reefdb.service.extraction.fieldName.MEAS_ANALYST_NM=${reefdb.service.extraction.fieldNamePrefix.MEAS}_Organisme_analyste
reefdb.service.extraction.fieldName.MEAS_CM=${reefdb.service.extraction.fieldNamePrefix.MEAS}_Commentaires
reefdb.service.extraction.fieldName.MEAS_DEP_NM=
reefdb.service.extraction.fieldName.MEAS_IDS=${reefdb.service.extraction.fieldNamePrefix.MEAS}_Identifiants_interne_MEAS_ID
reefdb.service.extraction.fieldName.MEAS_INDIV_ID=${reefdb.service.extraction.fieldNamePrefix.MEAS}_Numero_individu
reefdb.service.extraction.fieldName.MON_LOC_ID=${reefdb.service.extraction.fieldNamePrefix.MON_LOC}_Identifiant
......@@ -304,6 +305,7 @@ reefdb.service.extraction.fieldName.MON_LOC_ORDER_ITEM_NUMBER=${reefdb.service.e
reefdb.service.extraction.fieldName.ORDER_ITEM_CD=${reefdb.service.extraction.fieldNamePrefix.MON_LOC}_Entite_classement_Identifiant
reefdb.service.extraction.fieldName.ORDER_ITEM_NM=${reefdb.service.extraction.fieldNamePrefix.MON_LOC}_Entite_classement
reefdb.service.extraction.fieldName.ORDER_ITEM_TYPE_NM=${reefdb.service.extraction.fieldNamePrefix.MON_LOC}_Entite_classement_Type
reefdb.service.extraction.fieldName.REF_TAXON_NM=Taxon
reefdb.service.extraction.fieldName.SAMPLING_EQUIPMENT_NM=${reefdb.service.extraction.fieldNamePrefix.SAMPLING_OPER}_Moyen_acquisition
reefdb.service.extraction.fieldName.SAMPLING_EQUIPMENT_SIZE=${reefdb.service.extraction.fieldNamePrefix.SAMPLING_OPER}_Moyen_acquisition_Taille
reefdb.service.extraction.fieldName.SAMPLING_EQUIPMENT_SIZE_UNIT_SYMBOL=${reefdb.service.extraction.fieldNamePrefix.SAMPLING_OPER}_Moyen_acquisition_Taille_Symbole_unite
......@@ -325,6 +327,7 @@ reefdb.service.extraction.fieldName.SAMPLING_OPER_POSITION_LONG_MAX=${reefdb.ser
reefdb.service.extraction.fieldName.SAMPLING_OPER_POSITION_LONG_MIN=${reefdb.service.extraction.fieldNamePrefix.SAMPLING_OPER}_Coordonnees_MINX
reefdb.service.extraction.fieldName.SAMPLING_OPER_QUALIF_CM=${reefdb.service.extraction.fieldNamePrefix.SAMPLING_OPER}_Commentaire_qualification
reefdb.service.extraction.fieldName.SAMPLING_OPER_QUALIF_DT=${reefdb.service.extraction.fieldNamePrefix.SAMPLING_OPER}_Date_qualification
reefdb.service.extraction.fieldName.SAMPLING_OPER_QUAL_FLAG=
reefdb.service.extraction.fieldName.SAMPLING_OPER_QUAL_FLAG_NM=${reefdb.service.extraction.fieldNamePrefix.SAMPLING_OPER}_Niveau_qualite
reefdb.service.extraction.fieldName.SAMPLING_OPER_SIZE=${reefdb.service.extraction.fieldNamePrefix.SAMPLING_OPER}_Taille
reefdb.service.extraction.fieldName.SAMPLING_OPER_SIZE_UNIT_SYMBOL=${reefdb.service.extraction.fieldNamePrefix.SAMPLING_OPER}_Unite
......@@ -343,13 +346,15 @@ reefdb.service.extraction.fieldName.SURVEY_POSITION_LONG_MIN=${reefdb.service.ex
reefdb.service.extraction.fieldName.SURVEY_PROG_CD=Programme
reefdb.service.extraction.fieldName.SURVEY_QUALIF_CM=${reefdb.service.extraction.fieldNamePrefix.SURVEY}_Commentaire_qualification
reefdb.service.extraction.fieldName.SURVEY_QUALIF_DT=${reefdb.service.extraction.fieldNamePrefix.SURVEY}_Date_qualification
reefdb.service.extraction.fieldName.SURVEY_QUAL_FLAG=
reefdb.service.extraction.fieldName.SURVEY_QUAL_FLAG_NM=${reefdb.service.extraction.fieldNamePrefix.SURVEY}_Niveau_qualite
reefdb.service.extraction.fieldName.SURVEY_QUSERS=${reefdb.service.extraction.fieldNamePrefix.SURVEY}_Observateurs
reefdb.service.extraction.fieldName.SURVEY_TIME=${reefdb.service.extraction.fieldNamePrefix.SURVEY}_Heure
reefdb.service.extraction.fieldName.SURVEY_VALID_DT=${reefdb.service.extraction.fieldNamePrefix.SURVEY}_Date_validation
reefdb.service.extraction.fieldName.TAXON_GROUP_NM=Groupe_taxons
reefdb.service.extraction.fieldName.TAXON_MEAS_IDS=${reefdb.service.extraction.fieldNamePrefix.MEAS}_Identifiants_interne_TAXON_MEAS_ID
reefdb.service.extraction.fieldName.REF_TAXON_NM=Taxon
reefdb.service.extraction.fieldName.TAXON_NAME_ID=${reefdb.service.extraction.fieldNamePrefix.MEAS}_Identifiant_interne_TAXON_NAME_ID
reefdb.service.extraction.fieldName.TAXON_NAME_NM=Taxon_saisi
reefdb.service.extraction.fieldName.TAXON_PAMPA=Taxon_pampa
reefdb.service.extraction.fieldNamePrefix.MEAS=MESURE
reefdb.service.extraction.fieldNamePrefix.MON_LOC=STATION
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>fr.ifremer.reefdb</groupId>
<artifactId>reefdb</artifactId>
<version>3.9.1-SNAPSHOT</version>
<version>3.9.1</version>
</parent>
<artifactId>reefdb-ui-swing</artifactId>
......
......@@ -44,7 +44,7 @@
toolTipText: "reefdb.action.save.observation";
_applicationAction: {SaveAction.class};
_applicationActionKey: {fr.ifremer.reefdb.ui.swing.util.ReefDbKeyStrokes.SAVE};
enabled: {model.isEditable() && model.isModify() && model.isValid() && !model.isLoading()};
enabled: {model.isEditable() && model.isModify() && (model.isValid() || model.isControlValid()) && !model.isLoading()};
}
#nextButton {
......
......@@ -27,6 +27,7 @@ import fr.ifremer.reefdb.dto.*;
import fr.ifremer.reefdb.dto.configuration.control.ControlRuleDTO;
import fr.ifremer.reefdb.dto.configuration.programStrategy.PmfmStrategyDTO;
import fr.ifremer.reefdb.dto.configuration.programStrategy.ProgramDTO;
import fr.ifremer.reefdb.dto.data.measurement.MeasurementAware;
import fr.ifremer.reefdb.dto.data.measurement.MeasurementDTO;
import fr.ifremer.reefdb.dto.data.photo.PhotoDTO;
import fr.ifremer.reefdb.dto.data.sampling.SamplingOperationDTO;
......@@ -87,6 +88,46 @@ public class ObservationUIModel extends AbstractReefDbBeanUIModel<SurveyDTO, Obs
super(FROM_BEAN_BINDER, TO_BEAN_BINDER);
}
/**
* Check if there is real error (if not, means control is valid, then the save is enabled) (Mantis #50538)
*
* @return true if already valid or there is only control errors
*/
public boolean isControlValid() {
if (isValid() || !isEditable())
return true;
if (getSurveyMeasurementsTabUIModel() == null
|| getSurveyMeasurementsTabUIModel().getUngroupedTableUIModel() == null
|| getSurveyMeasurementsTabUIModel().getGroupedTableUIModel() == null
|| getOperationMeasurementsTabUIModel() == null
|| getOperationMeasurementsTabUIModel().getUngroupedTableUIModel() == null
|| getOperationMeasurementsTabUIModel().getGroupedTableUIModel() == null
)
return false;
for (MeasurementAware bean: getSurveyMeasurementsTabUIModel().getUngroupedTableUIModel().getRows()) {
if (!ReefDbBeans.getErrors(bean, false).isEmpty()) {
return false;
}
}
for (MeasurementAware bean: getSurveyMeasurementsTabUIModel().getGroupedTableUIModel().getRows()) {
if (!ReefDbBeans.getErrors(bean, false).isEmpty()) {
return false;
}
}
for (MeasurementAware bean: getOperationMeasurementsTabUIModel().getUngroupedTableUIModel().getRows()) {
if (!ReefDbBeans.getErrors(bean, false).isEmpty()) {
return false;
}
}
for (MeasurementAware bean: getOperationMeasurementsTabUIModel().getGroupedTableUIModel().getRows()) {
if (!ReefDbBeans.getErrors(bean, false).isEmpty()) {
return false;
}
}
return true;
}
/**
* <p>isEditable.</p>
*
......
......@@ -35,7 +35,7 @@
</field-validator>
<field-validator type="controltableexpression">
<param name="level">error</param>
<param name="controlLevel">none</param>
<param name="controlLevel">error</param>
<message/>
</field-validator>
</field>
......@@ -46,7 +46,7 @@
</field-validator>
<field-validator type="controltableexpression">
<param name="level">error</param>
<param name="controlLevel">none</param>
<param name="controlLevel">error</param>
<message/>
</field-validator>
</field>
......
......@@ -31,14 +31,14 @@
<field name='ungroupedTableUIModel'>
<field-validator type="controltableexpression">
<param name="level">warning</param>
<param name="controlLevel">all</param>
<param name="controlLevel">warning</param>
<message/>
</field-validator>
</field>
<field name='groupedTableUIModel'>
<field-validator type="controltableexpression">
<param name="level">warning</param>
<param name="controlLevel">all</param>
<param name="controlLevel">warning</param>
<message/>
</field-validator>
</field>
......
......@@ -35,7 +35,7 @@
</field-validator>
<field-validator type="controltableexpression">
<param name="level">error</param>
<param name="controlLevel">none</param>
<param name="controlLevel">error</param>
<message/>
</field-validator>
</field>
......@@ -46,7 +46,7 @@
</field-validator>
<field-validator type="controltableexpression">
<param name="level">error</param>
<param name="controlLevel">none</param>
<param name="controlLevel">error</param>
<message/>
</field-validator>
</field>
......
......@@ -30,11 +30,15 @@
<validators>
<field name='ungroupedTableUIModel'>
<field-validator type="controltableexpression">
<param name="level">warning</param>
<param name="controlLevel">warning</param>
<message/>
</field-validator>
</field>
<field name='groupedTableUIModel'>
<field-validator type="controltableexpression">
<param name="level">warning</param>
<param name="controlLevel">warning</param>
<message/>
</field-validator>
</field>
......
......@@ -38,6 +38,9 @@
<action dev="ludovic.pecquot@e-is.pro" type="add" issue="49615">
Add multiline edition dialog for survey's and operation's grouped measurement tables
</action>
<action dev="ludovic.pecquot@e-is.pro" type="fix" issue="50538">
RuleControl: The model can be valid if control is valid
</action>
</release>
<release version="3.9.0" date="2020-01-24" description="Stable release">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment