This is an automated email from the git hooks/post-receive script. New commit to branch feature/8180 in repository echobase. See https://gitlab.nuiton.org/codelutin/echobase.git commit f472fe90cea025623dc36041886521682d289c41 Author: Julien Ruchaud <julien.ruchaud@debux.org> Date: Tue Jul 5 18:06:49 2016 +0200 Add results import for mooring in UI --- .../fr/ifremer/echobase/entities/ImportType.java | 20 ++- echobase-domain/src/main/xmi/echobase.zargo | Bin 99818 -> 99798 bytes .../services/service/UserDbPersistenceService.java | 48 ++++--- .../importData/ConfigureMooringResultsImport.java | 131 +++++++++++++++++++ ...yage.java => GetDataProcessingsForMooring.java} | 33 +++-- .../importData/GetDataProcessingsForVoyage.java | 17 +-- .../importData/LaunchMooringResultsImport.java | 48 +++++++ .../main/resources/config/struts-importData.xml | 8 +- .../importData/configureMooringResultsImport.jsp | 138 +++++++++++++++++++++ .../jsp/importData/configureResultsImport.jsp | 2 +- .../importData/progressMooringResultsImport.jsp | 40 ++++++ .../jsp/importData/resultMooringResultsImport.jsp | 33 +++++ echobase-ui/src/main/webapp/js/gridHelper.js | 19 ++- 13 files changed, 473 insertions(+), 64 deletions(-) diff --git a/echobase-domain/src/main/java/fr/ifremer/echobase/entities/ImportType.java b/echobase-domain/src/main/java/fr/ifremer/echobase/entities/ImportType.java index c4716c2..d496041 100644 --- a/echobase-domain/src/main/java/fr/ifremer/echobase/entities/ImportType.java +++ b/echobase-domain/src/main/java/fr/ifremer/echobase/entities/ImportType.java @@ -175,7 +175,8 @@ public enum ImportType implements I18nAble { COMMON_ALL, COMMON_VOYAGE, COMMON_TRANSIT, - COMMON_TRANSECT}; + COMMON_TRANSECT + }; /** * All result import types. @@ -187,7 +188,18 @@ public enum ImportType implements I18nAble { RESULT_ESDU, RESULT_REGION, RESULT_MAP_FISH, - RESULT_MAP_OTHER}; + RESULT_MAP_OTHER + }; + + /** + * All result import types for moorings. + * + * @since 4.0 + */ + protected static final ImportType[] RESULT_MOORING_IMPORT_TYPES = new ImportType[]{ + RESULT_MOORING, + RESULT_MOORING_ESDU + }; private final EchoBaseUserEntityEnum entityType; @@ -221,4 +233,8 @@ public enum ImportType implements I18nAble { public static ImportType[] getResultImportType() { return RESULT_IMPORT_TYPES; } + + public static ImportType[] getMooringResultImportType() { + return RESULT_MOORING_IMPORT_TYPES; + } } diff --git a/echobase-domain/src/main/xmi/echobase.zargo b/echobase-domain/src/main/xmi/echobase.zargo index e8cbf36..9298b39 100644 Binary files a/echobase-domain/src/main/xmi/echobase.zargo and b/echobase-domain/src/main/xmi/echobase.zargo differ diff --git a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/UserDbPersistenceService.java b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/UserDbPersistenceService.java index bf24f97..1845e15 100644 --- a/echobase-services/src/main/java/fr/ifremer/echobase/services/service/UserDbPersistenceService.java +++ b/echobase-services/src/main/java/fr/ifremer/echobase/services/service/UserDbPersistenceService.java @@ -46,6 +46,7 @@ import fr.ifremer.echobase.entities.data.Category; import fr.ifremer.echobase.entities.data.Cell; import fr.ifremer.echobase.entities.data.CellTopiaDao; import fr.ifremer.echobase.entities.data.Data; +import fr.ifremer.echobase.entities.data.DataAcousticProvider; import fr.ifremer.echobase.entities.data.DataAcquisition; import fr.ifremer.echobase.entities.data.DataProcessing; import fr.ifremer.echobase.entities.data.Echotype; @@ -495,7 +496,6 @@ public class UserDbPersistenceService extends EchoBaseServiceSupport { } public Map<String, String> getDataProcessings(Voyage voyage) { - Map<String, String> result = Maps.newLinkedHashMap(); Decorator<Transit> transitDecorator = decoratorService.getDecorator(Transit.class, null); @@ -503,38 +503,46 @@ public class UserDbPersistenceService extends EchoBaseServiceSupport { Decorator<DataAcquisition> dataAcquisitionDecorator = decoratorService.getDecorator(DataAcquisition.class, null); Decorator<DataProcessing> dataProcessingDecorator = decoratorService.getDecorator(DataProcessing.class, null); - if (!voyage.isTransitEmpty()) { - for (Transit transit : voyage.getTransit()) { - String transitStr = transitDecorator.toString(transit); - if (!transit.isTransectEmpty()) { - for (Transect transect : transit.getTransect()) { - - String transectStr = transitStr + " / " + transectDecorator.toString(transect); - - if (!transect.isDataAcquisitionEmpty()) { + for (Transect transect : transit.getTransect()) { + String transectStr = transitStr + " / " + transectDecorator.toString(transect); - for (DataAcquisition dataAcquisition : transect.getDataAcquisition()) { + for (DataAcquisition dataAcquisition : transect.getDataAcquisition()) { + String dataAcquisitionStr = transectStr + " / " + dataAcquisitionDecorator.toString(dataAcquisition); - String dataAcquisitionStr = transectStr + " / " + dataAcquisitionDecorator.toString(dataAcquisition); + if (!dataAcquisition.isDataProcessingEmpty()) { + for (DataProcessing dataProcessing : dataAcquisition.getDataProcessing()) { - if (!dataAcquisition.isDataProcessingEmpty()) { - for (DataProcessing dataProcessing : dataAcquisition.getDataProcessing()) { - - String value = dataAcquisitionStr + dataProcessingDecorator.toString(dataProcessing); - result.put(dataProcessing.getTopiaId(), value); - } - } + String value = dataAcquisitionStr + dataProcessingDecorator.toString(dataProcessing); + result.put(dataProcessing.getTopiaId(), value); } } } } } - } return result; + } + + public Map<String, String> getDataProcessings(Mooring mooring) { + Map<String, String> result = Maps.newLinkedHashMap(); + Decorator<DataAcquisition> dataAcquisitionDecorator = decoratorService.getDecorator(DataAcquisition.class, null); + Decorator<DataProcessing> dataProcessingDecorator = decoratorService.getDecorator(DataProcessing.class, null); + + for (DataAcquisition dataAcquisition : mooring.getDataAcquisition()) { + String dataAcquisitionStr = dataAcquisitionDecorator.toString(dataAcquisition); + + if (!dataAcquisition.isDataProcessingEmpty()) { + for (DataProcessing dataProcessing : dataAcquisition.getDataProcessing()) { + + String value = dataAcquisitionStr + dataProcessingDecorator.toString(dataProcessing); + result.put(dataProcessing.getTopiaId(), value); + } + } + } + return result; } //------------------------------------------------------------------------// diff --git a/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureMooringResultsImport.java b/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureMooringResultsImport.java new file mode 100644 index 0000000..7448fa2 --- /dev/null +++ b/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureMooringResultsImport.java @@ -0,0 +1,131 @@ +/* + * #%L + * EchoBase :: UI + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * 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% + */ +package fr.ifremer.echobase.ui.actions.importData; + +import com.opensymphony.xwork2.interceptor.annotations.InputConfig; +import fr.ifremer.echobase.entities.ImportType; +import fr.ifremer.echobase.entities.data.Mooring; +import fr.ifremer.echobase.services.service.importdata.configurations.MooringResultsImportConfiguration; + +import java.io.File; +import java.util.Map; + +/** + * Configure a "results" import for mooring. + * + * @author Julien Ruchaud - ruchaud@codelutin.com + * @since 4.0 + */ +public class ConfigureMooringResultsImport extends AbstractConfigureImport<MooringResultsImportConfiguration> { + + private static final long serialVersionUID = 1L; + + /** Universe of existing moorings. */ + protected Map<String, String> moorings; + + /** Universe of possible import modes. */ + protected Map<String, String> importTypes; + + protected String resultLabel; + + public ConfigureMooringResultsImport() { + super(MooringResultsImportConfiguration.class); + } + + @Override + protected MooringResultsImportConfiguration createModel() { + return new MooringResultsImportConfiguration(getLocale()); + } + + @Override + protected void prepareInputAction(MooringResultsImportConfiguration model) { + moorings = userDbPersistenceService.loadSortAndDecorate(Mooring.class); + importTypes = decoratorService.decorateEnums(ImportType.getMooringResultImportType()); + + if (model.getImportType() == null) { + model.setImportType(ImportType.RESULT_MOORING); + } + } + + @InputConfig(methodName = "input") + public String modeMooring() throws Exception { + return execute(); + } + + @InputConfig(methodName = "input") + public String modeMooringEsdu() throws Exception { + return execute(); + } + + public Map<String, String> getMoorings() { + return moorings; + } + + public Map<String, String> getImportTypes() { + return importTypes; + } + + + public String getResultLabel() { + return resultLabel; + } + + public void setResultLabel(String resultLabel) { + this.resultLabel = resultLabel; + } + + public void setEchotypeFile(File file) { + getModel().getEchotypeFile().setFile(file); + } + + public void setEchotypeFileContentType(String contentType) { + getModel().getEchotypeFile().setContentType(contentType); + } + + public void setEchotypeFileFileName(String fileName) { + getModel().getEchotypeFile().setFileName(fileName); + } + + public void setEsduByEchotypeFile(File file) { + getModel().getEsduByEchotypeFile().setFile(file); + } + + public void setEsduByEchotypeFileContentType(String contentType) { + getModel().getEsduByEchotypeFile().setContentType(contentType); + } + + public void setEsduByEchotypeFileFileName(String fileName) { + getModel().getEsduByEchotypeFile().setFileName(fileName); + } + + public void setEsduByEchotypeAndSpeciesCategoryFile(File file) { + getModel().getEsduByEchotypeAndSpeciesCategoryFile().setFile(file); + } + + public void setEsduByEchotypeAndSpeciesCategoryFileContentType(String contentType) { + getModel().getEsduByEchotypeAndSpeciesCategoryFile().setContentType(contentType); + } + + public void setEsduByEchotypeAndSpeciesCategoryFileFileName(String fileName) { + getModel().getEsduByEchotypeAndSpeciesCategoryFile().setFileName(fileName); + } + +} diff --git a/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/GetDataProcessingsForVoyage.java b/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/GetDataProcessingsForMooring.java similarity index 74% copy from echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/GetDataProcessingsForVoyage.java copy to echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/GetDataProcessingsForMooring.java index eeb27dd..563a31e 100644 --- a/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/GetDataProcessingsForVoyage.java +++ b/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/GetDataProcessingsForMooring.java @@ -22,7 +22,7 @@ package fr.ifremer.echobase.ui.actions.importData; import com.google.common.base.Preconditions; import com.google.common.collect.Maps; -import fr.ifremer.echobase.entities.data.Voyage; +import fr.ifremer.echobase.entities.data.Mooring; import fr.ifremer.echobase.services.service.UserDbPersistenceService; import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport; import org.apache.commons.lang3.StringUtils; @@ -31,22 +31,22 @@ import javax.inject.Inject; import java.util.Map; /** - * Gets all dataProcessings of the selected voyage. + * Gets all dataProcessings of the selected mooring. * - * @author Tony Chemit - chemit@codelutin.com - * @since 0.4 + * @author Julien Ruchaud - ruchaud@codelutin.com + * @since 4.0 */ -public class GetDataProcessingsForVoyage extends EchoBaseActionSupport { +public class GetDataProcessingsForMooring extends EchoBaseActionSupport { private static final long serialVersionUID = 1L; - /** Selected voyage id. */ - protected String voyageId; + /** Selected mooring id. */ + protected String entityId; protected Map<String, String> dataProcessings; - public void setVoyageId(String voyageId) { - this.voyageId = voyageId; + public void setEntityId(String entityId) { + this.entityId = entityId; } public Map<String, String> getDataProcessings() { @@ -55,19 +55,14 @@ public class GetDataProcessingsForVoyage extends EchoBaseActionSupport { @Override public String execute() throws Exception { - - if (StringUtils.isEmpty(voyageId)) { + if (StringUtils.isEmpty(entityId)) { dataProcessings = Maps.newLinkedHashMap(); - + } else { + Mooring mooring = userDbPersistenceService.getMooring(entityId); + Preconditions.checkNotNull(mooring, "Could not find voyage with id " + entityId); - Voyage voyage = userDbPersistenceService.getVoyage(voyageId); - - Preconditions.checkNotNull( - voyage, - "Could not find voyage with id " + voyageId); - - dataProcessings = userDbPersistenceService.getDataProcessings(voyage); + dataProcessings = userDbPersistenceService.getDataProcessings(mooring); } return SUCCESS; diff --git a/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/GetDataProcessingsForVoyage.java b/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/GetDataProcessingsForVoyage.java index eeb27dd..1bb9ab3 100644 --- a/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/GetDataProcessingsForVoyage.java +++ b/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/GetDataProcessingsForVoyage.java @@ -41,12 +41,12 @@ public class GetDataProcessingsForVoyage extends EchoBaseActionSupport { private static final long serialVersionUID = 1L; /** Selected voyage id. */ - protected String voyageId; + protected String entityId; protected Map<String, String> dataProcessings; - public void setVoyageId(String voyageId) { - this.voyageId = voyageId; + public void setEntityId(String entityId) { + this.entityId = entityId; } public Map<String, String> getDataProcessings() { @@ -55,17 +55,12 @@ public class GetDataProcessingsForVoyage extends EchoBaseActionSupport { @Override public String execute() throws Exception { - - if (StringUtils.isEmpty(voyageId)) { + if (StringUtils.isEmpty(entityId)) { dataProcessings = Maps.newLinkedHashMap(); } else { - - Voyage voyage = userDbPersistenceService.getVoyage(voyageId); - - Preconditions.checkNotNull( - voyage, - "Could not find voyage with id " + voyageId); + Voyage voyage = userDbPersistenceService.getVoyage(entityId); + Preconditions.checkNotNull(voyage, "Could not find voyage with id " + entityId); dataProcessings = userDbPersistenceService.getDataProcessings(voyage); } diff --git a/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchMooringResultsImport.java b/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchMooringResultsImport.java new file mode 100644 index 0000000..7576961 --- /dev/null +++ b/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchMooringResultsImport.java @@ -0,0 +1,48 @@ +/* + * #%L + * EchoBase :: UI + * %% + * Copyright (C) 2011 - 2012 Ifremer, Codelutin + * %% + * 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% + */ +package fr.ifremer.echobase.ui.actions.importData; + +import fr.ifremer.echobase.entities.EchoBaseUser; +import fr.ifremer.echobase.services.service.importdata.ImportDataResult; +import fr.ifremer.echobase.services.service.importdata.ImportDataService; +import fr.ifremer.echobase.services.service.importdata.ImportException; +import fr.ifremer.echobase.services.service.importdata.configurations.MooringResultsImportConfiguration; + +/** + * Configure a "result" import for mooring. + * + * @author Julien Ruchaud - ruchaud@codelutin.com + * @since 4.0 + */ +public class LaunchMooringResultsImport extends AbstractLaunchImport<MooringResultsImportConfiguration, ImportDataService> { + + private static final long serialVersionUID = 1L; + + public LaunchMooringResultsImport() { + super(MooringResultsImportConfiguration.class, ImportDataService.class); + } + + @Override + protected ImportDataResult<MooringResultsImportConfiguration> doImport(ImportDataService service, MooringResultsImportConfiguration model, EchoBaseUser user) throws ImportException { + return service.doImportMooringResults(model, user); + } + +} diff --git a/echobase-ui/src/main/resources/config/struts-importData.xml b/echobase-ui/src/main/resources/config/struts-importData.xml index 2effe4c..923dbe0 100644 --- a/echobase-ui/src/main/resources/config/struts-importData.xml +++ b/echobase-ui/src/main/resources/config/struts-importData.xml @@ -90,7 +90,13 @@ class="fr.ifremer.echobase.ui.actions.importData.GetDataProcessingsForVoyage"> <result type="json"/> </action> - + + <!-- Get all dataprocessings of a mooring --> + <action name="getDataProcessingsForMooring" + class="fr.ifremer.echobase.ui.actions.importData.GetDataProcessingsForMooring"> + <result type="json"/> + </action> + <!-- CreateOrUpdate a new mission --> <action name="createMission" class="fr.ifremer.echobase.ui.actions.importData.CreateMission"> diff --git a/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureMooringResultsImport.jsp b/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureMooringResultsImport.jsp new file mode 100644 index 0000000..59db61d --- /dev/null +++ b/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureMooringResultsImport.jsp @@ -0,0 +1,138 @@ +<%-- + #%L + EchoBase :: UI + %% + Copyright (C) 2011 Ifremer, Codelutin + %% + 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 contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> +<%@ taglib prefix="sj" uri="/struts-jquery-tags" %> +<title> + Configuration <s:text name="echobase.common.importType.results"/> +</title> + +<script type="text/javascript" + src="<s:url value='/js/gridHelper.js' />"></script> + +<script type="text/javascript"> + + jQuery(document).ready(function () { + + $.addCheckFileSize(<s:property value="uploadFileMaxLength"/>); + + // to change form when mode is changed + $('[name="model.importType"]').change(function (event) { + $('[class~="importType"]').hide(); + $('#' + this.value).show(); + $('#' + this.value + ' .errorMessage').hide(); + }); + + // show incoming mode + var incomingVal = $('[name="model.importType"][checked="checked"]').val(); + $('#' + incomingVal).show(); + + $.autoSelectProviderAndDataProcessing( + $('#mooringSelectBox'), + $('#dataProcessingSelectBox'), + '<s:url action="getDataProcessingsForMooring" namespace="/importData"/>', + '<s:property value="model.mooringId"/>', + '<s:property value="model.dataProcessingId"/>' + ); + }); +</script> + +<s:radio id='mode' key='model.importType' list="importTypes" + cssClass="cleanBoth" requiredLabel="true" template="myradiomap" + label='%{getText("echobase.common.importType")}' /> + +<s:form id="RESULT_MOORING" namespace="/importData" method="POST" + enctype="multipart/form-data" cssClass="hidden importType"> + + <fieldset> + <legend> + <s:text name="echobase.legend.importData.configure"/> + </legend> + + <div class="cleanBoth help"> + <s:a href="%{getDocumentation('importData.html', null)}" target="doc"> + <s:text name="echobase.action.show.import.documentation"/> + </s:a> + </div> + <br/> + + <s:hidden key="model.importType" value="RESULT_MOORING" label=''/> + + <s:select key="model.mooringId" requiredLabel="true" + label='%{getText("echobase.common.mooring")}' + list="moorings" headerKey="" headerValue=""/> + + <s:label key="echobase.information.one.file.required" requiredLabel="true" + value=''/> + + <s:file key="echotypeFile" + label='%{getText("echobase.common.echotypeFile")}'/> + + <s:textarea key="model.importNotes" cols="80" rows="5" + label='%{getText("echobase.common.importNotes")}'/> + </fieldset> + <br/> + <s:submit action="configureMooringResults-modeMooring" key='echobase.action.import'/> +</s:form> + +<s:form id="RESULT_MOORING_ESDU" namespace="/importData" method="POST" + enctype="multipart/form-data" cssClass="hidden importType"> + + <fieldset> + <legend> + <s:text name="echobase.legend.importData.configure"/> + </legend> + + <div class="cleanBoth help"> + <s:a href="%{getDocumentation('importData.html', null)}" target="doc"> + <s:text name="echobase.action.show.import.documentation"/> + </s:a> + </div> + <br/> + + <s:hidden key="model.importType" value="RESULT_MOORING_ESDU" label=''/> + + <s:select id='mooringSelectBox' key="model.mooringId" requiredLabel="true" + label='%{getText("echobase.common.mooring")}' + list="moorings" headerKey="" headerValue=""/> + + <sj:select id='dataProcessingSelectBox' key="model.dataProcessingId" + requiredLabel="true" + label='%{getText("echobase.common.dataProcessing")}'/> + + <s:textfield key="model.resultLabel" size="40" requiredLabel="true" + label='%{getText("echobase.common.resultLabel")}'/> + + <s:label key="echobase.information.one.file.required" requiredLabel="true" + value=''/> + + <s:file key="esduByEchotypeFile" + label='%{getText("echobase.common.esduByEchotypeFile")}'/> + + <s:file key="esduByEchotypeAndSpeciesCategoryFile" + label='%{getText("echobase.common.esduByEchotypeAndSpeciesCategoryFile")}'/> + + <s:textarea key="model.importNotes" cols="80" rows="5" + label='%{getText("echobase.common.importNotes")}'/> + </fieldset> + <br/> + <s:submit action="configureMooringResults-modeMooringEsdu" key='echobase.action.import'/> +</s:form> diff --git a/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResultsImport.jsp b/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResultsImport.jsp index 8012881..e4bdc32 100644 --- a/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResultsImport.jsp +++ b/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResultsImport.jsp @@ -45,7 +45,7 @@ var incomingVal = $('[name="model.importType"][checked="checked"]').val(); $('#' + incomingVal).show(); - $.autoSelectVoyageAndDataProcessing( + $.autoSelectProviderAndDataProcessing( $('#voyageSelectBox'), $('#dataProcessingSelectBox'), '<s:url action="getDataProcessingsForVoyage" namespace="/importData"/>', diff --git a/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressMooringResultsImport.jsp b/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressMooringResultsImport.jsp new file mode 100644 index 0000000..399fb2e --- /dev/null +++ b/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressMooringResultsImport.jsp @@ -0,0 +1,40 @@ +<%-- + #%L + EchoBase :: UI + %% + Copyright (C) 2011 - 2012 Ifremer, Codelutin + %% + 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 contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> +<%@ taglib prefix="sj" uri="/struts-jquery-tags" %> + +<meta http-equiv="refresh" + content='10;url=<s:url action="importMooringResults" namespace="/importData"/>'/> + +<title> + <s:text name="echobase.common.importType.results"/> + <s:text name="echobase.common.inProgress"/> +</title> + +<%-- TODO letellier 20111104 : Add warn icon --%> +<p><s:text name="echobase.message.warnImportInProgress"/></p> + +<br/> + +<div> + <sj:progressbar value="%{model.progress}"/> +</div> diff --git a/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultMooringResultsImport.jsp b/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultMooringResultsImport.jsp new file mode 100644 index 0000000..1e7446b --- /dev/null +++ b/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultMooringResultsImport.jsp @@ -0,0 +1,33 @@ +<%-- + #%L + EchoBase :: UI + %% + Copyright (C) 2011 Ifremer, Codelutin + %% + 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 contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> + +<title> + <s:text name="echobase.common.importResult"/> +</title> + +<h4> + <s:text name="echobase.common.importType.results"/> + ( <s:property value="%{getText(model.importType.i18nKey)}"/> ) +</h4> + +<%@ include file="importDataActionResult.jsp" %> diff --git a/echobase-ui/src/main/webapp/js/gridHelper.js b/echobase-ui/src/main/webapp/js/gridHelper.js index 7b06a79..65a1298 100644 --- a/echobase-ui/src/main/webapp/js/gridHelper.js +++ b/echobase-ui/src/main/webapp/js/gridHelper.js @@ -234,30 +234,29 @@ } }, - // auto-selection des voyages - dataProcessing - autoSelectVoyageAndDataProcessing: function (voyageSelectBox, datapProcessingSelectBox, getUrl, voyageId, dataProcessingId) { + // auto-selection des voyages/mooring - dataProcessing + autoSelectProviderAndDataProcessing: function (selectBox, datapProcessingSelectBox, getUrl, entityId, dataProcessingId) { - voyageSelectBox.change({datapProcessingSelectBox: datapProcessingSelectBox, + selectBox.change({datapProcessingSelectBox: datapProcessingSelectBox, getUrl: getUrl}, function (event) { $.updateSelectBoxContent(event.data.getUrl, - {voyageId: this.value}, + {entityId: this.value}, 'dataProcessings', event.data.datapProcessingSelectBox ); }); - if (voyageId) { + if (entityId) { - voyageSelectBox.change(voyageId); + selectBox.change(entityId); $.updateSelectBoxContent(getUrl, - {voyageId: voyageId}, + {entityId: entityId}, 'dataProcessings', datapProcessingSelectBox, function () { if (dataProcessingId) { - datapProcessingSelectBox.val(dataProcessingId); } } @@ -370,8 +369,8 @@ autoSelectVoyageAndVessel: function (voyageSelectBox, vesselSelectBox, getUrl, voyageId, vesselId) { return $(document).autoSelectVoyageAndVessel(voyageSelectBox, vesselSelectBox, getUrl, voyageId, vesselId); }, - autoSelectVoyageAndDataProcessing: function (voyageSelectBox, dataProcessingSelectBox, getUrl, voyageId, dataProcessingId) { - return $(document).autoSelectVoyageAndDataProcessing(voyageSelectBox, dataProcessingSelectBox, getUrl, voyageId, dataProcessingId); + autoSelectProviderAndDataProcessing: function (voyageSelectBox, dataProcessingSelectBox, getUrl, voyageId, dataProcessingId) { + return $(document).autoSelectProviderAndDataProcessing(voyageSelectBox, dataProcessingSelectBox, getUrl, voyageId, dataProcessingId); }, autoSelectZones: function (facadeSelectBox, zoneSelectBox, getUrl, facadeId, zoneId) { return $(document).autoSelectZones(facadeSelectBox, zoneSelectBox, getUrl, facadeId, zoneId); -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.