branch develop updated (440123c -> 522269d)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository observe. See http://git.codelutin.com/observe.git from 440123c traduction des types de bancs (refs #7598) new 5d71046 migration de l'écran d'un object flottant (refs #7599) new 44d772e mise en place de la validation (refs #7599) new 522269d Merge branch 'feature/7599' into develop The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 522269d604bb26c20aca1d3299e546bc4f30766c Merge: 440123c 44d772e Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Thu Oct 15 10:33:53 2015 +0200 Merge branch 'feature/7599' into develop commit 44d772e94967a3fa27161fa59e1edc307178bcf8 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Thu Oct 15 10:32:35 2015 +0200 mise en place de la validation (refs #7599) commit 5d71046cb6aab802de72494c6aff688f6ee4b97c Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Thu Oct 15 10:25:48 2015 +0200 migration de l'écran d'un object flottant (refs #7599) Summary of changes: .../ird/observe/ui/content/ContentUIManager.java | 2 +- .../impl/seine/FloatingObjectUIHandler.java | 40 ++++------------------ ...loatingObjectDto-n1-create-error-validation.xml | 0 ...atingObjectDto-n1-create-warning-validation.xml | 0 ...loatingObjectDto-n1-update-error-validation.xml | 0 ...atingObjectDto-n1-update-warning-validation.xml | 0 .../observe-application-swing_fr_FR.properties | 2 +- .../services/dto/seine/FloatingObjectDtos.java | 26 ++++++++++++++ .../service/seine/FloatingObjectServiceTopia.java | 23 +++++++------ 9 files changed, 47 insertions(+), 46 deletions(-) copy observe-entities-validation/src/main/resources/fr/ird/observe/entities/seine/FloatingObject-n1-create-error-validation.xml => observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/FloatingObjectDto-n1-create-error-validation.xml (100%) copy observe-entities-validation/src/main/resources/fr/ird/observe/entities/seine/FloatingObject-n1-update-warning-validation.xml => observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/FloatingObjectDto-n1-create-warning-validation.xml (100%) copy observe-entities-validation/src/main/resources/fr/ird/observe/entities/seine/FloatingObject-n1-update-error-validation.xml => observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/FloatingObjectDto-n1-update-error-validation.xml (100%) copy observe-entities-validation/src/main/resources/fr/ird/observe/entities/seine/FloatingObject-n1-update-warning-validation.xml => observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/FloatingObjectDto-n1-update-warning-validation.xml (100%) create mode 100644 observe-services-model/src/main/java/fr/ird/observe/services/dto/seine/FloatingObjectDtos.java -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See http://git.codelutin.com/observe.git commit 5d71046cb6aab802de72494c6aff688f6ee4b97c Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Thu Oct 15 10:25:48 2015 +0200 migration de l'écran d'un object flottant (refs #7599) --- .../ird/observe/ui/content/ContentUIManager.java | 2 +- .../impl/seine/FloatingObjectUIHandler.java | 40 ++++------------------ .../observe-application-swing_fr_FR.properties | 2 +- .../services/dto/seine/FloatingObjectDtos.java | 26 ++++++++++++++ .../service/seine/FloatingObjectServiceTopia.java | 23 +++++++------ 5 files changed, 47 insertions(+), 46 deletions(-) diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/ContentUIManager.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/ContentUIManager.java index 271376c..aeaca36 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/ContentUIManager.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/ContentUIManager.java @@ -146,7 +146,7 @@ public class ContentUIManager { // addMapping(DATA, SetSeineDto.class, SetSeineDto.PROPERTY_NON_TARGET_SAMPLE, NonTargetSampleUI.class); addMapping(DATA, FloatingObjectDto.class, FloatingObjectUI.class); - addMapping(DATA, FloatingObjectDto.class, n("observe.tree.floatingObjectDto.unsaved"), FloatingObjectUI.class); + addMapping(DATA, FloatingObjectDto.class, n("observe.tree.floatingObject.unsaved"), FloatingObjectUI.class); addMapping(DATA, FloatingObjectDto.class, FloatingObjectDto.PROPERTY_OBJECT_OPERATION, FloatingObjectTransmittingBuoyOperationUI.class); addMapping(DATA, FloatingObjectDto.class, FloatingObjectObservedSpeciesDto.PROPERTY_OBJECT_OBSERVED_SPECIES, ObjectObservedSpeciesUI.class); addMapping(DATA, FloatingObjectDto.class, FloatingObjectSchoolEstimateDto.PROPERTY_OBJECT_SCHOOL_ESTIMATE, ObjectSchoolEstimateUI.class); diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/impl/seine/FloatingObjectUIHandler.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/impl/seine/FloatingObjectUIHandler.java index 4bc9749..d0178c9 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/impl/seine/FloatingObjectUIHandler.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/impl/seine/FloatingObjectUIHandler.java @@ -24,8 +24,9 @@ package fr.ird.observe.ui.content.impl.seine; import fr.ird.observe.ObserveSwingApplicationContext; import fr.ird.observe.business.db.DataContext; import fr.ird.observe.business.db.constants.DataContextType; -import fr.ird.observe.services.dto.FormDto; import fr.ird.observe.db.ObserveSwingDataSource; +import fr.ird.observe.services.dto.FormDto; +import fr.ird.observe.services.dto.ReferenceDto; import fr.ird.observe.services.dto.seine.ActivitySeineDto; import fr.ird.observe.services.dto.seine.FloatingObjectDto; import fr.ird.observe.services.dto.seine.FloatingObjectDtos; @@ -77,7 +78,7 @@ public class FloatingObjectUIHandler extends ContentUIHandler<FloatingObjectDto> // dcp existant - if (dataContext.isSelectedOpen(ActivitySeineDto.class)) { + if (getOpenDataManager().isOpenActivitySeine(dataContext.getSelectedActivitySeineId())) { // mode mise a jour return ContentMode.UPDATE; @@ -158,37 +159,17 @@ public class FloatingObjectUIHandler extends ContentUIHandler<FloatingObjectDto> contentUIModel.setModified(create); } - //FIXME @Override protected boolean doSave(FloatingObjectDto bean) throws Exception { String activityId = getSelectedParentId(); - getFloatingObjectService().save(activityId, bean); + String floatingObjectId = getFloatingObjectService().save(activityId, bean); + bean.setId(floatingObjectId); return true; } - //FIXME -// @Override -// protected FloatingObject onCreate(TopiaContext tx, Object parent, FloatingObject editBean) throws TopiaException { -// ActivitySeine parentBean = (ActivitySeine) parent; -// FloatingObjectDAO dao = ObserveDAOHelper.getFloatingObjectDAO(tx); -// FloatingObject beanToSave = dao.create(); -// editBean.setTopiaId(beanToSave.getTopiaId()); -// parentBean.addFloatingObject(beanToSave); -// return beanToSave; -// } - - //FIXME -// @Override -// protected FloatingObject onUpdate(TopiaContext tx, Object parentBean, FloatingObject beanToSave) throws TopiaException { -// -// getLoadBinder().copy(getBean(), beanToSave); -// -// return beanToSave; -// } - @Override protected void afterSave(boolean refresh) { super.afterSave(refresh); @@ -205,8 +186,8 @@ public class FloatingObjectUIHandler extends ContentUIHandler<FloatingObjectDto> // remove old node and recreate new node ObserveNode parentNode = treeHelper.removeNode(node); - //FIXME -// node = treeHelper.addFloatingObject(parentNode, bean); + ReferenceDto<FloatingObjectDto> beanRef = FloatingObjectDtos.newReferenceDto(bean); + node = treeHelper.addFloatingObject(parentNode, beanRef); stopEditUI(); if (refresh) { treeHelper.selectNode(node); @@ -233,13 +214,6 @@ public class FloatingObjectUIHandler extends ContentUIHandler<FloatingObjectDto> return true; } - //FIXME -// @Override -// protected void onDelete(TopiaContext tx, Object parent, FloatingObject beanToDelete) { -// ActivitySeine parentBean = (ActivitySeine) parent; -// parentBean.removeFloatingObject(beanToDelete); -// } - protected FloatingObjectService getFloatingObjectService() { return ObserveSwingApplicationContext.get().newService(FloatingObjectService.class); } diff --git a/observe-application-swing/src/main/resources/i18n/observe-application-swing_fr_FR.properties b/observe-application-swing/src/main/resources/i18n/observe-application-swing_fr_FR.properties index cd98046..cdaaeec 100644 --- a/observe-application-swing/src/main/resources/i18n/observe-application-swing_fr_FR.properties +++ b/observe-application-swing/src/main/resources/i18n/observe-application-swing_fr_FR.properties @@ -2258,7 +2258,7 @@ observe.tree.country=Pays observe.tree.detectionMode=Mode détection observe.tree.encounter=Rencontres observe.tree.encounterType=Type de rencontre -observe.tree.floatingObjectDto.unsaved=Nouveau DCP +observe.tree.floatingObject.unsaved=Nouveau DCP observe.tree.fpaZone=Zone FPA observe.tree.gear=Équipement observe.tree.gearCaracteristic=Caractéristique d'un équipement diff --git a/observe-services-model/src/main/java/fr/ird/observe/services/dto/seine/FloatingObjectDtos.java b/observe-services-model/src/main/java/fr/ird/observe/services/dto/seine/FloatingObjectDtos.java new file mode 100644 index 0000000..1b01d00 --- /dev/null +++ b/observe-services-model/src/main/java/fr/ird/observe/services/dto/seine/FloatingObjectDtos.java @@ -0,0 +1,26 @@ +package fr.ird.observe.services.dto.seine; + +import com.google.common.collect.Lists; +import fr.ird.observe.services.dto.ReferenceDto; +import fr.ird.observe.services.dto.ReferenceDtos; +import fr.ird.observe.services.dto.referential.ReferentialReferenceDto; + +public class FloatingObjectDtos extends AbstractFloatingObjectDtos { + + public static ReferenceDto<FloatingObjectDto> newReferenceDto(FloatingObjectDto floatingObjectDto) { + return newReferenceDto( + floatingObjectDto.getId(), + (String) floatingObjectDto.getObjectType().getPropertyValue(ReferentialReferenceDto.PROPERTY_LABEL)); + } + + public static ReferenceDto<FloatingObjectDto> newReferenceDto(String floatingObjectId, String objectTypeLabel) { + ReferenceDto<FloatingObjectDto> reference = ReferenceDtos.newReferenceDto(FloatingObjectDto.class, + Lists.newArrayList(FloatingObjectDto.PROPERTY_OBJECT_TYPE)); + + reference.setId(floatingObjectId); + reference.setPropertyValue(FloatingObjectDto.PROPERTY_OBJECT_TYPE, objectTypeLabel); + + return reference; + } + +} diff --git a/observe-services-topia/src/main/java/fr/ird/observe/services/service/seine/FloatingObjectServiceTopia.java b/observe-services-topia/src/main/java/fr/ird/observe/services/service/seine/FloatingObjectServiceTopia.java index 0fbaea8..e46701b 100644 --- a/observe-services-topia/src/main/java/fr/ird/observe/services/service/seine/FloatingObjectServiceTopia.java +++ b/observe-services-topia/src/main/java/fr/ird/observe/services/service/seine/FloatingObjectServiceTopia.java @@ -22,7 +22,6 @@ package fr.ird.observe.services.service.seine; * #L% */ -import com.google.common.collect.Lists; import com.google.common.collect.Sets; import fr.ird.observe.entities.constants.ReferenceLocale; import fr.ird.observe.entities.seine.ActivitySeine; @@ -31,11 +30,11 @@ import fr.ird.observe.entities.seine.FloatingObjectTopiaDao; import fr.ird.observe.services.ObserveServiceTopia; import fr.ird.observe.services.dto.FormDto; import fr.ird.observe.services.dto.ReferenceDto; -import fr.ird.observe.services.dto.ReferenceDtos; import fr.ird.observe.services.dto.ReferenceSetDto; import fr.ird.observe.services.dto.ReferenceSetDtos; import fr.ird.observe.services.dto.seine.ActivitySeineDto; import fr.ird.observe.services.dto.seine.FloatingObjectDto; +import fr.ird.observe.services.dto.seine.FloatingObjectDtos; import fr.ird.observe.services.service.DataNotFoundException; import java.util.LinkedHashSet; @@ -54,21 +53,19 @@ public class FloatingObjectServiceTopia extends ObserveServiceTopia implements F FloatingObjectTopiaDao dao = getTopiaPersistenceContext().getFloatingObjectDao(); List<FloatingObject> allStubByActivityId = dao.findAllStubByActivityId(activitySeineId, referenceLocale); - LinkedHashSet<ReferenceDto<FloatingObjectDto>> stubs = Sets.newLinkedHashSet(); + LinkedHashSet<ReferenceDto<FloatingObjectDto>> referenceDtos = Sets.newLinkedHashSet(); for (FloatingObject floatingObject : allStubByActivityId) { - ReferenceDto<FloatingObjectDto> stub = ReferenceDtos.newReferenceDto(FloatingObjectDto.class, - Lists.newArrayList(FloatingObjectDto.PROPERTY_OBJECT_TYPE)); + ReferenceDto<FloatingObjectDto> referenceDto = FloatingObjectDtos.newReferenceDto( + floatingObject.getTopiaId(), + referenceLocale.getLabel(floatingObject.getObjectType())); - stub.setId(floatingObject.getTopiaId()); - stub.setPropertyValue(FloatingObjectDto.PROPERTY_OBJECT_TYPE, referenceLocale.getLabel(floatingObject.getObjectType())); - - stubs.add(stub); + referenceDtos.add(referenceDto); } - ReferenceSetDto<FloatingObjectDto> result = ReferenceSetDtos.newReferenceSetDto(FloatingObjectDto.class, stubs, null); + ReferenceSetDto<FloatingObjectDto> result = ReferenceSetDtos.newReferenceSetDto(FloatingObjectDto.class, referenceDtos, null); return result; } @@ -85,9 +82,13 @@ public class FloatingObjectServiceTopia extends ObserveServiceTopia implements F @Override public ReferenceDto<FloatingObjectDto> loadReferenceToRead(String floatingObjectId) { + ReferenceLocale referenceLocale = getReferenceLocale(); + FloatingObject floatingObject = loadEntity(FloatingObjectDto.class, FloatingObject.class, floatingObjectId); - ReferenceDto<FloatingObjectDto> referenceDto = entityToReferenceDto(FloatingObjectDto.class, floatingObject); + ReferenceDto<FloatingObjectDto> referenceDto = FloatingObjectDtos.newReferenceDto( + floatingObject.getTopiaId(), + referenceLocale.getLabel(floatingObject.getObjectType())); return referenceDto; } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See http://git.codelutin.com/observe.git commit 44d772e94967a3fa27161fa59e1edc307178bcf8 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Thu Oct 15 10:32:35 2015 +0200 mise en place de la validation (refs #7599) --- ...loatingObjectDto-n1-create-error-validation.xml | 112 +++++++++++++++++++++ ...atingObjectDto-n1-create-warning-validation.xml | 55 ++++++++++ ...loatingObjectDto-n1-update-error-validation.xml | 111 ++++++++++++++++++++ ...atingObjectDto-n1-update-warning-validation.xml | 55 ++++++++++ 4 files changed, 333 insertions(+) diff --git a/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/FloatingObjectDto-n1-create-error-validation.xml b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/FloatingObjectDto-n1-create-error-validation.xml new file mode 100644 index 0000000..fe5b689 --- /dev/null +++ b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/FloatingObjectDto-n1-create-error-validation.xml @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + ObServe :: Validation + %% + Copyright (C) 2008 - 2010 IRD, Codelutin, Tony Chemit + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program. If not, see + <http://www.gnu.org/licenses/gpl-3.0.html>. + #L% + --> + +<!DOCTYPE validators PUBLIC + "-//Apache Struts//XWork Validator 1.0.3//EN" + "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd"> +<validators> + + <field name="objectType"> + + <!-- pas de type selectionne --> + <field-validator type="required" short-circuit="true"> + <message>validator.floatingObject.required.type</message> + </field-validator> + + <!-- type desactive --> + <field-validator type="fieldexpression" short-circuit="true"> + <param name="expression"> + <![CDATA[ objectType.enabled ]]> + </param> + <message>validator.floatingObject.desactivated.type</message> + </field-validator> + + </field> + + <field name="objectOperation"> + + <!-- pas de objectOperation selectionne --> + <field-validator type="required" short-circuit="true"> + <message>validator.floatingObject.required.objectOperation</message> + </field-validator> + + <!-- objectOperation desactive --> + <field-validator type="fieldexpression" short-circuit="true"> + <param name="expression"> + <![CDATA[ objectOperation.enabled ]]> + </param> + <message>validator.floatingObject.desactivated.objectOperation</message> + </field-validator> + + </field> + + <field name="supportVesselName"> + + <!-- supportVesselName de ${maxLength} caractères maximum --> + <field-validator type="fieldexpressionwithparams"> + <param name="intParams">maxLength:32</param> + <param name="expression"> + <![CDATA[ supportVesselName == null || supportVesselName.length() < ints.maxLength ]]> + </param> + <message>validator.floatingObject.size.supportVesselName##${ints.maxLength}</message> + </field-validator> + + </field> + + <field name="daysAtSeaCount"> + + <!-- count de jours a la mer positif --> + <field-validator type="int" short-circuit="true"> + <param name="min">0</param> + <message>validator.floatingObject.positive.daysAtSeaCount</message> + </field-validator> + + </field> + + <field name="comment"> + + <!-- comentaire de moins de 1024 caractères --> + <field-validator type="stringlength"> + <param name="maxLength">1024</param> + <message>validator.floatingObject.comment.tobig</message> + </field-validator> + + <!-- comment requis pour certains types d'objet --> + <field-validator type="fieldexpression"> + <param name="expression"> + <![CDATA[ objectType == null || !objectType.needComment || (comment != null && !comment.empty) ]]> + </param> + <message>validator.floatingObject.required.comment.for.type</message> + </field-validator> + + <!-- comment requis pour certains objectFates d'objet --> + <field-validator type="fieldexpression"> + <param name="expression"> + <![CDATA[ objectFate == null || !objectFate.needComment || (comment != null && !comment.empty) ]]> + </param> + <message>validator.floatingObject.required.comment.for.objectFate</message> + </field-validator> + + </field> + +</validators> diff --git a/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/FloatingObjectDto-n1-create-warning-validation.xml b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/FloatingObjectDto-n1-create-warning-validation.xml new file mode 100644 index 0000000..e89bff3 --- /dev/null +++ b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/FloatingObjectDto-n1-create-warning-validation.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + ObServe :: Validation + %% + Copyright (C) 2008 - 2010 IRD, Codelutin, Tony Chemit + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program. If not, see + <http://www.gnu.org/licenses/gpl-3.0.html>. + #L% + --> + +<!DOCTYPE validators PUBLIC + "-//Apache Struts//XWork Validator 1.0.3//EN" + "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd"> +<validators> + + <field name="objectFate"> + + <!-- pas de objectFate selectionne --> + <field-validator type="required" short-circuit="true"> + <message>validator.floatingObject.required.objectFate</message> + </field-validator> + + <!-- objectFate desactive --> + <field-validator type="fieldexpression" short-circuit="true"> + <param name="expression"> + <![CDATA[ objectFate.enabled ]]> + </param> + <message>validator.floatingObject.desactivated.objectFate</message> + </field-validator> + + </field> + + <field name="daysAtSeaCount"> + + <!-- count de jour a l'eau non renseigne --> + <field-validator type="required" short-circuit="true"> + <message>validator.floatingObject.null.daysAtSeaCount</message> + </field-validator> + + </field> + +</validators> diff --git a/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/FloatingObjectDto-n1-update-error-validation.xml b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/FloatingObjectDto-n1-update-error-validation.xml new file mode 100644 index 0000000..4ce1c8e --- /dev/null +++ b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/FloatingObjectDto-n1-update-error-validation.xml @@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + ObServe :: Validation + %% + Copyright (C) 2008 - 2010 IRD, Codelutin, Tony Chemit + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program. If not, see + <http://www.gnu.org/licenses/gpl-3.0.html>. + #L% + --> + +<!DOCTYPE validators PUBLIC + "-//Apache Struts//XWork Validator 1.0.3//EN" + "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd"> +<validators> + + <field name="objectType"> + + <!-- pas de type selectionne --> + <field-validator type="required" short-circuit="true"> + <message>validator.floatingObject.required.type</message> + </field-validator> + + <!-- type desactive --> + <field-validator type="fieldexpression" short-circuit="true"> + <param name="expression"> + <![CDATA[ objectType.enabled ]]> + </param> + <message>validator.floatingObject.desactivated.type</message> + </field-validator> + + </field> + + <field name="objectOperation"> + + <!-- pas de objectOperation selectionne --> + <field-validator type="required" short-circuit="true"> + <message>validator.floatingObject.required.objectOperation</message> + </field-validator> + + <!-- objectOperation desactive --> + <field-validator type="fieldexpression" short-circuit="true"> + <param name="expression"> + <![CDATA[ objectOperation.enabled ]]> + </param> + <message>validator.floatingObject.desactivated.objectOperation</message> + </field-validator> + + </field> + + <field name="supportVesselName"> + + <!-- supportVesselName de ${maxLength} caractères maximum --> + <field-validator type="fieldexpressionwithparams"> + <param name="intParams">maxLength:32</param> + <param name="expression"> + <![CDATA[ supportVesselName == null || supportVesselName.length() < ints.maxLength ]]> + </param> + <message>validator.floatingObject.size.supportVesselName##${ints.maxLength}</message> + </field-validator> + + </field> + + <field name="daysAtSeaCount"> + + <!-- count de jours a la mer positif --> + <field-validator type="int" short-circuit="true"> + <param name="min">0</param> + <message>validator.floatingObject.positive.daysAtSeaCount</message> + </field-validator> + + </field> + + <field name="comment"> + + <!-- comentaire de moins de 1024 caractères --> + <field-validator type="stringlength"> + <param name="maxLength">1024</param> + <message>validator.floatingObject.comment.tobig</message> + </field-validator> + + <!-- comment requis pour certains types d'objet --> + <field-validator type="fieldexpression"> + <param name="expression"> + <![CDATA[ objectType == null || !objectType.needComment || (comment != null && comment != "") ]]> + </param> + <message>validator.floatingObject.required.comment.for.type</message> + </field-validator> + + <!-- comment requis pour certains objectFates d'objet --> + <field-validator type="fieldexpression"> + <param name="expression"> + <![CDATA[ objectFate == null || !objectFate.needComment || ( comment != null && comment != "" ) ]]> + </param> + <message>validator.floatingObject.required.comment.for.objectFate</message> + </field-validator> + </field> + +</validators> diff --git a/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/FloatingObjectDto-n1-update-warning-validation.xml b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/FloatingObjectDto-n1-update-warning-validation.xml new file mode 100644 index 0000000..e89bff3 --- /dev/null +++ b/observe-application-swing/src/main/resources/fr/ird/observe/services/dto/seine/FloatingObjectDto-n1-update-warning-validation.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + ObServe :: Validation + %% + Copyright (C) 2008 - 2010 IRD, Codelutin, Tony Chemit + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program. If not, see + <http://www.gnu.org/licenses/gpl-3.0.html>. + #L% + --> + +<!DOCTYPE validators PUBLIC + "-//Apache Struts//XWork Validator 1.0.3//EN" + "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd"> +<validators> + + <field name="objectFate"> + + <!-- pas de objectFate selectionne --> + <field-validator type="required" short-circuit="true"> + <message>validator.floatingObject.required.objectFate</message> + </field-validator> + + <!-- objectFate desactive --> + <field-validator type="fieldexpression" short-circuit="true"> + <param name="expression"> + <![CDATA[ objectFate.enabled ]]> + </param> + <message>validator.floatingObject.desactivated.objectFate</message> + </field-validator> + + </field> + + <field name="daysAtSeaCount"> + + <!-- count de jour a l'eau non renseigne --> + <field-validator type="required" short-circuit="true"> + <message>validator.floatingObject.null.daysAtSeaCount</message> + </field-validator> + + </field> + +</validators> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See http://git.codelutin.com/observe.git commit 522269d604bb26c20aca1d3299e546bc4f30766c Merge: 440123c 44d772e Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Thu Oct 15 10:33:53 2015 +0200 Merge branch 'feature/7599' into develop .../ird/observe/ui/content/ContentUIManager.java | 2 +- .../impl/seine/FloatingObjectUIHandler.java | 40 ++------ ...loatingObjectDto-n1-create-error-validation.xml | 112 +++++++++++++++++++++ ...atingObjectDto-n1-create-warning-validation.xml | 55 ++++++++++ ...loatingObjectDto-n1-update-error-validation.xml | 111 ++++++++++++++++++++ ...atingObjectDto-n1-update-warning-validation.xml | 55 ++++++++++ .../observe-application-swing_fr_FR.properties | 2 +- .../services/dto/seine/FloatingObjectDtos.java | 26 +++++ .../service/seine/FloatingObjectServiceTopia.java | 23 +++-- 9 files changed, 380 insertions(+), 46 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
participants (1)
-
codelutin.com scm