Isis-fish-commits
Threads by month
- ----- 2026 -----
- August
- July
- 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
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
August 2008
- 4 participants
- 45 discussions
r1299 - branches/isis-fish-3.1.4/src/resources
by bpoussin@users.labs.libre-entreprise.org Aug. 14, 2008
by bpoussin@users.labs.libre-entreprise.org Aug. 14, 2008
Aug. 14, 2008
Author: bpoussin
Date: 2008-08-14 14:58:23 +0000 (Thu, 14 Aug 2008)
New Revision: 1299
Modified:
branches/isis-fish-3.1.4/src/resources/IsisFish_init.properties
Log:
montre par defaut toutes les simulations terminees
Modified: branches/isis-fish-3.1.4/src/resources/IsisFish_init.properties
===================================================================
--- branches/isis-fish-3.1.4/src/resources/IsisFish_init.properties 2008-08-14 14:55:00 UTC (rev 1298)
+++ branches/isis-fish-3.1.4/src/resources/IsisFish_init.properties 2008-08-14 14:58:23 UTC (rev 1299)
@@ -21,7 +21,7 @@
###
-### les propriétés de la configuration principal obligatoires pour commandline
+### les propri\u00E9t\u00E9s de la configuration principal obligatoires pour commandline
###
#main.config.definition.configFileName=java.io.File:.isis-config-3
@@ -40,7 +40,7 @@
#main.config.modifiers.version=final,static,mandatory
###
-### les propriétés de la configuration principal
+### les propri\u00E9t\u00E9s de la configuration principal
###
main.config.definition.compileDirectory=java.io.File:isis-build
@@ -103,10 +103,10 @@
main.config.definition.simulationServer=java.net.URL:http://simulateur.ifremer.fr:9090
main.config.modifiers.simulationServer=mandatory
-main.config.definition.simulationShowOnlyError=java.lang.Boolean:true
+main.config.definition.simulationShowOnlyError=java.lang.Boolean:false
main.config.modifiers.simulationShowOnlyError=
-main.config.definition.simulationShowOnlyQueue=java.lang.Boolean:true
+main.config.definition.simulationShowOnlyQueue=java.lang.Boolean:false
main.config.modifiers.simulationShowOnlyQueue=
main.config.definition.smtpServer=java.lang.String:smtp
@@ -120,7 +120,7 @@
###
-### les propriétés de la configuration vcs
+### les propri\u00E9t\u00E9s de la configuration vcs
###
vcs.config.definition.localDatabasePath=java.io.File:isis-database-3
vcs.config.modifiers.localDatabasePath=mandatory
@@ -168,7 +168,7 @@
vcs.config.modifiers.userName=mandatory
###
-### les propriétés de la configuration h2
+### les propri\u00E9t\u00E9s de la configuration h2
###
# On utilise pas cglib pour eviter les OutOfMemory: PermGen
h2.config.definition.h2BytecodeProvider=java.lang.String:javassist
@@ -258,5 +258,5 @@
h2.config.definition.storageData=java.lang.String:data
h2.config.modifiers.storageData=final,mandatory,static,transient
-h2.config.definition.updateschemaDatabase=java.lang.Boolean:false
+h2.config.definition.updateschemaDatabase=java.lang.Boolean:true
h2.config.modifiers.updateschemaDatabase=final,mandatory,static,transient
1
0
r1298 - in trunk/isis-fish/src/java/fr/ifremer/isisfish: . actions datastore ui vcs
by bpoussin@users.labs.libre-entreprise.org Aug. 14, 2008
by bpoussin@users.labs.libre-entreprise.org Aug. 14, 2008
Aug. 14, 2008
Author: bpoussin
Date: 2008-08-14 14:55:00 +0000 (Thu, 14 Aug 2008)
New Revision: 1298
Added:
trunk/isis-fish/src/java/fr/ifremer/isisfish/actions/
trunk/isis-fish/src/java/fr/ifremer/isisfish/actions/ExportAction.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/actions/ImportAction.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/actions/OtherAction.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/actions/SimulationAction.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/actions/VCSAction.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/AbstractVCS.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCSFactory.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCSNone.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCSSVN.java
Modified:
trunk/isis-fish/src/java/fr/ifremer/isisfish/IsisConfig.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/IsisFish.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/VersionStorage.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/Welcome.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCS.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/package.html
Log:
refactoring du vcs en cours
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/IsisConfig.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/IsisConfig.java 2008-08-13 18:24:19 UTC (rev 1297)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/IsisConfig.java 2008-08-14 14:55:00 UTC (rev 1298)
@@ -27,7 +27,7 @@
import fr.ifremer.isisfish.actions.SimulationAction;
import fr.ifremer.isisfish.actions.VCSAction;
import fr.ifremer.isisfish.simulator.SimulationContext;
-import fr.ifremer.isisfish.vcs.VCS;
+import fr.ifremer.isisfish.vcs.VCSNone;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
@@ -186,7 +186,7 @@
// public boolean isUseVCS() {
// String value = getOption(Option.VCS_TYPE.key);
-// boolean result = !VCS.TYPE_NONE.equals(value);
+// boolean result = !VCSNone.TYPE_NONE.equals(value);
// return result;
// }
@@ -439,14 +439,14 @@
SSH_PASSPHRASE("ssh.passphrase", _("isisfish.config.vcs.passphrase.description"), ""),
// can be None, CVS or SVN. only None or SVN work
- VCS_TYPE(VCS.VCS_TYPE, _("isisfish.config.vcs.type.description"), VCS.TYPE_SVN),
+ VCS_TYPE(VCSNone.VCS_TYPE, _("isisfish.config.vcs.type.description"), VCSNone.TYPE_SVN),
// depend of VCS_TYPE, for SVN can be http or ssh
- VCS_CONNECTION(VCS.VCS_CONNECTION, _("isisfish.config.vcs.useSshConnexion.description"), "http"),
+ VCS_CONNECTION(VCSNone.VCS_CONNECTION, _("isisfish.config.vcs.useSshConnexion.description"), "http"),
// user login to access vcs
- VCS_USER_NAME(VCS.VCS_USER_NAME, _("isisfish.config.vcs.userName.description"), "anonymous"),
- VCS_HOST_NAME(VCS.VCS_HOST_NAME, _("isisfish.config.vcs.hostName.description"), "labs.libre-entreprise.org"),
- VCS_PATH(VCS.VCS_PATH, _("isisfish.config.vcs.remotePath.description"), "svnroot/isis-fish-data"),
- VCS_TAG(VCS.VCS_TAG, _("isisfish.config.vcs.remoteDatabase.description"), "tag/" + VERSION_DATABASE),
+ VCS_USER_NAME(VCSNone.VCS_USER_NAME, _("isisfish.config.vcs.userName.description"), "anonymous"),
+ VCS_HOST_NAME(VCSNone.VCS_HOST_NAME, _("isisfish.config.vcs.hostName.description"), "labs.libre-entreprise.org"),
+ VCS_PATH(VCSNone.VCS_PATH, _("isisfish.config.vcs.remotePath.description"), "svnroot/isis-fish-data"),
+ VCS_TAG(VCSNone.VCS_TAG, _("isisfish.config.vcs.remoteDatabase.description"), "tag/" + VERSION_DATABASE),
// TYPE_REPO_PROPERTY_KEY = newConfigPropertyKey("typeRepo", VCSTypeRepo.class, 9, n_("isisfish.config.vcs.typeRepo.description"), "TAG"),
// PROJECT_NAME_PROPERTY_KEY = newConfigPropertyKey("projectName", String.class, 11, n_("isisfish.config.main.projectName.description"), "Isis-Fish"),
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/IsisFish.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/IsisFish.java 2008-08-13 18:24:19 UTC (rev 1297)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/IsisFish.java 2008-08-14 14:55:00 UTC (rev 1298)
@@ -49,7 +49,7 @@
import fr.ifremer.isisfish.util.RangeOfValuesConverter;
import fr.ifremer.isisfish.util.StringConverter;
import fr.ifremer.isisfish.util.TimeUnitConverter;
-import fr.ifremer.isisfish.vcs.VCS;
+import fr.ifremer.isisfish.vcs.VCSNone;
import java.io.File;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.logging.LogFactory;
@@ -92,7 +92,7 @@
static public IsisConfig config = null;
static public int step = 0; // action step
- static public VCS vcs = null;
+ static public VCSNone vcs = null;
static public Context uiContext = null;
static protected boolean quit = false;
@@ -250,12 +250,12 @@
}
/**
- * Initialise le VCS et check s'il y a des mises a jour pour prevenir
+ * Initialise le VCSNone et check s'il y a des mises a jour pour prevenir
* l'utilisateur
*/
static public void initVCS() {
// init vcs
- vcs = VCS.createVCS(config);
+ vcs = VCSNone.createVCS(config);
// check connection status
vcs.checkConnection();
Added: trunk/isis-fish/src/java/fr/ifremer/isisfish/actions/ExportAction.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/actions/ExportAction.java (rev 0)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/actions/ExportAction.java 2008-08-14 14:55:00 UTC (rev 1298)
@@ -0,0 +1,248 @@
+/* *##%
+ * Copyright (C) 2002-2008 Code Lutin, Benjamin Poussin
+ *
+ * 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ *##%*/
+
+package fr.ifremer.isisfish.actions;
+
+import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
+import fr.ifremer.isisfish.datastore.DataStorage;
+import fr.ifremer.isisfish.datastore.ExportStorage;
+import fr.ifremer.isisfish.datastore.FormuleStorage;
+import fr.ifremer.isisfish.datastore.RegionStorage;
+import fr.ifremer.isisfish.datastore.RuleStorage;
+import fr.ifremer.isisfish.datastore.ScriptStorage;
+import fr.ifremer.isisfish.datastore.SimulationStorage;
+import fr.ifremer.isisfish.datastore.SimulatorStorage;
+import fr.ifremer.isisfish.ui.ScriptActionHelper;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.regex.Pattern;
+import static org.codelutin.i18n.I18nf._;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.util.FileUtil;
+
+/**
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class ExportAction {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(ExportAction.class);
+
+ protected IsisConfig config = null;
+
+ public ExportAction(IsisConfig config) {
+ this.config = config;
+ }
+
+ public void applyFilter(String filter, List<String> names) {
+ if (filter != null && !"*".equals(filter)) {
+ Pattern p = Pattern.compile(filter);
+ // apply filter on names found
+ for (Iterator<String> i=names.iterator(); i.hasNext();) {
+ String name = i.next();
+ if (!p.matcher(name).matches()) {
+ i.remove();
+ }
+ }
+ }
+ }
+
+ public void display(String filter, List<String> names) {
+ StringBuilder sb = new StringBuilder();
+ sb.append(" found ").append(names.size());
+ sb.append(" with filter ").append(filter);
+ sb.append(" in IsisFish");
+ for (String name : names) {
+ sb.append("\n").append(name);
+ }
+ System.out.println(sb.toString());
+ }
+
+ public void listAnalysePlan(String filter) throws Exception {
+ List<String> names = AnalysePlanStorage.getAnalysePlanNames();
+ applyFilter(filter, names);
+ display(filter, names);
+ }
+
+ public void listExport(String filter) throws Exception {
+ List<String> names = ExportStorage.getExportNames();
+ applyFilter(filter, names);
+ display(filter, names);
+ }
+
+ public void listRule(String filter) throws Exception {
+ List<String> names = RuleStorage.getRuleNames();
+ applyFilter(filter, names);
+ display(filter, names);
+ }
+
+ public void listScript(String filter) throws Exception {
+ List<String> names = ScriptStorage.getScriptNames();
+ applyFilter(filter, names);
+ display(filter, names);
+ }
+
+ public void listRegion(String filter) throws Exception {
+ List<String> names = RegionStorage.getRegionNames();
+ applyFilter(filter, names);
+ display(filter, names);
+ }
+
+ public void listSimulation(String filter) throws Exception {
+ List<String> names = SimulationStorage.getSimulationNames();
+ applyFilter(filter, names);
+ display(filter, names);
+ }
+
+ public void listSimulator(String filter) throws Exception {
+ List<String> names = SimulatorStorage.getSimulatorNames();
+ applyFilter(filter, names);
+ display(filter, names);
+ }
+
+ public void listFormula(String filter) throws Exception {
+ List<String> names = new ArrayList<String>();
+ for (String name : FormuleStorage.getCategories()) {
+ names.addAll(FormuleStorage.getFormuleNames(name));
+ }
+ applyFilter(filter, names);
+ display(filter, names);
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ //
+ // E X P O R T
+ //
+ //////////////////////////////////////////////////////////////////////////
+
+ public void exportRegion(File file, String name, boolean force) throws Exception {
+ log.info("file:" + file + ", name:" + name);
+ if (!force && file.exists()) {
+ throw new IllegalArgumentException(_("destination already exists %s use 'force' argument to force overwrite", file));
+ }
+
+ if (!RegionStorage.exists(name)) {
+ // fatal error
+ throw new IllegalArgumentException(_("could not found region %s", name));
+ }
+ DataStorage data = RegionStorage.getRegion(name);
+ if (data != null) {
+ data.createZip(file);
+ }
+ }
+
+ public void exportSimulation(File file, String name, boolean force) throws Exception {
+ log.info("file:" + file + ", name:" + name);
+ if (!force && file.exists()) {
+ throw new IllegalArgumentException(_("destination already exists %s use 'force' argument to force overwrite", file));
+ }
+
+ if (!SimulationStorage.exists(name)) {
+ // fatal error
+ throw new IllegalArgumentException(_("could not found simulation %s", name));
+ }
+ DataStorage data = SimulationStorage.getSimulation(name);
+ if (data != null) {
+ data.createZip(file);
+ }
+ }
+
+ public void exportAnalysePlan(File file, String name, boolean force) throws Exception {
+ if (!force && file.exists()) {
+ throw new IllegalArgumentException(_("destination already exists %s use 'force' argument to force overwrite", file));
+ }
+ AnalysePlanStorage storage = AnalysePlanStorage.getAnalysePlan(name);
+ if (!storage.exists()) {
+ throw new IllegalArgumentException(_("could not found %s", name));
+ }
+ String content = storage.getContent();
+ FileUtil.writeString(file, content);
+ }
+
+ public void exportRule(File file, String name, boolean force) throws Exception {
+ if (!force && file.exists()) {
+ throw new IllegalArgumentException(_("destination already exists %s use 'force' argument to force overwrite", file));
+ }
+ RuleStorage storage = RuleStorage.getRule(name);
+ if (!storage.exists()) {
+ throw new IllegalArgumentException(_("could not found %s", name));
+ }
+ String content = storage.getContent();
+ FileUtil.writeString(file, content);
+ }
+
+ public void exportScript(File file, String name, boolean force) throws Exception {
+ if (!force && file.exists()) {
+ throw new IllegalArgumentException(_("destination already exists %s use 'force' argument to force overwrite", file));
+ }
+ ScriptStorage storage = ScriptStorage.getScript(name);
+ if (!storage.exists()) {
+ throw new IllegalArgumentException(_("could not found %s", name));
+ }
+ String content = storage.getContent();
+ FileUtil.writeString(file, content);
+ }
+
+ public void exportExport(File file, String name, boolean force) throws Exception {
+ if (!force && file.exists()) {
+ throw new IllegalArgumentException(_("destination already exists %s use 'force' argument to force overwrite", file));
+ }
+ ExportStorage storage = ExportStorage.getExport(name);
+ if (!storage.exists()) {
+ throw new IllegalArgumentException(_("could not found %s", name));
+ }
+ String content = storage.getContent();
+ FileUtil.writeString(file, content);
+ }
+
+ public void exportSimulator(File file, String name, boolean force) throws Exception {
+ if (!force && file.exists()) {
+ throw new IllegalArgumentException(_("destination already exists %s use 'force' argument to force overwrite", file));
+ }
+ SimulatorStorage storage = SimulatorStorage.getSimulator(name);
+ if (!storage.exists()) {
+ throw new IllegalArgumentException(_("could not found %s", name));
+ }
+ String content = storage.getContent();
+ FileUtil.writeString(file, content);
+ }
+
+ public void exportFormula(File file, String category, String name, boolean force) throws Exception {
+ if (!force && file.exists()) {
+ throw new IllegalArgumentException(_("destination already exists %s use 'force' argument to force overwrite", file));
+ }
+ FormuleStorage storage = FormuleStorage.getFormule(category, name);
+ if (!storage.exists()) {
+ throw new IllegalArgumentException(_("could not found %s", name));
+ }
+ String content = storage.getContent();
+ FileUtil.writeString(file, content);
+ }
+
+}
Added: trunk/isis-fish/src/java/fr/ifremer/isisfish/actions/ImportAction.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/actions/ImportAction.java (rev 0)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/actions/ImportAction.java 2008-08-14 14:55:00 UTC (rev 1298)
@@ -0,0 +1,169 @@
+/* *##%
+ * Copyright (C) 2002-2008 Code Lutin, Benjamin Poussin
+ *
+ * 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ *##%*/
+
+package fr.ifremer.isisfish.actions;
+
+import static org.codelutin.i18n.I18nf._;
+
+import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
+import fr.ifremer.isisfish.datastore.ExportStorage;
+import fr.ifremer.isisfish.datastore.FormuleStorage;
+import fr.ifremer.isisfish.datastore.RegionStorage;
+import fr.ifremer.isisfish.datastore.RuleStorage;
+import fr.ifremer.isisfish.datastore.ScriptStorage;
+import fr.ifremer.isisfish.datastore.SimulationStorage;
+import fr.ifremer.isisfish.datastore.SimulatorStorage;
+import fr.ifremer.isisfish.ui.ScriptActionHelper;
+import java.io.File;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.util.FileUtil;
+
+/**
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class ImportAction {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(ImportAction.class);
+
+ protected IsisConfig config = null;
+
+ public ImportAction(IsisConfig config) {
+ this.config = config;
+ }
+
+ public void importAnalysePlan(boolean force, File file) throws Exception {
+ String name = file.getName();
+ AnalysePlanStorage storage = AnalysePlanStorage.getAnalysePlan(name);
+ if(!force && storage.exists()) {
+ throw new IllegalArgumentException(_("destination already exists %s use \'force\' argument to force overwrite", storage.getFile()));
+ }
+ String content = FileUtil.readAsString(file);
+ storage.setContent(content);
+ }
+
+ public void importExport(boolean force, File file) throws Exception {
+ String name = file.getName();
+ ExportStorage storage = ExportStorage.getExport(name);
+ if(!force && storage.exists()) {
+ throw new IllegalArgumentException(_("destination already exists %s use \'force\' argument to force overwrite", storage.getFile()));
+ }
+ String content = FileUtil.readAsString(file);
+ storage.setContent(content);
+ }
+
+ public void importRule(boolean force, File file) throws Exception {
+ String name = file.getName();
+ RuleStorage storage = RuleStorage.getRule(name);
+ if(!force && storage.exists()) {
+ throw new IllegalArgumentException(_("destination already exists %s use \'force\' argument to force overwrite", storage.getFile()));
+ }
+ String content = FileUtil.readAsString(file);
+ storage.setContent(content);
+ }
+
+ public void importScript(boolean force, File file) throws Exception {
+ String name = file.getName();
+ ScriptStorage storage = ScriptStorage.getScript(name);
+ if(!force && storage.exists()) {
+ throw new IllegalArgumentException(_("destination already exists %s use \'force\' argument to force overwrite", storage.getFile()));
+ }
+ String content = FileUtil.readAsString(file);
+ storage.setContent(content);
+ }
+
+ public void importSimulator(boolean force, File file) throws Exception {
+ String name = file.getName();
+ SimulatorStorage storage = SimulatorStorage.getSimulator(name);
+ if(!force && storage.exists()) {
+ throw new IllegalArgumentException(_("destination already exists %s use \'force\' argument to force overwrite", storage.getFile()));
+ }
+ String content = FileUtil.readAsString(file);
+ storage.setContent(content);
+ }
+
+ public void importFormula(boolean force, String formulaType, File file) throws Exception {
+ if (!FormuleStorage.getCategories().contains(formulaType)) {
+ throw new IllegalArgumentException(_("Could not found formule type %s autorised type are %s", formulaType, FormuleStorage.getCategories()));
+ }
+ String name = file.getName();
+ FormuleStorage storage = FormuleStorage.getFormule(formulaType, name);
+ if(!force && storage.exists()) {
+ throw new IllegalArgumentException(_("destination already exists %s use \'force\' argument to force overwrite", storage.getFile()));
+ }
+ String content = FileUtil.readAsString(file);
+ storage.setContent(content);
+ }
+
+ /**
+ *
+ * @param file zip file containing data
+ * @param force
+ * @throws java.lang.Exception
+ */
+ public void importRegion(boolean force, File file) throws Exception {
+ //TODO test if region exists
+ RegionStorage.importZip(file);
+ }
+
+ /**
+ *
+ * @param file zip file containing data
+ * @param name new region name
+ * @param force
+ * @throws java.lang.Exception
+ */
+ public void importRegionAndRename(boolean force, File file, String name) throws Exception {
+ if (RegionStorage.exists(name) && !force) {
+ // fatal error
+ throw new IllegalArgumentException(_("region already exists %s use 'force' argument to force overwrite", name));
+ }
+ RegionStorage.importAndRenameZip(file, name);
+ }
+
+ /**
+ *
+ * @param file zip file containing data
+ * @param force
+ * @throws java.lang.Exception
+ */
+ public void importSimulation(boolean force, File file) throws Exception {
+ //TODO test if simulation exists
+ SimulationStorage.importZip(file);
+ }
+
+ /**
+ * Import zipped file containing all directory structure
+ *
+ * @param file zip file containing data
+ * @param force
+ * @throws java.lang.Exception
+ */
+ public void importScriptModule(boolean force, File file) throws Exception {
+ ScriptActionHelper.importScript(file, force, false, null);
+ }
+
+}
Added: trunk/isis-fish/src/java/fr/ifremer/isisfish/actions/OtherAction.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/actions/OtherAction.java (rev 0)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/actions/OtherAction.java 2008-08-14 14:55:00 UTC (rev 1298)
@@ -0,0 +1,62 @@
+/* *##%
+ * Copyright (C) 2002-2008 Code Lutin, Benjamin Poussin
+ *
+ * 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ *##%*/
+
+package fr.ifremer.isisfish.actions;
+
+import static org.codelutin.i18n.I18nf._;
+
+import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.vcs.VCSNone;
+import java.io.File;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class OtherAction {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(OtherAction.class);
+
+ protected IsisConfig config = null;
+
+ public OtherAction(IsisConfig config) {
+ this.config = config;
+ }
+
+ static public void help() {
+ System.out.println("Usage: isis-fish [-h]");
+ }
+
+ public void chekoutMavenFile() throws Exception {
+ VCSNone vcs = config.getVCS();
+ File dest = config.getDatabaseDirectory();
+ File file = new File(dest, "pom.xml");
+ log.info(_("Checkout pom.xml to %s", file));
+ vcs.update(file);
+ }
+
+
+}
Added: trunk/isis-fish/src/java/fr/ifremer/isisfish/actions/SimulationAction.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/actions/SimulationAction.java (rev 0)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/actions/SimulationAction.java 2008-08-14 14:55:00 UTC (rev 1298)
@@ -0,0 +1,112 @@
+/* *##%
+ * Copyright (C) 2002-2008 Code Lutin, Benjamin Poussin
+ *
+ * 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ *##%*/
+
+package fr.ifremer.isisfish.actions;
+
+import static org.codelutin.i18n.I18nf._;
+
+import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.datastore.RegionStorage;
+import fr.ifremer.isisfish.datastore.SimulationStorage;
+import fr.ifremer.isisfish.simulator.SimulationHelper;
+import fr.ifremer.isisfish.simulator.SimulationParameter;
+import java.io.File;
+import java.io.FileInputStream;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Properties;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class SimulationAction {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(SimulationAction.class);
+
+ protected IsisConfig config = null;
+
+ public SimulationAction(IsisConfig config) {
+ this.config = config;
+ }
+
+ public static void simulateWithRegion(String simulId, File parameterFile, File region) throws Exception {
+ Properties props = new Properties();
+ FileInputStream inStream = new FileInputStream(parameterFile);
+ props.load(inStream);
+ inStream.close();
+
+ SimulationParameter params = new SimulationParameter();
+ params.fromProperties(props);
+
+ // try to import region if needed
+ String regionName = params.getRegionName();
+ if (region != null) {
+ if (!RegionStorage.exists(regionName)) {
+ RegionStorage.importAndRenameZip(region, regionName);
+ } else {
+ log.warn(_("Region %s allready exist in repository. Cant import", regionName));
+ }
+ }
+
+ SimulationHelper.simulate(simulId, params, false);
+ }
+
+ /**
+ *
+ * @param simulId id de simulation
+ * @param zip Zip de la simulation
+ * @param parameterFile parametre optionnel pour la simulation
+ */
+ public static void simulateWithSimulation(String simulId, File parameterFile, File simulationZip) throws Exception {
+ SimulationParameter params = null;
+ if (parameterFile != null && parameterFile.exists()) {
+ Properties props = new Properties();
+ FileInputStream inStream = new FileInputStream(parameterFile);
+ props.load(inStream);
+ inStream.close();
+
+ params = new SimulationParameter();
+ params.fromProperties(props);
+ }
+ log.info("id:" + simulId + ", zip:" + simulationZip + (params!=null?" with parameters":""));
+
+ // import de cette simulation
+ String name = simulId + " " + new SimpleDateFormat("yyyy-MM-dd-HH-mm").format(new Date());
+
+ // import de la simulation avec un autre nom
+ SimulationStorage sim = SimulationStorage.importAndRenameZip(simulationZip, name);
+ if (params != null) {
+ sim.setParameter(params);
+ }
+ // lancement de la simulation
+ SimulationHelper.simulate(null, sim);
+
+ sim.getStorage().closeContext();
+
+ }
+
+}
Added: trunk/isis-fish/src/java/fr/ifremer/isisfish/actions/VCSAction.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/actions/VCSAction.java (rev 0)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/actions/VCSAction.java 2008-08-14 14:55:00 UTC (rev 1298)
@@ -0,0 +1,97 @@
+/* *##%
+ * Copyright (C) 2002-2008 Code Lutin, Benjamin Poussin
+ *
+ * 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ *##%*/
+
+package fr.ifremer.isisfish.actions;
+
+
+import com.sshtools.j2ssh.transport.publickey.OpenSSHPublicKeyFormat;
+import com.sshtools.j2ssh.transport.publickey.SshKeyGenerator;
+import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.ui.Welcome;
+import java.io.File;
+import java.util.Arrays;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.util.FileUtil;
+
+/**
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class VCSAction {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(VCSAction.class);
+
+ protected IsisConfig config = null;
+
+ public VCSAction(IsisConfig config) {
+ this.config = config;
+ }
+
+ public void sshCreateKey(boolean force) throws Exception {
+ File f = config.getOptionAsFile(IsisConfig.Option.SSH_KEY_FILE.key);
+
+ if (f.exists() && !force) {
+ log.error("the private key already exist " + f + ", use option [force] to overwrite");
+ return;
+ }
+ File publicKeyFile = new File(f.getAbsolutePath() + ".pub");
+
+ log.info("Generate ssh key to " + f);
+ SshKeyGenerator.main(new String[]{"-b", "1024", "-t", "rsa", f.getAbsolutePath()});
+
+ log.info("public key before OpenSsh : " + FileUtil.readAsString(publicKeyFile));
+ String openSshPublicKey =
+ SshKeyGenerator.convertPublicKeyFile(publicKeyFile,
+ new OpenSSHPublicKeyFormat(
+ config.getOption(IsisConfig.Option.USER_NAME.key) +
+ "@forIsisFish 1024-bit rsa"));
+
+ log.info("public key OpenSsh : " + openSshPublicKey);
+ FileUtil.writeString(new File(publicKeyFile.getAbsolutePath()), openSshPublicKey);
+ }
+
+ public void vcsUpdate() throws Exception {
+ // ATTENTION: il est inutil de d'accepter cette option au premier
+ // lancement! car on a effectue soit un checkout, soit
+ // une migration // !IsisContext.get().isFirstLaunch()
+ Welcome.updateVCS(null);
+ }
+
+ public void vcsAdd(File ... file) throws Exception {
+ log.info("file*:" + Arrays.toString(file));
+ throw new UnsupportedOperationException("to be done...");
+ }
+
+ public void vcsRemove(File ... file) throws Exception {
+ log.info("file*:" + Arrays.toString(file));
+ throw new UnsupportedOperationException("to be done...");
+ }
+
+ public void vcsCommit(File ... file) throws Exception {
+ log.info("file*:" + Arrays.toString(file));
+ throw new UnsupportedOperationException("to be done...");
+ }
+
+}
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/VersionStorage.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/VersionStorage.java 2008-08-13 18:24:19 UTC (rev 1297)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/VersionStorage.java 2008-08-14 14:55:00 UTC (rev 1298)
@@ -33,7 +33,7 @@
import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.vcs.VCSException;
-import fr.ifremer.isisfish.vcs.VCS;
+import fr.ifremer.isisfish.vcs.VCSNone;
import static org.codelutin.i18n.I18n._;
import org.codelutin.util.FileUtil;
@@ -56,7 +56,7 @@
/** Logger for this class */
private static final Log log = LogFactory.getLog(VersionStorage.class);
- static protected VCS getVCS() {
+ static protected VCSNone getVCS() {
return IsisFish.vcs;
}
@@ -68,7 +68,7 @@
* Par exemple si on a /home/poussin/isis-database comme root
* il faut que file soit un fichier ou un sous fichiers dans root
*
- * @param root le repertoire racine de mise en VCS (HOME VCS)
+ * @param root le repertoire racine de mise en VCSNone (HOME VCSNone)
* @param file le fichier a gérer.
*/
protected VersionStorage(File root, File file) {
@@ -78,7 +78,7 @@
/**
* Permet de demander la preparation des fichiers pour etre envoyé
- * vers le VCS
+ * vers le VCSNone
*
*/
abstract protected void prepare();
@@ -100,9 +100,9 @@
/**
* Indique s'il a deja ete ajouté au cvs. Si file est un repertoire
* (ex pour Region) alors vrai meme si tous les fichiers du repertoire
- * ne sont pas sur le VCS
+ * ne sont pas sur le VCSNone
*
- * @return vrai si deja dans le VCS
+ * @return vrai si deja dans le VCSNone
*/
public boolean isOnRemote() throws VCSException {
return getVCS().isOnRemote(getFile());
@@ -110,7 +110,7 @@
/**
* Permet de savoir si un fichier doit etre géré par le vcs ou non.
- * L'implantation par defaut exclus les répertoires VCS, il faut
+ * L'implantation par defaut exclus les répertoires VCSNone, il faut
* toujours appeler le super si on surcharge la methode.
*
* @param file le fichier a tester
@@ -121,7 +121,7 @@
}
/**
- * Donne la liste de tous les fichiers que le VCS doit gérer.
+ * Donne la liste de tous les fichiers que le VCSNone doit gérer.
* Par defaut parcours tous les repertoires et ajouter tous les fichiers
* et repertoire trouvé. Il est possible d'exclure des fichiers et/ou
* repertoire en surchargeant {@link #isVersionnableAbleFile(File)}
@@ -144,9 +144,9 @@
}
/**
- * Donne la liste de tous les fichiers à gérer par le VCS.
+ * Donne la liste de tous les fichiers à gérer par le VCSNone.
* Ceci inclu la liste des répertoires pour aller de ce storage
- * jusqu'a la racine VCS si withParent est vrai
+ * jusqu'a la racine VCSNone si withParent est vrai
*
* @param withParent si vrai inclu les parents
* @return la liste des fichiers trouvés
@@ -167,7 +167,7 @@
}
/**
- * Permet d'ajouter ce storage dans le VCS. Cela prend effet immediatement
+ * Permet d'ajouter ce storage dans le VCSNone. Cela prend effet immediatement
* (un commit est fait).
*
* @param msg le message indiquant le but du fichier
@@ -209,7 +209,7 @@
}
/**
- * Permet d'envoyer des modifications faite en local sur le VCS
+ * Permet d'envoyer des modifications faite en local sur le VCSNone
*
* @param msg le message indiquant le type des modifications
* @throws VCSException si pb pendant l'op
@@ -217,13 +217,13 @@
*/
public void commit(String msg) throws VCSException {
// on appelle en fait add, car il y a peut-etre des nouveaux fichiers
- // a ajouter au VCS et ca doit etre fait automatiquement
+ // a ajouter au VCSNone et ca doit etre fait automatiquement
add(msg);
}
/**
* Permet de mettre a jour le fichier local en fonction de ce qu'il y
- * a sur le VCS
+ * a sur le VCSNone
*
* @throws VCSException si pb pendant l'op
*
@@ -239,7 +239,7 @@
}
/**
- * Permet de ramener tout un répertoire du VCS. Utile seulement pour le
+ * Permet de ramener tout un répertoire du VCSNone. Utile seulement pour le
* premier lancement pour scipts et exports.
*
* @param destDir le repertoire parent
@@ -275,12 +275,12 @@
/**
* Retourne la liste des noms de tous les storages disponibles sur le
- * serveur VCS
+ * serveur VCSNone
*
- * @param directory le répertoire sur le VCS ou doivent se trouver
+ * @param directory le répertoire sur le VCSNone ou doivent se trouver
* les storages (regions, simulations)
* @return la liste des noms de tous les storages disponibles sur le
- * serveur VCS. Si le serveur n'est pas disponible la liste retournée
+ * serveur VCSNone. Si le serveur n'est pas disponible la liste retournée
* est vide.
*/
static public List<String> getRemoteStorageNames(File directory) {
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/Welcome.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/Welcome.java 2008-08-13 18:24:19 UTC (rev 1297)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/Welcome.java 2008-08-14 14:55:00 UTC (rev 1298)
@@ -49,7 +49,7 @@
import fr.ifremer.isisfish.datastore.RuleStorage;
import fr.ifremer.isisfish.datastore.ScriptStorage;
import fr.ifremer.isisfish.datastore.SimulatorStorage;
-import fr.ifremer.isisfish.vcs.VCS;
+import fr.ifremer.isisfish.vcs.VCSNone;
import org.swixat.framework.AbstractFrame;
import org.swixat.framework.OutputView;
import org.swixat.model.GenericContext;
@@ -74,7 +74,7 @@
/** to use log facility, just put in your code: log.info(\"...\"); */
static private Log log = LogFactory.getLog(Welcome.class);
- static protected VCS getVCS() {
+ static protected VCSNone getVCS() {
return IsisFish.config.getVCS();
}
Added: trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/AbstractVCS.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/AbstractVCS.java (rev 0)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/AbstractVCS.java 2008-08-14 14:55:00 UTC (rev 1298)
@@ -0,0 +1,56 @@
+/* *##%
+ * Copyright (C) 2002-2008 Code Lutin, Benjamin Poussin
+ *
+ * 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ *##%*/
+
+package fr.ifremer.isisfish.vcs;
+
+
+import java.io.File;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.util.ApplicationConfig;
+
+/**
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public abstract class AbstractVCS implements VCS {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(AbstractVCS.class);
+
+ protected ApplicationConfig config;
+
+ public AbstractVCS(ApplicationConfig config) {
+ this.config = config;
+ }
+
+ public boolean accept(File pathname) {
+ return isVersionnableAbleFile(pathname);
+ }
+
+ public boolean isVersionnableAbleFile(File file) {
+ String filename = file.getName();
+ return !".svn".equals(filename) && !"CVS".equals(filename) && !filename.endsWith("~");
+ }
+
+}
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCS.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCS.java 2008-08-13 18:24:19 UTC (rev 1297)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCS.java 2008-08-14 14:55:00 UTC (rev 1298)
@@ -1,4 +1,4 @@
-/* *##%
+/*
* Copyright (C) 2002-2008 Code Lutin, Benjamin Poussin
*
* This program is free software; you can redistribute it and/or
@@ -15,149 +15,188 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
- *##%*/
+ */
package fr.ifremer.isisfish.vcs;
import java.io.File;
import java.io.FileFilter;
-import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Properties;
-import static org.codelutin.i18n.I18nf._;
+import org.codelutin.util.VersionNumber;
-import org.apache.commons.beanutils.ConstructorUtils;
-import org.apache.commons.beanutils.ConvertUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.util.ApplicationConfig;
-
/**
- * VCS (svn or vcs) must extends this class. This class can be used as dummy
- * VCS if not valid VCS found.
- *
+ *
* @author poussin
* @version $Revision$
*
* Last update: $Date$
* by : $Author$
*/
-public class VCS implements FileFilter {
+public interface VCS extends FileFilter {
+ public static final String TYPE_CVS = "cvs";
+ public static final String TYPE_NONE = "none";
+ public static final String TYPE_SVN = "svn";
+ /**
+ * can be http, ssh, pserver, ...
+ */
+ public static final String VCS_PROTOCOLE = "vcs.protocole";
+ /**
+ * remote server adresse (ip or serveur name) ex: labs.libre-entreprise.org
+ */
+ public static final String VCS_HOST_NAME = "vcs.hostName";
+ /**
+ * remote repository path ex: /svnroot/isis-fish-data
+ */
+ public static final String VCS_PATH = "vcs.path";
+ /**
+ * repository tag to used ex: "3.2" or "" for no tag
+ */
+ public static final String VCS_TAG = "vcs.tag";
+ /**
+ * can be None, CVS or SVN. only None or SVN work
+ */
+ public static final String VCS_TYPE = "vcs.type";
+ /**
+ * user login to access vcs ex: bpoussin
+ */
+ public static final String VCS_USER_NAME = "vcs.username";
+ /**
+ * user passwd or passphrase to access vcs ex: xxxxxxxx
+ */
+ public static final String VCS_USER_PASSWORD = "vcs.password";
- static final public String TYPE_NONE = "none";
- static final public String TYPE_SVN = "svn";
- static final public String TYPE_CVS = "cvs";
-
- // can be None, CVS or SVN. only None or SVN work
- static final public String VCS_TYPE = "vcs.type";
- static final public String VCS_CONNECTION = "vcs.connection";
- // user login to access vcs
- static final public String VCS_USER_NAME = "vcs.username";
- static final public String VCS_HOST_NAME = "vcs.hostName";
- static final public String VCS_PATH = "vcs.path";
- static final public String VCS_TAG = "vcs.tag";
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(VCS.class);
+ /**
+ * Usefull to permit to use VCSNone as filter
+ * @param pathname
+ * @return
+ */
+ public boolean accept(File pathname);
- protected ApplicationConfig config;
+ /**
+ * Add and commit file in server repository
+ * @param files list of file to add
+ * @param msg message for commit
+ * @throws fr.ifremer.isisfish.vcs.VCSException
+ */
+ public void add(List<File> files, String msg) throws VCSException;
+
+ /**
+ * get repository module on server and put it in destDir
+ * @param destDir destination directory
+ * @param module module name
+ * @param b // FIXME
+ * @throws fr.ifremer.isisfish.vcs.VCSException
+ */
+ public void checkout(File destDir, String module, boolean b) throws VCSException;
+
+ /**
+ * Change repository tag, used when we use some tag and we want to go to
+ * trunk.
+ * @param version version to go, if null trunk is used, otherwize
+ * tags/version is used
+ * @throws fr.ifremer.isisfish.vcs.VCSException
+ */
+ public void switchTag(VersionNumber version) throws VCSException;
/**
- * VCS factory, looking for vcs.type key in config to find vcs class to used
- * If no vcs.type found or is not valid class, use {@link VCS}.
- * @param config
- * @return usable VCS
+ * switch to new protocole, can be used to switch between anonymous and
+ * authenticate protocole
+ * @param protocoleType
+ * @throws fr.ifremer.isisfish.vcs.VCSException
*/
- static public VCS createVCS(ApplicationConfig config) {
- Properties aliases = new Properties();
- aliases.setProperty("", VCS.class.getName());
- aliases.setProperty(TYPE_NONE, VCS.class.getName());
-// aliases.setProperty(TYPE_SVN, VCSSVN.class.getName());
-// aliases.setProperty(TYPE_CVS, VCSCVS.class.getName());
-
- VCS result = null;
- String type = config.getOption(VCS_TYPE);
- // try to convert if type is not class name but an alias
- String classname = aliases.getProperty(type, type);
- try {
- Class clazz = (Class)ConvertUtils.convert(classname, Class.class);
- result = (VCS) ConstructorUtils.invokeConstructor(clazz, config);
- } catch (Exception eee) {
- log.error(_("Can't instanciate wanted VCS (%s), use default",
- config.getOption(VCS_TYPE)), eee);
- result = new VCS(config);
- }
- return result;
- }
+ public void switchProtocole(String protocoleType) throws VCSException;
- protected VCS(ApplicationConfig config) {
- this.config = config;
- }
+ /**
+ * Delete and commit files in server repository
+ * @param files file to delete
+ * @param msg message for commit
+ * @throws fr.ifremer.isisfish.vcs.VCSException
+ */
+ public void delete(List<File> files, String msg) throws VCSException;
- public void add(List<File> files, String msg) throws VCSException {
- throw new VCSException("Can't add file with dummy VCS");
- }
+ /**
+ * Return all changelog between local file version and remote repository
+ * file version
+ * @param files
+ * @return changelog for each file
+ */
+ public Map<File, String> getChanglog(List<File> files);
- public void checkout(File destDir, String module, boolean b) throws VCSException {
- throw new VCSException("Can't checkout with dummy VCS");
- }
+ /**
+ * show diff between local file and repository file
+ * @param file
+ * @return
+ * @throws fr.ifremer.isisfish.vcs.VCSException
+ */
+ public String getDiff(File file) throws VCSException;
- public void delete(List<File> files, String msg) throws VCSException {
- // do nothing
- }
-
- public String getDiff(File file) throws VCSException {
- throw new VCSException("Can't diff with dummy VCS");
- }
-
/**
* Return list of all file on directory on remote server
* @param directory
* @return
*/
- public List<String> getFileList(File directory) throws VCSException {
- List<String> result = new ArrayList<String>();
- return result;
- }
+ public List<String> getFileList(File directory) throws VCSException;
- public boolean isConnected() {
- return false;
- }
-
- public boolean isOnRemote(File file) throws VCSException {
- return false;
- }
+ /**
+ * get list of new or modified files on server
+ * @return list of modified or new files
+ */
+ public List<File> getUpdatedFile();
- public boolean isUpToDate(File file) throws VCSException {
- return true;
- }
+ /**
+ * Ask if there are some new or modified files on server
+ * @return true if new file available
+ */
+ public boolean haveUpdate();
/**
+ * Get connection state.
+ * @return true if server is connectable
+ */
+ public boolean isConnected();
+
+ /**
+ * Check if file is available on server
+ * @param file file to check
+ * @return true if file available
+ * @throws fr.ifremer.isisfish.vcs.VCSException
+ */
+ public boolean isOnRemote(File file) throws VCSException;
+
+ /**
+ * look on server if version is tag repository
+ * @param version version number like 3.2
+ * @return true if tag found with this name
+ */
+ public boolean isTag(VersionNumber version);
+
+ /**
+ * Check if file is uptodate
+ * @param file file to check
+ * @return true if file is in last version
+ * @throws fr.ifremer.isisfish.vcs.VCSException
+ */
+ public boolean isUpToDate(File file) throws VCSException;
+
+ /**
* Must be overwriten, this default implementation return true.
* Check if file can be put in vcs repository, for example when you used
* CVS, you must not put CVS file.
- *
+ * <p>
+ * default refused .svn, CVS and ~ filename
+ *
* @param file
* @return
*/
- public boolean isVersionnableAbleFile(File file) {
- return true;
- }
+ public boolean isVersionnableAbleFile(File file);
- public void update(File file) throws VCSException {
- throw new VCSException("Can't update file with dummy VCS");
- }
-
/**
- * Usefull to permit to use VCS as filter
- * @param pathname
- * @return
+ * Update file
+ * @param file file to update
+ * @return true if there are some merging conflict, false otherwize
+ * @throws fr.ifremer.isisfish.vcs.VCSException
*/
- public boolean accept(File pathname) {
- return isVersionnableAbleFile(pathname);
- }
+ public boolean update(File file) throws VCSException;
-
}
Added: trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCSFactory.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCSFactory.java (rev 0)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCSFactory.java 2008-08-14 14:55:00 UTC (rev 1298)
@@ -0,0 +1,76 @@
+/* *##%
+ * Copyright (C) 2002-2008 Code Lutin, Benjamin Poussin
+ *
+ * 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ *##%*/
+
+package fr.ifremer.isisfish.vcs;
+
+import static org.codelutin.i18n.I18nf._;
+
+import java.util.Properties;
+import org.apache.commons.beanutils.ConstructorUtils;
+import org.apache.commons.beanutils.ConvertUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.util.ApplicationConfig;
+
+/**
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class VCSFactory {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(VCSFactory.class);
+
+ private VCSFactory() {}
+
+ /**
+ * VCSNone factory, looking for vcs.type key in config to find vcs class to used
+ * If no vcs.type found or is not valid class, use {@link VCSNone}.
+ * @param config
+ * @return usable VCSNone
+ */
+ static public VCSNone createVCS(ApplicationConfig config) {
+ Properties aliases = new Properties();
+ // for empty and TYPE_NONE we used this class
+ aliases.setProperty("", VCSNone.class.getName());
+ aliases.setProperty(VCS.TYPE_NONE, VCSNone.class.getName());
+ aliases.setProperty(VCS.TYPE_SVN, VCSSVN.class.getName());
+ // FIXME active this line when svn and CVS are implemented
+// aliases.setProperty(TYPE_CVS, VCSCVS.class.getName());
+
+ VCSNone result = null;
+ String type = config.getOption(VCS.VCS_TYPE);
+ // try to convert if type is not class name but an alias
+ String classname = aliases.getProperty(type, type);
+ try {
+ Class clazz = (Class)ConvertUtils.convert(classname, Class.class);
+ result = (VCSNone) ConstructorUtils.invokeConstructor(clazz, config);
+ } catch (Exception eee) {
+ log.error(_("Can't instanciate wanted VCS (%s), use default",
+ config.getOption(VCS.VCS_TYPE)), eee);
+ result = new VCSNone(config);
+ }
+ return result;
+ }
+
+}
Copied: trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCSNone.java (from rev 1283, trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCS.java)
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCSNone.java (rev 0)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCSNone.java 2008-08-14 14:55:00 UTC (rev 1298)
@@ -0,0 +1,186 @@
+/* *##%
+ * Copyright (C) 2002-2008 Code Lutin, Benjamin Poussin
+ *
+ * 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ *##%*/
+
+package fr.ifremer.isisfish.vcs;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import static org.codelutin.i18n.I18nf._;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.util.ApplicationConfig;
+import org.codelutin.util.VersionNumber;
+
+/**
+ * VCSNone (svn or vcs) must extends this class. This class can be used as dummy
+ * VCSNone if not valid VCSNone found.
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class VCSNone extends AbstractVCS {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(VCSNone.class);
+
+ public VCSNone(ApplicationConfig config) {
+ super(config);
+ }
+
+ /**
+ * look on server if version is tag repository
+ * @param version version number like 3.2
+ * @return true if tag found with this name
+ */
+ public boolean isTag(VersionNumber version) {
+ return false;
+ }
+
+ /**
+ * Ask if there are some new or modified files on server
+ * @return true if new file available
+ */
+ public boolean haveUpdate() {
+ return false;
+ }
+
+ /**
+ * get list of new or modified files on server
+ * @return list of modified or new files
+ */
+ public List<File> getUpdatedFile() {
+ return new ArrayList<File>();
+ }
+
+ /**
+ * Return all changelog between local file version and remote repository
+ * file version
+ * @param files
+ * @return changelog for each file
+ */
+ public Map<File, String> getChanglog(List<File> files) {
+ return new HashMap<File, String>();
+ }
+
+ /**
+ * Add and commit file in server repository
+ * @param files list of file to add
+ * @param msg message for commit
+ * @throws fr.ifremer.isisfish.vcs.VCSException
+ */
+ public void add(List<File> files, String msg) throws VCSException {
+ throw new VCSException("Can't add file with dummy VCS");
+ }
+
+ /**
+ * get repository module on server and put it in destDir
+ * @param destDir destination directory
+ * @param module module name
+ * @param b // FIXME
+ * @throws fr.ifremer.isisfish.vcs.VCSException
+ */
+ public void checkout(File destDir, String module, boolean b) throws VCSException {
+ throw new VCSException("Can't checkout with dummy VCS");
+ }
+
+ /**
+ * Delete and commit files in server repository
+ * @param files file to delete
+ * @param msg message for commit
+ * @throws fr.ifremer.isisfish.vcs.VCSException
+ */
+ public void delete(List<File> files, String msg) throws VCSException {
+ // do nothing
+ }
+
+ /**
+ * show diff between local file and repository file
+ * @param file
+ * @return
+ * @throws fr.ifremer.isisfish.vcs.VCSException
+ */
+ public String getDiff(File file) throws VCSException {
+ throw new VCSException("Can't diff with dummy VCS");
+ }
+
+ /**
+ * Return list of all file on directory on remote server
+ * @param directory
+ * @return
+ */
+ public List<String> getFileList(File directory) throws VCSException {
+ List<String> result = new ArrayList<String>();
+ return result;
+ }
+
+ /**
+ * Get connection state.
+ * @return true if server is connectable
+ */
+ public boolean isConnected() {
+ return false;
+ }
+
+ /**
+ * Check if file is available on server
+ * @param file file to check
+ * @return true if file available
+ * @throws fr.ifremer.isisfish.vcs.VCSException
+ */
+ public boolean isOnRemote(File file) throws VCSException {
+ return false;
+ }
+
+ /**
+ * Check if file is uptodate
+ * @param file file to check
+ * @return true if file is in last version
+ * @throws fr.ifremer.isisfish.vcs.VCSException
+ */
+ public boolean isUpToDate(File file) throws VCSException {
+ return true;
+ }
+
+ /**
+ * Update file
+ * @param file file to update
+ * @return true if there are some merging conflict, false otherwize
+ * @throws fr.ifremer.isisfish.vcs.VCSException
+ */
+ public boolean update(File file) throws VCSException {
+ throw new VCSException("Can't update file with dummy VCS");
+ }
+
+ public void switchTag(VersionNumber version) throws VCSException {
+ // do nothing
+ }
+
+ public void switchProtocole(String protocoleType) throws VCSException {
+ // do nothing
+ }
+
+
+}
Added: trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCSSVN.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCSSVN.java (rev 0)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCSSVN.java 2008-08-14 14:55:00 UTC (rev 1298)
@@ -0,0 +1,109 @@
+/* *##%
+ * Copyright (C) 2002-2008 Code Lutin, Benjamin Poussin
+ *
+ * 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ *##%*/
+
+package fr.ifremer.isisfish.vcs;
+
+
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.util.ApplicationConfig;
+import org.codelutin.util.VersionNumber;
+
+/**
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class VCSSVN extends AbstractVCS {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(VCSSVN.class);
+
+ public VCSSVN(ApplicationConfig config) {
+ super(config);
+ }
+
+ public void add(List<File> files, String msg) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void checkout(File destDir, String module, boolean b) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void delete(List<File> files, String msg) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public Map<File, String> getChanglog(List<File> files) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public String getDiff(File file) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public List<String> getFileList(File directory) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public List<File> getUpdatedFile() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public boolean haveUpdate() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public boolean isConnected() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public boolean isOnRemote(File file) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public boolean isTag(VersionNumber version) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public boolean isUpToDate(File file) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public boolean update(File file) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void switchTag(VersionNumber version) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void switchProtocole(String protocoleType) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+
+}
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/package.html
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/package.html 2008-08-13 18:24:19 UTC (rev 1297)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/package.html 2008-08-14 14:55:00 UTC (rev 1298)
@@ -1,4 +1,4 @@
-Try to keep this class agnostic about IsisFish specific objet. This permit
+Try to keep this classes agnostic about IsisFish specific objects. This permit
library creation in near futur.
<h1>Politique d'utilisation du VCS pour les datas</h1>
@@ -29,9 +29,9 @@
<ul>
<li>Sur le trunk en ecriture</li>
<li>Sur le trunk en lecture (anonymous)</li>
- <li>Sur le trunk en lecture (car release obsolete)</li>
+ <li>Sur le trunk en lecture (car release obsolete, sans mise a jour))</li>
<li>Sur un tag car ancienne release</li>
<li>Sur une branch (en developpement)</li>
<li>En lecture (trunk, tag, branch) car reseau indisponible</li>
</ul>
-</p>
\ No newline at end of file
+</p>
1
0
r1297 - branches/isis-fish-3.1.4/src/resources/i18n
by bpoussin@users.labs.libre-entreprise.org Aug. 13, 2008
by bpoussin@users.labs.libre-entreprise.org Aug. 13, 2008
Aug. 13, 2008
Author: bpoussin
Date: 2008-08-13 18:24:19 +0000 (Wed, 13 Aug 2008)
New Revision: 1297
Modified:
branches/isis-fish-3.1.4/src/resources/i18n/isis-fish-en_GB.properties
branches/isis-fish-3.1.4/src/resources/i18n/isis-fish-fr_FR.properties
Log:
Reprise de fichier valide depuis le svn
Modified: branches/isis-fish-3.1.4/src/resources/i18n/isis-fish-en_GB.properties
===================================================================
--- branches/isis-fish-3.1.4/src/resources/i18n/isis-fish-en_GB.properties 2008-08-13 18:15:25 UTC (rev 1296)
+++ branches/isis-fish-3.1.4/src/resources/i18n/isis-fish-en_GB.properties 2008-08-13 18:24:19 UTC (rev 1297)
@@ -1,4 +1,190 @@
-Can''t\ add\ result\ ''{0}''\ at\ date\ {1}=Can''t add result ''{0}'' at date {1}
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="fr ">
+
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title>Labs: Isis-fish: dépôt de sources</title>
+ <link rel="alternate" title="Labs - Project News Highlights RSS" href="/export/rss_sfnews.php" type="application/rss+xml"/>
+ <link rel="alternate" title="Labs - New Projects RSS" href="/export/rss_sfprojects.php" type="application/rss+xml"/>
+
+ <script language="JavaScript" type="text/javascript">
+ <!--
+
+ function admin_window(adminurl) {
+ AdminWin = window.open( adminurl, 'AdminWindow','scrollbars=yes,resizable=yes, toolbar=yes, height=400, width=400, top=2, left=2');
+ AdminWin.focus();
+ }
+ function help_window(helpurl) {
+ HelpWin = window.open( helpurl,'HelpWindow','scrollbars=yes,resizable=yes,toolbar=no,height=400,width=400');
+ }
+ // -->
+ </script>
+
+<style type="text/css">
+ <!--
+ BODY {
+ margin-top: 3;
+ margin-left: 3;
+ margin-right: 3;
+ margin-bottom: 3;
+ background-image: url("/themes/le/images/theme-top-blue.png");
+ }
+ ol,ul,p,body,td,tr,th,form { font-family: verdana,arial,helvetica,sans-serif; font-size:small;
+ color: #333333; }
+
+ h1 { font-size: x-large; font-family: verdana,arial,helvetica,sans-serif; }
+ h2 { font-size: large; font-family: verdana,arial,helvetica,sans-serif; }
+ h3 { font-size: medium; font-family: verdana,arial,helvetica,sans-serif; }
+ h4 { font-size: small; font-family: verdana,arial,helvetica,sans-serif; }
+ h5 { font-size: x-small; font-family: verdana,arial,helvetica,sans-serif; }
+ h6 { font-size: xx-small; font-family: verdana,arial,helvetica,sans-serif; }
+
+ pre,tt { font-family: courier,sans-serif }
+
+ a:link { text-decoration:none; color: #0000be }
+ a:visited { text-decoration:none; color: #0000be }
+ a:active { text-decoration:none }
+ a:hover { text-decoration:underline; color:red }
+
+ .titlebar { color: black; text-decoration: none; font-weight: bold; }
+ a.tablink { color: black; text-decoration: none; font-weight: bold; font-size: x-small; }
+ a.tablink:visited { color: black; text-decoration: none; font-weight: bold; font-size: x-small; }
+ a.tablink:hover { text-decoration: none; color: black; font-weight: bold; font-size: x-small; }
+ a.tabsellink { color: #0000be; text-decoration: none; font-weight: bold; font-size: x-small; }
+ a.tabsellink:visited { color: #0000be; text-decoration: none; font-weight: bold; font-size: x-small; }
+ a.tabsellink:hover { text-decoration: none; color: #0000be; font-weight: bold; font-size: x-small; }
+ -->
+</style>
+<link rel="stylesheet" type="text/css" href="/plugins/scmcvs/cvsweb/css/cvsweb.css" /><link rel="stylesheet" type="text/css" href="/plugins/scmsvn/viewcvs/styles.css" /></head>
+
+<body>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+
+ <tr>
+ <!--<td><a href="/"><img src="http://labs.libre-entreprise.org//themes/le/images/logo.png" border="0" alt="" width="81" height="62" /></a></td>-->
+ <td style="color: #FFFFFF; font-size: large; font-weight: bold;" valign="middle">Labs.libre-entreprise.org</td>
+ <td>
+ <form action="/search/" method="get">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr><td>
+ <div align="center" style="font-size:smaller"><select name="type_of_search"><option value="soft">Logiciel/Groupe</option>
+<option value="people">Personne</option>
+</select></div></td><td> </td><td><input type="text" size="12" name="words" value="" /></td><td> </td><td><input type="submit" name="Search" value="Rechercher" /></td></tr></table></form></td>
+ <td align="right"> <b><a style="color: #FFFFFF" href="/account/login.php">S'identifier</a></b><br />
+ <b><a style="color: #FFFFFF" href="/account/register.php">Nouveau compte</a></b>
+ </td>
+ <td> </td>
+ </tr>
+
+</table>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+
+ <tr>
+ <td> </td>
+ <td colspan="3">
+
+
+
+ <!-- start tabs -->
+
+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
+ <tr>
+ <td valign="top" width="10" background="/themes/le/images/theme-toptab-end-notselected.png"><img src="/themes/le/images/clear.png" height="25" width="10" alt="" /></td><td background="/themes/le/images/theme-toptab-notselected-bg.png" width="20%" align="center"><a class="tablink" href="/">Accueil</a></td>
+ <td colspan="2" valign="top" width="20" background="/themes/le/images/theme-toptab-notselected-notselected.png"><img src="/themes/le/images/clear.png" height="2" width="20" alt="" /></td><td background="/themes/le/images/theme-toptab-notselected-bg.png" width="20%" align="center"><a class="tablink" href="/my/">Ma page</a></td>
+ <td colspan="2" valign="top" width="20" background="/themes/le/images/theme-toptab-notselected-notselected.png"><img src="/themes/le/images/clear.png" height="2" width="20" alt="" /></td><td background="/themes/le/images/theme-toptab-notselected-bg.png" width="20%" align="center"><a class="tablink" href="/softwaremap/">Arbre des projets</a></td>
+ <td colspan="2" valign="top" width="20" background="/themes/le/images/theme-toptab-notselected-notselected.png"><img src="/themes/le/images/clear.png" height="2" width="20" alt="" /></td><td background="/themes/le/images/theme-toptab-notselected-bg.png" width="20%" align="center"><a class="tablink" href="/snippet/">Boite à outils</a></td>
+ <td colspan="2" valign="top" width="20" background="/themes/le/images/theme-toptab-notselected-selected.png"><img src="/themes/le/images/clear.png" height="2" width="20" alt="" /></td><td background="/themes/le/images/theme-toptab-selected-bg.png" width="20%" align="center"><a class="tabsellink" href="/projects/isis-fish/">Isis-fish</a></td>
+ <td valign="top" width="10" background="/themes/le/images/theme-toptab-selected-end.png"><img src="/themes/le/images/clear.png" height="2" width="10" alt="" /></td></tr><tr><td colspan="12" height="1" bgcolor="#909090"><img src="/themes/le/images/clear.png" height="1" width="10" /></td><td colspan="3" height="1" bgcolor="#e0e0e0"><img src="/themes/le/images/clear.png" height="1" width="10" /></td></tr>
+ </table>
+
+ <!-- end tabs -->
+
+ </td>
+ <td> </td>
+ </tr>
+
+ <tr>
+ <td align="left" bgcolor="#E0E0E0" width="9"><img src="/themes/le/images/tabs/topleft.png" height="9" width="9" alt="" /></td>
+ <td bgcolor="#E0E0E0" width="30"><img src="/themes/le/images/clear.png" width="30" height="1" alt="" /></td>
+ <td bgcolor="#E0E0E0"><img src="/themes/le/images/clear.png" width="1" height="1" alt="" /></td>
+ <td bgcolor="#E0E0E0" width="30"><img src="/themes/le/images/clear.png" width="30" height="1" alt="" /></td>
+ <td align="right" bgcolor="#E0E0E0" width="9"><img src="/themes/le/images/tabs/topright.png" height="9" width="9" alt="" /></td>
+ </tr>
+
+ <tr>
+
+ <!-- Outer body row -->
+
+ <td bgcolor="#E0E0E0"><img src="/themes/le/images/clear.png" width="10" height="1" alt="" /></td>
+ <td valign="top" width="99%" bgcolor="#E0E0E0" colspan="3">
+
+ <!-- Inner Tabs / Shell -->
+
+ <table border="0" width="100%" cellspacing="0" cellpadding="0">
+ <tr>
+ <td> </td>
+ <td>
+
+
+ <!-- start tabs -->
+
+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
+ <tr>
+ <td valign="top" width="10" background="/themes/le/images/theme-bottomtab-end-notselected.png"><img src="/themes/le/images/clear.png" height="25" width="10" alt="" /></td><td background="/themes/le/images/theme-bottomtab-notselected-bg.png" width="10%" align="center"><a class="tablink" href="/projects/isis-fish/">En bref</a></td>
+ <td colspan="2" valign="top" width="20" background="/themes/le/images/theme-bottomtab-notselected-notselected.png"><img src="/themes/le/images/clear.png" height="2" width="20" alt="" /></td><td background="/themes/le/images/theme-bottomtab-notselected-bg.png" width="10%" align="center"><a class="tablink" href="/tracker/?group_id=8">Suivi</a></td>
+ <td colspan="2" valign="top" width="20" background="/themes/le/images/theme-bottomtab-notselected-notselected.png"><img src="/themes/le/images/clear.png" height="2" width="20" alt="" /></td><td background="/themes/le/images/theme-bottomtab-notselected-bg.png" width="10%" align="center"><a class="tablink" href="/mail/?group_id=8">Listes</a></td>
+ <td colspan="2" valign="top" width="20" background="/themes/le/images/theme-bottomtab-notselected-notselected.png"><img src="/themes/le/images/clear.png" height="2" width="20" alt="" /></td><td background="/themes/le/images/theme-bottomtab-notselected-bg.png" width="10%" align="center"><a class="tablink" href="/pm/?group_id=8">Tâches</a></td>
+ <td colspan="2" valign="top" width="20" background="/themes/le/images/theme-bottomtab-notselected-notselected.png"><img src="/themes/le/images/clear.png" height="2" width="20" alt="" /></td><td background="/themes/le/images/theme-bottomtab-notselected-bg.png" width="10%" align="center"><a class="tablink" href="/docman/?group_id=8">Documents</a></td>
+ <td colspan="2" valign="top" width="20" background="/themes/le/images/theme-bottomtab-notselected-notselected.png"><img src="/themes/le/images/clear.png" height="2" width="20" alt="" /></td><td background="/themes/le/images/theme-bottomtab-notselected-bg.png" width="10%" align="center"><a class="tablink" href="/survey/?group_id=8">Sondages</a></td>
+ <td colspan="2" valign="top" width="20" background="/themes/le/images/theme-bottomtab-notselected-notselected.png"><img src="/themes/le/images/clear.png" height="2" width="20" alt="" /></td><td background="/themes/le/images/theme-bottomtab-notselected-bg.png" width="10%" align="center"><a class="tablink" href="/news/?group_id=8">Annonces</a></td>
+ <td colspan="2" valign="top" width="20" background="/themes/le/images/theme-bottomtab-notselected-selected.png"><img src="/themes/le/images/clear.png" height="2" width="20" alt="" /></td><td background="/themes/le/images/theme-bottomtab-selected-bg.png" width="10%" align="center"><a class="tabsellink" href="/scm/?group_id=8">Sources</a></td>
+ <td colspan="2" valign="top" width="20" background="/themes/le/images/theme-bottomtab-selected-notselected.png"><img src="/themes/le/images/clear.png" height="2" width="20" alt="" /></td><td background="/themes/le/images/theme-bottomtab-notselected-bg.png" width="10%" align="center"><a class="tablink" href="/frs/?group_id=8">Fichiers</a></td>
+ <td colspan="2" valign="top" width="20" background="/themes/le/images/theme-bottomtab-notselected-notselected.png"><img src="/themes/le/images/clear.png" height="2" width="20" alt="" /></td><td background="/themes/le/images/theme-bottomtab-notselected-bg.png" width="10%" align="center"><a class="tablink" href="/plugins/wiki/index.php?id=8&type=g">Wiki</a></td>
+ <td valign="top" width="10" background="/themes/le/images/theme-bottomtab-notselected-end.png"><img src="/themes/le/images/clear.png" height="2" width="10" alt="" /></td></tr><tr><td colspan="21" height="1" bgcolor="#909090"><img src="/themes/le/images/clear.png" height="1" width="10" /></td><td colspan="3" height="1" bgcolor="white"><img src="/themes/le/images/clear.png" height="1" width="10" /></td><td colspan="6" height="1" bgcolor="#909090"><img src="/themes/le/images/clear.png" height="1" width="10" /></td></tr>
+ </table>
+
+ <!-- end tabs -->
+ </td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td align="left" bgcolor="#ffffff" width="9"><img src="/themes/le/images/tabs/topleft-inner.png" height="9" width="9" alt="" /></td>
+ <td bgcolor="#ffffff"><img src="/themes/le/images/clear.png" width="1" height="1" alt="" /></td>
+ <td align="right" bgcolor="#ffffff" width="9"><img src="/themes/le/images/tabs/topright-inner.png" height="9" width="9" alt="" /></td>
+ </tr>
+
+ <tr>
+ <td bgcolor="#ffffff"><img src="/themes/le/images/clear.png" width="10" height="1" alt="" /></td>
+ <td valign="top" width="99%" bgcolor="white">
+
+ <link href="/plugins/scmsvn/styles.css" rel="stylesheet" TYPE="text/css"><h1>isis-fish: trunk/isis-fish/src/resources/i18n/isis-fish-en_GB.properties</h1>
+
+<div class="vc_summary">
+File: <a href="/plugins/scmsvn/viewcvs.php/?rev=1246&root=isis-fish#dirlist">[isis-fish]</a> / <a href="/plugins/scmsvn/viewcvs.php/trunk/?rev=1246&root=isis-fish#dirlist">trunk</a> / <a href="/plugins/scmsvn/viewcvs.php/trunk/isis-fish/?rev=1246&root=isis-fish#dirlist">isis-fish</a> / <a href="/plugins/scmsvn/viewcvs.php/trunk/isis-fish/src/?rev=1246&root=isis-fish#dirlist">src</a> / <a href="/plugins/scmsvn/viewcvs.php/trunk/isis-fish/src/resources/?rev=1246&root=isis-fish#dirlist">resources</a> / <a href="/plugins/scmsvn/viewcvs.php/trunk/isis-fish/src/resources/i18n/?rev=1246&root=isis-fish#dirlist">i18n</a> / isis-fish-en_GB.properties
+(<a href="/plugins/scmsvn/viewcvs.php/*checkout*/trunk/isis-fish/src/resources/i18n/isis-fish-en_GB.properties?rev=1246&root=isis-fish"><b>download</b></a>)
+
+<br>
+
+Revision: <b>1246</b>,
+<i>Fri Jul 11 19:12:55 2008 UTC</i> (4 weeks, 4 days ago) by <i>tchemit</i>
+
+
+
+
+
+<br>File size: 59512 byte(s)
+
+
+<pre class="vc_log">i18n ? use key</pre>
+
+</div>
+<pre>Can''t\ add\ result\ ''{0}''\ at\ date\ {1}=Can''t add result ''{0}'' at date {1}
Can''t\ evaluate\ simulation\ prescript=Can''t evaluate simulation prescript
Can''t\ get\ result\:\ {0}=Can''t get result\: {0}
Can't\ create\ simulation\ logger=Can't create simulation logger
@@ -176,7 +362,7 @@
isisfish.error.acceptable.population=New value isn't acceptable value for this population
isisfish.error.add.card=Error while adding of result to the map.
isisfish.error.add.file=Can't add file {0}
-isisfish.error.add.logger.simulation\ =isisfish.error.add.logger.simulation
+isisfish.error.add.logger.simulation\ =isisfish.error.add.logger.simulation
isisfish.error.add.result.data=Error while adding result ot data.
isisfish.error.add.result.graph=Error while adding result to graph
isisfish.error.add.tray=Can''t add system tray icon
@@ -232,7 +418,7 @@
isisfish.error.init.remove.button=could not init remove button (button
isisfish.error.instanciate=Can't instanciate {0}
isisfish.error.instanciate.export=Can't instanciate export {0}
-isisfish.error.integer.positif=Your input must be a positif integer (>1)
+isisfish.error.integer.positif=Your input must be a positif integer (>1)
isisfish.error.invalid.category.name=The category's name {0} is not valid.
isisfish.error.invalid.configuration=Configuration is not full, could not launch IsisFish, try again ?
isisfish.error.invalid.configuration.title=Error while loading IsisFish
@@ -263,7 +449,7 @@
isisfish.error.log.foundAppender=\=could not found log appender {0} for category {1}
isisfish.error.matrix.more.2d=Matrice de plus de 2 dimensions\!\!\\nSelectionnez moins d'\u00E9l\u00E9ments ou utilisez l'op\u00E9rateur somme.
isisfish.error.migration.negative=Migration negative
-isisfish.error.no.matrix=No matrix for\:
+isisfish.error.no.matrix=No matrix for\:
isisfish.error.no.null.time.step=Error, the time step should not be null
isisfish.error.no.sector=No sector defined
isisfish.error.no.select.simulation=could not select simulation
@@ -271,7 +457,7 @@
isisfish.error.no.target.species=no target species in {0} for {1}
isisfish.error.not.connected=Error \: not connected
isisfish.error.not.find.status=could not find status for file {0} for reason {1}
-isisfish.error.not.found.class=this class does not
+isisfish.error.not.found.class=this class does not
isisfish.error.not.found.code=could not found codeclass for {0}
isisfish.error.not.found.description=could not found description for {0}
isisfish.error.not.found.field=could not found field {0} doc for {0}
@@ -282,7 +468,7 @@
isisfish.error.not.null.natiral.death=natural mortality null
isisfish.error.not.possible.metier=Pas de m\u00E9tier possible
isisfish.error.not.species.node.population.container=Population container not in Species node
-isisfish.error.not.support.class=this class does not support
+isisfish.error.not.support.class=this class does not support
isisfish.error.number.classes.upper.zero=Error, the number of classes must be upper than 0
isisfish.error.obtain.analyseplan=Can''t obtain description of AnalysePlan
isisfish.error.obtain.doc.export=Can''t obtain @Doc on class export
@@ -512,7 +698,7 @@
isisfish.log.addAppender=add appender [{0}]
isisfish.log.body=Message to add
isisfish.log.closeAppender=closing appender {0} for category {1}
-isisfish.log.mail.failed=Can't send report by mail. Is your mail server up ? (I'm trying to contact the < {0} > smtp server)
+isisfish.log.mail.failed=Can't send report by mail. Is your mail server up ? (I'm trying to contact the < {0} > smtp server)
isisfish.log.mail.send=A report has been sent to {0}
isisfish.log.mail.send.title=Send simulation {0} by email
isisfish.log.mailTo=Destination adress
@@ -543,7 +729,7 @@
isisfish.message.commit.finished=commit finished
isisfish.message.commit.region.canceled=Commit region canceled
isisfish.message.commiting.region=Commiting region {0} ...
-isisfish.message.compilation.time=Compilation time {0}s
+isisfish.message.compilation.time=Compilation time {0}s
isisfish.message.confirm.delete.object=Do you really want delete object {0}
isisfish.message.confirm.remove.region=Do you really want to remove the region {0} ?
isisfish.message.confirm.remove.script=Do you want to remove script ? ''{0}''
@@ -577,10 +763,10 @@
isisfish.message.import.region.zipped=Zipped Region
isisfish.message.import.scripts.file=Import scripts from file {0}
isisfish.message.import.scripts.file.cancelled=Import scripts cancelled
-isisfish.message.import.scripts.file.done=Import scripts done
+isisfish.message.import.scripts.file.done=Import scripts done
isisfish.message.import.scripts.zipped=Zipped Scripts
-isisfish.message.import.xml.v2.file\ =Import xml v2 file
-isisfish.message.import.zip=Import zip file
+isisfish.message.import.xml.v2.file\ =Import xml v2 file
+isisfish.message.import.zip=Import zip file
isisfish.message.load.finished=load finished
isisfish.message.load.map=Try to load map file\: {0} ({1}, {2})
isisfish.message.load.region.canceled=load region canceled
@@ -685,7 +871,7 @@
isisfish.params.toString.number.years=Number of years\: {0}\\n\\n
isisfish.params.toString.plan=Plan\: {0}
isisfish.params.toString.plan.number=Analyse plan sequence number\: {0}\\n\\n
-isisfish.params.toString.populations=Populations\:
+isisfish.params.toString.populations=Populations\:
isisfish.params.toString.rule=Rule\: {0}
isisfish.params.toString.script.logger.level=Level of scripts' logger {0}
isisfish.params.toString.script.presimulation=Script de presimulation
@@ -792,15 +978,15 @@
isisfish.queue.title=Queue
isisfish.result.abundance=Abondance
isisfish.result.add=Add a result
-isisfish.result.begin.simulation=En debut de Simulation\:
+isisfish.result.begin.simulation=En debut de Simulation\:
isisfish.result.capture=Capture
isisfish.result.capture.metier=Capture par metier
isisfish.result.choose.simulation=Choose a Simulation
isisfish.result.datas=Datas
isisfish.result.datasRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.donneeRadioButton
isisfish.result.desktopPane=defaultToolTip-fr.ifremer.resultat.ResultatView.desktopPane
-isisfish.result.dimension\ =Dimension
-isisfish.result.end.simulation=En fin de Simulation\:
+isisfish.result.dimension\ =Dimension
+isisfish.result.end.simulation=En fin de Simulation\:
isisfish.result.export=Export
isisfish.result.export.file=Export text file
isisfish.result.file=File
@@ -960,8 +1146,8 @@
isisfish.strategyMonthInfo.toString={0} {1}
isisfish.timeUnit.day=Day
isisfish.timeUnit.hours=Hours
-isisfish.tray.simulation=<b>Isis-fish<b><p>{0} - {1}/{2}
-isisfish.tray.simulation.no=<b>Isis-fish<b><p><i>No simulation<i>
+isisfish.tray.simulation=<b>Isis-fish<b><p>{0} - {1}/{2}
+isisfish.tray.simulation.no=<b>Isis-fish<b><p><i>No simulation<i>
isisfish.tripType.comments=Comments
isisfish.tripType.duration=Duration
isisfish.tripType.minTime=Minimum time between trips
@@ -975,7 +1161,7 @@
isisfish.vcs.commit.ok=vcs.commit.ok
isisfish.vcs.config.title=Vcs configuration Modifier
isisfish.vcs.configuration.title=VCS server configuration
-isisfish.vcs.migrate.end=Migration done in {0}s.<br/>New database in is located at [{1}]
+isisfish.vcs.migrate.end=Migration done in {0}s.<br/>New database in is located at [{1}]
isisfish.vcs.update=vcs.update
isisfish.vcs.update.cancel=cancel
isisfish.vcs.update.checkAll=checkAll
@@ -1079,3 +1265,57 @@
the\ property\ {0}\ is\ mandatory\ but\ missed.=the property {0} is mandatory but missed.
to\ use\ ssh\ authentication\ mode,\ you\ must\ have\ a\ username.\ {0}.=to use ssh authentication mode, you must have a username. {0}.
to\ use\ ssh\ authentication\ mode,\ you\ must\ have\ an\ existing\ private\ key\ {0}\ \:\ {1}.=to use ssh authentication mode, you must have an existing private key {0} \: {1}.
+</pre>
+
+<hr noshade>
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr>
+<td align="left">
+<address><a href="mailto:webmaster at labs.libre-entreprise.org">CVS/SVN Admin</a></address><br />
+Powered by <a href="http://viewcvs.sourceforge.net/">ViewCVS 1.0-dev</a>
+</td>
+<td align="right">
+<img src="/doc/viewcvs/images/logo.png" alt="(Powered by ViewCVS)" border="0"
+width="128" height="48" /><br />
+<h3><a target="_blank" href="/plugins/scmsvn/viewcvs/help_rootview.html">ViewCVS and CVS/SVN Help</a></h3>
+</td>
+</tr>
+</table>
+<!--
+</body>
+</html>
+-->
+ <!-- end main body row -->
+
+
+ </td>
+ <td width="10" bgcolor="#ffffff"><img src="/themes/le/images/clear.png" width="2" height="1" alt="" /></td>
+ </tr>
+ <tr>
+ <td align="left" bgcolor="#E0E0E0" width="9"><img src="/themes/le/images/tabs/bottomleft-inner.png" height="11" width="11" alt="" /></td>
+ <td bgcolor="#ffffff"><img src="/themes/le/images/clear.png" width="1" height="1" alt="" /></td>
+ <td align="right" bgcolor="#E0E0E0" width="9"><img src="/themes/le/images/tabs/bottomright-inner.png" height="11" width="11" alt="" /></td>
+ </tr>
+ </table>
+
+ <!-- end inner body row -->
+
+ </td>
+ <td width="10" bgcolor="#E0E0E0"><img src="/themes/le/images/clear.png" width="2" height="1" alt="" /></td>
+ </tr>
+ <tr>
+ <td align="left" bgcolor="#E0E0E0" width="9"><img src="/themes/le/images/tabs/bottomleft.png" height="9" width="9" alt="" /></td>
+ <td bgcolor="#E0E0E0" colspan="3"><img src="/themes/le/images/clear.png" width="1" height="1" alt="" /></td>
+ <td align="right" bgcolor="#E0E0E0" width="9"><img src="/themes/le/images/tabs/bottomright.png" height="9" width="9" alt="" /></td>
+ </tr>
+</table>
+
+<!-- PLEASE LEAVE "Powered By GForge" on your site -->
+<br />
+<center>
+<a href="http://gforge.org/"><img src="/images/pow-gforge.png" alt="Powered By GForge Collaborative Development Environment" border="0" /></a>
+</center>
+
+
+</body>
+</html>
Modified: branches/isis-fish-3.1.4/src/resources/i18n/isis-fish-fr_FR.properties
===================================================================
--- branches/isis-fish-3.1.4/src/resources/i18n/isis-fish-fr_FR.properties 2008-08-13 18:15:25 UTC (rev 1296)
+++ branches/isis-fish-3.1.4/src/resources/i18n/isis-fish-fr_FR.properties 2008-08-13 18:24:19 UTC (rev 1297)
@@ -176,7 +176,7 @@
isisfish.error.acceptable.population=New value isn't acceptable value for this population
isisfish.error.add.card=Erreur lors de l'ajout du r\u00E9sultat \u00E0 la carte.
isisfish.error.add.file=Can't add file {0}
-isisfish.error.add.logger.simulation\ =isisfish.error.add.logger.simulation
+isisfish.error.add.logger.simulation\ =isisfish.error.add.logger.simulation
isisfish.error.add.result.data=Erreur lors de l'ajout du r\u00E9sultat au data.
isisfish.error.add.result.graph=Erreur lors de l'ajout du r\u00E9sultat au graph.
isisfish.error.add.tray=Can't add system tray icon
@@ -263,7 +263,7 @@
isisfish.error.log.foundAppender=n''a pas trouve l''appender {0} pour la categorie {1}
isisfish.error.matrix.more.2d=Matrice de plus de 2 dimensions\!\!\\nSelectionnez moins d'\u00E9l\u00E9ments ou utilisez l'op\u00E9rateur somme.
isisfish.error.migration.negative=Migration negative
-isisfish.error.no.matrix=No matrix for\:
+isisfish.error.no.matrix=No matrix for\:
isisfish.error.no.null.time.step=Error, the time step should not be null
isisfish.error.no.sector=il n'y a pas de secteur de d\u00E9finit
isisfish.error.no.select.simulation=could not select simulation
@@ -271,7 +271,7 @@
isisfish.error.no.target.species=no target species in {0} for {1}
isisfish.error.not.connected=Erreur \u00E0 la connexion...
isisfish.error.not.find.status=n''a pas pu trouver le status du fichier {0} pour la raison suivante \: {1}
-isisfish.error.not.found.class=this class does not
+isisfish.error.not.found.class=this class does not
isisfish.error.not.found.code=could not found codeclass for {0}
isisfish.error.not.found.description=could not found description for {0}
isisfish.error.not.found.field=could not found field {0} doc for {0}
@@ -282,9 +282,9 @@
isisfish.error.not.null.natiral.death=mortalite naturelle nulle
isisfish.error.not.possible.metier=Pas de m\u00E9tier possible
isisfish.error.not.species.node.population.container=Population container not in Species node
-isisfish.error.not.support.class=this class does not support
+isisfish.error.not.support.class=this class does not support
isisfish.error.number.classes.upper.zero=Error, the number of classes must be upper than 0
-isisfish.error.obtain.analyseplan=Can''t obtain description of AnalysePlan
+isisfish.error.obtain.analyseplan=Can''t obtain description of AnalysePlan
isisfish.error.obtain.doc.export=Can't obtain @Doc on class Export
isisfish.error.obtain.doc.resultName=Can't obtain @Doc on ResultName
isisfish.error.obtain.doc.rule=Can't obtain description for a Rule class
@@ -485,7 +485,7 @@
isisfish.launch.find.public.key=Clef publique ssh (*.pub) associ\u00E9e \u00E0 la clef priv\u00E9e
isisfish.launch.first=Premier d\u00E9marrage type vcs {0} - version {1}
isisfish.launch.firstname=nom
-isisfish.launch.howto.save.key=Comment enregister sa clef publique ssh aupr\u00E8s du labs
+isisfish.launch.howto.save.key=Comment enregister sa clef publique ssh aupr\u00E8s du labs
isisfish.launch.init.done=init done in {0}.
isisfish.launch.lasstname=pr\u00E9nom
isisfish.launch.save.key=Acc\u00E9der au labs pour enregister votre clef publique ssh
@@ -500,7 +500,7 @@
isisfish.launch.server.ssh.key.generate.error=La clef {0} n''a pas \u00E9t\u00E9 g\u00E9n\u00E9r\u00E9e.
isisfish.launch.server.ssh.key.generate.succes=Votre clef ssh {0} a \u00E9t\u00E9 g\u00E9n\u00E9r\u00E9e,il faut d\u00E9sormais l''enregistrer aupr\u00E8s du serveur lab.
isisfish.launch.server.ssh.key.no.key=Pas de clef ssh connu ou vous n'avez pas s\u00E9lectionn\u00E9 le mode SSH, voulez-vous quand meme continuer ?
-isisfish.launch.server.ssh.key.register=Enregister votre clef publique ssh sur le serveur du labs
+isisfish.launch.server.ssh.key.register=Enregister votre clef publique ssh sur le serveur du labs
isisfish.launch.server.ssh.no.passphrase=pas de passphrase
isisfish.launch.server.ssh.passphrase=passphrase
isisfish.launch.server.ssh.privateKeyFile=clef priv\u00E9e ssh
@@ -543,10 +543,10 @@
isisfish.message.commit.finished=commit termin\u00E9
isisfish.message.commit.region.canceled=Commit de la r\u00E9gion annul\u00E9
isisfish.message.commiting.region=En train de commiter la r\u00E9gion {0} ...
-isisfish.message.compilation.time=Temps de compilation {0}s
+isisfish.message.compilation.time=Temps de compilation {0}s
isisfish.message.confirm.delete.object=Voulez-vous vraiment supprimer l'objet {0}
isisfish.message.confirm.remove.region=Voulez-vous vraiement supprimer la r\u00E9gion {0} ?
-isisfish.message.confirm.remove.script=Voulez-vous vraiment supprimer le script ? ''{0}''
+isisfish.message.confirm.remove.script=Voulez-vous vraiment supprimer le script ? ''{0}''
isisfish.message.copy.finished=Copie termin\u00E9e
isisfish.message.copy.region=Copier la r\u00E9gion vers {0}
isisfish.message.copy.revision=Working copy initialize fine... Revision \: [ {0} - {1} ]
@@ -579,8 +579,8 @@
isisfish.message.import.scripts.file.cancelled=Importation des scripts annul\u00E9
isisfish.message.import.scripts.file.done=Importation des scripts termin\u00E9
isisfish.message.import.scripts.zipped=Zipped Scripts
-isisfish.message.import.xml.v2.file\ =Import xml v2 file
-isisfish.message.import.zip=Import zip file
+isisfish.message.import.xml.v2.file\ =Import xml v2 file
+isisfish.message.import.zip=Import zip file
isisfish.message.load.finished=Chargement termin\u00E9
isisfish.message.load.map=Chargement de la carte \: {0} ({1}, {2})
isisfish.message.load.region.canceled=chargement de r\u00E9gion annul\u00E9
@@ -685,7 +685,7 @@
isisfish.params.toString.number.years=Nombre d'ann\u00E9\u00E9s \: {0}\\n\\n
isisfish.params.toString.plan=Plan\: {0}
isisfish.params.toString.plan.number=Analyse plan sequence number\: {0}\\n\\n
-isisfish.params.toString.populations=Populations\:
+isisfish.params.toString.populations=Populations\:
isisfish.params.toString.rule=Rule\: {0}
isisfish.params.toString.script.logger.level=niveau du logger de scripts {0}
isisfish.params.toString.script.presimulation=Script de presimulation
@@ -792,15 +792,15 @@
isisfish.queue.title=Queue
isisfish.result.abundance=Abondance
isisfish.result.add=Ajouter un r\u00E9sultat\=
-isisfish.result.begin.simulation=En debut de Simulation\:
+isisfish.result.begin.simulation=En debut de Simulation\:
isisfish.result.capture=Capturer
isisfish.result.capture.metier=Capturer par metier
isisfish.result.choose.simulation=Choisir une simulation
isisfish.result.datas=Donn\u00E9es
isisfish.result.datasRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.donneeRadioButton
isisfish.result.desktopPane=defaultToolTip-fr.ifremer.resultat.ResultatView.desktopPane
-isisfish.result.dimension\ =Dimension
-isisfish.result.end.simulation=En fin de Simulation\:
+isisfish.result.dimension\ =Dimension
+isisfish.result.end.simulation=En fin de Simulation\:
isisfish.result.export=Export
isisfish.result.export.file=Exporter text file
isisfish.result.file=Fichier
1
0
r1296 - in branches/isis-fish-3.1.4/src: java/fr/ifremer/isisfish/entities uimodel/fr/ifremer/isisfish/ui/input uimodel/fr/ifremer/isisfish/ui/simulator
by bpoussin@users.labs.libre-entreprise.org Aug. 13, 2008
by bpoussin@users.labs.libre-entreprise.org Aug. 13, 2008
Aug. 13, 2008
Author: bpoussin
Date: 2008-08-13 18:15:25 +0000 (Wed, 13 Aug 2008)
New Revision: 1296
Modified:
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/entities/SetOfVesselsImpl.java
branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/input/PopulationMigration.xgl
branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/input/SetOfVessels.xgl
branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/input/SetOfVessels.xml
branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/input/Strategy.xgl
branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/input/Strategy.xml
branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/simulator/AdvancedParams.xgl
branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/simulator/AdvancedParams.xml
Log:
- ajout des composants graphiques pour l'edition des equations (inactivity, technicalEfficiency)
- ajout de la possibilite de lancer les simulations en batch (sous process)
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/entities/SetOfVesselsImpl.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/entities/SetOfVesselsImpl.java 2008-08-13 13:17:17 UTC (rev 1295)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/entities/SetOfVesselsImpl.java 2008-08-13 18:15:25 UTC (rev 1296)
@@ -84,7 +84,7 @@
EquationDAO dao = IsisFishDAOHelper.getEquationDAO(getTopiaContext());
// create Growth equation
eq = dao.create();
- eq.setCategory("Inactivity");
+ eq.setCategory("TechnicalEfficiency");
eq.setJavaInterface(SoVTechnicalEfficiencyEquation.class);
eq.setLanguage(Language.JAVA);
setTechnicalEfficiencyEquation(eq);
Modified: branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/input/PopulationMigration.xgl
===================================================================
--- branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/input/PopulationMigration.xgl 2008-08-13 13:17:17 UTC (rev 1295)
+++ branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/input/PopulationMigration.xgl 2008-08-13 18:15:25 UTC (rev 1296)
@@ -33,7 +33,7 @@
</tr>
</table>
-<table Zonespacing="5">
+<table cellspacing="5">
<tr>
<td fill="Both" width="100%">buttonPopulationMigrationSave</td>
<td fill="Both" width="100%">buttonPopulationMigrationCancel</td>
Modified: branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/input/SetOfVessels.xgl
===================================================================
--- branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/input/SetOfVessels.xgl 2008-08-13 13:17:17 UTC (rev 1295)
+++ branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/input/SetOfVessels.xgl 2008-08-13 18:15:25 UTC (rev 1296)
@@ -26,11 +26,25 @@
<td class="label">labelSetOfVesselsFixedCosts</td>
<td class="field">fieldSetOfVesselsFixedCosts</td>
</tr>
+
<tr>
- <td class="label" rowspan="3">labelSetOfVesselsComment</td>
- <td class="field" height="20%" rowspan="3">fieldSetOfVesselsComment</td>
+ <td class="label">labelSetOfVesselsTechnicalEfficiency</td>
+ <td class="field">fieldSetOfVesselsTechnicalEfficiency</td>
</tr>
+ <tr>
+ <td class="label">buttonSetOfVesselsTechnicalEfficiencySaveAsModel</td>
+ <td class="field" height="30%" rowspan="3">fieldScriptSetOfVesselsTechnicalEfficiency</td>
+ </tr>
+ <tr>
+ <td class="label">buttonSetOfVesselsTechnicalEfficiencyEquationEditor</td>
+ </tr>
<tr></tr>
+
+
+ <tr>
+ <td class="label" rowspan="2">labelSetOfVesselsComment</td>
+ <td class="field" height="20%" rowspan="2">fieldSetOfVesselsComment</td>
+ </tr>
<tr></tr>
<tr>
Modified: branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/input/SetOfVessels.xml
===================================================================
--- branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/input/SetOfVessels.xml 2008-08-13 13:17:17 UTC (rev 1295)
+++ branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/input/SetOfVessels.xml 2008-08-13 18:15:25 UTC (rev 1296)
@@ -36,6 +36,31 @@
<DocumentEvents onModified="Update($fieldSetOfVesselsFixedCosts/text)"/>
</textfield>
+
+ <label constraints="labelSetOfVesselsTechnicalEfficiency" text="isisfish.setOfVessels.technicalEfficiency"/>
+ <combobox constraints="fieldSetOfVesselsTechnicalEfficiency" id="fieldSetOfVesselsTechnicalEfficiency"
+ origin="$SetOfVessels/technicalEfficiencyEquation" renderer="name" firstNull="true"
+ actionCommand="Update($fieldSetOfVesselsTechnicalEfficiency/selectedItem/content, $fieldScriptSetOfVesselsTechnicalEfficiency/text)">
+ <ComboBoxModel origin='fr.ifremer.isisfish.datastore.FormuleStorage.getFormules($TopiaContext, "TechnicalEfficiency")'/>
+ </combobox>
+
+ <button constraints="buttonSetOfVesselsTechnicalEfficiencySaveAsModel" text="isisfish.common.saveModel"
+ actionCommand='input.Input.saveEquationAsModel($SetOfVessels/technicalEfficiencyEquation);refreshView($fieldSetOfVesselsTechnicalEfficiency)'/>
+
+ <button constraints="buttonSetOfVesselsTechnicalEfficiencyEquationEditor" text="isisfish.common.openEditor"
+ actionCommand='input.Input.openEditor($SetOfVessels/technicalEfficiencyEquation/category,$SetOfVessels/technicalEfficiencyEquation/name,$SetOfVessels/technicalEfficiencyEquation/javaInterface,$SetOfVessels/technicalEfficiencyEquation/content,$fieldScriptSetOfVesselsTechnicalEfficiency)'/>
+
+ <editor constraints="fieldScriptSetOfVesselsTechnicalEfficiency" askIfNotSaved="false"
+ id="fieldScriptSetOfVesselsTechnicalEfficiency"
+ origin="org.codelutin.util.FileUtil.getTempFile($SetOfVessels/technicalEfficiencyEquation/content, '.java')">
+ <DocumentEvents onModified="Update">
+ <UpdateOrigin
+ target="setEquationTechnicalEfficiency($SetOfVessels, $fieldScriptSetOfVesselsTechnicalEfficiency/text)"/>
+ </DocumentEvents>
+ </editor>
+
+
+
<label constraints="labelSetOfVesselsComment" text="isisfish.setOfVessels.comments"/>
<scrollPane constraints="fieldSetOfVesselsComment">
<textarea id="fieldSetOfVesselsComment" origin="$SetOfVessels/comment">
Modified: branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/input/Strategy.xgl
===================================================================
--- branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/input/Strategy.xgl 2008-08-13 13:17:17 UTC (rev 1295)
+++ branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/input/Strategy.xgl 2008-08-13 18:15:25 UTC (rev 1296)
@@ -18,9 +18,18 @@
<td class="label">labelStrategyProportionSetOfVessels</td>
<td class="field">fieldStrategyProportionSetOfVessels</td>
</tr>
+
+ <tr>
+ <td></td>
+ <td class="field">fieldUseEquationInactivity</td>
+ </tr>
+ <tr>
+ <td class="labelTitle" fill="Both" height="100%" width="100%" colspan="2">hideablePanelInactivityEquation</td>
+ </tr>
+
<tr>
- <td class="label" rowspan="3">labelStrategyComment</td>
- <td class="field" height="20%" rowspan="3">fieldStrategyComment</td>
+ <td class="label" rowspan="2">labelStrategyComment</td>
+ <td class="field" height="20%" rowspan="2">fieldStrategyComment</td>
</tr>
<tr></tr>
<tr></tr>
@@ -30,5 +39,26 @@
</tr>
</table>
+ <table>
+ <tr>
+ <td fill="Both" height="100%" width="100%">fieldUseEquation</td>
+ </tr>
+ </table>
+
+ <table cellspacing="2">
+ <tr>
+ <td class="label">labelStrategyInactivity</td>
+ <td class="field">fieldStrategyInactivity</td>
+ </tr>
+ <tr>
+ <td class="label">buttonStrategyInactivitySaveAsModel</td>
+ <td class="field" height="30%" rowspan="3">fieldScriptStrategyInactivity</td>
+ </tr>
+ <tr>
+ <td class="label">buttonStrategyInactivityEquationEditor</td>
+ </tr>
+ <tr></tr>
+ </table>
+
</layout>
Modified: branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/input/Strategy.xml
===================================================================
--- branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/input/Strategy.xml 2008-08-13 13:17:17 UTC (rev 1295)
+++ branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/input/Strategy.xml 2008-08-13 18:15:25 UTC (rev 1296)
@@ -22,6 +22,42 @@
<DocumentEvents onModified="Update($fieldStrategyProportionSetOfVessels/text)"/>
</textfield>
+ <checkbox constraints="fieldUseEquationInactivity" id="fieldUseEquationInactivity"
+ origin="$Strategy/inactivityEquationUsed" text="isisfish.strategy.inactivityEquationUsed">
+ <ItemEvents onStateChanged="Update($fieldUseEquationInactivity/selected, $Strategy/inactivityEquationUsed, refreshView($hideablePanelInactivityEquation))"/>
+ </checkbox>
+
+
+ <panel id="hideablePanelInactivityEquation" constraints="hideablePanelInactivityEquation" layout="XMLGridLayout(fr/ifremer/isisfish/ui/input/Strategy.xgl)">
+
+ <hidablePanel constraints="fieldUseEquation"
+ origin="getInactivityEquationUsed($Strategy)"
+ layout="XMLGridLayout(fr/ifremer/isisfish/ui/input/Strategy.xgl)">
+ <label constraints="labelStrategyInactivity" text="isisfish.strategy.inactivity"/>
+ <combobox constraints="fieldStrategyInactivity" id="fieldStrategyInactivity"
+ origin="$Strategy/inactivityEquation" renderer="name" firstNull="true"
+ actionCommand="Update($fieldStrategyInactivity/selectedItem/content, $fieldScriptStrategyInactivity/text)">
+ <ComboBoxModel origin='fr.ifremer.isisfish.datastore.FormuleStorage.getFormules($TopiaContext, "Inactivity")'/>
+ </combobox>
+
+ <button constraints="buttonStrategyInactivitySaveAsModel" text="isisfish.common.saveModel"
+ actionCommand='input.Input.saveEquationAsModel($Strategy/inactivityEquation);refreshView($fieldStrategyInactivity)'/>
+
+ <button constraints="buttonStrategyInactivityEquationEditor" text="isisfish.common.openEditor"
+ actionCommand='input.Input.openEditor($Strategy/inactivityEquation/category,$Strategy/inactivityEquation/name,$Strategy/inactivityEquation/javaInterface,$Strategy/inactivityEquation/content,$fieldScriptStrategyInactivity)'/>
+
+ <editor constraints="fieldScriptStrategyInactivity" askIfNotSaved="false"
+ id="fieldScriptStrategyInactivity"
+ origin="org.codelutin.util.FileUtil.getTempFile($Strategy/inactivityEquation/content, '.java')">
+ <DocumentEvents onModified="Update">
+ <UpdateOrigin
+ target="setEquationInactivity($Strategy, $fieldScriptStrategyInactivity/text)"/>
+ </DocumentEvents>
+ </editor>
+
+ </hidablePanel>
+ </panel>
+
<label constraints="labelStrategyComment" text="isisfish.strategy.comments"/>
<scrollPane constraints="fieldStrategyComment">
<textarea id="fieldStrategyComment" origin="$Strategy/comment">
Modified: branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/simulator/AdvancedParams.xgl
===================================================================
--- branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/simulator/AdvancedParams.xgl 2008-08-13 13:17:17 UTC (rev 1295)
+++ branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/simulator/AdvancedParams.xgl 2008-08-13 18:15:25 UTC (rev 1296)
@@ -20,7 +20,8 @@
<td width="99%" colspan="3" fill="Horizontal">fieldSimulAdvParamsSimulatorSelect</td>
</tr>
<tr>
- <td fill="Horizontal" colspan="2" width="33%">fieldSimulAdvParamsSimulatorLocal</td>
+ <td fill="Horizontal" width="33%">fieldSimulAdvParamsSimulatorLocal</td>
+ <td fill="Horizontal" width="33%">fieldSimulAdvParamsSimulatorSubProcess</td>
<td fill="Horizontal" width="33%">fieldSimulationStatistique</td>
<td fill="Horizontal" width="33%">fieldSimulationCache</td>
</tr>
Modified: branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/simulator/AdvancedParams.xml
===================================================================
--- branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/simulator/AdvancedParams.xml 2008-08-13 13:17:17 UTC (rev 1295)
+++ branches/isis-fish-3.1.4/src/uimodel/fr/ifremer/isisfish/ui/simulator/AdvancedParams.xml 2008-08-13 18:15:25 UTC (rev 1296)
@@ -33,6 +33,12 @@
origin="$SimulationParameter/local"
actionCommand="Update($fieldSimulAdvParamsSimulatorLocal/selected)"/>
+ <checkbox text="isisfish.advancedParams.subProcessSimulation"
+ constraints="fieldSimulAdvParamsSimulatorSubProcess"
+ id="fieldSimulAdvParamsSimulatorSubProcess"
+ origin="$SimulationParameter/subProcess"
+ actionCommand="Update($fieldSimulAdvParamsSimulatorSubProcess/selected)"/>
+
<!--
|
| Trace/Cache option
1
0
r1295 - in branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish: datastore/migration simulator
by bpoussin@users.labs.libre-entreprise.org Aug. 13, 2008
by bpoussin@users.labs.libre-entreprise.org Aug. 13, 2008
Aug. 13, 2008
Author: bpoussin
Date: 2008-08-13 13:17:17 +0000 (Wed, 13 Aug 2008)
New Revision: 1295
Modified:
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/migration/SwingMigrationCallbackHandler.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationManager.java
Log:
SimulationManager
- utilisation de execute et non submit sur les executors pour forcer l'execution
- lors de la demande du control si on ne le trouve pas dans les simulations actives, recherche dans les simulations ternimees
Migration
- la migration fonctionne
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/migration/SwingMigrationCallbackHandler.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/migration/SwingMigrationCallbackHandler.java 2008-08-12 15:23:29 UTC (rev 1294)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/migration/SwingMigrationCallbackHandler.java 2008-08-13 13:17:17 UTC (rev 1295)
@@ -98,7 +98,7 @@
}
}
- return MigrationChoice.NO_MIGRATION; // force false during test // result;
+ return result;
}
private void migrateTo3_2(Connection conn) throws SQLException {
@@ -112,8 +112,10 @@
"alter table STRATEGY add column INACTIVITYEQUATION VARCHAR(255);",
};
for (String sql : sqls) {
+ log.info("try " + sql);
PreparedStatement sta = conn.prepareStatement(sql);
sta.executeUpdate();
+ log.info("done " + sql);
}
}
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationManager.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationManager.java 2008-08-12 15:23:29 UTC (rev 1294)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationManager.java 2008-08-13 13:17:17 UTC (rev 1295)
@@ -36,8 +36,6 @@
import fr.ifremer.isisfish.datastore.SimulationStorage;
import fr.ifremer.isisfish.types.Date;
import java.beans.PropertyChangeEvent;
-import java.util.logging.Level;
-import java.util.logging.Logger;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import static org.codelutin.i18n.I18nf._;
@@ -67,7 +65,10 @@
static protected SimulationManager instance = null;
- protected boolean autoLaunch = false;
+ // FIXME pouvoir configurer ceci en fichier de config
+ // FIXME ainsi que la mise a false, lors de la simulation de la derniere
+ // (sans doute ajoute un boolean, simulationListAsQueue = true|false)
+ protected boolean autoLaunch = true;
protected ListenerSet<SimulationQueueListener> listeners = new ListenerSet<SimulationQueueListener>();
protected PropertyChangeSupport propertyListeners = new PropertyChangeSupport(this);
@@ -163,6 +164,7 @@
synchronized(this) {
while (!isAutoLaunch()) {
try {
+ log.info("autoLaunch is false waiting queue start");
this.wait();
} catch (InterruptedException eee) {
log.warn("Error during wait autoLaunch flag", eee);
@@ -193,19 +195,22 @@
// on construit le bon type de SimulationItem pour le job
SimulationItem item = null;
if (param.getUseAnalysePlan()) {
+ // c un plan d'analyse, il peut etre independant ou dependant
if (!param.isIndependentPlan()) {
item = new SimulationItemPlan(id, param);
- executor.submit(new SimulationJob(this, item));
+ executor.execute(new SimulationJob(this, item));
} else {
// on met dans la queue local le process de generation de toutes
// les simus
item = new SimulationItemPlanIndependent(id, param);
- localExecutor.submit(
+ localExecutor.execute(
new PrepareIndependentSimulationJob(this, executor, item));
}
} else {
+ // une simulation normal
item = new SimulationItem(id, param);
- executor.submit(new SimulationJob(this, item));
+ log.info("Simulation added to executor: " + executor.isShutdown() + ", " + executor.isTerminated());
+ executor.execute(new SimulationJob(this, item));
}
fireAddEvent(id, item); // must be before thread notification because thread look in map
}
@@ -338,6 +343,10 @@
public SimulationControl getControl(String id) {
SimulationControl result = null;
SimulationItem item = map.get(id);
+ if (item == null) {
+ // try to find it in done simulation
+ item = mapDones.get(id);
+ }
if (item != null) {
result = item.control;
}
@@ -360,6 +369,7 @@
// on ne met jamais dans la queue done les simulations de plan
// sauf si elle echoue
result = false;
+// FIXME a revoir la condition avec showOnly error et showOnly queue (qui ne sert plus)
} else if (!(config.isSimulationShowOnlyError() &&
!(item instanceof SimulationItemPlan) &&
item.getSimulation().getInformation().hasError())) {
@@ -655,7 +665,7 @@
// plus celles en cours d'affichees
while (item.hasNext()) {
try {
- executor.submit(new SimulationJob(simulationManager, item.next()));
+ executor.execute(new SimulationJob(simulationManager, item.next()));
} catch (Exception eee) {
log.error("Can't add simulation: " + item, eee);
}
@@ -689,6 +699,7 @@
}
public void run() {
+ log.info("Start simulation : " + simItem.id);
simulationManager.waitAutoLaunch();
try {
// si l'simItem exist encore (que l'utilisateur ne la pas retire)
1
0
r1294 - in branches/isis-fish-3.1.4/src: java/fr/ifremer/isisfish java/fr/ifremer/isisfish/datastore/migration java/fr/ifremer/isisfish/entities java/fr/ifremer/isisfish/equation java/fr/ifremer/isisfish/simulator java/fr/ifremer/isisfish/ui/simulator xmi
by bpoussin@users.labs.libre-entreprise.org Aug. 12, 2008
by bpoussin@users.labs.libre-entreprise.org Aug. 12, 2008
Aug. 12, 2008
Author: bpoussin
Date: 2008-08-12 15:23:29 +0000 (Tue, 12 Aug 2008)
New Revision: 1294
Added:
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/equation/SoVTechnicalEfficiencyEquation.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/equation/StrategyInactivityEquation.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java
Removed:
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/PopulationMonitorMultiThread.java
Modified:
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/IsisConfig.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/migration/SwingMigrationCallbackHandler.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/entities/SetOfVesselsImpl.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/entities/StrategyImpl.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/entities/StrategyMonthInfoImpl.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationManager.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/ui/simulator/SimulatorListeners.java
branches/isis-fish-3.1.4/src/xmi/isis-fish.zargo
Log:
- Implantation dans le modele des nouvelles equations
- passage de version en 3.2.0
- ajout du code pour upgrader les tables (alter table)
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/IsisConfig.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/IsisConfig.java 2008-08-12 15:23:26 UTC (rev 1293)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/IsisConfig.java 2008-08-12 15:23:29 UTC (rev 1294)
@@ -42,10 +42,9 @@
*/
public class IsisConfig extends IsisAbstractConfigMain {
- protected final static VersionNumber version = new VersionNumber(3, 1, 4);
+ protected final static VersionNumber version = new VersionNumber(3, 2, 0);
protected final static VersionNumber databaseVersion = new VersionNumber(
- 0);
-// FIXME a remettre apres les tests de simu version.getNumber(0), version.getNumber(1));
+ version.getNumber(0), version.getNumber(1));
public static VersionNumber getVersionNumber() {
return version;
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/migration/SwingMigrationCallbackHandler.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/migration/SwingMigrationCallbackHandler.java 2008-08-12 15:23:26 UTC (rev 1293)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/migration/SwingMigrationCallbackHandler.java 2008-08-12 15:23:29 UTC (rev 1294)
@@ -19,6 +19,8 @@
package fr.ifremer.isisfish.datastore.migration;
import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
import javax.swing.JOptionPane;
import org.apache.commons.logging.Log;
@@ -99,19 +101,20 @@
return MigrationChoice.NO_MIGRATION; // force false during test // result;
}
- private void migrateTo3_2(Connection conn) {
+ private void migrateTo3_2(Connection conn) throws SQLException {
log.info("Migrate to version 3.2");
//alteration du schema
// nouvelles equations dans les tables
-
- // creation de valeur par defaut pour les equations
-
-
- // recuperation des valeurs de ???
-
- // creation de l'equation avec ces valeurs
-
- // sauvegarde de l'equation
+
+ String [] sqls = new String[]{
+ "alter table SETOFVESSELS add column TECHNICALEFFICIENCYEQUATION VARCHAR(255);",
+ "alter table STRATEGY add column INACTIVITYEQUATIONUSED BIT default false;",
+ "alter table STRATEGY add column INACTIVITYEQUATION VARCHAR(255);",
+ };
+ for (String sql : sqls) {
+ PreparedStatement sta = conn.prepareStatement(sql);
+ sta.executeUpdate();
+ }
}
}
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/entities/SetOfVesselsImpl.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/entities/SetOfVesselsImpl.java 2008-08-12 15:23:26 UTC (rev 1293)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/entities/SetOfVesselsImpl.java 2008-08-12 15:23:29 UTC (rev 1294)
@@ -1,10 +1,19 @@
package fr.ifremer.isisfish.entities;
+import static org.codelutin.i18n.I18n._;
+
+import fr.ifremer.isisfish.IsisFishDAOHelper;
import java.io.Serializable;
import fr.ifremer.isisfish.IsisFishRuntimeException;
import fr.ifremer.isisfish.datastore.RegionStorage;
import fr.ifremer.isisfish.datastore.StorageException;
+import fr.ifremer.isisfish.equation.Language;
+import fr.ifremer.isisfish.equation.SoVTechnicalEfficiencyEquation;
+import fr.ifremer.isisfish.types.Date;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.topia.TopiaException;
/**
* Implantation des operations pour l'entité SetOfVessels.
@@ -13,6 +22,11 @@
private static final long serialVersionUID = 1L;
+ /**
+ * Logger for this class
+ */
+ private static final Log log = LogFactory.getLog(SetOfVesselsImpl.class);
+
public FisheryRegion getFisheryRegion() {
try {
FisheryRegion result = RegionStorage.getFisheryRegion(getTopiaContext());
@@ -22,6 +36,68 @@
}
}
+ /**
+ * override to change name of equation
+ * @see fr.ifremer.isisfish.entities.SetOfVesselsAbstract#setName(java.lang.String)
+ */
+ @Override
+ public void setName(String value) {
+ super.setName(value);
+ Equation eq = getTechnicalEfficiencyEquation();
+ if (eq != null) {
+ eq.setName(getName());
+ }
+ }
+
+ /**
+ * Compute or return inactivity days
+ * @param length length of group
+ * @param group group
+ * @return age in month
+ */
+ @Override
+ public double getTechnicalEfficiency(Date date, Metier metier) {
+ double result = 0;
+
+ try {
+ Gear gear = metier.getGear();
+ Equation eq = getTechnicalEfficiencyEquation();
+ if (eq != null) {
+ result = eq.evaluate("date", date, "metier", metier, "gear", gear);
+ }
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Error in technical efficiency equation");
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("StackTrace", eee);
+ }
+ }
+ return result;
+ }
+
+ public void setEquationTechnicalEfficiency(String content) {
+ try {
+ Equation eq = getTechnicalEfficiencyEquation();
+
+ if (eq == null) {
+ EquationDAO dao = IsisFishDAOHelper.getEquationDAO(getTopiaContext());
+ // create Growth equation
+ eq = dao.create();
+ eq.setCategory("Inactivity");
+ eq.setJavaInterface(SoVTechnicalEfficiencyEquation.class);
+ eq.setLanguage(Language.JAVA);
+ setTechnicalEfficiencyEquation(eq);
+ }
+
+ eq.setName(getName());
+ eq.setContent(content);
+ eq.update();
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(_("isisfish.change.equation"), eee);
+ }
+ }
+
/* (non-Javadoc)
* @see fr.ifremer.isisfish.entities.FisheryRegionAbstract#toString()
*/
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/entities/StrategyImpl.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/entities/StrategyImpl.java 2008-08-12 15:23:26 UTC (rev 1293)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/entities/StrategyImpl.java 2008-08-12 15:23:29 UTC (rev 1294)
@@ -14,6 +14,8 @@
import fr.ifremer.isisfish.IsisFishRuntimeException;
import fr.ifremer.isisfish.datastore.RegionStorage;
import fr.ifremer.isisfish.datastore.StorageException;
+import fr.ifremer.isisfish.equation.Language;
+import fr.ifremer.isisfish.equation.StrategyInactivityEquation;
import fr.ifremer.isisfish.types.Month;
/**
@@ -34,6 +36,19 @@
throw new IsisFishRuntimeException(eee);
}
}
+
+ /**
+ * override to change name of equation
+ * @see fr.ifremer.isisfish.entities.StrategyAbstract#setName(java.lang.String)
+ */
+ @Override
+ public void setName(String value) {
+ super.setName(value);
+ Equation eq = getInactivityEquation();
+ if (eq != null) {
+ eq.setName(getName());
+ }
+ }
/* (non-Javadoc)
* @see fr.ifremer.isisfish.entities.StrategyAbstract#getStrategyMonthInfo()
@@ -88,6 +103,55 @@
return result;
}
+ /**
+ * Compute or return inactivity days
+ * @param length length of group
+ * @param group group
+ * @return age in month
+ */
+ public double getInactivityDays(Month month) {
+ double result = 0;
+
+ StrategyMonthInfo info = getStrategyMonthInfo(month);
+ if (!getInactivityEquationUsed()) {
+ result = info.getMinInactivityDays();
+ } else {
+ try {
+ Equation eq = getInactivityEquation();
+ result = eq.evaluate("month", month, "info", info);
+ } catch (Exception eee) {
+ if (log.isWarnEnabled()) {
+ log.warn("Error in inactivityDays equation");
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("StackTrace", eee);
+ }
+ }
+ }
+ return result;
+ }
+ public void setEquationInactivity(String content) {
+ try {
+ Equation eq = getInactivityEquation();
+
+ if (eq == null) {
+ EquationDAO dao = IsisFishDAOHelper.getEquationDAO(getTopiaContext());
+ // create Growth equation
+ eq = dao.create();
+ eq.setCategory("Inactivity");
+ eq.setJavaInterface(StrategyInactivityEquation.class);
+ eq.setLanguage(Language.JAVA);
+ setInactivityEquation(eq);
+ }
+
+ eq.setName(getName());
+ eq.setContent(content);
+ eq.update();
+ } catch (TopiaException eee) {
+ throw new IsisFishRuntimeException(_("isisfish.change.equation"), eee);
+ }
+ }
+
/* (non-Javadoc)
* @see fr.ifremer.isisfish.entities.StrategyAbstract#toString()
*/
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/entities/StrategyMonthInfoImpl.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/entities/StrategyMonthInfoImpl.java 2008-08-12 15:23:26 UTC (rev 1293)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/entities/StrategyMonthInfoImpl.java 2008-08-12 15:23:29 UTC (rev 1294)
@@ -152,7 +152,10 @@
public void computeNumberOfTrips() {
TripType tripType = getTripType();
- int inactivity = getMinInactivityDays();
+ // remplace un simple getMinInactivityDays(), pour pouvoir utiliser une
+ // equation si besoin (tout est pret, il ne manque que l'interface
+ // graphique pour saisir l'equation dans strategie
+ double inactivity = getStrategy().getInactivityDays(getMonth());
if(tripType != null && tripType.getTripDuration() != null && inactivity >= 0){
int nbDayMonth = getMonth().getNumbersOfDays();
double result = (int)((nbDayMonth - inactivity) / tripType.getTripDuration().getDay());
Added: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/equation/SoVTechnicalEfficiencyEquation.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/equation/SoVTechnicalEfficiencyEquation.java (rev 0)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/equation/SoVTechnicalEfficiencyEquation.java 2008-08-12 15:23:29 UTC (rev 1294)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2002-2008 Code Lutin, Benjamin Poussin
+ *
+ * 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ */
+
+package fr.ifremer.isisfish.equation;
+
+import fr.ifremer.isisfish.entities.Gear;
+import fr.ifremer.isisfish.entities.Metier;
+import fr.ifremer.isisfish.simulator.SimulationContext;
+import fr.ifremer.isisfish.util.Args;
+
+/**
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public interface SoVTechnicalEfficiencyEquation {
+
+ /**
+ * @param context
+ * @param metier le metier pour lequel on demande le calcul
+ * @param gear l'engin utilise par le metier
+ * @return
+ */
+ @Args({"context", "metier", "gear"})
+ public double compute(SimulationContext context, Metier metier, Gear gear) throws Exception;
+
+}
Added: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/equation/StrategyInactivityEquation.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/equation/StrategyInactivityEquation.java (rev 0)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/equation/StrategyInactivityEquation.java 2008-08-12 15:23:29 UTC (rev 1294)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2002-2008 Code Lutin, Benjamin Poussin
+ *
+ * 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ */
+
+package fr.ifremer.isisfish.equation;
+
+import fr.ifremer.isisfish.entities.StrategyMonthInfo;
+import fr.ifremer.isisfish.simulator.SimulationContext;
+import fr.ifremer.isisfish.types.Month;
+import fr.ifremer.isisfish.util.Args;
+
+/**
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public interface StrategyInactivityEquation {
+
+ /**
+ *
+ * @param context
+ * @param month le mois courant de simulation
+ * @param info l'objet associe a la strategie pour le mois courant
+ * @return
+ */
+ @Args({"context", "month", "info"})
+ public double compute(SimulationContext context, Month month, StrategyMonthInfo info) throws Exception;
+
+}
Deleted: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java 2008-08-12 15:23:26 UTC (rev 1293)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java 2008-08-12 15:23:29 UTC (rev 1294)
@@ -1,372 +0,0 @@
-/* *##%
- * Copyright (C) 2006
- * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
- *
- * 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 2
- * 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *##%*/
-
-/* *
- * PopulationMonitor.java
- *
- * Created: 21 août 2006 15:41:18
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
-package fr.ifremer.isisfish.simulator;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.collections.MapIterator;
-import org.apache.commons.collections.keyvalue.MultiKey;
-import org.apache.commons.collections.map.MultiKeyMap;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.math.matrix.MatrixFactory;
-import org.codelutin.math.matrix.MatrixIterator;
-import org.codelutin.math.matrix.MatrixND;
-
-import fr.ifremer.isisfish.entities.Population;
-import fr.ifremer.isisfish.entities.PopulationGroup;
-import fr.ifremer.isisfish.entities.PopulationSeasonInfo;
-import fr.ifremer.isisfish.entities.Species;
-import fr.ifremer.isisfish.entities.Zone;
-import fr.ifremer.isisfish.types.Date;
-import fr.ifremer.isisfish.types.Month;
-
-
-/**
- * Classe permettant le suivi des populations de la simulation.
- *
- * FIXME: certain calcul sont les memes que ceux implanter dans les scripts
- * a cause du groupe des juveniles qui n'est pas un vrai groupe de population.
- * Il serait bon que ce groupe deviennent un vrai groupe et que ce code specifique
- * puisse etre supprimer.
- *
- *
- * @author poussin
- */
-public class PopulationMonitor {
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(PopulationMonitor.class);
-
- /** current number of fish by Pop */
- protected Map<Population, MatrixND> Ns = new HashMap<Population, MatrixND>();
- /** reproduction key: <date, pop> value:<MatrixND> */
- protected MultiKeyMap reproductions = new MultiKeyMap();
- /** discard key: <date, pop> value:<MatrixND> */
- protected MultiKeyMap discards = new MultiKeyMap();
- /** catch per population, only last catch is remaining */
- protected Map<Population, MatrixND> catchs = new HashMap<Population, MatrixND>();
- /** catch per population, only last catch is remaining */
- protected Map<Population, MatrixND> holdCatchs = new HashMap<Population, MatrixND>();
- protected double totalHoldCatch = 0;
-
- /**
- * Return all population actualy in PopulationMonitor
- * @return new list of Population
- */
- public List<Population> getPopulations() {
- ArrayList<Population> result = new ArrayList<Population>(Ns.keySet());
- return result;
- }
-
- /**
- * Return current biomass for species
- * @param species
- * @return
- */
- public double getBiomass(Species species) {
- double result = 0;
-
- for (Population pop : species.getPopulation()) {
- result += getBiomass(pop);
- }
-
- return result;
- }
-
- /**
- * Return current biomass for population
- * @param pop
- * @return
- */
- public double getBiomass(Population pop) {
- double result = 0;
-
- MatrixND n = getN(pop);
- if (n != null) {
- n = n.sumOverDim(1);
- for (MatrixIterator i=n.iterator(); i.next();){
- Object [] coord = i.getSemanticsCoordinates();
- PopulationGroup group = (PopulationGroup)coord[0];
- result += i.getValue() * group.getMeanWeight();
- }
- }
-
- return result;
- }
-
- /**
- * Return current numbers for population
- * @param pop
- * @return
- */
- public MatrixND getN(Population pop) {
- MatrixND result = Ns.get(pop);
-
- if (result != null) {
- // change semantics with list from argument to ensure that
- // semantics don't used too old context
- result.setSemantics(0, pop.getPopulationGroup());
- result.setSemantics(1, pop.getPopulationZone());
- }
-
- return result;
- }
-
- public void setN(Population pop, MatrixND mat) {
- Ns.put(pop, mat);
- }
-
- /**
- * @return Returns the reproduction.
- */
- public MatrixND getReproduction(Date date, Population pop) {
- return (MatrixND)this.reproductions.get(date, pop);
- }
-
- /**
- * @param reproduction The reproduction to set.
- */
- public void setReproduction(Date date, Population pop, MatrixND repro) {
- this.reproductions.put(date, pop, repro);
- }
-
- /**
- * Applique de la mortalite naturelle aux poissons qui sont pas encore
- * dans les classes de populations. (Reproduction)
- * @param pop
- */
- public void applyReproductionMortality(Population pop) {
- for (MapIterator i=reproductions.mapIterator(); i.hasNext();) {
- i.next();
- MultiKey key = (MultiKey)i.getKey();
- if (pop.equals(key.getKey(1))) {
- MatrixND reproduction = (MatrixND)i.getValue();
- if (log.isTraceEnabled()) {
- log.trace("Matrix repro before mortality: " + reproduction);
- }
- for(MatrixIterator mi=reproduction.iterator(); mi.next();){
- Object[] sems = mi.getSemanticsCoordinates();
- Zone z = (Zone)sems[0];
- double coeff = pop.getNaturalDeathBirth(z);
- if (log.isTraceEnabled()) {
- log.trace("NaturalDeath zone " + z + "=" + coeff);
- }
- mi.setValue(mi.getValue() * Math.exp(-coeff/Month.NUMBER_OF_MONTH));
- }
- if (log.isTraceEnabled()) {
- log.trace("Matrix repro after mortality: " + reproduction);
- }
- }
- }
- }
-
- /**
- * @todo les reproductions qui sont trop veille pour encore servir
- * doivent être supprimées. c-a-d date < currentDate - etalement - gap between repro recru
- * Une autre facon de faire est de supprimer les repro == 0 car normalement
- * toute la repro doit etre utilisé au bout d'un certain temps
- *
- * @param date
- * @param pop
- * @return
- */
- public MatrixND getRecruitment(Date date, Population pop) {
- MatrixND matEtalement = pop.getRecruitmentDistribution();
- int etalement = matEtalement.getDim(0);
-
- MatrixND result = MatrixFactory.getInstance().create(
- new List[]{pop.getPopulationGroup(), pop.getPopulationZone()});
-
- // pour chaque
- for(int e=0; e<etalement; e++){
- // recuperation de la reproduction stucture en zone repro
- Date d = new Date(date.getDate() - e -
- pop.getMonthGapBetweenReproRecrutement());
- MatrixND repro = (MatrixND)reproductions.get(d, pop);
-
- if(repro != null){ // si une repro existe pour le mois
-
- // on fait la correspondance entre les zones repro et
- // recrutement
-
- PopulationGroup classe;
- int indiceClasse = 0;
- // si on a change d'annee le recrutement ne se fait pas en
- // classe 0 mais en classe 1, si on a change 2 fois d'annee
- // le recrutement se fait en age 2, etc.
- classe = pop.getPopulationGroup().get(indiceClasse);
-
- List<Zone> zoneRepros = pop.getReproductionZone();
-
- // on multiplie la repro par le coeff de recrutement
- double coeff = matEtalement.getValue(e);
-
- MatrixND matRepro = repro.copy();
- matRepro = matRepro.mults(coeff);
-
- matRepro.setSemantics(0, zoneRepros);
-
- MatrixND mapping = pop.getMappingZoneReproZoneRecru();
- for(Zone zoneRepro : zoneRepros){
- MatrixND submapping = mapping.getSubMatrix(0, new Object[]{zoneRepro});
- for (MatrixIterator i=submapping.iterator(); i.hasNext();) {
- i.next();
- Object[] sem = i.getSemanticsCoordinates();
- Zone zoneRecru = (Zone)sem[1];
- double c = i.getValue();
- result.setValue(classe, zoneRecru, c*matRepro.getValue(zoneRepro)
- +result.getValue(classe, zoneRecru));
- }
- }
- }
- }
-
- if(pop.getSpecies().getAgeGroupType()){
- // conversion et retour de la matrice en vecteur
- MatrixND N = pop.N2DToN1D(result);
- // on applique les migrations et le changement d'age sur le resultat
- // on suppose que la reproduction est toujours dans une seul saison
- Date dateRepro = new Date(date.getDate() -
- pop.getMonthGapBetweenReproRecrutement());
-
- // recherche les saisons des differents mois entre les deux dates
- List<PopulationSeasonInfo> infos = pop.getPopulationSeasonInfo();
- List<PopulationSeasonInfo> usedSeasons = new ArrayList<PopulationSeasonInfo>();
-
- while (date.after(dateRepro)) {
- dateRepro = dateRepro.next();
- Month month = dateRepro.getMonth();
- for (PopulationSeasonInfo info : infos) {
- if (month.equals(info.getFirstMonth())) {
- usedSeasons.add(info);
- dateRepro = new Date(dateRepro.getDate() + info.getMonths().size() - 1); // -1 because, for have next()
- break;
- }
- }
- }
-
- for(PopulationSeasonInfo info : usedSeasons){
- Month month = info.getFirstMonth();
- MatrixND CA = info.getGroupChangeMatrix(month);
- MatrixND MI = info.getMigrationMatrix(month, result);
- MatrixND tmp0 = N.mult(CA);
- MatrixND tmp2 = tmp0.mult(MI);
- N = tmp2;
- }
- result = pop.split2D(N);
- }
- return result;
- }
-
- /**
- * @param catchPerStrategyMet
- */
- public void holdCatch(Population pop, MatrixND catchPerStrategyMet) {
- catchs.put(pop, catchPerStrategyMet);
-
- MatrixND holdCatch = holdCatchs.get(pop);
- if (holdCatch == null) {
- holdCatch = MatrixFactory.getInstance().create(catchPerStrategyMet);
- holdCatchs.put(pop, holdCatch);
- } else {
- holdCatch.add(catchPerStrategyMet);
- }
-
- // compute total
- for(MatrixIterator i=catchPerStrategyMet.iterator(); i.next();){
- this.totalHoldCatch += i.getValue();
- }
-
- }
-
- /**
- * @param pop
- * @return
- */
- public MatrixND getCatch(Population pop) {
- MatrixND result = catchs.get(pop);
- return result;
- }
-
- /**
- * @param pop
- * @return
- */
- public MatrixND getHoldCatch(Population pop) {
- MatrixND result = holdCatchs.get(pop);
- return result;
- }
-
- /**
- * @param pop
- * @return
- */
- public double getTotalHoldCatch(Population pop) {
- double result = totalHoldCatch;
- return result;
- }
-
- /**
- * raz capture cumulée de toutes les pops
- */
- public void clearCatch() {
- catchs.clear();
- holdCatchs.clear();
- totalHoldCatch = 0;
- }
-
- /**
- * @param date
- * @param pop
- * @return
- */
- public MatrixND getDiscard(Date date, Population pop) {
- MatrixND result = (MatrixND)discards.get(date, pop);
- return result;
- }
-
- public void addDiscard(Date date, Population pop, MatrixND discard) {
- MatrixND tmp = (MatrixND)discards.get(date, pop);
- if (tmp == null) {
- tmp = discard.copy();
- discards.put(date, pop, tmp);
- } else {
- tmp.add(discard);
- }
- }
-}
-
-
Copied: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java (from rev 1292, branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/PopulationMonitorMultiThread.java)
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java (rev 0)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java 2008-08-12 15:23:29 UTC (rev 1294)
@@ -0,0 +1,399 @@
+/* *##%
+ * Copyright (C) 2006
+ * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
+ *
+ * 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+/* *
+ * PopulationMonitor.java
+ *
+ * Created: 21 août 2006 15:41:18
+ *
+ * @author poussin
+ * @version $Revision: 428 $
+ *
+ * Last update: $Date: 2007-10-15 14:56:13 +0200 (lun, 15 oct 2007) $
+ * by : $Author: bpoussin $
+ */
+
+package fr.ifremer.isisfish.simulator;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.math.matrix.MatrixFactory;
+import org.codelutin.math.matrix.MatrixIterator;
+import org.codelutin.math.matrix.MatrixND;
+
+import fr.ifremer.isisfish.entities.Population;
+import fr.ifremer.isisfish.entities.PopulationGroup;
+import fr.ifremer.isisfish.entities.PopulationSeasonInfo;
+import fr.ifremer.isisfish.entities.Species;
+import fr.ifremer.isisfish.entities.Zone;
+import fr.ifremer.isisfish.types.Date;
+import fr.ifremer.isisfish.types.Month;
+import java.util.Collections;
+
+
+/**
+ * Classe permettant le suivi des populations de la simulation.
+ * <p>
+ * Cette classe est normalement multi-thread safe
+ * <p>
+ * FIXME: certain calcul sont les memes que ceux implanter dans les scripts
+ * a cause du groupe des juveniles qui n'est pas un vrai groupe de population.
+ * Il serait bon que ce groupe deviennent un vrai groupe et que ce code specifique
+ * puisse etre supprimer.
+ *
+ *
+ * @author poussin
+ */
+public class PopulationMonitor {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(PopulationMonitor.class);
+
+ /** La liste des pops monitorer par cette instance */
+ protected List<Population> pops = null;
+ /** current number of fish by Pop */
+ protected Map<Population, MatrixND> Ns = new HashMap<Population, MatrixND>();
+ /** reproduction key: <date, pop> value:<MatrixND> */
+ protected Map<Population, Map<Date, MatrixND>> reproductions = new HashMap<Population, Map<Date, MatrixND>>();
+ /** discard key: <date, pop> value:<MatrixND> */
+ protected Map<Population, Map<Date, MatrixND>> discards = new HashMap<Population, Map<Date, MatrixND>>();
+ /** catch per population, only last catch is remaining */
+ protected Map<Population, MatrixND> catchs = new HashMap<Population, MatrixND>();
+ /** catch per population, only last catch is remaining */
+ protected Map<Population, MatrixND> holdCatchs = new HashMap<Population, MatrixND>();
+ protected double totalHoldCatch = 0;
+
+ /**
+ * Initialise le monitor pour l'ensemble de pop passe en parametre.
+ * Normalement cet init est fait dans le thread principale de la simulation
+ * et il n'y a pas de besoin de le synchroniser.
+ *
+ * Cet init permet d'avoir ensuite le maxime de variable en lecture, et donc
+ * de permettre le multithreading de facon legere (pas de synchronise) et
+ * sur (pas de concurent modification exception)
+ *
+ * @param pops
+ */
+ public void init(List<Population> pops) {
+ this.pops = Collections.unmodifiableList(new ArrayList<Population>(pops));
+ for (Population pop : this.pops) {
+ reproductions.put(pop, new HashMap<Date, MatrixND>());
+ discards.put(pop, new HashMap<Date, MatrixND>());
+ }
+ }
+
+ /**
+ * Return all population actualy in PopulationMonitor
+ * @return new list of Population
+ */
+ public List<Population> getPopulations() {
+ return pops;
+ }
+
+ /**
+ * Return current biomass for species
+ * @param species
+ * @return
+ */
+ public double getBiomass(Species species) {
+ double result = 0;
+
+ for (Population pop : species.getPopulation()) {
+ result += getBiomass(pop);
+ }
+
+ return result;
+ }
+
+ /**
+ * Return current biomass for population
+ * @param pop
+ * @return
+ */
+ public double getBiomass(Population pop) {
+ double result = 0;
+
+ MatrixND n = getN(pop);
+ if (n != null) {
+ n = n.sumOverDim(1);
+ for (MatrixIterator i=n.iterator(); i.next();){
+ Object [] coord = i.getSemanticsCoordinates();
+ PopulationGroup group = (PopulationGroup)coord[0];
+ result += i.getValue() * group.getMeanWeight();
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Return current numbers for population
+ * @param pop
+ * @return
+ */
+ public MatrixND getN(Population pop) {
+ MatrixND result = Ns.get(pop);
+
+ if (result != null) {
+ // change semantics with list from argument to ensure that
+ // semantics don't used too old context
+ result.setSemantics(0, pop.getPopulationGroup());
+ result.setSemantics(1, pop.getPopulationZone());
+ }
+
+ return result;
+ }
+
+ public void setN(Population pop, MatrixND mat) {
+ Ns.put(pop, mat);
+ }
+
+ /**
+ * @return Returns the reproduction.
+ */
+ public MatrixND getReproduction(Date date, Population pop) {
+ return this.reproductions.get(pop).get(date);
+ }
+
+ /**
+ * @param reproduction The reproduction to set.
+ */
+ public void setReproduction(Date date, Population pop, MatrixND repro) {
+ reproductions.get(pop).put(date, repro);
+ }
+
+ /**
+ * Applique de la mortalite naturelle aux poissons qui sont pas encore
+ * dans les classes de populations. (Reproduction)
+ * @param pop
+ */
+ public void applyReproductionMortality(Population pop) {
+ for (MatrixND reproduction : reproductions.get(pop).values()) {
+ if (log.isTraceEnabled()) {
+ log.trace("Matrix repro before mortality: " + reproduction);
+ }
+
+ for (MatrixIterator mi = reproduction.iterator(); mi.next();) {
+ Object[] sems = mi.getSemanticsCoordinates();
+ Zone z = (Zone) sems[0];
+ double coeff = pop.getNaturalDeathBirth(z);
+ if (log.isTraceEnabled()) {
+ log.trace("NaturalDeath zone " + z + "=" + coeff);
+ }
+ mi.setValue(mi.getValue() * Math.exp(-coeff / Month.NUMBER_OF_MONTH));
+ }
+ if (log.isTraceEnabled()) {
+ log.trace("Matrix repro after mortality: " + reproduction);
+ }
+ }
+ }
+
+ /**
+ * @todo les reproductions qui sont trop veille pour encore servir
+ * doivent être supprimées. c-a-d date < currentDate - etalement - gap between repro recru
+ * Une autre facon de faire est de supprimer les repro == 0 car normalement
+ * toute la repro doit etre utilisé au bout d'un certain temps
+ *
+ * @param date
+ * @param pop
+ * @return
+ */
+ public MatrixND getRecruitment(Date date, Population pop) {
+ MatrixND matEtalement = pop.getRecruitmentDistribution();
+ int etalement = matEtalement.getDim(0);
+
+ MatrixND result = MatrixFactory.getInstance().create(
+ new List[]{pop.getPopulationGroup(), pop.getPopulationZone()});
+
+ // pour chaque
+ for(int e=0; e<etalement; e++){
+ // recuperation de la reproduction stucture en zone repro
+ Date d = new Date(date.getDate() - e -
+ pop.getMonthGapBetweenReproRecrutement());
+ MatrixND repro = (MatrixND)reproductions.get(pop).get(d);
+
+ if(repro != null){ // si une repro existe pour le mois
+
+ // on fait la correspondance entre les zones repro et
+ // recrutement
+
+ PopulationGroup classe;
+ int indiceClasse = 0;
+ // si on a change d'annee le recrutement ne se fait pas en
+ // classe 0 mais en classe 1, si on a change 2 fois d'annee
+ // le recrutement se fait en age 2, etc.
+ classe = pop.getPopulationGroup().get(indiceClasse);
+
+ List<Zone> zoneRepros = pop.getReproductionZone();
+
+ // on multiplie la repro par le coeff de recrutement
+ double coeff = matEtalement.getValue(e);
+
+ MatrixND matRepro = repro.copy();
+ matRepro = matRepro.mults(coeff);
+
+ matRepro.setSemantics(0, zoneRepros);
+
+ MatrixND mapping = pop.getMappingZoneReproZoneRecru();
+ for(Zone zoneRepro : zoneRepros){
+ MatrixND submapping = mapping.getSubMatrix(0, new Object[]{zoneRepro});
+ for (MatrixIterator i=submapping.iterator(); i.hasNext();) {
+ i.next();
+ Object[] sem = i.getSemanticsCoordinates();
+ Zone zoneRecru = (Zone)sem[1];
+ double c = i.getValue();
+ result.setValue(classe, zoneRecru, c*matRepro.getValue(zoneRepro)
+ +result.getValue(classe, zoneRecru));
+ }
+ }
+ }
+ }
+
+ if(pop.getSpecies().getAgeGroupType()){
+ // conversion et retour de la matrice en vecteur
+ MatrixND N = pop.N2DToN1D(result);
+ // on applique les migrations et le changement d'age sur le resultat
+ // on suppose que la reproduction est toujours dans une seul saison
+ Date dateRepro = new Date(date.getDate() -
+ pop.getMonthGapBetweenReproRecrutement());
+
+ // recherche les saisons des differents mois entre les deux dates
+ List<PopulationSeasonInfo> infos = pop.getPopulationSeasonInfo();
+ List<PopulationSeasonInfo> usedSeasons = new ArrayList<PopulationSeasonInfo>();
+
+ while (date.after(dateRepro)) {
+ dateRepro = dateRepro.next();
+ Month month = dateRepro.getMonth();
+ for (PopulationSeasonInfo info : infos) {
+ if (month.equals(info.getFirstMonth())) {
+ usedSeasons.add(info);
+ dateRepro = new Date(dateRepro.getDate() + info.getMonths().size() - 1); // -1 because, for have next()
+ break;
+ }
+ }
+ }
+
+ for(PopulationSeasonInfo info : usedSeasons){
+ Month month = info.getFirstMonth();
+ MatrixND CA = info.getGroupChangeMatrix(month);
+ MatrixND MI = info.getMigrationMatrix(month, result);
+ MatrixND tmp0 = N.mult(CA);
+ MatrixND tmp2 = tmp0.mult(MI);
+ N = tmp2;
+ }
+ result = pop.split2D(N);
+ }
+ return result;
+ }
+
+ /**
+ * @param catchPerStrategyMet
+ */
+ public void holdCatch(Population pop, MatrixND catchPerStrategyMet) {
+ catchs.put(pop, catchPerStrategyMet);
+
+ MatrixND holdCatch = holdCatchs.get(pop);
+ if (holdCatch == null) {
+ holdCatch = MatrixFactory.getInstance().create(catchPerStrategyMet);
+ holdCatchs.put(pop, holdCatch);
+ } else {
+ holdCatch.add(catchPerStrategyMet);
+ }
+
+ // compute total
+ for(MatrixIterator i=catchPerStrategyMet.iterator(); i.next();){
+ this.totalHoldCatch += i.getValue();
+ }
+
+ }
+
+ /**
+ * @param pop
+ * @return
+ */
+ public MatrixND getCatch(Population pop) {
+ MatrixND result = catchs.get(pop);
+ return result;
+ }
+
+ /**
+ * @param pop
+ * @return
+ */
+ public MatrixND getHoldCatch(Population pop) {
+ MatrixND result = holdCatchs.get(pop);
+ return result;
+ }
+
+ /**
+ * @param pop
+ * @return
+ */
+ public double getTotalHoldCatch(Population pop) {
+ double result = totalHoldCatch;
+ return result;
+ }
+
+ /**
+ * raz capture cumulée de toutes les pops
+ */
+ public void clearCatch() {
+ catchs.clear();
+ holdCatchs.clear();
+ totalHoldCatch = 0;
+ }
+
+ /**
+ * @param date
+ * @param pop
+ * @return
+ */
+ public MatrixND getDiscard(Date date, Population pop) {
+ MatrixND result = discards.get(pop).get(date);
+ return result;
+ }
+
+ /**
+ * FIXME: discards n'est jamais vider, on le conserve pour toutes les annees
+ * il serait bon de faire un peu le menage de temps en temps.
+ *
+ * @param date
+ * @param pop
+ * @param discard
+ */
+ public void addDiscard(Date date, Population pop, MatrixND discard) {
+ Map<Date, MatrixND> oneDiscard = discards.get(pop);
+ synchronized(oneDiscard) {
+ MatrixND tmp = oneDiscard.get(date);
+ if (tmp == null) {
+ tmp = discard.copy();
+ discards.get(pop).put(date, tmp);
+ } else {
+ tmp.add(discard);
+ }
+ }
+ }
+}
+
+
Deleted: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/PopulationMonitorMultiThread.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/PopulationMonitorMultiThread.java 2008-08-12 15:23:26 UTC (rev 1293)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/PopulationMonitorMultiThread.java 2008-08-12 15:23:29 UTC (rev 1294)
@@ -1,399 +0,0 @@
-/* *##%
- * Copyright (C) 2006
- * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
- *
- * 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 2
- * 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *##%*/
-
-/* *
- * PopulationMonitor.java
- *
- * Created: 21 août 2006 15:41:18
- *
- * @author poussin
- * @version $Revision: 428 $
- *
- * Last update: $Date: 2007-10-15 14:56:13 +0200 (lun, 15 oct 2007) $
- * by : $Author: bpoussin $
- */
-
-package fr.ifremer.isisfish.simulator;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.codelutin.math.matrix.MatrixFactory;
-import org.codelutin.math.matrix.MatrixIterator;
-import org.codelutin.math.matrix.MatrixND;
-
-import fr.ifremer.isisfish.entities.Population;
-import fr.ifremer.isisfish.entities.PopulationGroup;
-import fr.ifremer.isisfish.entities.PopulationSeasonInfo;
-import fr.ifremer.isisfish.entities.Species;
-import fr.ifremer.isisfish.entities.Zone;
-import fr.ifremer.isisfish.types.Date;
-import fr.ifremer.isisfish.types.Month;
-import java.util.Collections;
-
-
-/**
- * Classe permettant le suivi des populations de la simulation.
- * <p>
- * Cette classe est normalement multi-thread safe
- * <p>
- * FIXME: certain calcul sont les memes que ceux implanter dans les scripts
- * a cause du groupe des juveniles qui n'est pas un vrai groupe de population.
- * Il serait bon que ce groupe deviennent un vrai groupe et que ce code specifique
- * puisse etre supprimer.
- *
- *
- * @author poussin
- */
-public class PopulationMonitorMultiThread {
-
- /** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(PopulationMonitorMultiThread.class);
-
- /** La liste des pops monitorer par cette instance */
- protected List<Population> pops = null;
- /** current number of fish by Pop */
- protected Map<Population, MatrixND> Ns = new HashMap<Population, MatrixND>();
- /** reproduction key: <date, pop> value:<MatrixND> */
- protected Map<Population, Map<Date, MatrixND>> reproductions = new HashMap<Population, Map<Date, MatrixND>>();
- /** discard key: <date, pop> value:<MatrixND> */
- protected Map<Population, Map<Date, MatrixND>> discards = new HashMap<Population, Map<Date, MatrixND>>();
- /** catch per population, only last catch is remaining */
- protected Map<Population, MatrixND> catchs = new HashMap<Population, MatrixND>();
- /** catch per population, only last catch is remaining */
- protected Map<Population, MatrixND> holdCatchs = new HashMap<Population, MatrixND>();
- protected double totalHoldCatch = 0;
-
- /**
- * Initialise le monitor pour l'ensemble de pop passe en parametre.
- * Normalement cet init est fait dans le thread principale de la simulation
- * et il n'y a pas de besoin de le synchroniser.
- *
- * Cet init permet d'avoir ensuite le maxime de variable en lecture, et donc
- * de permettre le multithreading de facon legere (pas de synchronise) et
- * sur (pas de concurent modification exception)
- *
- * @param pops
- */
- public void init(List<Population> pops) {
- this.pops = Collections.unmodifiableList(new ArrayList<Population>(pops));
- for (Population pop : this.pops) {
- reproductions.put(pop, new HashMap<Date, MatrixND>());
- discards.put(pop, new HashMap<Date, MatrixND>());
- }
- }
-
- /**
- * Return all population actualy in PopulationMonitor
- * @return new list of Population
- */
- public List<Population> getPopulations() {
- return pops;
- }
-
- /**
- * Return current biomass for species
- * @param species
- * @return
- */
- public double getBiomass(Species species) {
- double result = 0;
-
- for (Population pop : species.getPopulation()) {
- result += getBiomass(pop);
- }
-
- return result;
- }
-
- /**
- * Return current biomass for population
- * @param pop
- * @return
- */
- public double getBiomass(Population pop) {
- double result = 0;
-
- MatrixND n = getN(pop);
- if (n != null) {
- n = n.sumOverDim(1);
- for (MatrixIterator i=n.iterator(); i.next();){
- Object [] coord = i.getSemanticsCoordinates();
- PopulationGroup group = (PopulationGroup)coord[0];
- result += i.getValue() * group.getMeanWeight();
- }
- }
-
- return result;
- }
-
- /**
- * Return current numbers for population
- * @param pop
- * @return
- */
- public MatrixND getN(Population pop) {
- MatrixND result = Ns.get(pop);
-
- if (result != null) {
- // change semantics with list from argument to ensure that
- // semantics don't used too old context
- result.setSemantics(0, pop.getPopulationGroup());
- result.setSemantics(1, pop.getPopulationZone());
- }
-
- return result;
- }
-
- public void setN(Population pop, MatrixND mat) {
- Ns.put(pop, mat);
- }
-
- /**
- * @return Returns the reproduction.
- */
- public MatrixND getReproduction(Date date, Population pop) {
- return this.reproductions.get(pop).get(date);
- }
-
- /**
- * @param reproduction The reproduction to set.
- */
- public void setReproduction(Date date, Population pop, MatrixND repro) {
- reproductions.get(pop).put(date, repro);
- }
-
- /**
- * Applique de la mortalite naturelle aux poissons qui sont pas encore
- * dans les classes de populations. (Reproduction)
- * @param pop
- */
- public void applyReproductionMortality(Population pop) {
- for (MatrixND reproduction : reproductions.get(pop).values()) {
- if (log.isTraceEnabled()) {
- log.trace("Matrix repro before mortality: " + reproduction);
- }
-
- for (MatrixIterator mi = reproduction.iterator(); mi.next();) {
- Object[] sems = mi.getSemanticsCoordinates();
- Zone z = (Zone) sems[0];
- double coeff = pop.getNaturalDeathBirth(z);
- if (log.isTraceEnabled()) {
- log.trace("NaturalDeath zone " + z + "=" + coeff);
- }
- mi.setValue(mi.getValue() * Math.exp(-coeff / Month.NUMBER_OF_MONTH));
- }
- if (log.isTraceEnabled()) {
- log.trace("Matrix repro after mortality: " + reproduction);
- }
- }
- }
-
- /**
- * @todo les reproductions qui sont trop veille pour encore servir
- * doivent être supprimées. c-a-d date < currentDate - etalement - gap between repro recru
- * Une autre facon de faire est de supprimer les repro == 0 car normalement
- * toute la repro doit etre utilisé au bout d'un certain temps
- *
- * @param date
- * @param pop
- * @return
- */
- public MatrixND getRecruitment(Date date, Population pop) {
- MatrixND matEtalement = pop.getRecruitmentDistribution();
- int etalement = matEtalement.getDim(0);
-
- MatrixND result = MatrixFactory.getInstance().create(
- new List[]{pop.getPopulationGroup(), pop.getPopulationZone()});
-
- // pour chaque
- for(int e=0; e<etalement; e++){
- // recuperation de la reproduction stucture en zone repro
- Date d = new Date(date.getDate() - e -
- pop.getMonthGapBetweenReproRecrutement());
- MatrixND repro = (MatrixND)reproductions.get(pop).get(d);
-
- if(repro != null){ // si une repro existe pour le mois
-
- // on fait la correspondance entre les zones repro et
- // recrutement
-
- PopulationGroup classe;
- int indiceClasse = 0;
- // si on a change d'annee le recrutement ne se fait pas en
- // classe 0 mais en classe 1, si on a change 2 fois d'annee
- // le recrutement se fait en age 2, etc.
- classe = pop.getPopulationGroup().get(indiceClasse);
-
- List<Zone> zoneRepros = pop.getReproductionZone();
-
- // on multiplie la repro par le coeff de recrutement
- double coeff = matEtalement.getValue(e);
-
- MatrixND matRepro = repro.copy();
- matRepro = matRepro.mults(coeff);
-
- matRepro.setSemantics(0, zoneRepros);
-
- MatrixND mapping = pop.getMappingZoneReproZoneRecru();
- for(Zone zoneRepro : zoneRepros){
- MatrixND submapping = mapping.getSubMatrix(0, new Object[]{zoneRepro});
- for (MatrixIterator i=submapping.iterator(); i.hasNext();) {
- i.next();
- Object[] sem = i.getSemanticsCoordinates();
- Zone zoneRecru = (Zone)sem[1];
- double c = i.getValue();
- result.setValue(classe, zoneRecru, c*matRepro.getValue(zoneRepro)
- +result.getValue(classe, zoneRecru));
- }
- }
- }
- }
-
- if(pop.getSpecies().getAgeGroupType()){
- // conversion et retour de la matrice en vecteur
- MatrixND N = pop.N2DToN1D(result);
- // on applique les migrations et le changement d'age sur le resultat
- // on suppose que la reproduction est toujours dans une seul saison
- Date dateRepro = new Date(date.getDate() -
- pop.getMonthGapBetweenReproRecrutement());
-
- // recherche les saisons des differents mois entre les deux dates
- List<PopulationSeasonInfo> infos = pop.getPopulationSeasonInfo();
- List<PopulationSeasonInfo> usedSeasons = new ArrayList<PopulationSeasonInfo>();
-
- while (date.after(dateRepro)) {
- dateRepro = dateRepro.next();
- Month month = dateRepro.getMonth();
- for (PopulationSeasonInfo info : infos) {
- if (month.equals(info.getFirstMonth())) {
- usedSeasons.add(info);
- dateRepro = new Date(dateRepro.getDate() + info.getMonths().size() - 1); // -1 because, for have next()
- break;
- }
- }
- }
-
- for(PopulationSeasonInfo info : usedSeasons){
- Month month = info.getFirstMonth();
- MatrixND CA = info.getGroupChangeMatrix(month);
- MatrixND MI = info.getMigrationMatrix(month, result);
- MatrixND tmp0 = N.mult(CA);
- MatrixND tmp2 = tmp0.mult(MI);
- N = tmp2;
- }
- result = pop.split2D(N);
- }
- return result;
- }
-
- /**
- * @param catchPerStrategyMet
- */
- public void holdCatch(Population pop, MatrixND catchPerStrategyMet) {
- catchs.put(pop, catchPerStrategyMet);
-
- MatrixND holdCatch = holdCatchs.get(pop);
- if (holdCatch == null) {
- holdCatch = MatrixFactory.getInstance().create(catchPerStrategyMet);
- holdCatchs.put(pop, holdCatch);
- } else {
- holdCatch.add(catchPerStrategyMet);
- }
-
- // compute total
- for(MatrixIterator i=catchPerStrategyMet.iterator(); i.next();){
- this.totalHoldCatch += i.getValue();
- }
-
- }
-
- /**
- * @param pop
- * @return
- */
- public MatrixND getCatch(Population pop) {
- MatrixND result = catchs.get(pop);
- return result;
- }
-
- /**
- * @param pop
- * @return
- */
- public MatrixND getHoldCatch(Population pop) {
- MatrixND result = holdCatchs.get(pop);
- return result;
- }
-
- /**
- * @param pop
- * @return
- */
- public double getTotalHoldCatch(Population pop) {
- double result = totalHoldCatch;
- return result;
- }
-
- /**
- * raz capture cumulée de toutes les pops
- */
- public void clearCatch() {
- catchs.clear();
- holdCatchs.clear();
- totalHoldCatch = 0;
- }
-
- /**
- * @param date
- * @param pop
- * @return
- */
- public MatrixND getDiscard(Date date, Population pop) {
- MatrixND result = discards.get(pop).get(date);
- return result;
- }
-
- /**
- * FIXME: discards n'est jamais vider, on le conserve pour toutes les annees
- * il serait bon de faire un peu le menage de temps en temps.
- *
- * @param date
- * @param pop
- * @param discard
- */
- public void addDiscard(Date date, Population pop, MatrixND discard) {
- Map<Date, MatrixND> oneDiscard = discards.get(pop);
- synchronized(oneDiscard) {
- MatrixND tmp = oneDiscard.get(date);
- if (tmp == null) {
- tmp = discard.copy();
- discards.get(pop).put(date, tmp);
- } else {
- tmp.add(discard);
- }
- }
- }
-}
-
-
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationManager.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationManager.java 2008-08-12 15:23:26 UTC (rev 1293)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationManager.java 2008-08-12 15:23:29 UTC (rev 1294)
@@ -67,7 +67,7 @@
static protected SimulationManager instance = null;
-// protected boolean autoLaunch = false;
+ protected boolean autoLaunch = false;
protected ListenerSet<SimulationQueueListener> listeners = new ListenerSet<SimulationQueueListener>();
protected PropertyChangeSupport propertyListeners = new PropertyChangeSupport(this);
@@ -122,12 +122,12 @@
}
-// /**
-// * @return Returns the autoLaunch.
-// */
-// public boolean isAutoLaunch() {
-// return this.autoLaunch;
-// }
+ /**
+ * @return Returns the autoLaunch.
+ */
+ public boolean isAutoLaunch() {
+ return this.autoLaunch;
+ }
public void addPropertyChangeListener(PropertyChangeListener listener) {
propertyListeners.addPropertyChangeListener(listener);
@@ -145,15 +145,32 @@
propertyListeners.removePropertyChangeListener(propertyName, listener);
}
-// /**
-// * @param autoLaunch The autoLaunch to set.
-// */
-// public void setAutoLaunch(boolean autoLaunch) {
-// boolean oldValue = this.autoLaunch;
-// this.autoLaunch = autoLaunch;
-// propertyListeners.firePropertyChange("autoLaunch", oldValue, autoLaunch);
-// }
+ /**
+ * @param autoLaunch The autoLaunch to set.
+ */
+ public void setAutoLaunch(boolean autoLaunch) {
+ synchronized (this) {
+ boolean oldValue = this.autoLaunch;
+ this.autoLaunch = autoLaunch;
+ if (this.autoLaunch) {
+ this.notifyAll();
+ }
+ propertyListeners.firePropertyChange("autoLaunch", oldValue, autoLaunch);
+ }
+ }
+ public void waitAutoLaunch() {
+ synchronized(this) {
+ while (!isAutoLaunch()) {
+ try {
+ this.wait();
+ } catch (InterruptedException eee) {
+ log.warn("Error during wait autoLaunch flag", eee);
+ }
+ }
+ }
+ }
+
/**
* Cree l'objet de gestion de la simulation en interne et le place dans la
* bonne queue de simulation (local/remote). Appel le
@@ -632,6 +649,7 @@
}
public void run() {
+ simulationManager.waitAutoLaunch();
// l'item est independant, on ajoute toutes ces simulations en plus
// mais pas dans la map pour qu'il n'y ait bien que l'initiale
// plus celles en cours d'affichees
@@ -671,6 +689,7 @@
}
public void run() {
+ simulationManager.waitAutoLaunch();
try {
// si l'simItem exist encore (que l'utilisateur ne la pas retire)
while (simulationManager.exists(simItem.getPlanIdOrId()) &&
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/ui/simulator/SimulatorListeners.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/ui/simulator/SimulatorListeners.java 2008-08-12 15:23:26 UTC (rev 1293)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/ui/simulator/SimulatorListeners.java 2008-08-12 15:23:29 UTC (rev 1294)
@@ -115,10 +115,8 @@
* <code>false</code> otherwise
*/
public static boolean isSimulStartButtonEnabled(JTable table) {
- return false;
- // L'auto launche a disparu maintenant
-// return !SimulationManager.getInstance().isAutoLaunch() &&
-// (table.getRowCount() > 0);
+ return !SimulationManager.getInstance().isAutoLaunch() &&
+ (table.getRowCount() > 0);
}
/**
Modified: branches/isis-fish-3.1.4/src/xmi/isis-fish.zargo
===================================================================
(Binary files differ)
1
0
r1293 - branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/entities
by bpoussin@users.labs.libre-entreprise.org Aug. 12, 2008
by bpoussin@users.labs.libre-entreprise.org Aug. 12, 2008
Aug. 12, 2008
Author: bpoussin
Date: 2008-08-12 15:23:26 +0000 (Tue, 12 Aug 2008)
New Revision: 1293
Removed:
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/entities/migration/
Log:
- Implantation dans le modele des nouvelles equations
- passage de version en 3.2.0
- ajout du code pour upgrader les tables (alter table)
1
0
r1292 - in branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish: . datastore logging simulator versionning
by bpoussin@users.labs.libre-entreprise.org Aug. 11, 2008
by bpoussin@users.labs.libre-entreprise.org Aug. 11, 2008
Aug. 11, 2008
Author: bpoussin
Date: 2008-08-11 14:36:27 +0000 (Mon, 11 Aug 2008)
New Revision: 1292
Added:
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/PopulationMonitorMultiThread.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/versionning/DummyVCSHandler.java
Modified:
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/IsisConfig.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/IsisContext.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/IsisFish.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/CodeSourceStorage.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/VersionStorage.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/logging/SimulationLoggerUtil.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationHelper.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationManager.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationQueueModel.java
Log:
debut de debbugage de la refonte du lanceur de simulation.
- SimulationLogUtil ne semble pas multi-thread support (plusieurs simulation simultanement)
- ajout d'un DummyVCSHandler si le reseau est unreacheable
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/IsisConfig.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/IsisConfig.java 2008-08-07 19:38:45 UTC (rev 1291)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/IsisConfig.java 2008-08-11 14:36:27 UTC (rev 1292)
@@ -44,16 +44,22 @@
protected final static VersionNumber version = new VersionNumber(3, 1, 4);
protected final static VersionNumber databaseVersion = new VersionNumber(
- version.getNumber(0), version.getNumber(1));
+ 0);
+// FIXME a remettre apres les tests de simu version.getNumber(0), version.getNumber(1));
+ public static VersionNumber getVersionNumber() {
+ return version;
+ }
+
static public String getVERSION() {
- String result = getVersion().toString();
+ String result = version.toString();
return result;
}
- static public VersionNumber getVersion() {
- return version;
- }
+// @Override
+// public VersionNumber getVersion() {
+// return version;
+// }
public static VersionNumber getDatabaseVersion() {
return databaseVersion;
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/IsisContext.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/IsisContext.java 2008-08-07 19:38:45 UTC (rev 1291)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/IsisContext.java 2008-08-11 14:36:27 UTC (rev 1292)
@@ -21,6 +21,7 @@
import fr.ifremer.isisfish.commandline.IsisAbstractContext;
import fr.ifremer.isisfish.commandline.IsisOptionParser;
import fr.ifremer.isisfish.datastore.IsisH2Config;
+import fr.ifremer.isisfish.versionning.DummyVCSHandler;
import fr.ifremer.isisfish.versionning.IsisVcsConfig;
import org.codelutin.i18n.I18n;
import org.codelutin.option.OptionKey;
@@ -209,6 +210,10 @@
}
public VCSHandler getVCSHanler() {
+ if (handler == null) {
+ // handler not initializer, we used dummy handler
+ handler = new DummyVCSHandler();
+ }
return handler;
}
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/IsisFish.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/IsisFish.java 2008-08-07 19:38:45 UTC (rev 1291)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/IsisFish.java 2008-08-11 14:36:27 UTC (rev 1292)
@@ -105,7 +105,7 @@
StringBuilder builder = new StringBuilder();
builder.append(java.text.SimpleDateFormat.getInstance().format(new java.util.Date()));
builder.append(" Java version: ").append(System.getProperty("java.runtime.version"));
- builder.append(" Isis-fish version: ").append(IsisConfig.VERSION_PROPERTY_KEY.getDefaultValue().toString());
+ builder.append(" Isis-fish version: ").append(IsisConfig.getVERSION());
log.info(builder.toString());
log.debug(_("isisfish.launch.debugMode"));
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/CodeSourceStorage.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/CodeSourceStorage.java 2008-08-07 19:38:45 UTC (rev 1291)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/CodeSourceStorage.java 2008-08-11 14:36:27 UTC (rev 1292)
@@ -75,7 +75,7 @@
* @param directory le repertoire ou devrait se trouver la classe. Ce
* répertoire doit etre un sous répertoire de rootSrc
* @param name le nom de la classe
- * @param suffix TODO
+ * @param suffix l'extension des fichiers
*/
protected CodeSourceStorage(File rootSrc, File directory, String name, String suffix) {
// if name end with suffix we don't add suffix to filename
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/VersionStorage.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/VersionStorage.java 2008-08-07 19:38:45 UTC (rev 1291)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/VersionStorage.java 2008-08-11 14:36:27 UTC (rev 1292)
@@ -42,6 +42,7 @@
import org.apache.commons.logging.LogFactory;
import java.io.File;
+import java.io.FilenameFilter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -260,10 +261,15 @@
static public List<String> getStorageNames(File directory) {
List<String> result = new ArrayList<String>();
- if (directory.exists()) {
- Collections.addAll(result, directory.list(getVCSHanler().getVersionnableFilenameFilter()));
+ try {
+ if (directory.exists()) {
+ FilenameFilter filter = getVCSHanler().getVersionnableFilenameFilter();
+ String[] list = directory.list(filter);
+ Collections.addAll(result, list);
+ }
+ } catch (Exception eee) {
+ log.error("Can't get list file for " + directory, eee);
}
-
Collections.sort(result);
return result;
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/logging/SimulationLoggerUtil.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/logging/SimulationLoggerUtil.java 2008-08-07 19:38:45 UTC (rev 1291)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/logging/SimulationLoggerUtil.java 2008-08-11 14:36:27 UTC (rev 1292)
@@ -39,6 +39,10 @@
import java.util.Map;
/**
+ * FIXME poussin, a priori cette classe ne supporte pas plusieurs simulation
+ * en meme temps, ce qui est le cas si on a plusieurs processeurs de dispo :(
+ *
+ *
* Usefull class for dealing with hot configuration of log4J. this is temporary
* we must find a way to abstract this layer.
* <p/>
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java 2008-08-07 19:38:45 UTC (rev 1291)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java 2008-08-11 14:36:27 UTC (rev 1292)
@@ -55,6 +55,13 @@
/**
+ * Classe permettant le suivi des populations de la simulation.
+ *
+ * FIXME: certain calcul sont les memes que ceux implanter dans les scripts
+ * a cause du groupe des juveniles qui n'est pas un vrai groupe de population.
+ * Il serait bon que ce groupe deviennent un vrai groupe et que ce code specifique
+ * puisse etre supprimer.
+ *
*
* @author poussin
*/
Added: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/PopulationMonitorMultiThread.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/PopulationMonitorMultiThread.java (rev 0)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/PopulationMonitorMultiThread.java 2008-08-11 14:36:27 UTC (rev 1292)
@@ -0,0 +1,399 @@
+/* *##%
+ * Copyright (C) 2006
+ * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
+ *
+ * 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+/* *
+ * PopulationMonitor.java
+ *
+ * Created: 21 août 2006 15:41:18
+ *
+ * @author poussin
+ * @version $Revision: 428 $
+ *
+ * Last update: $Date: 2007-10-15 14:56:13 +0200 (lun, 15 oct 2007) $
+ * by : $Author: bpoussin $
+ */
+
+package fr.ifremer.isisfish.simulator;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.math.matrix.MatrixFactory;
+import org.codelutin.math.matrix.MatrixIterator;
+import org.codelutin.math.matrix.MatrixND;
+
+import fr.ifremer.isisfish.entities.Population;
+import fr.ifremer.isisfish.entities.PopulationGroup;
+import fr.ifremer.isisfish.entities.PopulationSeasonInfo;
+import fr.ifremer.isisfish.entities.Species;
+import fr.ifremer.isisfish.entities.Zone;
+import fr.ifremer.isisfish.types.Date;
+import fr.ifremer.isisfish.types.Month;
+import java.util.Collections;
+
+
+/**
+ * Classe permettant le suivi des populations de la simulation.
+ * <p>
+ * Cette classe est normalement multi-thread safe
+ * <p>
+ * FIXME: certain calcul sont les memes que ceux implanter dans les scripts
+ * a cause du groupe des juveniles qui n'est pas un vrai groupe de population.
+ * Il serait bon que ce groupe deviennent un vrai groupe et que ce code specifique
+ * puisse etre supprimer.
+ *
+ *
+ * @author poussin
+ */
+public class PopulationMonitorMultiThread {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(PopulationMonitorMultiThread.class);
+
+ /** La liste des pops monitorer par cette instance */
+ protected List<Population> pops = null;
+ /** current number of fish by Pop */
+ protected Map<Population, MatrixND> Ns = new HashMap<Population, MatrixND>();
+ /** reproduction key: <date, pop> value:<MatrixND> */
+ protected Map<Population, Map<Date, MatrixND>> reproductions = new HashMap<Population, Map<Date, MatrixND>>();
+ /** discard key: <date, pop> value:<MatrixND> */
+ protected Map<Population, Map<Date, MatrixND>> discards = new HashMap<Population, Map<Date, MatrixND>>();
+ /** catch per population, only last catch is remaining */
+ protected Map<Population, MatrixND> catchs = new HashMap<Population, MatrixND>();
+ /** catch per population, only last catch is remaining */
+ protected Map<Population, MatrixND> holdCatchs = new HashMap<Population, MatrixND>();
+ protected double totalHoldCatch = 0;
+
+ /**
+ * Initialise le monitor pour l'ensemble de pop passe en parametre.
+ * Normalement cet init est fait dans le thread principale de la simulation
+ * et il n'y a pas de besoin de le synchroniser.
+ *
+ * Cet init permet d'avoir ensuite le maxime de variable en lecture, et donc
+ * de permettre le multithreading de facon legere (pas de synchronise) et
+ * sur (pas de concurent modification exception)
+ *
+ * @param pops
+ */
+ public void init(List<Population> pops) {
+ this.pops = Collections.unmodifiableList(new ArrayList<Population>(pops));
+ for (Population pop : this.pops) {
+ reproductions.put(pop, new HashMap<Date, MatrixND>());
+ discards.put(pop, new HashMap<Date, MatrixND>());
+ }
+ }
+
+ /**
+ * Return all population actualy in PopulationMonitor
+ * @return new list of Population
+ */
+ public List<Population> getPopulations() {
+ return pops;
+ }
+
+ /**
+ * Return current biomass for species
+ * @param species
+ * @return
+ */
+ public double getBiomass(Species species) {
+ double result = 0;
+
+ for (Population pop : species.getPopulation()) {
+ result += getBiomass(pop);
+ }
+
+ return result;
+ }
+
+ /**
+ * Return current biomass for population
+ * @param pop
+ * @return
+ */
+ public double getBiomass(Population pop) {
+ double result = 0;
+
+ MatrixND n = getN(pop);
+ if (n != null) {
+ n = n.sumOverDim(1);
+ for (MatrixIterator i=n.iterator(); i.next();){
+ Object [] coord = i.getSemanticsCoordinates();
+ PopulationGroup group = (PopulationGroup)coord[0];
+ result += i.getValue() * group.getMeanWeight();
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Return current numbers for population
+ * @param pop
+ * @return
+ */
+ public MatrixND getN(Population pop) {
+ MatrixND result = Ns.get(pop);
+
+ if (result != null) {
+ // change semantics with list from argument to ensure that
+ // semantics don't used too old context
+ result.setSemantics(0, pop.getPopulationGroup());
+ result.setSemantics(1, pop.getPopulationZone());
+ }
+
+ return result;
+ }
+
+ public void setN(Population pop, MatrixND mat) {
+ Ns.put(pop, mat);
+ }
+
+ /**
+ * @return Returns the reproduction.
+ */
+ public MatrixND getReproduction(Date date, Population pop) {
+ return this.reproductions.get(pop).get(date);
+ }
+
+ /**
+ * @param reproduction The reproduction to set.
+ */
+ public void setReproduction(Date date, Population pop, MatrixND repro) {
+ reproductions.get(pop).put(date, repro);
+ }
+
+ /**
+ * Applique de la mortalite naturelle aux poissons qui sont pas encore
+ * dans les classes de populations. (Reproduction)
+ * @param pop
+ */
+ public void applyReproductionMortality(Population pop) {
+ for (MatrixND reproduction : reproductions.get(pop).values()) {
+ if (log.isTraceEnabled()) {
+ log.trace("Matrix repro before mortality: " + reproduction);
+ }
+
+ for (MatrixIterator mi = reproduction.iterator(); mi.next();) {
+ Object[] sems = mi.getSemanticsCoordinates();
+ Zone z = (Zone) sems[0];
+ double coeff = pop.getNaturalDeathBirth(z);
+ if (log.isTraceEnabled()) {
+ log.trace("NaturalDeath zone " + z + "=" + coeff);
+ }
+ mi.setValue(mi.getValue() * Math.exp(-coeff / Month.NUMBER_OF_MONTH));
+ }
+ if (log.isTraceEnabled()) {
+ log.trace("Matrix repro after mortality: " + reproduction);
+ }
+ }
+ }
+
+ /**
+ * @todo les reproductions qui sont trop veille pour encore servir
+ * doivent être supprimées. c-a-d date < currentDate - etalement - gap between repro recru
+ * Une autre facon de faire est de supprimer les repro == 0 car normalement
+ * toute la repro doit etre utilisé au bout d'un certain temps
+ *
+ * @param date
+ * @param pop
+ * @return
+ */
+ public MatrixND getRecruitment(Date date, Population pop) {
+ MatrixND matEtalement = pop.getRecruitmentDistribution();
+ int etalement = matEtalement.getDim(0);
+
+ MatrixND result = MatrixFactory.getInstance().create(
+ new List[]{pop.getPopulationGroup(), pop.getPopulationZone()});
+
+ // pour chaque
+ for(int e=0; e<etalement; e++){
+ // recuperation de la reproduction stucture en zone repro
+ Date d = new Date(date.getDate() - e -
+ pop.getMonthGapBetweenReproRecrutement());
+ MatrixND repro = (MatrixND)reproductions.get(pop).get(d);
+
+ if(repro != null){ // si une repro existe pour le mois
+
+ // on fait la correspondance entre les zones repro et
+ // recrutement
+
+ PopulationGroup classe;
+ int indiceClasse = 0;
+ // si on a change d'annee le recrutement ne se fait pas en
+ // classe 0 mais en classe 1, si on a change 2 fois d'annee
+ // le recrutement se fait en age 2, etc.
+ classe = pop.getPopulationGroup().get(indiceClasse);
+
+ List<Zone> zoneRepros = pop.getReproductionZone();
+
+ // on multiplie la repro par le coeff de recrutement
+ double coeff = matEtalement.getValue(e);
+
+ MatrixND matRepro = repro.copy();
+ matRepro = matRepro.mults(coeff);
+
+ matRepro.setSemantics(0, zoneRepros);
+
+ MatrixND mapping = pop.getMappingZoneReproZoneRecru();
+ for(Zone zoneRepro : zoneRepros){
+ MatrixND submapping = mapping.getSubMatrix(0, new Object[]{zoneRepro});
+ for (MatrixIterator i=submapping.iterator(); i.hasNext();) {
+ i.next();
+ Object[] sem = i.getSemanticsCoordinates();
+ Zone zoneRecru = (Zone)sem[1];
+ double c = i.getValue();
+ result.setValue(classe, zoneRecru, c*matRepro.getValue(zoneRepro)
+ +result.getValue(classe, zoneRecru));
+ }
+ }
+ }
+ }
+
+ if(pop.getSpecies().getAgeGroupType()){
+ // conversion et retour de la matrice en vecteur
+ MatrixND N = pop.N2DToN1D(result);
+ // on applique les migrations et le changement d'age sur le resultat
+ // on suppose que la reproduction est toujours dans une seul saison
+ Date dateRepro = new Date(date.getDate() -
+ pop.getMonthGapBetweenReproRecrutement());
+
+ // recherche les saisons des differents mois entre les deux dates
+ List<PopulationSeasonInfo> infos = pop.getPopulationSeasonInfo();
+ List<PopulationSeasonInfo> usedSeasons = new ArrayList<PopulationSeasonInfo>();
+
+ while (date.after(dateRepro)) {
+ dateRepro = dateRepro.next();
+ Month month = dateRepro.getMonth();
+ for (PopulationSeasonInfo info : infos) {
+ if (month.equals(info.getFirstMonth())) {
+ usedSeasons.add(info);
+ dateRepro = new Date(dateRepro.getDate() + info.getMonths().size() - 1); // -1 because, for have next()
+ break;
+ }
+ }
+ }
+
+ for(PopulationSeasonInfo info : usedSeasons){
+ Month month = info.getFirstMonth();
+ MatrixND CA = info.getGroupChangeMatrix(month);
+ MatrixND MI = info.getMigrationMatrix(month, result);
+ MatrixND tmp0 = N.mult(CA);
+ MatrixND tmp2 = tmp0.mult(MI);
+ N = tmp2;
+ }
+ result = pop.split2D(N);
+ }
+ return result;
+ }
+
+ /**
+ * @param catchPerStrategyMet
+ */
+ public void holdCatch(Population pop, MatrixND catchPerStrategyMet) {
+ catchs.put(pop, catchPerStrategyMet);
+
+ MatrixND holdCatch = holdCatchs.get(pop);
+ if (holdCatch == null) {
+ holdCatch = MatrixFactory.getInstance().create(catchPerStrategyMet);
+ holdCatchs.put(pop, holdCatch);
+ } else {
+ holdCatch.add(catchPerStrategyMet);
+ }
+
+ // compute total
+ for(MatrixIterator i=catchPerStrategyMet.iterator(); i.next();){
+ this.totalHoldCatch += i.getValue();
+ }
+
+ }
+
+ /**
+ * @param pop
+ * @return
+ */
+ public MatrixND getCatch(Population pop) {
+ MatrixND result = catchs.get(pop);
+ return result;
+ }
+
+ /**
+ * @param pop
+ * @return
+ */
+ public MatrixND getHoldCatch(Population pop) {
+ MatrixND result = holdCatchs.get(pop);
+ return result;
+ }
+
+ /**
+ * @param pop
+ * @return
+ */
+ public double getTotalHoldCatch(Population pop) {
+ double result = totalHoldCatch;
+ return result;
+ }
+
+ /**
+ * raz capture cumulée de toutes les pops
+ */
+ public void clearCatch() {
+ catchs.clear();
+ holdCatchs.clear();
+ totalHoldCatch = 0;
+ }
+
+ /**
+ * @param date
+ * @param pop
+ * @return
+ */
+ public MatrixND getDiscard(Date date, Population pop) {
+ MatrixND result = discards.get(pop).get(date);
+ return result;
+ }
+
+ /**
+ * FIXME: discards n'est jamais vider, on le conserve pour toutes les annees
+ * il serait bon de faire un peu le menage de temps en temps.
+ *
+ * @param date
+ * @param pop
+ * @param discard
+ */
+ public void addDiscard(Date date, Population pop, MatrixND discard) {
+ Map<Date, MatrixND> oneDiscard = discards.get(pop);
+ synchronized(oneDiscard) {
+ MatrixND tmp = oneDiscard.get(date);
+ if (tmp == null) {
+ tmp = discard.copy();
+ discards.get(pop).put(date, tmp);
+ } else {
+ tmp.add(discard);
+ }
+ }
+ }
+}
+
+
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationHelper.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationHelper.java 2008-08-07 19:38:45 UTC (rev 1291)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationHelper.java 2008-08-11 14:36:27 UTC (rev 1292)
@@ -30,6 +30,8 @@
package fr.ifremer.isisfish.simulator;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import static org.codelutin.i18n.I18n._;
import java.io.File;
@@ -291,22 +293,20 @@
*/
static public void simulate(String simulId, SimulationParameter param,
boolean inQueue) throws SimulationException {
- // Ajout automatiquement de la date+heure a la fin de l'identifiant
- // comme demandé par Steph 20070227
- simulId += " " + dateFormat.format(new java.util.Date());
+ try {
+ simulId += " " + dateFormat.format(new java.util.Date());
- if (simulId == null ||
- "".equals(simulId) ||
- SimulationStorage.localyExists(simulId) ||
- SimulationManager.getInstance().exists(simulId)) {
- log.error("Can't start simulation, bad id: " + simulId);
- throw new SimulationException(_("isisfish.error.start" +
- " simulation, bad id: {0}", "" + simulId));
+ if (simulId == null || "".equals(simulId) || SimulationStorage.localyExists(simulId) || SimulationManager.getInstance().exists(simulId)) {
+ log.error("Can't start simulation, bad id: " + simulId);
+ throw new SimulationException(_("isisfish.error.start" + " simulation, bad id: {0}", "" + simulId));
+ }
+ SimulationParameter p = param.copy();
+ p.setInQueue(inQueue);
+
+ SimulationManager.getInstance().addSimulation(simulId, p);
+ } catch (Exception eee) {
+ throw new SimulationException("Can't add simulation", eee);
}
- SimulationParameter p = param.copy();
- p.setInQueue(inQueue);
-
- SimulationManager.getInstance().addSimulation(simulId, p);
}
static public SimulationStorage simulate(SimulationControl control, SimulationStorage simulation) throws Exception {
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationManager.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationManager.java 2008-08-07 19:38:45 UTC (rev 1291)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationManager.java 2008-08-11 14:36:27 UTC (rev 1292)
@@ -36,9 +36,11 @@
import fr.ifremer.isisfish.datastore.SimulationStorage;
import fr.ifremer.isisfish.types.Date;
import java.beans.PropertyChangeEvent;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import static org.codelutin.i18n.I18n._;
+import static org.codelutin.i18n.I18nf._;
import org.codelutin.util.FileUtil;
import org.codelutin.util.ListenerSet;
@@ -46,16 +48,11 @@
import java.beans.PropertyChangeSupport;
import java.io.File;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-import java.util.concurrent.PriorityBlockingQueue;
/**
@@ -118,7 +115,8 @@
// TODO passer ces valeurs en valeur configurable
int cpus = Runtime.getRuntime().availableProcessors();
int MAX_REMOTE_SIMULATION = 1;
-
+ log.info(_("Launch Simulation executor with %s cpu(s) for local, and %s" +
+ " process for remote", cpus, MAX_REMOTE_SIMULATION));
localExecutor = Executors.newFixedThreadPool(cpus);
remoteExecutor = Executors.newFixedThreadPool(MAX_REMOTE_SIMULATION);
}
@@ -173,26 +171,26 @@
log.debug(_("isisfish.message.add.queue.remote", id));
}
+
+
// on construit le bon type de SimulationItem pour le job
SimulationItem item = null;
if (param.getUseAnalysePlan()) {
if (!param.isIndependentPlan()) {
item = new SimulationItemPlan(id, param);
+ executor.submit(new SimulationJob(this, item));
} else {
+ // on met dans la queue local le process de generation de toutes
+ // les simus
item = new SimulationItemPlanIndependent(id, param);
- // l'item est independant, on ajoute toutes ces simulations en plus
- // mais pas dans la map pour qu'il n'y ait bien que l'initiale
- // plus celles en cours d'affichees
- while(item.hasNext()) {
- executor.submit(new SimulationJob(this, item.next()));
- }
+ localExecutor.submit(
+ new PrepareIndependentSimulationJob(this, executor, item));
}
} else {
item = new SimulationItem(id, param);
+ executor.submit(new SimulationJob(this, item));
}
fireAddEvent(id, item); // must be before thread notification because thread look in map
-
- executor.submit(new SimulationJob(this, item));
}
/**
@@ -619,10 +617,40 @@
//
// }
+ class PrepareIndependentSimulationJob implements Runnable {
+
+ protected SimulationManager simulationManager;
+ protected ExecutorService executor;
+ protected SimulationItem item;
+
+ public PrepareIndependentSimulationJob(SimulationManager simulationManager,
+ ExecutorService executor,
+ SimulationItem item) {
+ this.simulationManager = simulationManager;
+ this.executor = executor;
+ this.item = item;
+ }
+
+ public void run() {
+ // l'item est independant, on ajoute toutes ces simulations en plus
+ // mais pas dans la map pour qu'il n'y ait bien que l'initiale
+ // plus celles en cours d'affichees
+ while (item.hasNext()) {
+ try {
+ executor.submit(new SimulationJob(simulationManager, item.next()));
+ } catch (Exception eee) {
+ log.error("Can't add simulation: " + item, eee);
+ }
+ }
+
+ }
+
+ }
+
/**
* Utilise pour les simulations sans plan d'analyse ou des plans independant
*/
- static class SimulationJob implements Runnable {
+ class SimulationJob implements Runnable {
protected SimulationManager simulationManager;
protected SimulationItem simItem;
@@ -739,6 +767,7 @@
* Une simulation a faire sans plan d'experience
*/
public class SimulationItem {
+
protected String id;
protected SimulationParameter param;
protected SimulationItemPlan planItem = null;
@@ -877,7 +906,8 @@
/**
* Une simulation a faire qui contient un plan d'experience dependant
*/
- public class SimulationItemPlan extends SimulationItem implements PropertyChangeListener {
+ public class SimulationItemPlan extends SimulationItem
+ implements PropertyChangeListener {
// FIXME a mettre en config MAX_SIMULATION_PLAN
// nombre maximal de simulation de plan par simulation
// (pour eviter les plans qui ne retroune jamais faux
@@ -971,12 +1001,26 @@
}
public void propertyChange(PropertyChangeEvent evt) {
+ // Attention il faut bien que toutes les simultions soit
+ // genere (ou qu'il en reste au moins une en cours
+ // sinon, la condition est tout de suite vrai et la simulation
+ // s'arrete. Ce qui est normalement le cas ici, car on utilise
+ // le meme executor pour genere les simultions que pour les faire
+ // et les generes est mis en premier dans l'executor, mais si
+ // on est multi cpu, et que le temps de simulation est inferieur
+ // au temps de generation des simulations, on pourrai finir par
+ // avoir un probleme.
+
if (Boolean.FALSE.equals(evt.getNewValue())) {
simulationFinished++;
control.setProgress(simulationFinished);
control.setText(simulationFinished + " / " + simulationNumber);
if (simulationFinished >= simulationNumber) {
+ log.info("All simulations have been executed: " + simulationFinished);
control.stopSimulation();
+ String id = control.getId();
+ SimulationManager.this.fireStopEvent(id);
+ SimulationManager.this.fireRemoveEvent(id);
}
}
}
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationQueueModel.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationQueueModel.java 2008-08-07 19:38:45 UTC (rev 1291)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationQueueModel.java 2008-08-11 14:36:27 UTC (rev 1292)
@@ -73,7 +73,11 @@
int row = getRowCount();
fireTableRowsInserted(row, row);
SimulationControl control = getSimulationControl(e.getId());
- control.addPropertyChangeListener(this);
+ if (control != null) {
+ control.addPropertyChangeListener(this);
+ } else {
+ log.warn("Simulation without controler: " + e.getId());
+ }
}
/* (non-Javadoc)
Added: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/versionning/DummyVCSHandler.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/versionning/DummyVCSHandler.java (rev 0)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/versionning/DummyVCSHandler.java 2008-08-11 14:36:27 UTC (rev 1292)
@@ -0,0 +1,209 @@
+/* *##%
+ * Copyright (C) 2002-2008 Code Lutin, Benjamin Poussin
+ *
+ * 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ *##%*/
+
+package fr.ifremer.isisfish.versionning;
+
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.vcs.VCSConfig;
+import org.codelutin.vcs.VCSException;
+import org.codelutin.vcs.VCSHandler;
+import org.codelutin.vcs.VCSState;
+
+/**
+ * Class utilisee lorsqu'aucun handler n'a ete initialise
+ *
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class DummyVCSHandler implements VCSHandler {
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(DummyVCSHandler.class);
+
+ protected final FilenameFilter versionnableFilenameFilter;
+ protected final FileFilter versionnableFileFilter;
+
+ public DummyVCSHandler() {
+ this.versionnableFilenameFilter = new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ return !".svn".equals(name) && !"CVS".equals(name);
+ }
+ };
+ this.versionnableFileFilter = new FileFilter() {
+ public boolean accept(File dir) {
+ return !".svn".equals(dir.getName()) && !"CVS".equals(dir.getName());
+ }
+ };
+}
+
+
+
+ public File getLocalDatabasePath() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void initWorkingCopy() throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void reinitWorkingCopy() throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void deleteWorkingCopy() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public String getRemoteUrl() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public VCSConfig getConfig() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public FilenameFilter getVersionnableFilenameFilter() {
+ return versionnableFilenameFilter;
+ }
+
+ public FileFilter getVersionnableFileFilter() {
+ return versionnableFileFilter;
+ }
+
+ public String getConfLocalDirname() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public String getConfLocalEntriesFilename() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public VCSState getState(File fileState, Collection tmp) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public VCSState getState(File file, Collection tmp, boolean noremote) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public boolean isOnRemote(File file) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public boolean isUpToDate(File file) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public boolean isVersionnableFile(File file) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void makeRemoteDir(String commitMessage, String... dirNames) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void deleteRemoteDir(String commitMessage, String... dirNames) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public long add(List<File> files, String msg) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void delete(List<File> files, String msg) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void revert(List<File> files) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public long commit(List<File> files, String msg) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void update(File file, Object revision) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void update(File file) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void checkout(File destDir, String module, boolean recurse) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void checkoutFile(File destDir, String module) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public long checkoutOnlyTheDirectory(File root, Object revision) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public List<String> getRemoteStorageNames(File directory) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public List<String> getLocalStorageNames(File directory) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public Object getRevision(File f) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public List getLog(Object startRevision, Object endRevision, File file) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public String getFileContent(File file, Object revision) throws VCSException, IOException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public String getChangeLog(File file) throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public String getDiff(File file) throws VCSException, IOException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public String getDiff(File file, Object againstRevision) throws VCSException, IOException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ public void testConnection() throws VCSException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+}
1
0
r1291 - in branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish: . commandline/actions datastore datastore/migration simulator ui/simulator
by bpoussin@users.labs.libre-entreprise.org Aug. 7, 2008
by bpoussin@users.labs.libre-entreprise.org Aug. 7, 2008
Aug. 7, 2008
Author: bpoussin
Date: 2008-08-07 19:38:45 +0000 (Thu, 07 Aug 2008)
New Revision: 1291
Added:
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/AnalysePlanIndependent.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationCheckpointExternalProcessThread.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationCheckpointRemoteThread.java
Removed:
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationCheckpointThread.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationQueueModelOld.java
Modified:
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/IsisConfig.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/commandline/actions/IsisOptionActionSimulate.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/IsisH2Config.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/SimulationInformation.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/SimulationStorage.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/migration/SwingMigrationCallbackHandler.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/AbstractSimulationQueueModel.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationControl.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationDoneQueueModel.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationHelper.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationManager.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationParameter.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationQueueModel.java
branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/ui/simulator/SimulatorListeners.java
Log:
refonte complete du SimulationManager, on utilise maintenant 2 executors, un local (batch ou non) et l'autre distant.
Les executors utlisent un nombre de thread predefinit au maximun (default: cpu number)
Ajout du mode batch pour lancer les simulations dans un sous process systeme
Ajout du support de la migration de base, tout est pret pour ecrire les changements necessaires entre version
pas encore test tout ca, mais commiter c jamais mauvais pour ne rien perdre
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/IsisConfig.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/IsisConfig.java 2008-08-07 17:05:40 UTC (rev 1290)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/IsisConfig.java 2008-08-07 19:38:45 UTC (rev 1291)
@@ -33,6 +33,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import org.codelutin.util.VersionNumber;
/**
* L'implantation concrete de la configuration principale d'Isis
@@ -41,16 +42,23 @@
*/
public class IsisConfig extends IsisAbstractConfigMain {
- /** la version (ne peut pas être final car la configuration doit être chargée) */
- static private String VERSION;
-
+ protected final static VersionNumber version = new VersionNumber(3, 1, 4);
+ protected final static VersionNumber databaseVersion = new VersionNumber(
+ version.getNumber(0), version.getNumber(1));
+
static public String getVERSION() {
- if (VERSION == null) {
- VERSION = IsisContext.get().getMainConfig().getVersion().toString();
- }
- return VERSION;
+ String result = getVersion().toString();
+ return result;
}
+
+ static public VersionNumber getVersion() {
+ return version;
+ }
+ public static VersionNumber getDatabaseVersion() {
+ return databaseVersion;
+ }
+
/** le copyright (ne peut pas être final car la configuration doit être chargée) */
static private String COPYRIGHT_TEXT;
@@ -591,8 +599,6 @@
@Override
protected void loadFromSource() throws IOException {
super.loadFromSource();
- // alwyas used the java program version, should even never stored...
- setVersion(VERSION_PROPERTY_KEY.getDefaultValue());
// we do not deal with inter-config properties
clearUnsafeData();
}
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/commandline/actions/IsisOptionActionSimulate.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/commandline/actions/IsisOptionActionSimulate.java 2008-08-07 17:05:40 UTC (rev 1290)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/commandline/actions/IsisOptionActionSimulate.java 2008-08-07 19:38:45 UTC (rev 1291)
@@ -16,6 +16,7 @@
import fr.ifremer.isisfish.datastore.RegionStorage;
import fr.ifremer.isisfish.datastore.SimulationStorage;
+import fr.ifremer.isisfish.simulator.SimulationControl;
import fr.ifremer.isisfish.simulator.SimulationHelper;
import fr.ifremer.isisfish.simulator.SimulationParameter;
@@ -37,16 +38,22 @@
@Override
public void run() throws Exception {
- Thread.currentThread().dumpStack();
- String simulId = getSimulationId();
- File parameters = getSimulationParameter();
- File region = this.getRegion();
- File simulation = getSimulation();
+ String simulId = getSimulationId();
+ File parameters = getSimulationParameter();
+ File region = this.getRegion();
+ File simulation = getSimulation();
- if (parameters != null && simulation == null) {
+ if (parameters == null && region == null && simulation == null) {
+ // juste l'id, donc la simulation exist deja en local et ne demande
+ // qu'a etre executee
+ log.info(getOption().getUsedAlias() + ", id:" + simulId);
+ simulationWithId(simulId);
+ } else if (parameters != null && simulation == null) {
+ // Si on a des parametre, on a peut etre aussi une region
log.info(getOption().getUsedAlias() + ", id:" + simulId + ", parameters:" + parameters);
simulateWithParams(simulId, parameters, region);
} else {
+ // si on a une simulation, on a peut-etre des paramtres
log.info(getOption().getUsedAlias() + ", id:" + simulId + ", zip:" + simulation);
simulateWithSimulation(simulId, simulation, parameters);
}
@@ -101,11 +108,22 @@
if (params != null) {
sim.setParameter(params);
}
+
+ SimulationControl control = new SimulationControl(simulId);
+
// lancement de la simulation
- SimulationHelper.simulate(null, sim);
+ SimulationHelper.simulate(control, sim);
- sim.getStorage().closeContext();
+ sim.closeStorage();
+ }
+
+ public static void simulationWithId(String simulId) throws Exception {
+ SimulationStorage sim = SimulationStorage.getSimulation(simulId);
+ SimulationControl control = new SimulationControl(simulId);
+ // lancement de la simulation
+ SimulationHelper.simulate(control, sim);
+
+ sim.closeStorage();
}
-
}
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/IsisH2Config.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/IsisH2Config.java 2008-08-07 17:05:40 UTC (rev 1290)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/IsisH2Config.java 2008-08-07 19:38:45 UTC (rev 1291)
@@ -18,6 +18,7 @@
* ##% */
package fr.ifremer.isisfish.datastore;
+import fr.ifremer.isisfish.IsisConfig;
import fr.ifremer.isisfish.commandline.configs.IsisAbstractConfigH2;
import fr.ifremer.isisfish.IsisContext;
import fr.ifremer.isisfish.IsisFishRuntimeException;
@@ -148,7 +149,7 @@
// migrate database
if (conf.isUpdateschemaDatabase()) {
// migration configuration
- config.put(TopiaMigrationServiceImpl.MIGRATION_APPLICATION_VERSION, conf.getMigrationApplicationVersion());
+ config.put(TopiaMigrationServiceImpl.MIGRATION_APPLICATION_VERSION, IsisConfig.getDatabaseVersion().toString());
config.put(TopiaMigrationServiceImpl.MIGRATION_PREVIOUS_MAPPING_DIRECTORY, conf.getMigrationPreviousMappingDirectory());
config.put(TopiaMigrationServiceImpl.MIGRATION_MODEL_NAMES, conf.getMigrationModelNames());
config.put(TopiaMigrationServiceImpl.MIGRATION_CALLBACKHANDLERS, conf.getMigrationCallBackhandlers());
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/SimulationInformation.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/SimulationInformation.java 2008-08-07 17:05:40 UTC (rev 1290)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/SimulationInformation.java 2008-08-07 19:38:45 UTC (rev 1291)
@@ -275,6 +275,10 @@
setInfo(SIMULATION_EXCEPTION, v);
}
+ public boolean hasError() {
+ boolean result = getException() != null && getException().length() > 0;
+ return result;
+ }
public String getInfomation() {
String result = info.getProperty(OTHER_INFO);
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/SimulationStorage.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/SimulationStorage.java 2008-08-07 17:05:40 UTC (rev 1290)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/SimulationStorage.java 2008-08-07 19:38:45 UTC (rev 1291)
@@ -57,6 +57,7 @@
import fr.ifremer.isisfish.entities.FisheryRegion;
import fr.ifremer.isisfish.entities.FisheryRegionDAO;
import fr.ifremer.isisfish.logging.SimulationLoggerUtil;
+import fr.ifremer.isisfish.simulator.SimulationControl;
import fr.ifremer.isisfish.simulator.SimulationParameter;
import org.codelutin.vcs.VCSException;
@@ -99,6 +100,50 @@
//return new File(getDirectory(), IsisConfig.SIMULATION_PARAMETERS);
}
+ protected transient File simulationControlFile = null;
+ protected File getSimulationControlFile() {
+ if (simulationControlFile == null) {
+ simulationControlFile = new File(getDirectory(), "control");
+ }
+ return simulationControlFile;
+ }
+
+ public void saveControl(SimulationControl control) {
+ try {
+ Properties prop = control.getProperties();
+ File file = getSimulationControlFile();
+ FileOutputStream out = new FileOutputStream(file);
+ prop.store(out, "Control");
+ out.close();
+ } catch (Exception eee) {
+ // juste un log, car la sauvegarde d'un control ne doit jamais echouer
+ // car simplement utilise pour indique l'etat de simulation
+ log.warn("Can't save control", eee);
+ }
+ }
+
+ /**
+ * Reli le fichier contenant les infos de SimulationControl, en excluant
+ * certain champs
+ * @param control
+ * @param exclude
+ */
+ public void readControl(SimulationControl control, String ... exclude) {
+ try {
+ Properties prop = new Properties();
+ File file = getSimulationControlFile();
+ FileInputStream in = new FileInputStream(file);
+ prop.load(in);
+ in.close();
+ for (String e : exclude) {
+ prop.remove(e);
+ }
+ control.updateFromProperties(prop);
+ } catch (Exception eee) {
+ log.warn("Can't read control", eee);
+ }
+ }
+
public void setParameter(SimulationParameter parameter) {
this.parameter = parameter;
if (parameter != null) {
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/migration/SwingMigrationCallbackHandler.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/migration/SwingMigrationCallbackHandler.java 2008-08-07 17:05:40 UTC (rev 1290)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/datastore/migration/SwingMigrationCallbackHandler.java 2008-08-07 19:38:45 UTC (rev 1291)
@@ -18,12 +18,17 @@
package fr.ifremer.isisfish.datastore.migration;
+import java.sql.Connection;
import javax.swing.JOptionPane;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.topia.migration.DatabaseManager;
import org.codelutin.topia.migration.callback.MigrationCallbackHandler;
+import org.codelutin.topia.migration.callback.MigrationCallbackHandler.MigrationChoice;
+import org.codelutin.util.VersionNumberUtil;
-
/**
* MigrationCallbackHandler
*
@@ -35,11 +40,15 @@
*/
public class SwingMigrationCallbackHandler implements MigrationCallbackHandler {
+ /** to use log facility, just put in your code: log.info("..."); */
+ static private Log log = LogFactory.getLog(SwingMigrationCallbackHandler.class);
+
/* (non-Javadoc)
* @see org.codelutin.topia.migration.callback.MigrationCallbackHandler#doMigration(java.lang.String, java.lang.String)
*/
@Override
- public boolean doMigration(String dbVersion, String applicationVersion) {
+ public MigrationChoice doMigration(DatabaseManager dbManager,
+ String dbVersion, String applicationVersion) {
int answer = JOptionPane
.showConfirmDialog(
@@ -52,9 +61,57 @@
JOptionPane.QUESTION_MESSAGE
);
- boolean result = ( answer == JOptionPane.YES_OPTION );
+ MigrationChoice result = ( answer == JOptionPane.YES_OPTION ) ? MigrationChoice.MIGRATION : MigrationChoice.NO_MIGRATION;
+ if (result == MigrationChoice.MIGRATION) {
+ // migration manuel sans l'aide de topia-service
+ // tant que c pas fait on dit non
+ result = MigrationChoice.NO_MIGRATION;
+ // ouverture d'une connexion direct JDBC sur la base
+ try {
+ Connection conn = dbManager.getConnection();
+ try {
+ conn.setAutoCommit(false);
+ if (VersionNumberUtil.smallerThan(dbVersion, "3.2")) {
+ // on fait une migration vers 3.2
+ migrateTo3_2(conn);
+ }
+
+ // do same thing for other version
+
+ // commit des modifs
+ conn.commit();
+ // la migration a reussi, on dit que c fait
+ result = MigrationChoice.CUSTOM_MIGRATION;
+ } catch (Exception eee) {
+ // en cas d'erreur
+ log.error("Migration impossible de la base", eee);
+ // rollback du travail en cours
+ conn.rollback();
+ } finally {
+ // close database connexion
+ conn.close();
+ }
+ } catch (Exception eee) {
+ log.error("Error lors de la tentative de migration", eee);
+ }
+ }
- return result;
+ return MigrationChoice.NO_MIGRATION; // force false during test // result;
}
+ private void migrateTo3_2(Connection conn) {
+ log.info("Migrate to version 3.2");
+ //alteration du schema
+ // nouvelles equations dans les tables
+
+ // creation de valeur par defaut pour les equations
+
+
+ // recuperation des valeurs de ???
+
+ // creation de l'equation avec ces valeurs
+
+ // sauvegarde de l'equation
+ }
+
}
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/AbstractSimulationQueueModel.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/AbstractSimulationQueueModel.java 2008-08-07 17:05:40 UTC (rev 1290)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/AbstractSimulationQueueModel.java 2008-08-07 19:38:45 UTC (rev 1291)
@@ -15,6 +15,7 @@
import java.awt.Component;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -29,13 +30,14 @@
*
* @author chemit
*/
-public abstract class AbstractSimulationQueueModel extends JComponent implements TableModel, SimulationQueueListener, PropertyChangeListener {
+public abstract class AbstractSimulationQueueModel extends JComponent
+ implements TableModel, SimulationQueueListener, PropertyChangeListener {
/** @return list of ids of simulations contained in this model */
protected abstract List<String> getSimulationIds();
/** @return map of QueueItems (indexed by id) */
- protected abstract Map<String, SimulationManager.QueueItem> getQueueItemsAsMap();
+ protected abstract Map<String, SimulationManager.SimulationItem> getQueueItemsAsMap();
/** to use log facility, just put in your code: log.info("..."); */
protected static LutinLog log = LutinLogFactory.getLutinLog(AbstractSimulationQueueModel.class);
@@ -50,7 +52,14 @@
protected String[] header = new String[]{_("isisfish.queue.id"), _("isisfish.queue.plan"), _("isisfish.queue.name"), _("isisfish.queue.local"), _("isisfish.queue.status"), _("isisfish.queue.progression")};
/** columns types */
- protected Class[] columnClass = new Class[]{String.class, String.class, Boolean.class, Boolean.class, String.class, JProgressBar.class};
+ protected Class[] columnClass = new Class[]{
+ String.class, // id
+ String.class, // analyse plan number
+ Boolean.class, // in queue
+ String.class, // local, remote, batch
+ String.class, // text
+ JProgressBar.class // progress
+ };
/** progress bar (one for each row) */
protected Map<String, JProgressBar> progress = new HashMap<String, JProgressBar>();
@@ -116,7 +125,7 @@
* @param id id of the QueueItem to find
* @return the queueItem found via his id
*/
- protected SimulationManager.QueueItem getItem(String id) {
+ protected SimulationManager.SimulationItem getItem(String id) {
return getQueueItemsAsMap().get(id);
}
@@ -124,7 +133,7 @@
* @param rowIndex rowIndex of the QueueItem to find
* @return the queueItem found via his rowIndex
*/
- protected SimulationManager.QueueItem getItem(int rowIndex) {
+ protected SimulationManager.SimulationItem getItem(int rowIndex) {
String id = getSimulationId(rowIndex);
return id == null ? null : getQueueItemsAsMap().get(id);
}
@@ -134,24 +143,16 @@
* @return the SimulationControl of the given simulation
*/
protected SimulationControl getSimulationControl(String id) {
- SimulationControl result = null;
- SimulationManager.QueueItem item = getItem(id);
- if (item != null) {
- result = item.control;
- } else {
+ SimulationControl result = queue.getControl(id);
+ if (result == null) {
log.user(_("isisfish.error.invalid.simulation.id", id, getSimulationIds()));
}
return result;
}
public SimulationControl getSimulationControl(int rowIndex) {
- SimulationControl result = null;
- SimulationManager.QueueItem item = getItem(rowIndex);
- if (item != null) {
- result = item.control;
- } else {
- log.user(_("isisfish.error.invalid.simulation.index", rowIndex));
- }
+ String id = getSimulationId(rowIndex);
+ SimulationControl result = getSimulationControl(id);
return result;
}
/**
@@ -160,7 +161,7 @@
*/
protected SimulationParameter getSimulationParameter(String id) {
SimulationParameter result = null;
- SimulationManager.QueueItem item = getItem(id);
+ SimulationManager.SimulationItem item = getItem(id);
if (item != null) {
result = item.param;
} else {
@@ -189,6 +190,24 @@
}
/////////////////////////////////////////////
+ // SimulationQueueListener implementation
+ /////////////////////////////////////////////
+
+ /* (non-Javadoc)
+ * @see SimulationQueueListener#simulationStart(fr.ifremer.isisfish.simulator.SimulationQueueEvent)
+ */
+ public void simulationStart(SimulationQueueEvent e) {
+ // nothing to do
+ }
+
+ /* (non-Javadoc)
+ * @see SimulationQueueListener#simulationStop(fr.ifremer.isisfish.simulator.SimulationQueueEvent)
+ */
+ public void simulationStop(SimulationQueueEvent e) {
+ // nothing to do
+ }
+
+ /////////////////////////////////////////////
// TableModel implementation
/////////////////////////////////////////////
@@ -260,7 +279,15 @@
result = param.getInQueue();
break;
case 3:
- result = param.getLocal();
+ if (param.getLocal()) {
+ if (param.isSubProcess()) {
+ result = "batch";
+ } else {
+ result = "local";
+ }
+ } else {
+ result = "remote";
+ }
break;
case 4:
if (control != null) {
Added: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/AnalysePlanIndependent.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/AnalysePlanIndependent.java (rev 0)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/AnalysePlanIndependent.java 2008-08-07 19:38:45 UTC (rev 1291)
@@ -0,0 +1,46 @@
+/* *##%
+ * Copyright (C) 2007
+ * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
+ *
+ * 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *##%*/
+
+/* *
+ * AnalysePlan.java
+ *
+ * Created: 1 mars 07 20:27:28
+ *
+ * @author poussin
+ * @version $Revision: 336 $
+ *
+ * Last update: $Date: 2007-03-09 15:10:40 +0100 (ven, 09 mar 2007) $
+ * by : $Author: bpoussin $
+ */
+
+package fr.ifremer.isisfish.simulator;
+
+/**
+ * Use for Analyse plan that don't need previous simulation to do next
+ * simulation. When Simulation use this plan type, Isis can do more than one
+ * simulation in same time.
+ *
+ * author poussin
+ */
+public interface AnalysePlanIndependent extends AnalysePlan {
+
+
+}
+
+
Added: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationCheckpointExternalProcessThread.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationCheckpointExternalProcessThread.java (rev 0)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationCheckpointExternalProcessThread.java 2008-08-07 19:38:45 UTC (rev 1291)
@@ -0,0 +1,89 @@
+/**
+* SimulationCheckpointThread.java
+*
+* Created: Wed Aug 28 2002
+*
+* @author <poussin at codelutin.com>
+* Copyright Code Lutin
+* @version $Revision: 1187 $
+*
+* Mise a jour: $Date: 2008-03-19 01:26:10 +0100 (mer, 19 mar 2008) $
+* par : $Author: tchemit $
+*/
+
+package fr.ifremer.isisfish.simulator;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+import org.apache.xmlrpc.XmlRpcClient;
+
+import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.IsisContext;
+import fr.ifremer.isisfish.datastore.SimulationStorage;
+import java.io.BufferedInputStream;
+import java.io.InputStream;
+import java.util.Properties;
+
+/**
+ * This thread is responsable to synchronized SimulationControl used localy with
+ * remote simulation control for remote simulation.
+ *
+ * This thread dead when {@link SimulationControl#isRunning()} is false
+ *
+ * @author poussin
+ */
+public class SimulationCheckpointExternalProcessThread extends Thread { // SimulationCheckpointThread
+
+ /**
+ * Logger for this class
+ */
+ private static final Log log = LogFactory
+ .getLog(SimulationCheckpointExternalProcessThread.class);
+
+ protected SimulationControl control = null;
+ protected SimulationStorage simulation = null;
+ protected Process process = null;
+ // on l'appel plutot out que in, car c le output du process lance
+ protected InputStream out = null;
+
+ public SimulationCheckpointExternalProcessThread(SimulationControl control,
+ SimulationStorage simulation, Process process) {
+ this.control = control;
+ this.simulation = simulation;
+ this.process = process;
+ out = process.getInputStream();
+
+ }
+
+ public void run(){
+ int sleepTime = 2000;
+ int error = 0;
+ while(true){
+ try{
+ out.skip(out.available());
+ Thread.sleep(sleepTime);
+ // on ne lit pas le stop, car le stop ne peut-etre appeler
+ // que par l'utilisateur qui est de ce cote de la machine
+ simulation.readControl(control, "stop");
+
+ if (control.isStopSimulationRequest()) {
+ // FIXME, un destroy du process est peut-etre un peu violent ?
+ process.destroy();
+ // passe artificiellement le control a fini
+ control.stopSimulation();
+ }
+ if (!control.isRunning()) {
+ return;
+ }
+ } catch (Exception eee) {
+ log.debug("Can't update control for " + control.getId(), eee);
+ }
+ }
+
+ }
+
+} // SimulationCheckpointThread
Copied: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationCheckpointRemoteThread.java (from rev 1289, branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationCheckpointThread.java)
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationCheckpointRemoteThread.java (rev 0)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationCheckpointRemoteThread.java 2008-08-07 19:38:45 UTC (rev 1291)
@@ -0,0 +1,92 @@
+/**
+* SimulationCheckpointRemoteThread.java
+*
+* Created: Wed Aug 28 2002
+*
+* @author <poussin at codelutin.com>
+* Copyright Code Lutin
+* @version $Revision$
+*
+* Mise a jour: $Date$
+* par : $Author$
+*/
+
+package fr.ifremer.isisfish.simulator;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+import org.apache.xmlrpc.XmlRpcClient;
+
+import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.IsisContext;
+
+/**
+ * This thread is responsable to synchronized SimulationControl used localy with
+ * remote simulation control for remote simulation.
+ *
+ * This thread dead when {@link SimulationControl#isRunning()} is false
+ *
+ * @author poussin
+ */
+public class SimulationCheckpointRemoteThread extends Thread { // SimulationCheckpointRemoteThread
+
+ /**
+ * Logger for this class
+ */
+ private static final Log log = LogFactory
+ .getLog(SimulationCheckpointRemoteThread.class);
+
+ protected SimulationControl control = null;
+ int badId = 0;
+
+ public SimulationCheckpointRemoteThread(SimulationControl control) {
+ this.control = control;
+ }
+
+ public void run(){
+ int sleepTime = 2000;
+ while(true){
+ try{
+ Thread.sleep(sleepTime);
+
+ updateControl(control);
+ // on remet de le temps normal, vu que la connexion a reussi
+ sleepTime = 2000;
+
+ if (!control.isRunning()) {
+ return;
+ }
+
+ } catch (Exception eee) {
+ // on supporte 10 erreurs puis ensuite on quitte le thread.
+ if ( badId++ > 10){
+ log.error("Error !!! ", eee);
+ break;
+ }else{
+ // on a echouer sur une tentative, on allonge un
+ // peu le temps
+ sleepTime += 2000;
+ }
+ }
+ }
+
+ }
+
+ public void updateControl(SimulationControl control) throws Exception {
+ // essai l'ancienne etait en dur: "http://localhost:9090"
+ IsisConfig config = IsisContext.get().getMainConfig();
+ XmlRpcClient c = new XmlRpcClient(config.getSimulationServer());
+ c.setBasicAuthentication(config.getLogin(), config.getPassword());
+
+ Vector a = new Vector();
+ a.add(control.getUpdateHashtable());
+ Hashtable<String, Object> result = (Hashtable<String, Object>)c.execute("checkPoint", a);
+ // on remet de le temps normal, vu que la connexion a reussi
+ control.updateFromHashtable(result);
+ }
+
+} // SimulationCheckpointRemoteThread
Deleted: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationCheckpointThread.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationCheckpointThread.java 2008-08-07 17:05:40 UTC (rev 1290)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationCheckpointThread.java 2008-08-07 19:38:45 UTC (rev 1291)
@@ -1,92 +0,0 @@
-/**
-* SimulationCheckpointThread.java
-*
-* Created: Wed Aug 28 2002
-*
-* @author <poussin at codelutin.com>
-* Copyright Code Lutin
-* @version $Revision$
-*
-* Mise a jour: $Date$
-* par : $Author$
-*/
-
-package fr.ifremer.isisfish.simulator;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.apache.xmlrpc.XmlRpcClient;
-
-import fr.ifremer.isisfish.IsisConfig;
-import fr.ifremer.isisfish.IsisContext;
-
-/**
- * This thread is responsable to synchronized SimulationControl used localy with
- * remote simulation control for remote simulation.
- *
- * This thread dead when {@link SimulationControl#isRunning()} is false
- *
- * @author poussin
- */
-public class SimulationCheckpointThread extends Thread { // SimulationCheckpointThread
-
- /**
- * Logger for this class
- */
- private static final Log log = LogFactory
- .getLog(SimulationCheckpointThread.class);
-
- protected SimulationControl control = null;
- int badId = 0;
-
- public SimulationCheckpointThread(SimulationControl control) {
- this.control = control;
- }
-
- public void run(){
- int sleepTime = 2000;
- while(true){
- try{
- Thread.sleep(sleepTime);
-
- updateControl(control);
- // on remet de le temps normal, vu que la connexion a reussi
- sleepTime = 2000;
-
- if (!control.isRunning()) {
- return;
- }
-
- } catch (Exception eee) {
- // on supporte 10 erreurs puis ensuite on quitte le thread.
- if ( badId++ > 10){
- log.error("Error !!! ", eee);
- break;
- }else{
- // on a echouer sur une tentative, on allonge un
- // peu le temps
- sleepTime += 2000;
- }
- }
- }
-
- }
-
- public void updateControl(SimulationControl control) throws Exception {
- // essai l'ancienne etait en dur: "http://localhost:9090"
- IsisConfig config = IsisContext.get().getMainConfig();
- XmlRpcClient c = new XmlRpcClient(config.getSimulationServer());
- c.setBasicAuthentication(config.getLogin(), config.getPassword());
-
- Vector a = new Vector();
- a.add(control.getUpdateHashtable());
- Hashtable<String, Object> result = (Hashtable<String, Object>)c.execute("checkPoint", a);
- // on remet de le temps normal, vu que la connexion a reussi
- control.updateFromHashtable(result);
- }
-
-} // SimulationCheckpointThread
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationControl.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationControl.java 2008-08-07 17:05:40 UTC (rev 1290)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationControl.java 2008-08-07 19:38:45 UTC (rev 1291)
@@ -31,6 +31,7 @@
package fr.ifremer.isisfish.simulator;
+import fr.ifremer.isisfish.datastore.SimulationStorage;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
@@ -40,6 +41,7 @@
import org.apache.commons.logging.LogFactory;
import fr.ifremer.isisfish.types.Date;
+import java.util.Properties;
/**
* Permit to communicate with user interface from simulation thread
@@ -52,8 +54,12 @@
protected PropertyChangeSupport listeners = new PropertyChangeSupport(this);
protected boolean inUpdateFromHashtable = false;
+ protected transient SimulationStorage simulation = null;
+ /** si vrai des qu'une propriete change, sauvegarde sont etat */
+ protected transient boolean autoSaveState = false;
protected String id = null;
+ protected boolean started = false;
protected boolean running = true;
protected boolean stop = false;
protected Date date = new Date();
@@ -70,16 +76,60 @@
this.id = id;
addPropertyChangeListener(this);
}
+
+ public void setAutoSaveState(boolean autoSaveState) {
+ this.autoSaveState = autoSaveState;
+ }
+
+ public boolean isAutoSaveState() {
+ return autoSaveState;
+ }
+ /**
+ * Retourne la simulation associe a ce control
+ * @return retourne null si la simulation n'existe pas encore
+ */
+ public SimulationStorage getSimulation() {
+ if (simulation == null) {
+ simulation = SimulationStorage.getSimulation(id);
+ }
+ return simulation;
+ }
+
+
+
+ public void addPropertyChangeListener(String propName, PropertyChangeListener l) {
+ listeners.addPropertyChangeListener(propName, l);
+ }
+
public void addPropertyChangeListener(PropertyChangeListener l) {
listeners.addPropertyChangeListener(l);
}
+ public void removePropertyChangeListener(String propName, PropertyChangeListener l) {
+ listeners.removePropertyChangeListener(propName, l);
+ }
+
public void removePropertyChangeListener(PropertyChangeListener l) {
listeners.removePropertyChangeListener(l);
}
+ public boolean isStarted() {
+ return started;
+ }
+
/**
+ * appelee juste avant de reellement demarrer le thread de simulation
+ * indique que cette simulation est en cours et qu'il ne faut plus la lancer
+ * @param running The running to set.
+ */
+ public void setStarted(boolean started) {
+ boolean oldValue = this.started;
+ this.started = started;
+ listeners.firePropertyChange("started", oldValue, this.started);
+ }
+
+ /**
* Method running
*
* @return faux une fois que stopSimulation a ete appele.
@@ -221,12 +271,75 @@
}
/**
+ * Met dans un Properties tous les champs
+ * @return un Properties avec tous les champs
+ */
+ public Properties getProperties() {
+ Properties result = new Properties();
+ result.setProperty("id", id);
+ result.setProperty("started", String.valueOf(started));
+ result.setProperty("running", String.valueOf(running));
+ result.setProperty("stop", String.valueOf(stop));
+ result.setProperty("date", String.valueOf(date.getDate()));
+ result.setProperty("progressMax", String.valueOf(progressMax));
+ result.setProperty("progress", String.valueOf(progress));
+ result.setProperty("text", text);
+
+ return result;
+ }
+
+ /**
+ * update current object from Properties representation
+ *
+ */
+ public void updateFromProperties(Properties h) {
+ inUpdateFromHashtable = true;
+ try {
+ if (h.contains("started")) {
+ boolean started = "true".equalsIgnoreCase(h.getProperty("started"));
+ setStarted(started);
+ }
+ if (h.contains("running")) {
+ boolean running = "true".equalsIgnoreCase(h.getProperty("running"));
+ setRunning(running);
+ }
+ if (h.contains("stop")) {
+ boolean stop = "true".equalsIgnoreCase(h.getProperty("stop"));
+ setStopSimulationRequest(stop);
+ }
+ if (h.contains("date")) {
+ Date date = new Date(Integer.parseInt(h.getProperty("date")));
+ setDate(date);
+ }
+ if (h.contains("progressMax")) {
+ int progressMax = Integer.parseInt(h.getProperty("progressMax"));
+ setProgressMax(progressMax);
+ }
+ if (h.contains("progress")) {
+ int progress = Integer.parseInt(h.getProperty("progress"));
+ setProgress(progress);
+ }
+ if (h.contains("text")) {
+ String text = h.getProperty("text");
+ setText(text);
+ }
+ } finally {
+ inUpdateFromHashtable = false;
+ }
+ }
+
+
+ /**
* update current object from hashtable representation
*
*/
public void updateFromHashtable(Hashtable h) {
inUpdateFromHashtable = true;
try {
+ if (h.contains("started")) {
+ boolean started = (Boolean)h.get("started");
+ setStarted(started);
+ }
if (h.contains("running")) {
boolean running = (Boolean)h.get("running");
setRunning(running);
@@ -266,6 +379,9 @@
} else {
Object value = e.getNewValue();
update.put(property, value);
+ if (isAutoSaveState() && getSimulation() != null) {
+ getSimulation().saveControl(this);
+ }
}
}
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationDoneQueueModel.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationDoneQueueModel.java 2008-08-07 17:05:40 UTC (rev 1290)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationDoneQueueModel.java 2008-08-07 19:38:45 UTC (rev 1291)
@@ -62,13 +62,13 @@
* @see AbstractSimulationQueueModel at getSimulationIds()
*/
protected java.util.List<String> getSimulationIds() {
- return getQueue().idDones;
+ return getQueue().getDoneIds();
}
/* (non-Javadoc)
* @see AbstractSimulationQueueModel at getQueueItemsAsMap()
*/
- protected java.util.Map<String, SimulationManager.QueueItem> getQueueItemsAsMap() {
+ protected java.util.Map<String, SimulationManager.SimulationItem> getQueueItemsAsMap() {
return getQueue().mapDones;
}
@@ -89,57 +89,32 @@
// IsisConfig.SIMULATION_SHOW_ONLY_XXX properties)
int pos = getSimulationIndex(e.getId());
if (isRowIndexValid(pos)) {
- log.info(" in done model for " + e.getId() + " pos " + getSimulationIndex(e.getId()));
+ log.info(" in done model for " + e.getId() + " pos " + pos);
fireTableRowsInserted(pos, pos);
+
+ // on indique si la simulation a ete annulee
SimulationControl control = getSimulationControl(e.getId());
log.info("isStopSimulationRequest : "+control.isStopSimulationRequest());
if (control.isStopSimulationRequest()) {
control.setText(I18n._("isisfish.queue.cancelled"));
}
- SimulationManager.QueueItem item = getQueueItemsAsMap().get(e.getId());
- try {
- //TODO I don't known if this is good ?
- SimulationStorage lastSim = item.lastSimulation;
- SimulationParameter simulationParameter = getSimulationParameter(e.getId());
- if (lastSim != null) {
- if (simulationParameter.getUseAnalysePlan()) {
- //TODO Is the lastSimulation is the good one ???
- SimulationInformation infos = getItem(e.getId()).lastSimulation.getInformation();
- if (infos != null && infos.getException() != null) {
- // should deal with error
- log.error(I18n._("isisfish.error.while.simulation", infos.getException()));
- control.setText(I18n._("isisfish.message.stop.with.error"));
- }
- } else if (lastSim.getName().equals(e.getId())) {
- SimulationInformation infos = getItem(e.getId()).lastSimulation.getInformation();
- if (infos != null && infos.getException() != null) {
- // should deal with error
- log.error(I18n._("isisfish.error.while.simulation", infos.getException()));
- control.setText(I18n._("isisfish.message.stop.with.error",infos.getException()));
- }
+ // on change le message pour dire qu'il y a eu une erreur
+ try {
+ SimulationManager.SimulationItem item = getQueueItemsAsMap().get(e.getId());
+ if (!item.hasSimulation()) {
+ SimulationInformation infos = item.getSimulation().getInformation();
+ if (infos.hasError()) {
+ log.error(I18n._("isisfish.error.while.simulation", infos.getException()));
+ control.setText(I18n._("isisfish.message.stop.with.error"));
}
}
- // I don't known if you can come here with no previous simulation ?
- } catch (Exception e1) {
- log.warn(I18n._("isisfish.error.obtain.information.file", e.getId()));
+ } catch (Exception eee) {
+ log.warn(I18n._("isisfish.error.obtain.information.file", e.getId()), eee);
}
control.addPropertyChangeListener(this);
}
}
- /* (non-Javadoc)
- * @see SimulationQueueListener#simulationStart(fr.ifremer.isisfish.simulator.SimulationQueueEvent)
- */
- public void simulationStart(SimulationQueueEvent e) {
- // nothing to do
- }
-
- /* (non-Javadoc)
- * @see SimulationQueueListener#simulationStop(fr.ifremer.isisfish.simulator.SimulationQueueEvent)
- */
- public void simulationStop(SimulationQueueEvent e) {
- // nothing to do
- }
}// SimulationDoneQueueModel
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationHelper.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationHelper.java 2008-08-07 17:05:40 UTC (rev 1290)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationHelper.java 2008-08-07 19:38:45 UTC (rev 1291)
@@ -63,6 +63,7 @@
import fr.ifremer.isisfish.IsisConfig;
import fr.ifremer.isisfish.IsisFishRuntimeException;
import fr.ifremer.isisfish.IsisContext;
+import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.aspect.AspectClassLoader;
import fr.ifremer.isisfish.aspect.Cache;
import fr.ifremer.isisfish.aspect.Trace;
@@ -311,7 +312,11 @@
static public SimulationStorage simulate(SimulationControl control, SimulationStorage simulation) throws Exception {
SimulationStorage result;
if (simulation.getParameter().getLocal()) {
- result = localSimulate(control, simulation);
+ if (simulation.getParameter().isSubProcess()) {
+ result = subProcessSimulate(control, simulation);
+ } else {
+ result = localSimulate(control, simulation);
+ }
} else {
result = remoteSimulate(control, simulation);
}
@@ -328,14 +333,15 @@
* @return le storage après simulation
* @throws Exception pour toute erreur
*/
- static public SimulationStorage remoteSimulate(SimulationControl control, SimulationStorage simulation) throws Exception {
+ static public SimulationStorage remoteSimulate(SimulationControl control,
+ SimulationStorage simulation) throws Exception {
// export en zip du storage
File zip = simulation.createZip();
if (control != null) {
// creation du thread de surveillance de la simulation distante
// qui sert a mettre a jour les valeurs de control
- new SimulationCheckpointThread(control).start();
+ new SimulationCheckpointRemoteThread(control).start();
}
// envoie le zip au serveur de simulation
@@ -362,7 +368,41 @@
result = SimulationStorage.importAndRenameZip(tmpzip, control.getId());
return result;
}
-
+
+ static public SimulationStorage subProcessSimulate(SimulationControl control,
+ SimulationStorage simulation) throws Exception {
+
+ String simulationId = simulation.getName();
+
+ // on ferme le SimulationStorage pour ne pas interferer avec le process
+ simulation.closeStorage();
+
+ String java = System.getProperty("java.home") +
+ File.separator + "bin" + File.separator + "java";
+ String classpath = System.getProperty("java.class.path");
+
+ // prepare le process
+ ProcessBuilder processBuilder = new ProcessBuilder(java, "-classpath", classpath,
+ IsisFish.class.getName(),
+ "--simulate", simulationId);
+ processBuilder.redirectErrorStream(true);
+
+ // demarrage du process
+ Process process = processBuilder.start();
+
+ if (control != null) {
+ // prepare de thread de surveillance du process si control n'est pas null
+ Thread monitor = new SimulationCheckpointExternalProcessThread(control, simulation, process);
+ }
+
+ // on attend que la simulation soit fini
+ process.waitFor();
+
+ // on retourne directement le simulation storage passe en argument
+ // car la simulation a ete faite avec
+ return simulation;
+ }
+
/**
* fait la simulation en local dans un nouveau thread, cela permet
* pour chaque simulation d'avoir les bons scripts dans le classloader
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationManager.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationManager.java 2008-08-07 17:05:40 UTC (rev 1290)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationManager.java 2008-08-07 19:38:45 UTC (rev 1291)
@@ -35,6 +35,7 @@
import fr.ifremer.isisfish.IsisContext;
import fr.ifremer.isisfish.datastore.SimulationStorage;
import fr.ifremer.isisfish.types.Date;
+import java.beans.PropertyChangeEvent;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import static org.codelutin.i18n.I18n._;
@@ -46,9 +47,14 @@
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
+import java.util.List;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
import java.util.concurrent.PriorityBlockingQueue;
@@ -64,30 +70,33 @@
static protected SimulationManager instance = null;
- protected boolean autoLaunch = false;
+// protected boolean autoLaunch = false;
protected ListenerSet<SimulationQueueListener> listeners = new ListenerSet<SimulationQueueListener>();
protected PropertyChangeSupport propertyListeners = new PropertyChangeSupport(this);
- protected SimulationThread localThread;
- protected SimulationThread remoteThread;
+// protected SimulationThread localThread;
+// protected SimulationThread remoteThread;
- /** La queue, bloquante lorsqu'elle est vide, utilisé par le thread de simulation local*/
- protected PriorityBlockingQueue<QueueItem> localQueue = new PriorityBlockingQueue<QueueItem>();
- /** La queue, bloquante lorsqu'elle est vide, utilisé par le thread de simulation remote*/
- protected PriorityBlockingQueue<QueueItem> remoteQueue = new PriorityBlockingQueue<QueueItem>();
- /** La liste des simulations terminées */
- protected LinkedHashSet<QueueItem> dones = new LinkedHashSet<QueueItem>();
+ protected ExecutorService localExecutor;
+ protected ExecutorService remoteExecutor;
+
+// /** La queue, bloquante lorsqu'elle est vide, utilisé par le thread de simulation local*/
+// protected PriorityBlockingQueue<QueueItem> localQueue = new PriorityBlockingQueue<QueueItem>();
+// /** La queue, bloquante lorsqu'elle est vide, utilisé par le thread de simulation remote*/
+// protected PriorityBlockingQueue<QueueItem> remoteQueue = new PriorityBlockingQueue<QueueItem>();
+// /** La liste des simulations terminées */
+// protected LinkedHashSet<SimulationItem> dones = new LinkedHashSet<SimulationItem>();
- /** une liste des id (local et remote) */
- protected ArrayList<String> ids = new ArrayList<String>();
- /** une map id->item pour accelerer les acces */
- protected Map<String, QueueItem> map = new HashMap<String, QueueItem>();
+// /** une liste des id (local et remote) */
+// protected ArrayList<String> ids = new ArrayList<String>();
+ /** une map id->simItem pour accelerer les acces */
+ protected Map<String, SimulationItem> map = new LinkedHashMap<String, SimulationItem>();
- /** une liste des id des simulations terminées */
- protected ArrayList<String> idDones = new ArrayList<String>();
- /** une map id->item pour accelerer les acces aux simulation terminées */
- protected Map<String, QueueItem> mapDones = new HashMap<String, QueueItem>();
+// /** une liste des id des simulations terminées */
+// protected ArrayList<String> idDones = new ArrayList<String>();
+ /** une map id->simItem pour accelerer les acces aux simulation terminées */
+ protected Map<String, SimulationItem> mapDones = new LinkedHashMap<String, SimulationItem>();
static public SimulationManager getInstance() {
if (instance == null) {
@@ -100,20 +109,27 @@
* Cree l'objet et lance les deux threads de simulation (local/remote)
*/
protected SimulationManager() {
- localThread = new SimulationThread("local", this, localQueue);
- remoteThread = new SimulationThread("remote", this, remoteQueue);
+// localThread = new SimulationThread("local", this, localQueue);
+// remoteThread = new SimulationThread("remote", this, remoteQueue);
+//
+// localThread.start();
+// remoteThread.start();
- localThread.start();
- remoteThread.start();
+ // TODO passer ces valeurs en valeur configurable
+ int cpus = Runtime.getRuntime().availableProcessors();
+ int MAX_REMOTE_SIMULATION = 1;
+
+ localExecutor = Executors.newFixedThreadPool(cpus);
+ remoteExecutor = Executors.newFixedThreadPool(MAX_REMOTE_SIMULATION);
}
- /**
- * @return Returns the autoLaunch.
- */
- public boolean isAutoLaunch() {
- return this.autoLaunch;
- }
+// /**
+// * @return Returns the autoLaunch.
+// */
+// public boolean isAutoLaunch() {
+// return this.autoLaunch;
+// }
public void addPropertyChangeListener(PropertyChangeListener listener) {
propertyListeners.addPropertyChangeListener(listener);
@@ -131,32 +147,52 @@
propertyListeners.removePropertyChangeListener(propertyName, listener);
}
- /**
- * @param autoLaunch The autoLaunch to set.
- */
- public void setAutoLaunch(boolean autoLaunch) {
- boolean oldValue = this.autoLaunch;
- this.autoLaunch = autoLaunch;
- propertyListeners.firePropertyChange("autoLaunch", oldValue, autoLaunch);
- }
+// /**
+// * @param autoLaunch The autoLaunch to set.
+// */
+// public void setAutoLaunch(boolean autoLaunch) {
+// boolean oldValue = this.autoLaunch;
+// this.autoLaunch = autoLaunch;
+// propertyListeners.firePropertyChange("autoLaunch", oldValue, autoLaunch);
+// }
/**
* Cree l'objet de gestion de la simulation en interne et le place dans la
* bonne queue de simulation (local/remote). Appel le
- * {@link #fireAddEvent(String, QueueItem)}
+ * {@link #fireAddEvent(String, SimulationItem)}
* @param id l'id de simulation
* @param param les paramètres de la simulation
*/
- public void addSimulation(String id, SimulationParameter param) {
- QueueItem item = new QueueItem(id, param);
- fireAddEvent(id, item); // must be before thread notification because thread look in map
+ public void addSimulation(String id, SimulationParameter param) throws Exception {
+ ExecutorService executor = null;
if (param.getLocal()) {
- localQueue.add(item);
+ executor = localExecutor;
log.debug(_("isisfish.message.add.queue", id));
} else {
- remoteQueue.add(item);
+ executor = remoteExecutor;
log.debug(_("isisfish.message.add.queue.remote", id));
}
+
+ // on construit le bon type de SimulationItem pour le job
+ SimulationItem item = null;
+ if (param.getUseAnalysePlan()) {
+ if (!param.isIndependentPlan()) {
+ item = new SimulationItemPlan(id, param);
+ } else {
+ item = new SimulationItemPlanIndependent(id, param);
+ // l'item est independant, on ajoute toutes ces simulations en plus
+ // mais pas dans la map pour qu'il n'y ait bien que l'initiale
+ // plus celles en cours d'affichees
+ while(item.hasNext()) {
+ executor.submit(new SimulationJob(this, item.next()));
+ }
+ }
+ } else {
+ item = new SimulationItem(id, param);
+ }
+ fireAddEvent(id, item); // must be before thread notification because thread look in map
+
+ executor.submit(new SimulationJob(this, item));
}
/**
@@ -166,7 +202,7 @@
* @param id l'id de simulation
*/
public void removeSimulation(String id) {
- QueueItem item = map.get(id);
+ SimulationItem item = map.get(id);
if (item != null) {
item.control.setStopSimulationRequest(true);
}
@@ -174,6 +210,26 @@
}
/**
+ * Retourne une liste toujours dans le meme ordre des ids de simulation
+ * a faire
+ * @return
+ */
+ public List<String> getIds() {
+ List<String> result = new ArrayList<String>(map.keySet());
+ return result;
+ }
+
+ /**
+ * Retourne une liste toujours dans le meme ordre des ids de simulation
+ * a faire
+ * @return
+ */
+ public List<String> getDoneIds() {
+ List<String> result = new ArrayList<String>(mapDones.keySet());
+ return result;
+ }
+
+ /**
* @param id l'id de simulation
* @return <code>true</code> si un identifiant est utilisé pour une simulation
*/
@@ -202,8 +258,8 @@
listeners.remove(l);
}
- protected void fireAddEvent(String id, QueueItem item) {
- ids.add(id);
+ protected void fireAddEvent(String id, SimulationItem item) {
+// ids.add(id);
map.put(id, item);
SimulationQueueEvent e = new SimulationQueueEvent(this, id);
for (SimulationQueueListener l : listeners) {
@@ -216,21 +272,29 @@
// add the simulation in done model
// check if we should keep the simulation in done model
if (mustShowSimulationDone(id)) {
- idDones.add(id);
- SimulationManager.QueueItem queueItem = map.get(id);
- dones.add(queueItem);
+// idDones.add(id);
+ SimulationItem queueItem = map.get(id);
+// dones.add(queueItem);
mapDones.put(id, queueItem);
}
SimulationQueueEvent e = new SimulationQueueEvent(this, id);
for (SimulationQueueListener l : listeners) {
l.simulationWillBeRemoved(e);
}
- ids.remove(id);
+// ids.remove(id);
map.remove(id);
}
}
- protected void fireStartEvent(String id) {
+ protected void fireStartEvent(String id, SimulationItem item) {
+ if (!exists(id) && item.isIndependent()) {
+ // la simulation qui vient d'etre lancee n'existe pas, c parce qu'il
+ // s'agit d'une simulation de plan, on l'ajoute a la liste pour que
+ // l'utilisateur puisse la visualiser. On ne le fait pas pour les
+ // plan dependant car, il partage le meme controleur, donc
+ // l'utilisateur voit deja ce qui se passe
+ fireAddEvent(id, item);
+ }
SimulationQueueEvent e = new SimulationQueueEvent(this, id);
for (SimulationQueueListener l : listeners) {
l.simulationStart(e);
@@ -258,7 +322,7 @@
*/
public SimulationControl getControl(String id) {
SimulationControl result = null;
- QueueItem item = map.get(id);
+ SimulationItem item = map.get(id);
if (item != null) {
result = item.control;
}
@@ -273,233 +337,597 @@
protected boolean mustShowSimulationDone(String id) {
boolean result = true;
- QueueItem item = map.get(id);
- SimulationParameter simulationParameter = getParameter(id);
- IsisConfig config = IsisContext.get().getMainConfig();
- if (config.isSimulationShowOnlyQueue() && !simulationParameter.getLocal()) {
- return false;
- }
+ try {
+ IsisConfig config = IsisContext.get().getMainConfig();
- try {
- //TODO cela ne fonctionne pas, le fichier existe-il à ce moment ?
- if (config.isSimulationShowOnlyError() && item.lastSimulation.getInformation().getException() != null) {
- return true;
+ SimulationItem item = map.get(id);
+ if (item.hasPlanItem() && !item.getSimulation().getInformation().hasError()) {
+ // on ne met jamais dans la queue done les simulations de plan
+ // sauf si elle echoue
+ result = false;
+ } else if (!(config.isSimulationShowOnlyError() &&
+ !(item instanceof SimulationItemPlan) &&
+ item.getSimulation().getInformation().hasError())) {
+ result = false;
}
- } catch (Exception e) {
+ } catch (Exception eee) {
+ log.debug("Ne devrait pas arriver", eee);
// I don't known how it could appear, but in doubt, show it!
- return true;
}
return result;
}
+// /**
+// * Thread permettant de faire les simulations se trouvant dans la queue
+// * passée en parametre.
+// * <p>
+// * Si la simulation prise dans la queue n'existe plus, au moment ou on
+// * souhaite l'utiliser dans le {@link SimulationManager} alors elle est
+// * passée et on en recherche une autre.
+// *
+// * @author poussin
+// */
+// static class SimulationThread extends Thread {
+// protected SimulationManager simulationManager;
+// protected BlockingQueue<QueueItem> queue;
+//
+// /**
+// *
+// * @param name just small name to differenciate thread (local/remote)
+// * @param simulationManager le manager de simulation
+// * @param queue la queue de simulations
+// */
+// public SimulationThread(String name, SimulationManager simulationManager, BlockingQueue<QueueItem> queue) {
+// super("Simulation Thread " + name);
+// this.simulationManager = simulationManager;
+// this.queue = queue;
+// }
+//
+// /* (non-Javadoc)
+// * @see java.lang.Thread#run()
+// */
+// @Override
+// public void run() {
+// log.info("Start simulation thread");
+// while (true) {
+// // simItem qui sert a faire la simulation courante
+// QueueItem simItem = null;
+// try {
+// //
+// // recheche d'une simulation
+// //
+// while (simItem == null) {
+// log.debug("try to take simulation");
+// simItem = queue.take();
+// log.debug("Just take " + simItem.id);
+// if (!simulationManager.exists(simItem.id)) {
+// // on ne le retrouve pas dans la map, la simulation
+// // a donc ete supprimée par l'utilisateur on passe a la
+// // suivante
+// simItem = null;
+// } else if (!simulationManager.isAutoLaunch() && simItem.param.getInQueue()) {
+// // don't use simItem, because is queue and queue is not launched
+// queue.add(simItem);
+// simItem = null;
+// // sleep 1s. Because all other simItem is in queue too
+// // this sleep permit to user to put not queue simItem,
+// // with out eat cpu
+// sleep(1000);
+// }
+// }
+//
+// log.debug("use if has next simulation: " + simItem.id);
+// if (simItem.hasNext()) {
+// SimulationStorage sim = simItem.getSimulation();
+// String simId = sim.getName();
+// log.debug("Start simulation: " + simId);
+// SimulationControl control = simItem.control;
+// // set date to 0 at beginning of simulation
+// control.setDate(new Date());
+// control.setProgress(0);
+// control.setStarted(true);
+//
+// simulationManager.fireStartEvent(simItem.id);
+// try {
+// sim = SimulationHelper.simulate(control, sim);
+// simItem.setLastSimulation(sim);
+// } finally {
+// simulationManager.fireStopEvent(simItem.id);
+// }
+// // copie les exports de simulation dans le repertoire
+// // souhaiter par l'utilisateur
+// SimulationParameter param = sim.getParameter();
+// if (param.getExportNames() != null && param.getExportNames().size() > 0) {
+// File exportDir = IsisConfig.getResultExportDirectory(sim.getDirectory());
+// FileUtil.copyAndRenameRecursively(
+// exportDir,
+// new File(param.getExportDirectory()),
+// exportDir.getName(), simItem.id);
+//// FileUtil.copyAndRenameRecursively(
+//// exportDir,
+//// new File(sim.getDirectory(), IsisConfig.RESULT_EXPORT),
+//// IsisConfig.RESULT_EXPORT, simItem.id);
+// }
+//
+// if (simItem.hasNext() && simulationManager.exists(simItem.id)) {
+// // il y a encore des simulations a faire pour cet simItem
+// // on le remet dans la queue (on ne fait pas les autres
+// // simulations de cet simItem
+// // tout de suite car l'simItem peut-etre un simItem de queue
+// // moins prioritaire que les autres simulations
+// // il faut donc qu'il reprenne sa place dans l'ordre)
+//
+// queue.add(simItem);
+// } else {
+// // Si l'utilisateur souhaite seulement les exports
+// // on supprimer la/les simulations. Il faut le faire
+// // lorsqu'il n'y a plus de next car le calcul des plans
+// // peut avoir besoin des simulations precedentes
+// if (param.getOnlyExport()) {
+// if (param.getUseAnalysePlan()) {
+// for(File file : FileUtil.find(
+// IsisConfig.getSimulationDirectory(),
+// simItem.id + "_[0-9]+$", false)) {
+// log.debug("Delete simulation " + file);
+// FileUtil.deleteRecursively(file);
+// }
+// } else {
+// sim.delete(false);
+// }
+// }
+// simulationManager.fireRemoveEvent(simItem.id);
+//
+// if (simulationManager.isAutoLaunch() && simItem.param.getInQueue()) {
+// // if simItem is last in queue, stop the queue after that
+// QueueItem [] items = queue.toArray(new QueueItem[queue.size()]);
+// if (items.length > 0) {
+// QueueItem last = items[items.length-1];
+// if (!last.param.getInQueue()) {
+// // la derniere n'est pas en queue, donc plus de simulation en queue
+// simulationManager.setAutoLaunch(false);
+// }
+// } else {
+// // aucun simulation, donc forcement plus en queue non plus
+// simulationManager.setAutoLaunch(false);
+// }
+// }
+// }
+// }
+//
+//// } catch (Exception eee) {
+// } catch (Throwable eee) {
+// try {
+// // on sauvegarde l'erreur rencontrée, elle sera traité lors
+// // du fireRemoveEvent
+// simItem.lastSimulation.getInformation().setException(eee);
+// } catch (Exception e) {
+// if (log.isWarnEnabled()) {
+// log.warn(_("isisfish.error.during.simulation.information.file", simItem.id), eee);
+// }
+// } finally {
+// // error during simulation, remove bad simulation
+// simulationManager.fireRemoveEvent(simItem.id);
+// if (log.isWarnEnabled()) {
+// log.warn(_("isisfish.error.during.simulation", simItem.id), eee);
+// }
+// }
+//
+// } finally {
+// simItem = null;
+// }
+// }
+// }
+// }
+
+// /**
+// * Utilise pour les simulations avec plan d'analyse dependant
+// */
+// static class SimulationPlanJob implements Runnable {
+//
+// protected SimulationManager simulationManager;
+// protected SimulationItemPlan item;
+//
+// public SimulationPlanJob(SimulationManager simulationManager, SimulationItemPlan item) {
+// this.simulationManager = simulationManager;
+// this.item = item;
+// }
+//
+// public void run() {
+// try {
+// log.debug("use if has next simulation: " + item.id);
+// // on traite tout l'simItem dans le meme thread
+// while (simulationManager.exists(item.id) && item.hasNext()) {
+// SimulationStorage sim = item.getSimulation();
+// String simId = sim.getName();
+// log.debug("Start simulation: " + simId);
+// SimulationControl control = item.control;
+// // set date to 0 at beginning of simulation
+// control.setDate(new Date());
+// control.setProgress(0);
+// control.setStarted(true);
+//
+// simulationManager.fireStartEvent(item.id);
+// try {
+// sim = SimulationHelper.simulate(control, sim);
+// item.setLastSimulation(sim);
+// } finally {
+// simulationManager.fireStopEvent(item.id);
+// }
+// // copie les exports de simulation dans le repertoire
+// // souhaiter par l'utilisateur
+// SimulationParameter param = sim.getParameter();
+// if (param.getExportNames() != null &&
+// param.getExportNames().size() > 0) {
+// File exportDir = IsisConfig.getResultExportDirectory(
+// sim.getDirectory());
+// FileUtil.copyAndRenameRecursively(
+//
+// exportDir,
+// new File(param.getExportDirectory()),
+// exportDir.getName(), item.id);
+//// FileUtil.copyAndRenameRecursively(
+//// exportDir,
+//// new File(sim.getDirectory(), IsisConfig.RESULT_EXPORT),
+//// IsisConfig.RESULT_EXPORT, simItem.id);
+// }
+// }
+//
+// if (item.lastSimulation != null) {
+// SimulationParameter param = item.param;
+// // Si l'utilisateur souhaite seulement les exports
+// // on supprimer la/les simulations. Il faut le faire
+// // lorsqu'il n'y a plus de next car le calcul des plans
+// // peut avoir besoin des simulations precedentes
+// if (param.getOnlyExport()) {
+// if (param.getUseAnalysePlan()) {
+// for (File file : FileUtil.find(
+// IsisConfig.getSimulationDirectory(),
+// item.id + "_[0-9]+$", false)) {
+// log.debug("Delete simulation " + file);
+// FileUtil.deleteRecursively(file);
+// }
+// } else {
+// item.lastSimulation.delete(false);
+// }
+// }
+// }
+// // on previent que c la fin de la simulation
+// simulationManager.fireRemoveEvent(item.id);
+// } catch (Throwable eee) {
+// try {
+// // on sauvegarde l'erreur rencontrée, elle sera traité lors
+// // du fireRemoveEvent
+// if (item.lastSimulation != null) {
+// item.lastSimulation.getInformation().setException(eee);
+// }
+// } catch (Exception e) {
+// if (log.isWarnEnabled()) {
+// log.warn(_("isisfish.error.during.simulation.information.file", item.id), eee);
+// }
+// } finally {
+// // error during simulation, remove bad simulation
+// simulationManager.fireRemoveEvent(item.id);
+// if (log.isWarnEnabled()) {
+// log.warn(_("isisfish.error.during.simulation", item.id), eee);
+// }
+// }
+//
+// } finally {
+// item = null;
+// }
+// }
+//
+// }
+
/**
- * Thread permettant de faire les simulations se trouvant dans la queue
- * passée en parametre.
- * <p>
- * Si la simulation prise dans la queue n'existe plus, au moment ou on
- * souhaite l'utiliser dans le {@link SimulationManager} alors elle est
- * passée et on en recherche une autre.
- *
- * @author poussin
+ * Utilise pour les simulations sans plan d'analyse ou des plans independant
*/
- static class SimulationThread extends Thread {
+ static class SimulationJob implements Runnable {
+
protected SimulationManager simulationManager;
- protected BlockingQueue<QueueItem> queue;
+ protected SimulationItem simItem;
/**
- *
- * @param name just small name to differenciate thread (local/remote)
- * @param simulationManager le manager de simulation
- * @param queue la queue de simulations
+ *
+ * @param simulationManager
+ * @param parentId si ce job est le resulat d'un plan d'analyse
+ * independant, sinon null ou la meme valeur que id
+ * @param id l'identifiant de la simulation (avec _N pour ceux qui
+ * proviennent d'un plan d'analyse)
+ * @param zip le zip contenant la simulation
*/
- public SimulationThread(String name, SimulationManager simulationManager, BlockingQueue<QueueItem> queue) {
- super("Simulation Thread " + name);
+ public SimulationJob(SimulationManager simulationManager,
+ SimulationItem item) {
this.simulationManager = simulationManager;
- this.queue = queue;
+ this.simItem = item;
}
-
- /* (non-Javadoc)
- * @see java.lang.Thread#run()
- */
- @Override
+
public void run() {
- log.info("Start simulation thread");
- while (true) {
- // item qui sert a faire la simulation courante
- QueueItem item = null;
- try {
- //
- // recheche d'une simulation
- //
- while (item == null) {
- log.debug("try to take simulation");
- item = queue.take();
- log.debug("Just take " + item.id);
- if (!simulationManager.exists(item.id)) {
- // on ne le retrouve pas dans la map, la simulation
- // a donc ete supprimée par l'utilisateur on passe a la
- // suivante
- item = null;
- } else if (!simulationManager.isAutoLaunch() && item.param.getInQueue()) {
- // don't use item, because is queue and queue is not launched
- queue.add(item);
- item = null;
- // sleep 1s. Because all other item is in queue too
- // this sleep permit to user to put not queue item,
- // with out eat cpu
- sleep(1000);
- }
- }
+ try {
+ // si l'simItem exist encore (que l'utilisateur ne la pas retire)
+ while (simulationManager.exists(simItem.getPlanIdOrId()) &&
+ simItem.hasNext()) {
+ SimulationItem item = simItem.next();
+ try {
+ String id = item.id;
- log.debug("use if has next simulation: " + item.id);
- if (item.hasNext()) {
- SimulationStorage sim = item.getSimulation();
- String simId = sim.getName();
- log.debug("Start simulation: " + simId);
+ log.debug("Start simulation: " + id);
+ SimulationStorage simulation = item.getSimulation();
SimulationControl control = item.control;
// set date to 0 at beginning of simulation
control.setDate(new Date());
control.setProgress(0);
+ control.setStarted(true);
- simulationManager.fireStartEvent(item.id);
+ simulationManager.fireStartEvent(id, item);
try {
- sim = SimulationHelper.simulate(control, sim);
- item.setLastSimulation(sim);
+ simulation = SimulationHelper.simulate(control, simulation);
+ item.setLastSimulation(simulation);
} finally {
- simulationManager.fireStopEvent(item.id);
+ simulationManager.fireStopEvent(id);
}
// copie les exports de simulation dans le repertoire
// souhaiter par l'utilisateur
- SimulationParameter param = sim.getParameter();
- if (param.getExportNames() != null && param.getExportNames().size() > 0) {
- File exportDir = IsisConfig.getResultExportDirectory(sim.getDirectory());
+ SimulationParameter param = simulation.getParameter();
+ if (param.getExportNames() != null &&
+ param.getExportNames().size() > 0) {
+ File exportDir = IsisConfig.getResultExportDirectory(
+ simulation.getDirectory());
FileUtil.copyAndRenameRecursively(
exportDir,
new File(param.getExportDirectory()),
- exportDir.getName(), item.id);
+ // FIXME, est-ce bien parentId et pas id ?
+ exportDir.getName(), id);
// FileUtil.copyAndRenameRecursively(
// exportDir,
// new File(sim.getDirectory(), IsisConfig.RESULT_EXPORT),
-// IsisConfig.RESULT_EXPORT, item.id);
+// IsisConfig.RESULT_EXPORT, simItem.id);
}
-
- if (item.hasNext() && simulationManager.exists(item.id)) {
- // il y a encore des simulations a faire pour cet item
- // on le remet dans la queue (on ne fait pas les autres
- // simulations de cet item
- // tout de suite car l'item peut-etre un item de queue
- // moins prioritaire que les autres simulations
- // il faut donc qu'il reprenne sa place dans l'ordre)
-
- queue.add(item);
- } else {
- // Si l'utilisateur souhaite seulement les exports
- // on supprimer la/les simulations. Il faut le faire
- // lorsqu'il n'y a plus de next car le calcul des plans
- // peut avoir besoin des simulations precedentes
- if (param.getOnlyExport()) {
- if (param.getUseAnalysePlan()) {
- for(File file : FileUtil.find(
- IsisConfig.getSimulationDirectory(),
- item.id + "_[0-9]+$", false)) {
- log.debug("Delete simulation " + file);
- FileUtil.deleteRecursively(file);
- }
- } else {
- sim.delete(false);
- }
+ // Si l'utilisateur souhaite seulement les exports
+ // on supprimer la/les simulations.
+ // pour les plan dependant il faut le faire apres toutes
+ // les simulations
+ if (simItem.isIndependent() && param.getOnlyExport()) {
+ simulation.delete(false);
+ }
+ // on previent que c la fin de la simulation
+ simulationManager.fireRemoveEvent(id);
+ } catch (Throwable eee) {
+ try {
+ // on sauvegarde l'erreur rencontrée, elle sera traité lors
+ // du fireRemoveEvent
+ item.getSimulation().getInformation().setException(eee);
+ } catch (Exception e) {
+ if (log.isWarnEnabled()) {
+ log.warn(_("isisfish.error.during.simulation.information.file", item.id), eee);
}
+ } finally {
+ // error during simulation, remove bad simulation
simulationManager.fireRemoveEvent(item.id);
-
- if (simulationManager.isAutoLaunch() && item.param.getInQueue()) {
- // if item is last in queue, stop the queue after that
- QueueItem [] items = queue.toArray(new QueueItem[queue.size()]);
- if (items.length > 0) {
- QueueItem last = items[items.length-1];
- if (!last.param.getInQueue()) {
- // la derniere n'est pas en queue, donc plus de simulation en queue
- simulationManager.setAutoLaunch(false);
- }
- } else {
- // aucun simulation, donc forcement plus en queue non plus
- simulationManager.setAutoLaunch(false);
- }
+ if (log.isWarnEnabled()) {
+ log.warn(_("isisfish.error.during.simulation", item.id), eee);
}
}
}
-
-// } catch (Exception eee) {
- } catch (Throwable eee) {
- try {
- // on sauvegarde l'erreur rencontrée, elle sera traité lors
- // du fireRemoveEvent
- item.lastSimulation.getInformation().setException(eee);
- } catch (Exception e) {
- if (log.isWarnEnabled()) {
- log.warn(_("isisfish.error.during.simulation.information.file", item.id), eee);
- }
- } finally {
- // error during simulation, remove bad simulation
- simulationManager.fireRemoveEvent(item.id);
- if (log.isWarnEnabled()) {
- log.warn(_("isisfish.error.during.simulation", item.id), eee);
- }
- }
-
- } finally {
- item = null;
}
+ } catch (Exception eee) {
+ log.error("Can't take next simulation: " + simItem.id, eee);
}
- }
+ // suppression des simulations pour les plans dependants
+ // Si l'utilisateur souhaite seulement les exports
+ // on supprimer la/les simulations. Il faut le faire
+ // lorsqu'il n'y a plus de next car le calcul des plans
+ // peut avoir besoin des simulations precedentes
+ if (!simItem.isIndependent() && simItem.param.getOnlyExport()) {
+ for (File file : FileUtil.find(
+ IsisConfig.getSimulationDirectory(),
+ simItem.id + "_[0-9]+$", false)) {
+ log.debug("Delete simulation " + file);
+ FileUtil.deleteRecursively(file);
+ }
+ }
+
+ if (!simItem.control.isRunning() && simItem.hasSimulation()) {
+ // c'etait la derniere simulation du plan, on arrete le plan
+ simulationManager.fireStopEvent(simItem.id);
+ simulationManager.fireRemoveEvent(simItem.id);
+ }
+ }
}
/**
- * Permet de comparer les simulations pour les ordonner.
- * Les simulations de queue soit moins prioritaire que les autres, ensuite
- * l'ordre se fait sur la date d'arrivé dans la queue de simulation
- *
- * @author poussin
+ * Une simulation a faire sans plan d'experience
*/
- public class QueueItem implements Comparable<QueueItem> {
-
- protected long time;
+ public class SimulationItem {
protected String id;
protected SimulationParameter param;
- protected PlanGenerator plan = null;
+ protected SimulationItemPlan planItem = null;
protected File zip;
protected SimulationControl control;
protected SimulationStorage lastSimulation = null;
- public QueueItem(String id, SimulationParameter param) {
- this.time = System.nanoTime();
+ protected SimulationItem() {
+ }
+
+ public boolean isIndependent() {
+ return true;
+ }
+
+ /**
+ * Utilise pour servir sous simItem pour les items de plan d'experience
+ * @param id
+ * @param control
+ * @param sim
+ */
+ public SimulationItem(SimulationItemPlan planItem, SimulationControl control,
+ SimulationStorage sim) {
+ this.planItem = planItem;
+ this.id = sim.getName();
+ param = sim.getParameter();
+ this.control = control;
+ lastSimulation = sim;
+ }
+
+ /**
+ * Retourne l'id du plan qui a genere cet item, si cet item n'est
+ * pas genere par un plan, retourne directement l'id
+ * @return
+ */
+ public String getPlanIdOrId() {
+ String result = id;
+ if (hasPlanItem()) {
+ result = getPlanItem().id;
+ }
+ return result;
+ }
+
+ public SimulationItemPlan getPlanItem() {
+ return planItem;
+ }
+
+ public boolean hasPlanItem() {
+ boolean result = planItem != null;
+ return result;
+ }
+
+ /**
+ * creer un simItem de simulation et prepare le zip
+ * @param id
+ * @param param
+ */
+ public SimulationItem(String id, SimulationParameter param) {
this.id = id;
this.param = param;
this.control = new SimulationControl(id);
+ zip = SimulationHelper.prepareSimulationZipFile(control, param, true);
+ }
+
+ public boolean hasSimulation() {
+ boolean result = lastSimulation != null;
+ return result;
+ }
+
+ /**
+ * Retourne la simulation qu'il faut faire
+ * @return le storage de simulation
+ * @throws Exception si problème pendant l'import de la simulation
+ */
+ public SimulationStorage getSimulation() throws Exception {
+ if (lastSimulation == null) {
+ lastSimulation = SimulationStorage.importAndRenameZip(zip, id);
+ }
+ return lastSimulation;
+ }
+
+ /**
+ * Appelé apres que la simulation est vraiment eu lieu. On en a besoin
+ * car pour une simulation distante apres la simulation le storage
+ * a ete changé par rapport au storage initialement cree pour la
+ * simulation
+ *
+ * @param lastSimulation The lastSimulation to set.
+ */
+ public void setLastSimulation(SimulationStorage lastSimulation) {
+ this.lastSimulation = lastSimulation;
+ if (hasPlanItem()) {
+ getPlanItem().setLastSimulation(lastSimulation);
+ }
+ }
+
+ /**
+ * @return <code>true</code> s'il y a encore une simulation si on
+ * utilise un plan et qu'il dit qu'il y en a encore, ou si la simulation
+ * n'a pas encore ete faite.
+ */
+ public boolean hasNext() {
+ boolean result;
+ result = !control.isStarted();
+ return result;
+ }
+
+ /**
+ * Ce retourne lui meme, car il n'y a pas de plan
+ * @return
+ */
+ public SimulationItem next() throws Exception {
+ return this;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ boolean result = false;
+ if (obj instanceof SimulationItem) {
+ result = param.equals(((SimulationItem)obj).param);
+ }
+ return result;
+ }
+
+ @Override
+ public int hashCode() {
+ int hash = 3;
+ hash = 53 * hash + (this.param != null ? this.param.hashCode() : 0);
+ return hash;
+ }
+
+ }
+
+ /**
+ * Une simulation a faire qui contient un plan d'experience dependant
+ */
+ public class SimulationItemPlan extends SimulationItem implements PropertyChangeListener {
+ // FIXME a mettre en config MAX_SIMULATION_PLAN
+ // nombre maximal de simulation de plan par simulation
+ // (pour eviter les plans qui ne retroune jamais faux
+ protected static final int MAX_SIMULATION_PLAN = 10000;
+
+ protected int simulationNumber = 0;
+ protected int simulationFinished = 0;
+ protected PlanGenerator plan = null;
+
+ public SimulationItemPlan(String id, SimulationParameter param) {
+ this.id = id;
+ this.param = param;
+ this.control = new SimulationControl(id);
// ne pas inverser la creation de PlanGenerator et du zip.
// car le init des plans est fait dans le constructeur de
// PlanGenerator, et le init peut modifier les parametres
// de simulation
- if (param.getUseAnalysePlan()) {
- plan = new PlanGenerator(id, control, param);
+ if (!param.getUseAnalysePlan()) {
+ throw new SimulationException("Your simulation is not a plan:" + id);
}
+
+ plan = new PlanGenerator(id, control, param);
zip = SimulationHelper.prepareSimulationZipFile(control, param, true);
- if (plan != null) {
- plan.setZip(zip);
- }
+ plan.setZip(zip);
}
+ @Override
+ public boolean isIndependent() {
+ return false;
+ }
+
/**
* Retourne la simulation qu'il faut faire
* @return le storage de simulation
* @throws Exception si problème pendant l'import de la simulation
*/
+ @Override
public SimulationStorage getSimulation() throws Exception {
+ throw new UnsupportedOperationException("Plan item don't have simulation");
+ }
+
+ /**
+ * Retourne la simulation qu'il faut faire
+ * @return le storage de simulation
+ * @throws Exception si problème pendant l'import de la simulation
+ */
+ public SimulationStorage getNextSimulation() throws Exception {
SimulationStorage result;
- if (plan != null) {
- result = plan.next();
- } else {
- result = SimulationStorage.importAndRenameZip(zip, id);
- }
+ result = plan.next();
+ simulationNumber++;
lastSimulation = result;
return result;
}
@@ -512,11 +940,10 @@
*
* @param lastSimulation The lastSimulation to set.
*/
+ @Override
public void setLastSimulation(SimulationStorage lastSimulation) {
this.lastSimulation = lastSimulation;
- if (plan != null) {
- plan.setLastSimulation(lastSimulation);
- }
+ plan.setLastSimulation(lastSimulation);
}
/**
@@ -524,47 +951,66 @@
* utilise un plan et qu'il dit qu'il y en a encore, ou si la simulation
* n'a pas encore ete faite.
*/
+ @Override
public boolean hasNext() {
boolean result;
- result = (plan != null && plan.hasNext()) || lastSimulation == null;
+ result = simulationNumber < MAX_SIMULATION_PLAN &&
+ ((plan != null && plan.hasNext()) || lastSimulation == null);
return result;
}
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
+ /**
+ * On utilise le meme control pour les plans dependants
+ * @return
*/
@Override
- public boolean equals(Object obj) {
- boolean result = false;
- if (obj instanceof QueueItem) {
- result = param.equals(((QueueItem)obj).param);
- }
+ public SimulationItem next() throws Exception {
+ SimulationStorage sim = getNextSimulation();
+ SimulationItem result = new SimulationItem(this, control, sim);
return result;
}
- /* (non-Javadoc)
- * @see java.lang.Comparable#compareTo(java.lang.Object)
- */
- public int compareTo(QueueItem o) {
- int result;
-
- boolean inQueue1 = param.getInQueue();
- boolean inQueue2 = o.param.getInQueue();
- if (inQueue1 == inQueue2) {
- // this et o ont la meme valeur, on compare les temps
- // le plus vieux devant (donc le plus petit)
- result = time<o.time ? -1 : (time==o.time ? 0 : 1);
- } else if (inQueue1) {
- // this est dans la queue donc moins prioritaire
- // on le met donc a la fin
- result = 1;
- } else {
- // o est dans la queue donc moins prioritaire
- result = -1;
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (Boolean.FALSE.equals(evt.getNewValue())) {
+ simulationFinished++;
+ control.setProgress(simulationFinished);
+ control.setText(simulationFinished + " / " + simulationNumber);
+ if (simulationFinished >= simulationNumber) {
+ control.stopSimulation();
+ }
}
+ }
+ }
+
+ /**
+ * Une simulation a faire qui contient un plan d'experience independant
+ */
+ public class SimulationItemPlanIndependent extends SimulationItemPlan {
+
+ public SimulationItemPlanIndependent(String id, SimulationParameter param) {
+ super(id, param);
+ }
+
+ @Override
+ public boolean isIndependent() {
+ return true;
+ }
+
+ /**
+ * On utilise un nouveau control pour les plans independants
+ * @return
+ */
+ @Override
+ public SimulationItem next() throws Exception {
+ SimulationStorage sim = getNextSimulation();
+ control.setProgressMax(simulationNumber);
+ SimulationControl control = new SimulationControl(sim.getName());
+ control.addPropertyChangeListener("running", this);
+ SimulationItem result = new SimulationItem(this, control, sim);
return result;
}
+
}
}
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationParameter.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationParameter.java 2008-08-07 17:05:40 UTC (rev 1290)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationParameter.java 2008-08-07 19:38:45 UTC (rev 1291)
@@ -127,6 +127,9 @@
/** La simulation doit etre faite en local */
protected boolean local = true;
+ /** La simulation doit etre faite dans un sous process */
+ protected boolean subProcess = false;
+
/** La simulation doit etre lancé dans la queue de simulation (non prioritaire)*/
protected boolean inQueue = false;
@@ -273,6 +276,7 @@
result.setProperty("exports", exportList);
result.setProperty("local", String.valueOf(local));
+ result.setProperty("subProcess", String.valueOf(subProcess));
result.setProperty("inQueue", String.valueOf(inQueue));
result.setProperty("usePreScript", String.valueOf(usePreScript));
result.setProperty("preScript", preScript);
@@ -415,6 +419,7 @@
}
local = Boolean.parseBoolean(props.getProperty("local", "true"));
+ subProcess = Boolean.parseBoolean(props.getProperty("subProcess", "false"));
inQueue = Boolean.parseBoolean(props.getProperty("inQueue", "false"));
usePreScript = Boolean.parseBoolean(props.getProperty("usePreScript",
"false"));
@@ -680,7 +685,14 @@
this.local = local;
}
+ public void setSubProcess(boolean subProcess) {
+ this.subProcess = subProcess;
+ }
+ public boolean isSubProcess() {
+ return subProcess;
+ }
+
/**
* @return Returns the inQueue.
*/
@@ -715,6 +727,17 @@
public boolean getUseStatistic() {
return this.useStatistic;
}
+
+ public boolean isIndependentPlan() {
+ boolean result = true;
+ for (AnalysePlan plan : getAnalysePlans()) {
+ if (!(plan instanceof AnalysePlanIndependent)) {
+ result = false;
+ break;
+ }
+ }
+ return result;
+ }
/**
* @param useStatistic The useStatistic to set.
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationQueueModel.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationQueueModel.java 2008-08-07 17:05:40 UTC (rev 1290)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationQueueModel.java 2008-08-07 19:38:45 UTC (rev 1291)
@@ -31,6 +31,9 @@
package fr.ifremer.isisfish.simulator;
+import java.util.ArrayList;
+import java.util.List;
+
/** @author poussin */
public class SimulationQueueModel extends AbstractSimulationQueueModel {
@@ -53,13 +56,13 @@
* @see AbstractSimulationQueueModel at getSimulationIds()
*/
protected java.util.List<String> getSimulationIds() {
- return getQueue().ids;
+ return getQueue().getIds();
}
/* (non-Javadoc)
* @see AbstractSimulationQueueModel at getQueueItemsAsMap()
*/
- protected java.util.Map<String, SimulationManager.QueueItem> getQueueItemsAsMap() {
+ protected java.util.Map<String, SimulationManager.SimulationItem> getQueueItemsAsMap() {
return getQueue().map;
}
@@ -89,18 +92,4 @@
progress.remove(id);
}
- /* (non-Javadoc)
- * @see SimulationQueueListener#simulationStart(fr.ifremer.isisfish.simulator.SimulationQueueEvent)
- */
- public void simulationStart(SimulationQueueEvent e) {
- // nothing to do
- }
-
- /* (non-Javadoc)
- * @see SimulationQueueListener#simulationStop(fr.ifremer.isisfish.simulator.SimulationQueueEvent)
- */
- public void simulationStop(SimulationQueueEvent e) {
- // nothing to do
- }
-
} // SimulationQueueModel
\ No newline at end of file
Deleted: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationQueueModelOld.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationQueueModelOld.java 2008-08-07 17:05:40 UTC (rev 1290)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/SimulationQueueModelOld.java 2008-08-07 19:38:45 UTC (rev 1291)
@@ -1,409 +0,0 @@
-/* *##%
- * Copyright (C) 2006
- * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin
- *
- * 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 2
- * 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *##%*/
-
-/* *
- * SimulationQueueModel.java
- *
- * Created: 18 août 2006 00:05:41
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
-
-package fr.ifremer.isisfish.simulator;
-
-import static org.codelutin.i18n.I18n._;
-
-import java.awt.Component;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.swing.JComponent;
-import javax.swing.JProgressBar;
-import javax.swing.JTable;
-import javax.swing.event.EventListenerList;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import javax.swing.table.TableCellRenderer;
-import javax.swing.table.TableModel;
-
-import org.codelutin.log.LutinLog;
-import org.codelutin.log.LutinLogFactory;
-
-
-/**
- * @author poussin
- *
- */
-
-public class SimulationQueueModelOld extends JComponent implements TableModel, SimulationQueueListener, PropertyChangeListener {
-
- /** to use log facility, just put in your code: log.info("..."); */
- static private LutinLog log = LutinLogFactory.getLutinLog(SimulationQueueModel.class);
-
- /** List of listeners */
- protected EventListenerList listenerList = new EventListenerList();
-
- protected SimulationManager queue;
- protected String [] header = new String[]{_("isisfish.queue.id"),_("isisfish.queue.plan"),_("isisfish.queue.name"),_("isisfish.queue.local"),_("isisfish.queue.status"),_("isisfish.queue.progression")};
- protected Class [] columnClass = new Class[]{String.class, String.class, Boolean.class, Boolean.class, String.class, JProgressBar.class};
-
- protected Map<String, JProgressBar> progress = new HashMap<String, JProgressBar>();
-
- /**
- * use SimulationQueue.getInstance() as queue
- */
- public SimulationQueueModelOld() {
- this(SimulationManager.getInstance());
- }
-
- /**
- * if queue is null, then the model used SimulationQueue.getInstance() as queue
- */
- public SimulationQueueModelOld(SimulationManager queue) {
- this.queue = queue;
- if (queue == null) {
- this.queue = SimulationManager.getInstance();
- }
- this.queue.addSimulationQueueListener(this);
-
- // add this model as listener on all already launched simulation
- for (String id : this.queue.ids) {
- SimulationControl control = this.queue.getControl(id);
- if (control != null) {
- control.addPropertyChangeListener(this);
- }
- }
- }
-
- /**
- * @param queue The queue to set.
- */
- public void setQueue(SimulationManager queue) {
- this.queue = queue;
- fireTableDataChanged();
- }
-
- /* (non-Javadoc)
- * @see javax.swing.table.TableModel#getRowCount()
- */
- public int getRowCount() {
- int result = queue.ids.size();
- return result;
- }
-
- /* (non-Javadoc)
- * @see javax.swing.table.TableModel#getColumnCount()
- */
- public int getColumnCount() {
- return header.length;
- }
-
- /* (non-Javadoc)
- * @see javax.swing.table.AbstractTableModel#getColumnName(int)
- */
- public String getColumnName(int column) {
- return header[column];
- }
-
- /* (non-Javadoc)
- * @see javax.swing.table.AbstractTableModel#getColumnClass(int)
- */
- public Class<?> getColumnClass(int columnIndex) {
- return columnClass[columnIndex];
- }
-
- public SimulationControl getSimulationControl(int rowIndex) {
- SimulationControl result = null;
- if (rowIndex >= 0) {
- String id = queue.ids.get(rowIndex);
- result = queue.getControl(id);
- } else {
- log.user(_("isisfish.error.invalide.simulation.index"));
- }
- return result;
- }
-
- /* (non-Javadoc)
- * @see javax.swing.table.TableModel#getValueAt(int, int)
- */
- public Object getValueAt(int rowIndex, int columnIndex) {
- Object result = "";
- if (rowIndex >= queue.ids.size()) {
- return "error";
- }
- String id = queue.ids.get(rowIndex);
- SimulationControl control = queue.getControl(id);
- switch (columnIndex) {
- case 0:
- result = id;
- break;
- case 1:
- int number = queue.getParameter(id).getAnalysePlanNumber();
- if (number >= 0) {
- result = number;
- } else {
- result = _("isisfish.common.no");
- }
- break;
- case 2:
- result = queue.getParameter(id).getInQueue();
- break;
- case 3:
- result = queue.getParameter(id).getLocal();
- break;
- case 4:
- if (control != null) {
- if (control.isStopSimulationRequest()) {
- result = _("isisfish.launch.stop");
- } else {
- result = control.getText();
- }
- }
- break;
- case 5:
- JProgressBar pb = getProgressBar(id);
- if (control != null) {
- pb.setMaximum(control.getProgressMax());
- pb.setValue(control.getProgress());
- pb.setString(control.date.getMonth() + "/" + control.date.getYear());
- }
- result = pb;
- break;
- }
- return result;
- }
-
- protected JProgressBar getProgressBar(String id) {
- JProgressBar result = progress.get(id);
- if (result == null) {
- result = new JProgressBar(JProgressBar.HORIZONTAL, 0, 100);
- result.setStringPainted(true);
- progress.put(id, result);
- }
- return result;
- }
-
- /* (non-Javadoc)
- * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent evt) {
- SimulationControl control = (SimulationControl)evt.getSource();
- int row = queue.ids.indexOf(control.getId());
- fireTableRowsUpdated(row, row);
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.simulator.SimulationQueueListener#simulationAdded(fr.ifremer.isisfish.simulator.SimulationQueueEvent)
- */
- public void simulationAdded(SimulationQueueEvent e) {
- int row = getRowCount();
- fireTableRowsInserted(row, row);
- SimulationControl control = queue.getControl(e.getId());
- control.addPropertyChangeListener(this);
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.simulator.SimulationQueueListener#simulationRemoved(fr.ifremer.isisfish.simulator.SimulationQueueEvent)
- */
- public void simulationWillBeRemoved(SimulationQueueEvent e) {
- String id = e.getId();
-
- SimulationControl control = queue.getControl(id);
- if (control != null) {
- control.removePropertyChangeListener(this);
- }
-
- int row = queue.ids.indexOf(id);
- fireTableRowsDeleted(row, row);
- progress.remove(id);
- }
-
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.simulator.SimulationQueueListener#simulationStart(fr.ifremer.isisfish.simulator.SimulationQueueEvent)
- */
- public void simulationStart(SimulationQueueEvent e) {
- // nothing to do
- }
- /* (non-Javadoc)
- * @see fr.ifremer.isisfish.simulator.SimulationQueueListener#simulationStop(fr.ifremer.isisfish.simulator.SimulationQueueEvent)
- */
- public void simulationStop(SimulationQueueEvent e) {
- // nothing to do
- }
-
- /* (non-Javadoc)
- * @see javax.swing.table.TableModel#isCellEditable(int, int)
- */
- public boolean isCellEditable(int rowIndex, int columnIndex) {
- return false;
- }
-
- /* (non-Javadoc)
- * @see javax.swing.table.TableModel#setValueAt(java.lang.Object, int, int)
- */
- public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
- }
-
- /* (non-Javadoc)
- * @see javax.swing.table.TableModel#addTableModelListener(javax.swing.event.TableModelListener)
- */
- public void addTableModelListener(TableModelListener l) {
- listenerList.add(TableModelListener.class, l);
- if (l instanceof JTable) {
- ((JTable)l).setDefaultRenderer(JProgressBar.class, new JProgressBarTableCellRenderer());
- }
-
- }
-
- /* (non-Javadoc)
- * @see javax.swing.table.TableModel#removeTableModelListener(javax.swing.event.TableModelListener)
- */
- public void removeTableModelListener(TableModelListener l) {
- listenerList.remove(TableModelListener.class, l);
- }
-
- /**
- * Notifies all listeners that all cell values in the table's
- * rows may have changed. The number of rows may also have changed
- * and the <code>JTable</code> should redraw the
- * table from scratch. The structure of the table (as in the order of the
- * columns) is assumed to be the same.
- *
- * @see TableModelEvent
- * @see EventListenerList
- * @see JTable#tableChanged(TableModelEvent)
- */
- public void fireTableDataChanged() {
- fireTableChanged(new TableModelEvent(this));
- }
-
- /**
- * Notifies all listeners that the table's structure has changed.
- * The number of columns in the table, and the names and types of
- * the new columns may be different from the previous state.
- * If the <code>JTable</code> receives this event and its
- * <code>autoCreateColumnsFromModel</code>
- * flag is set it discards any table columns that it had and reallocates
- * default columns in the order they appear in the model. This is the
- * same as calling <code>setModel(TableModel)</code> on the
- * <code>JTable</code>.
- *
- * @see TableModelEvent
- * @see EventListenerList
- */
- public void fireTableStructureChanged() {
- fireTableChanged(new TableModelEvent(this, TableModelEvent.HEADER_ROW));
- }
-
- /**
- * Notifies all listeners that rows in the range
- * <code>[firstRow, lastRow]</code>, inclusive, have been inserted.
- *
- * @param firstRow the first row
- * @param lastRow the last row
- *
- * @see TableModelEvent
- * @see EventListenerList
- *
- */
- public void fireTableRowsInserted(int firstRow, int lastRow) {
- fireTableChanged(new TableModelEvent(this, firstRow, lastRow,
- TableModelEvent.ALL_COLUMNS, TableModelEvent.INSERT));
- }
-
- /**
- * Notifies all listeners that rows in the range
- * <code>[firstRow, lastRow]</code>, inclusive, have been updated.
- *
- * @param firstRow the first row
- * @param lastRow the last row
- *
- * @see TableModelEvent
- * @see EventListenerList
- */
- public void fireTableRowsUpdated(int firstRow, int lastRow) {
- fireTableChanged(new TableModelEvent(this, firstRow, lastRow,
- TableModelEvent.ALL_COLUMNS, TableModelEvent.UPDATE));
- }
-
- /**
- * Notifies all listeners that rows in the range
- * <code>[firstRow, lastRow]</code>, inclusive, have been deleted.
- *
- * @param firstRow the first row
- * @param lastRow the last row
- *
- * @see TableModelEvent
- * @see EventListenerList
- */
- public void fireTableRowsDeleted(int firstRow, int lastRow) {
- fireTableChanged(new TableModelEvent(this, firstRow, lastRow,
- TableModelEvent.ALL_COLUMNS, TableModelEvent.DELETE));
- }
-
- /**
- * Notifies all listeners that the value of the cell at
- * <code>[row, column]</code> has been updated.
- *
- * @param row row of cell which has been updated
- * @param column column of cell which has been updated
- * @see TableModelEvent
- * @see EventListenerList
- */
- public void fireTableCellUpdated(int row, int column) {
- fireTableChanged(new TableModelEvent(this, row, row, column));
- }
-
- /**
- * Forwards the given notification event to all
- * <code>TableModelListeners</code> that registered
- * themselves as listeners for this table model.
- *
- * @param e the event to be forwarded
- *
- * @see #addTableModelListener
- * @see TableModelEvent
- * @see EventListenerList
- */
- public void fireTableChanged(TableModelEvent e) {
- // Guaranteed to return a non-null array
- Object[] listeners = listenerList.getListenerList();
- // Process the listeners last to first, notifying
- // those that are interested in this event
- for (int i = listeners.length-2; i>=0; i-=2) {
- if (listeners[i]==TableModelListener.class) {
- ((TableModelListener)listeners[i+1]).tableChanged(e);
- }
- }
- }
-
-
- public class JProgressBarTableCellRenderer implements TableCellRenderer {
- public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
- return (JProgressBar)value;
- }
- }// JProgressBarTableCellRenderer
-
-}
\ No newline at end of file
Modified: branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/ui/simulator/SimulatorListeners.java
===================================================================
--- branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/ui/simulator/SimulatorListeners.java 2008-08-07 17:05:40 UTC (rev 1290)
+++ branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/ui/simulator/SimulatorListeners.java 2008-08-07 19:38:45 UTC (rev 1291)
@@ -115,8 +115,10 @@
* <code>false</code> otherwise
*/
public static boolean isSimulStartButtonEnabled(JTable table) {
- return !SimulationManager.getInstance().isAutoLaunch() &&
- (table.getRowCount() > 0);
+ return false;
+ // L'auto launche a disparu maintenant
+// return !SimulationManager.getInstance().isAutoLaunch() &&
+// (table.getRowCount() > 0);
}
/**
1
0
Author: bpoussin
Date: 2008-08-07 17:05:40 +0000 (Thu, 07 Aug 2008)
New Revision: 1290
Added:
branches/isis-fish-3.1.3/
Log:
sauvegarde de la version 3.1.3 avant
de casser le mecanisme de simulation
Copied: branches/isis-fish-3.1.3 (from rev 1289, branches/isis-fish-3.1.4)
1
0
Author: bpoussin
Date: 2008-08-05 20:17:04 +0000 (Tue, 05 Aug 2008)
New Revision: 1289
Removed:
branches/3.1.4/
Log:
repertoire vide maintenant
1
0
Author: bpoussin
Date: 2008-08-05 20:16:32 +0000 (Tue, 05 Aug 2008)
New Revision: 1288
Added:
branches/isis-fish-3.1.4/
Removed:
branches/3.1.4/isis-fish/
Log:
en fait comme la dit eric, c plus logique d'avoir le numero apres que avant
Copied: branches/isis-fish-3.1.4 (from rev 1287, branches/3.1.4/isis-fish)
1
0
Author: bpoussin
Date: 2008-08-05 20:14:53 +0000 (Tue, 05 Aug 2008)
New Revision: 1287
Removed:
branches/3.1.4/mod/
Log:
suppression de mod qui est vide et donc pas vraiment necessaire dans la branche
1
0
Author: bpoussin
Date: 2008-08-05 20:14:18 +0000 (Tue, 05 Aug 2008)
New Revision: 1286
Removed:
branches/3.1.4/isis-fish-data/
Log:
suppression du repertoire isis-fish-data qui a sont propre projet
1
0
Author: bpoussin
Date: 2008-08-05 20:13:46 +0000 (Tue, 05 Aug 2008)
New Revision: 1285
Removed:
branches/3.1.4/CVSROOT/
Log:
suppression du repertoire CVSROOT
1
0
Author: bpoussin
Date: 2008-08-05 20:12:39 +0000 (Tue, 05 Aug 2008)
New Revision: 1284
Added:
branches/3.1.4/
Removed:
branches/4.0.0.0/
Log:
en fait la creation de branche a fonctionne mais pas le switch,
donc trunk est tout casse et la branche est stable
Copied: branches/3.1.4 (from rev 1283, branches/4.0.0.0)
1
0
r1283 - trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore
by chatellier@users.labs.libre-entreprise.org Aug. 5, 2008
by chatellier@users.labs.libre-entreprise.org Aug. 5, 2008
Aug. 5, 2008
Author: chatellier
Date: 2008-08-05 17:57:47 +0000 (Tue, 05 Aug 2008)
New Revision: 1283
Modified:
trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/IsisH2Config.java
Log:
Change config
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/IsisH2Config.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/IsisH2Config.java 2008-08-05 17:56:11 UTC (rev 1282)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/IsisH2Config.java 2008-08-05 17:57:47 UTC (rev 1283)
@@ -19,6 +19,7 @@
package fr.ifremer.isisfish.datastore;
import fr.ifremer.isisfish.commandline.configs.IsisAbstractConfigH2;
+import fr.ifremer.isisfish.IsisContext;
import fr.ifremer.isisfish.IsisFishRuntimeException;
import fr.ifremer.isisfish.IsisFishDAOHelper;
import org.codelutin.topia.migration.TopiaMigrationServiceImpl;
@@ -50,8 +51,8 @@
}
/**
- * @param rootDir le répertoire de base du DataStorage
- * @return le répertoire de données d'un Data storage à partir de son répertoire de base
+ * @param rootDir le rᅵpertoire de base du DataStorage
+ * @return le rᅵpertoire de donnᅵes d'un Data storage ᅵ partir de son rᅵpertoire de base
* @see #STORAGE_DATA_PROPERTY_KEY
*/
static public File getStorageDataDirectory(File rootDir) {
@@ -60,15 +61,15 @@
}
//////////////////////////////////////////////////
- // Les opérations sur base embarquée
+ // Les opᅵrations sur base embarquᅵe
//////////////////////////////////////////////////
/**
* Retourne une base en memoire
*
- * @param config la configuration à remplir
+ * @param config la configuration ᅵ remplir
* @param id l'identifiant de la base
- * @return l'objet config passé en parametre
+ * @return l'objet config passᅵ en parametre
*/
static public Properties addMemDatabaseConfig(Properties config, String id) {
IsisAbstractConfigH2 conf = IsisContext.get().getH2Config();
@@ -87,11 +88,11 @@
/**
* Ajoute differente information au parametre config qui indique comment
- * se connecter a la base de données
+ * se connecter a la base de donnᅵes
*
* @param config l'objet properties dans lequel il faut ajouter les informations
* @param directory le repertoire dans lequel la base de donn?es doit se trouver
- * @return l'objet config passé en parametre
+ * @return l'objet config passᅵ en parametre
*/
static public Properties addDatabaseConfig(Properties config, File directory) {
File databasePath = getStorageDataDirectory(directory);
@@ -157,10 +158,10 @@
}
/**
- * Permet d'ajouter les differents mapping hibernate spécifique a l'application
+ * Permet d'ajouter les differents mapping hibernate spᅵcifique a l'application
*
* @param config l'objet properties dans lequel il faut ajouter les informations
- * @return l'objet config passé en parametre
+ * @return l'objet config passᅵ en parametre
*/
static public Properties addHibernateMapping(Properties config) {
config.setProperty("topia.persistence.classes",
@@ -287,12 +288,12 @@
//if (IsisConfig.UPDATESCHEMA_DATABASE) {
// migration configuration
//TODO Use config static,final,mandatory properties
- config.put(TopiaMigrationServiceImpl.MIGRATION_APPLICATION_VERSION, "1");
- config.put(TopiaMigrationServiceImpl.MIGRATION_PREVIOUS_MAPPING_DIRECTORY, "oldmappings");
- config.put(TopiaMigrationServiceImpl.MIGRATION_MODEL_NAMES, "IsisFish");
- config.put(TopiaMigrationServiceImpl.MIGRATION_CALLBACKHANDLERS,
+ config.setProperty(TopiaMigrationServiceImpl.MIGRATION_APPLICATION_VERSION, "1");
+ config.setProperty(TopiaMigrationServiceImpl.MIGRATION_PREVIOUS_MAPPING_DIRECTORY, "oldmappings");
+ config.setProperty(TopiaMigrationServiceImpl.MIGRATION_MODEL_NAMES, "IsisFish");
+ config.setProperty(TopiaMigrationServiceImpl.MIGRATION_CALLBACKHANDLERS,
fr.ifremer.isisfish.datastore.migration.SwingMigrationCallbackHandler.class.getName());
- config.put("topia.service.migration", TopiaMigrationServiceImpl.class.getName());
+ config.setProperty("topia.service.migration", TopiaMigrationServiceImpl.class.getName());
}
return config;
}
1
0
r1282 - trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/migration
by chatellier@users.labs.libre-entreprise.org Aug. 5, 2008
by chatellier@users.labs.libre-entreprise.org Aug. 5, 2008
Aug. 5, 2008
Author: chatellier
Date: 2008-08-05 17:56:11 +0000 (Tue, 05 Aug 2008)
New Revision: 1282
Modified:
trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/migration/SwingMigrationCallbackHandler.java
Log:
Change return type for migration handlers
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/migration/SwingMigrationCallbackHandler.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/migration/SwingMigrationCallbackHandler.java 2008-08-04 16:59:55 UTC (rev 1281)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/migration/SwingMigrationCallbackHandler.java 2008-08-05 17:56:11 UTC (rev 1282)
@@ -39,7 +39,7 @@
* @see org.codelutin.topia.migration.callback.MigrationCallbackHandler#doMigration(java.lang.String, java.lang.String)
*/
@Override
- public boolean doMigration(String dbVersion, String applicationVersion) {
+ public MigrationChoice doMigration(String dbVersion, String applicationVersion) {
int answer = JOptionPane
.showConfirmDialog(
@@ -52,7 +52,7 @@
JOptionPane.QUESTION_MESSAGE
);
- boolean result = ( answer == JOptionPane.YES_OPTION );
+ MigrationChoice result = ( answer == JOptionPane.YES_OPTION ) ? MigrationChoice.MIGRATION : MigrationChoice.NO_MIGRATION;
return result;
}
1
0
r1281 - in trunk/isis-fish: . doc src/java src/java/fr/ifremer/isisfish src/java/fr/ifremer/isisfish/datastore src/java/fr/ifremer/isisfish/entities src/java/fr/ifremer/isisfish/logging src/java/fr/ifremer/isisfish/logging/console src/java/fr/ifremer/isisfish/map src/java/fr/ifremer/isisfish/simulator src/java/fr/ifremer/isisfish/ui src/java/fr/ifremer/isisfish/ui/script src/java/fr/ifremer/isisfish/ui/script/action src/java/fr/ifremer/isisfish/ui/simulator src/java/fr/ifremer/isisfish/u
by bpoussin@users.labs.libre-entreprise.org Aug. 4, 2008
by bpoussin@users.labs.libre-entreprise.org Aug. 4, 2008
Aug. 4, 2008
Author: bpoussin
Date: 2008-08-04 16:59:55 +0000 (Mon, 04 Aug 2008)
New Revision: 1281
Added:
trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/
trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCS.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCSException.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/package.html
Removed:
trunk/isis-fish/src/java/fr/ifremer/isisfish/IsisContext.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/commandline/
trunk/isis-fish/src/java/fr/ifremer/isisfish/versionning/
trunk/isis-fish/src/java/org/
Modified:
trunk/isis-fish/doc/Todo.rst
trunk/isis-fish/pom.xml
trunk/isis-fish/src/java/fr/ifremer/isisfish/IsisConfig.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/IsisFish.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/AnalysePlanStorage.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/CodeSourceStorage.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/DataStorage.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/ExportStorage.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/FormuleStorage.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/IsisH2Config.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/JavaSourceStorage.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/RegionStorage.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/RuleStorage.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/ScriptStorage.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/SimulationStorage.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/SimulatorStorage.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/VersionStorage.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/entities/EquationImpl.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/logging/SimulationLoggerUtil.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/logging/console/LogConsole.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/map/IsisMapBean.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationCheckpointThread.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationExportResultWrapper.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationHelper.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationManager.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationParameter.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationProperties.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationResultXML.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/ScriptActionHelper.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/Welcome.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/script/Action.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/script/action/BackupAction.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/simulator/SimulatorAction.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/util/IsisActionWithBackup.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/util/CompileHelper.java
trunk/isis-fish/src/java/fr/ifremer/isisfish/util/EvaluatorHelper.java
trunk/isis-fish/src/resources/i18n/isis-fish-en_GB.properties
trunk/isis-fish/src/resources/i18n/isis-fish-fr_FR.properties
Log:
premier commit dans la branche
- modif de parsage d'option faite
- modif de vcs en cours
- modif de base en db4o pas fait
Modified: trunk/isis-fish/doc/Todo.rst
===================================================================
--- trunk/isis-fish/doc/Todo.rst 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/doc/Todo.rst 2008-08-04 16:59:55 UTC (rev 1281)
@@ -1,3 +1,13 @@
+- dans interface de demande de config, proposer le choix de l'emplacement de la base (montre la place disque restante)
+
+- Ajouter dans le wiki, la signification du 3eme chiffre de version (version API de script)
+
+- mettre les directory dans les storages, compiledir dans javasourcestorage
+- IsisConfig avec les options + val static
+- IsisAction avec les actions
+
+- jnlp config: policy="prompt-update"
+
====
Todo
====
Modified: trunk/isis-fish/pom.xml
===================================================================
--- trunk/isis-fish/pom.xml 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/pom.xml 2008-08-04 16:59:55 UTC (rev 1281)
@@ -22,7 +22,7 @@
<packaging>jar</packaging>
<!--Version-->
- <version>3.1.5-SNAPSHOT</version>
+ <version>3.1.6-SNAPSHOT</version>
<!--Description-->
<description>Simulateur de pecherie complexe.</description>
@@ -454,61 +454,6 @@
</executions>
</plugin>
<plugin>
- <groupId>org.codelutin.commandline</groupId>
- <artifactId>maven-commandline-plugin</artifactId>
- <version>0.6</version>
- <configuration>
- <prefix>Isis</prefix>
- <i18nPrefix>isisfish</i18nPrefix>
- <source>
- ${basedir}/src/resources/IsisFish_init.properties
- </source>
- <packageName>
- fr.ifremer.isisfish.commandline
- </packageName>
- <concreteConfig>false</concreteConfig>
- <rstFilePath>
- ${basedir}/src/site/@bundle@/rst/v3/user
- </rstFilePath>
- <_projectName>Isis-Fish</_projectName>
- <_configFileName>.isis-config-3</_configFileName>
- <!--_version>3.1.5</_version-->
- <_locale>fr_FR</_locale>
- <_projectName>CommandlineDemo</_projectName>
- <_projectURL>http://isis-fish.labs.libre-entreprise.org</_projectURL>
- <_organisationName>Ifremer - Codelutin</_organisationName>
- <_organisationURL>http://codelutin.com</_organisationURL>
- <_copyright>Copyright Ifremer Codelutin 1999 - 2008</_copyright>
- </configuration>
- <executions>
- <execution>
- <id>genJava</id>
- <goals>
- <goal>genJava</goal>
- </goals>
- <configuration>
- <out>${basedir}/target/gen/java</out>
- </configuration>
- </execution>
- <execution>
- <id>genRst</id>
- <goals>
- <goal>genRst</goal>
- </goals>
- <configuration>
- <out>${basedir}/target/classes</out>
- </configuration>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>lutinlib</groupId>
- <artifactId>lutinutil</artifactId>
- <version>0.29-SNAPSHOT</version>
- </dependency>
- </dependencies>
- </plugin>
- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
@@ -556,7 +501,7 @@
<dependency>
<groupId>lutinlib</groupId>
<artifactId>lutinutil</artifactId>
- <version>0.29</version>
+ <version>0.30-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
@@ -610,12 +555,6 @@
<!-- librairie commandline -->
<dependency>
<groupId>org.codelutin.commandline</groupId>
- <artifactId>commandline-core</artifactId>
- <version>0.6</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.codelutin.commandline</groupId>
<artifactId>commandline-ui</artifactId>
<version>0.6</version>
<scope>compile</scope>
@@ -694,12 +633,6 @@
<scope>compile</scope>
</dependency>
<dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.1</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/IsisConfig.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/IsisConfig.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/IsisConfig.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -1,435 +1,320 @@
-/*
-* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Code Lutin,
-* 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 2
-* 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, write to the Free Software
-* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-* ##% */
+/* *##%
+ * Copyright (C) 2002-2008 Code Lutin, Benjamin Poussin
+ *
+ * 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ *##%*/
+
package fr.ifremer.isisfish;
-import fr.ifremer.isisfish.simulator.SimulationContext;
-import fr.ifremer.isisfish.commandline.configs.IsisAbstractConfigMain;
-import static org.codelutin.i18n.I18n._;
-import org.codelutin.util.StringUtil;
+import fr.ifremer.isisfish.actions.ExportAction;
+import static org.codelutin.i18n.I18nf._;
+import fr.ifremer.isisfish.actions.OtherAction;
+import fr.ifremer.isisfish.actions.ImportAction;
+import fr.ifremer.isisfish.actions.SimulationAction;
+import fr.ifremer.isisfish.actions.VCSAction;
+import fr.ifremer.isisfish.simulator.SimulationContext;
+import fr.ifremer.isisfish.vcs.VCS;
import java.io.File;
-import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
+import org.apache.commons.beanutils.ConvertUtils;
+import org.apache.commons.lang.time.DurationFormatUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.util.ApplicationConfig;
+import org.codelutin.util.StringUtil;
/**
- * L'implantation concrete de la configuration principale d'Isis
*
- * @author chemit
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
*/
-public class IsisConfig extends IsisAbstractConfigMain {
+public class IsisConfig extends ApplicationConfig {
- /** la version (ne peut pas être final car la configuration doit être chargée) */
- static private String VERSION;
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(IsisConfig.class);
- static public String getVERSION() {
- if (VERSION == null) {
- VERSION = IsisContext.get().getMainConfig().getVersion().toString();
- }
- return VERSION;
- }
+ /** la version du logiciel constitue de l.d.a.r
+ * <li>l: le numero de version du logiciel
+ * <li>d: le numero de version du schema de la base de donnees
+ * <li>a: le numero de version de l'api des scripts
+ * <li>r: le numero de version de de l'interface graphique ou autre modif mineur
+ * <p>
+ * lors de l'increment de l, d, a et r sont remis a 0
+ * lors de l'increment de d, a et r sont remis a 0
+ * lors de l'increment de a, r est remis a 0
+ * <p>
+ * Un changement d'UI ne modifie jamais le numero de version de database
+ * Un changement de schema de base pour lequel on ne peut pas faire de
+ * migration de donnees demande automatiquement un changement de version
+ * d'application.
+ */
+ // ATTENTION NE PAS MODIFIER LES LIGNES SUIVANTES OU BIEN VERIFIER QUE
+ // LE SCRIPT 'publish' FONCTIONNE TOUJOURS
+ static final public String VERSION_APPLICATION = "4";
+ static final public String VERSION_DATABASE = VERSION_APPLICATION + ".0";
+ static final public String VERSION_API_SCRIPT = VERSION_DATABASE + ".0";
+ static final public String VERSION = VERSION_DATABASE + ".0";
- /** le copyright (ne peut pas être final car la configuration doit être chargée) */
- static private String COPYRIGHT_TEXT;
-
- static public String getCOPYRIGHT_TEXT() {
- if (COPYRIGHT_TEXT == null) {
- COPYRIGHT_TEXT = "Version " + IsisConfig.getVERSION() + " IFREMER-MAERHA © 2000-2008";
+ static final public String COPYRIGHT_TEXT = "Version " + VERSION + " IFREMER-MAERHA © 2000-2008";
+ static final public String CONFIG_FILENAME = "isis-config-" + VERSION_APPLICATION;
+
+ /** separateur de liste */
+ static final public String SEP = ",";
+ static final public String REPORT_EMAIL = "isis-fish-bugreport at lists.labs.libre-entreprise.org";
+
+ protected transient File backupSessionDirectory = null;
+ protected long startingTime = System.nanoTime();
+
+ public IsisConfig() {
+ for (Option o : Option.values()) {
+ setDefaultOption(o.key, o.defaultValue);
}
- return COPYRIGHT_TEXT;
- }
-
- //////////////////////////////////////////////////
- // Les modules du VCS (avec mapping sur les implantations)
- //////////////////////////////////////////////////
- static public enum Module {
- EXPORT("exports", fr.ifremer.isisfish.datastore.ExportStorage.class),
- FORMULE("formules", fr.ifremer.isisfish.datastore.FormuleStorage.class),
- RULE("rules", fr.ifremer.isisfish.datastore.RuleStorage.class),
- ANALYSE_PLAN("analyseplans", fr.ifremer.isisfish.datastore.AnalysePlanStorage.class),
- SCRIPT("scripts", fr.ifremer.isisfish.datastore.ScriptStorage.class),
- SIMULATOR("simulators", fr.ifremer.isisfish.datastore.SimulatorStorage.class),
- REGION("regions", fr.ifremer.isisfish.datastore.RegionStorage.class),
- SIMULATION("simulations", fr.ifremer.isisfish.datastore.SimulationStorage.class);
-
- private final String value;
- private final Class<? extends fr.ifremer.isisfish.datastore.VersionStorage> clazz;
-
- Module(String value, Class<? extends fr.ifremer.isisfish.datastore.VersionStorage> clazz) {
- this.value = value;
- this.clazz = clazz;
- }
- public String value() {
- return value;
- }
- public Class<? extends fr.ifremer.isisfish.datastore.VersionStorage> getClazz() {
- return clazz;
- }
- public File getDirectory() {
- File result = new File(getDatabaseDirectory(), value());
- if (!result.exists()) {
- result.mkdirs();
+
+ for (Action a : Action.values()) {
+ for (String alias : a.aliases) {
+ addActionAlias(alias, a.action);
}
- return result;
}
- }
- static public Module getModule(String value) {
- for (Module module : Module.values()) {
- if (module.value.equals(value)) {
- return module;
- }
- }
- return null;
}
+ static public String getVersion() {
+ return VERSION;
+ }
+
//////////////////////////////////////////////////
- // méthodes sur ClassLoader
+ // Methode d'acces aux options
//////////////////////////////////////////////////
-
- /**
- * Retourne un class loader contenant le répertoire de compilation
- * Il permet alors de charger des classes qui viennent d'etre compilée
- * dans isis
- * If current thread is in simulation then return specific simulation
- * compilation directory, else default compilation directory
- *
- * @return the class loader adéquate
- */
- static public ClassLoader getScriptClassLoader() {
- SimulationContext simContext = SimulationContext.get();
- ClassLoader result = simContext.getClassLoader();
- if (result == null) {
- // on est pas dans une simulation, il faut retourner un nouveau
- // a chaque fois. on force la creation d'un nouveau classloader
- // a chaque fois pour
- // que l'ancienne class compiler et chargé ne soit pas presente
- File f = IsisContext.get().getMainConfig().getCompileDirectory();
- try {
- URL[] cp = new URL[]{f.toURI().toURL()};
- // il faut prendre le ClassLoader du thread courant comme parent
- // car pour les simulations il a ete modifié, et il faut
- // que les classes de script soit recherché dedans avant
- // la recherche dans le getCompileDirectory().
- // ce qui est le cas avec les URLClassLoader
- ClassLoader parent = Thread.currentThread().getContextClassLoader();
- result = new URLClassLoader(cp, parent);
- } catch (MalformedURLException eee) {
- throw new IsisFishRuntimeException(_("isisfish.error.load.classloader", f, eee.getMessage()), eee);
- }
+
+ public File getDatabaseDirectory() {
+ File result = getOptionAsFile(Option.DATABASE_DIRECTORY.key);
+ if (!result.exists()) {
+ result.mkdirs();
}
return result;
}
- //////////////////////////////////////////////////
- // Les répertoires de compilation
- //////////////////////////////////////////////////
+ public File getCompileDirectory() {
+ File result = getOptionAsFile(Option.COMPILATION_DIRECTORY.key);
+ if (!result.exists()) {
+ result.mkdirs();
+ }
+ return result;
+ }
- static protected File getCompileDirectory(String name) {
- File compileDirectory = IsisContext.get().getMainConfig().getCompileDirectory();
- File result;
- result = new File(compileDirectory, name);
+ public Locale getLocale() {
+ String value = getOption(Option.LOCALE.key);
+ Locale result = (Locale)ConvertUtils.convert(value, Locale.class);
return result;
}
-
- /**
- * @return le répertoire où sont compilé les scripts
- * @see #getCompileDirectory(String)
- * @see Module#SCRIPT
- */
- static public File getScriptCompileDirectory() {
- File result;
- result = getCompileDirectory(Module.SCRIPT.value());
+
+ public String getEncoding() {
+ String result = getOption(Option.ENCODING.key);
return result;
}
-
- /**
- * @return le répertoire où sont compilé les simulateurs
- * @see #getCompileDirectory(String)
- * @see Module#SIMULATOR
- */
- static public File getSimulatorCompileDirectory() {
- File result;
- result = getCompileDirectory(Module.SIMULATOR.value());
+
+ public String getSmtpServer() {
+ String result = getOption(Option.SMTP_SERVER.key);
return result;
}
-
- /**
- * @return le répertoire où sont compilé les scripts d'export
- * @see #getCompileDirectory(String)
- * @see Module#EXPORT
- */
- static public File getExportCompileDirectory() {
- File result;
- result = getCompileDirectory(Module.EXPORT.value());
+
+ public String getUserName() {
+ String result = getOption(Option.USER_NAME.key);
return result;
}
-
- /**
- * @return le répertoire où sont compilé les formules
- * @see #getCompileDirectory(String)
- * @see Module#FORMULE
- */
- static public File getFormuleCompileDirectory() {
- File result;
- result = getCompileDirectory(Module.FORMULE.value());
+
+ public String getUserMail() {
+ String result = getOption(Option.USER_MAIL.key);
return result;
}
-
- //////////////////////////////////////////////////
- // Les fichiers et répertoires de la base locale
- //////////////////////////////////////////////////
-
- /**
- * @return le repertoire ou les données de l'application sont stockées.
- * <p/>
- * <b>Si le répertoire n'existe pas il est créé.</b>
- */
- static public File getDatabaseDirectory() {
- File result = IsisContext.get().getVcsConfig().getLocalDatabasePath();
- if (!result.exists()) {
- result.mkdirs();
- }
+
+ public String getSimulatorServer() {
+ String result = getOption(Option.SIMULATOR_SERVER.key);
return result;
}
-
- /**
- * @param name le nom du sous-répertoire à récupérer
- * @return le sous répertoire de nom <code>name</code> du repertoire ou les
- * données de l'application sont stockées.
- * <p/>
- * <b>Si le sous-répertoire n'existe pas il est créé.</b>
- * @see #getDatabaseDirectory()
- */
- static protected File getDatabaseDirectory(String name) {
- File result = new File(getDatabaseDirectory(), name);
- if (!result.exists()) {
- result.mkdirs();
- }
+
+ public String getSimulatorUsername() {
+ String result = getOption(Option.SIMULATOR_USER_NAME.key);
return result;
}
- /**
- * @param rootDir le nom du répertoire de base du storage
- * @return le fichier contenant la définition du storage à partir du
- * répertoire de base du storage (il s'agit du fichier compressé
- * contenant le code sql pour créer la db du storage).
- * @see #DATA_BACKUP_FILENAME_PROPERTY_KEY
- */
- static public File getDataBackupFile(File rootDir) {
- String name = IsisContext.get().getMainConfig().getDataBackupFilename();
- return new File(rootDir, name);
+ public String getSimulatorPassword() {
+ String result = getOption(Option.SIMULATOR_PASSWORD.key);
+ return result;
}
-
- /**
- * @return le répertoire (de la base locale) dans lequel toutes les régions sont stockées
- * @see #getDatabaseDirectory(String)
- * @see Module#REGION
- * @see fr.ifremer.isisfish.datastore.RegionStorage
- */
- static public File getRegionDirectory() {
- return getDatabaseDirectory(Module.REGION.value());
+
+ public String getSimulatorClassfile() {
+ String result = getOption(Option.SIMULATOR_CLASSFILE.key);
+ return result;
}
-
- /**
- * @return le répertoire (de la base locale) dans lequel toutes les simulations sont stockées
- * @see #getDatabaseDirectory(String)
- * @see Module#SIMULATION
- * @see fr.ifremer.isisfish.datastore.SimulationStorage
- */
- static public File getSimulationDirectory() {
- return getDatabaseDirectory(Module.SIMULATION.value());
+
+ public void setSimulatorClassfile(String value) {
+ setOption(Option.SIMULATOR_CLASSFILE.key, value);
}
+
+ public boolean isSimulatorLocal() {
+ String value = getOption(Option.SIMULATOR_LAUNCHER.key);
+ boolean result = "local".equalsIgnoreCase(value);
+ return result;
+ }
- /**
- * @return le répertoire (de la base locale) dans lequel toutes les scripts de rules sont stockées
- * @see #getDatabaseDirectory(String)
- * @see Module#RULE
- * @see fr.ifremer.isisfish.datastore.RuleStorage
- */
- static public File getRuleDirectory() {
- return getDatabaseDirectory(Module.RULE.value());
- }
+// public boolean isUseVCS() {
+// String value = getOption(Option.VCS_TYPE.key);
+// boolean result = !VCS.TYPE_NONE.equals(value);
+// return result;
+// }
- /**
- * @return le répertoire (de la base locale) dans lequel toutes les scripts analyses de sensibilité sont stockées
- * @see #getDatabaseDirectory(String)
- * @see Module#ANALYSE_PLAN
- * @see fr.ifremer.isisfish.datastore.AnalysePlanStorage
- */
- static public File getAnalysePlanDirectory() {
- return getDatabaseDirectory(Module.ANALYSE_PLAN.value());
- }
+ public boolean isLaunchUI() {
+ boolean result = getOptionAsBoolean(Option.LAUNCH_UI.key);
+ return result;
+ }
- /**
- * @return le répertoire (de la base locale) dans lequel toutes les formules sont stockées
- * @see #getDatabaseDirectory(String)
- * @see Module#FORMULE
- * @see fr.ifremer.isisfish.datastore.FormuleStorage
- */
- static public File getFormuleDirectory() {
- return getDatabaseDirectory(Module.FORMULE.value());
- }
+ public void setSimulatorLauncher(String value) {
+ setOption(Option.SIMULATOR_LAUNCHER.key, value);
+ }
- /**
- * @return le répertoire (de la base locale) dans lequel toutes les scripts de script sont stockées
- * @see #getDatabaseDirectory(String)
- * @see Module#SCRIPT
- * @see fr.ifremer.isisfish.datastore.ScriptStorage
- */
- static public File getScriptDirectory() {
- return getDatabaseDirectory(Module.SCRIPT.value());
- }
+ public boolean isSimulationShowOnlyQueue() {
+ Boolean result = getOptionAsBoolean(Option.SIMULATION_SHOW_ONLY_QUEUE.key);
+ return result;
+ }
- /**
- * @return le répertoire (de la base locale) dans lequel toutes les scripts d'exports sont stockées
- * @see #getDatabaseDirectory(String)
- * @see Module#EXPORT
- * @see fr.ifremer.isisfish.datastore.ExportStorage
- */
- static public File getExportDirectory() {
- return getDatabaseDirectory(Module.EXPORT.value());
- }
+ public boolean isSimulationShowOnlyError() {
+ Boolean result = getOptionAsBoolean(Option.SIMULATION_SHOW_ONLY_ERROR.key);
+ return result;
+ }
- /**
- * @return le répertoire (de la base locale) dans lequel toutes les scripts de simulator sont stockées
- * @see #getDatabaseDirectory(String)
- * @see Module#SIMULATOR
- * @see fr.ifremer.isisfish.datastore.SimulatorStorage
- */
- static public File getSimulatorDirectory() {
- return getDatabaseDirectory(Module.SIMULATOR.value());
+ public File getDefaultExportDirectory() {
+ File result = getOptionAsFile(Option.DEFAULT_EXPORT_DIRECTORY.key);
+ if (!result.exists()) {
+ result.mkdirs();
+ }
+ return result;
}
- /**
- * @param name le nom de la region
- * @return le répertoire (de la base locale) dans lequel les données de la région donnée sont stockées
- * @see #getRegionDirectory()
- */
- static public File getRegionDirectory(String name) {
- return new File(getRegionDirectory(), name);
- }
+ public void setDefaultExportDirectory(String value) {
+ setOption(Option.DEFAULT_EXPORT_DIRECTORY.key, value);
+ }
- /**
- * @param name le nom de la simulation
- * @return le répertoire (de la base locale) dans lequel les données de la simulation donnée sont stockées
- * @see #getSimulationDirectory()
- */
- static public File getSimulationDirectory(String name) {
- return new File(getSimulationDirectory(), name);
+ public String getDefaultExportNames() {
+ String result = getOption(Option.DEFAULT_EXPORT_NAMES.key);
+ return result;
}
- //////////////////////////////////////////////////
- // Les autres fichiers et répertoires
- //////////////////////////////////////////////////
-
- /**
- * @param rootDir le répertoire de base de la simulation
- * @return le répertoire de résultat d'export à partir du répertoire de base de la simulation
- * @see #RESULT_EXPORT_PROPERTY_KEY
- */
- static public File getResultExportDirectory(File rootDir) {
- String name = IsisContext.get().getMainConfig().getResultExport();
- return new File(rootDir, name);
+ public void setDefaultExportNames(List<String> exportNames) {
+ StringBuilder sb = new StringBuilder();
+ for (String exportName : exportNames) {
+ sb.append(SEP).append(exportName);
+ }
+ String value = sb.toString().substring(1);
+ setOption(Option.DEFAULT_EXPORT_NAMES.key, value);
+ saveForUser();
}
/**
- * @param simulationDir le répertoire de base de la simulation
- * @return le fichier dans lequel est stocké les paramètres d'une
- * simulation à partir de son répertoire de base
- * @see #SIMULATION_PARAMETERS_FILENAME_PROPERTY_KEY
+ * @return la liste des noms d'exports par defaut sous forme de liste,
+ * a partir de la propriete {@link Option#DEFAULT_EXPORT_NAMES}
+ * ou null si ils n'ont jamais ete sauves par l'utilisateur.
+ * by user.
+ * @see Option#DEFAULT_EXPORT_NAMES
*/
- static public File getSimulationParametersFile(File simulationDir) {
- String name = IsisContext.get().getMainConfig().getSimulationParametersFilename();
- return new File(simulationDir, name);
+ public List<String> getDefaultExportNamesAsList() {
+ List<String> result = null;
+ String exportNamesList = getDefaultExportNames();
+ if (exportNamesList != null) {
+ result = new ArrayList<String>();
+ String[] exportNames = StringUtil.split(exportNamesList, ",");
+ result.addAll(Arrays.asList(exportNames));
+ }
+ return result;
}
- /**
- * @param simulationDir le répertoire de base de la simulation
- * @return le fichier dans lequel est stocké les informations d'une
- * simulation à partir de son répertoire de base
- * @see fr.ifremer.isisfish.simulator.SimulationProperties
- * @see #SIMULATION_INFORMATION_FILENAME_PROPERTY_KEY
- */
- static public File getSimulationInformationFile(File simulationDir) {
- String name = IsisContext.get().getMainConfig().getSimulationInformationFilename();
- return new File(simulationDir, name);
+ public String getDefaultMapFilename() {
+ String result = getOption(Option.DEFAULT_MAP_FILENAME.key);
+ return result;
}
- /**
- * @param simulationDir le répertoire de base de la simulation
- * @return le fichier dans lequel sont stockés les résultats aux format xml
- * d'une simulation à partir de son répertoire de base
- * @see fr.ifremer.isisfish.simulator.SimulationResultXML
- * @see #SIMULATION_RESULT_XML_FILENAME_PROPERTY_KEY
- */
- static public File getSimulationResultXmlFile(File simulationDir) {
- String name = IsisContext.get().getMainConfig().getSimulationResultXmlFilename();
- return new File(simulationDir, name);
+ public String getDefaultResultNames() {
+ String result = getOption(Option.DEFAULT_RESULT_NAMES.key);
+ return result;
}
- /**
- * @param rootDir le répertoire de base de la région
- * @return le répertoire des maps d'une région à partir du répertoire de base de la région
- * @see #REGION_MAP_PROPERTY_KEY
- */
- static public File getRegionMapDirectory(File rootDir) {
- String name = IsisContext.get().getMainConfig().getRegionMap();
- return new File(rootDir, name);
+ public void setDefaultResultNames(List<String> resultNames) {
+ StringBuilder sb = new StringBuilder();
+ for (String resultName : resultNames) {
+ sb.append(SEP).append(resultName);
+ }
+ String value = sb.toString().substring(1);
+ setOption(Option.DEFAULT_RESULT_NAMES.key, value);
+ saveForUser();
}
- //////////////////////////////////////////////////
- // accesseur statiques de propriétés vers collections
- //////////////////////////////////////////////////
-
/**
- * @return la liste des noms d'exports par défaut sous forme de liste,
- * à partir de la propriété {@link #DEFAULT_EXPORT_NAMES_PROPERTY_KEY}
- * ou null si ils n'ont jamais été sauvé par l'utilisateur.
- * by user.
- * @see #DEFAULT_EXPORT_NAMES_PROPERTY_KEY
+ * @return les resultats par defaut d'une simulation sous forme de liste
+ * a partir de la propriete {@link Option#DEFAULT_RESULT_NAMES}
+ * @see Option#DEFAULT_RESULT_NAMES
*/
- static public List<String> getDefaultExportNamesAsList() {
+ public List<String> getDefaultResultNamesAsList() {
List<String> result = null;
- String exportNamesList = IsisContext.get().getMainConfig().getDefaultExportNames();
- if (exportNamesList != null) {
+ String resultNamesList = getDefaultResultNames();
+ if (resultNamesList != null) {
result = new ArrayList<String>();
- String[] exportNames = StringUtil.split(exportNamesList, ",");
- result.addAll(Arrays.asList(exportNames));
+ String[] resultNames = StringUtil.split(resultNamesList, ",");
+ result.addAll(Arrays.asList(resultNames));
}
return result;
}
+
+ public String getDefaultTagValue() {
+ String result = getOption(Option.DEFAULT_TAG_VALUE.key);
+ return result;
+ }
+
+ public void setDefaultTagValues(Map<String, String> tagValues) {
+ StringBuilder sb = new StringBuilder();
+ for (Map.Entry<String, String> entry : tagValues.entrySet()) {
+ sb.append(SEP).append('"').append(entry.getKey()).append("\":\"").append(entry.getValue()).append('"');
+ }
+ String value = sb.toString().substring(1);
+ setOption(Option.DEFAULT_TAG_VALUE.key, value);
+ saveForUser();
+ }
+
+
/**
- * @return le dictionnaire des tags par défaut d'une simulation à partir
- * de la propriété {@link #DEFAULT_TAG_VALUE_PROPERTY_KEY}
- * @see #DEFAULT_TAG_VALUE_PROPERTY_KEY
+ * @return le dictionnaire des tags par defaut d'une simulation a partir
+ * de la propriete {@link Option#DEFAULT_TAG_VALUE}
+ * @see Option#DEFAULT_TAG_VALUE_PROPERTY_KEY
*/
- static public Map<String, String> getDefaultTagValueAsMap() {
+ public Map<String, String> getDefaultTagValueAsMap() {
Map<String, String> result = new HashMap<String, String>();
- String tagValuesList = IsisContext.get().getMainConfig().getDefaultTagValue();
+ String tagValuesList = getDefaultTagValue();
if (tagValuesList != null) {
String[] tagValues = StringUtil.split(tagValuesList, ",");
for (String tagValue : tagValues) {
@@ -446,154 +331,196 @@
}
return result;
}
-
- /**
- * @return les resultats par défaut d'une simulation sous forme de liste
- * à partir de la propriété {@link #DEFAULT_RESULT_NAMES_PROPERTY_KEY}
- * @see #DEFAULT_RESULT_NAMES_PROPERTY_KEY
- */
- static public List<String> getDefaultResultNamesAsList() {
- List<String> result = null;
- String resultNamesList = IsisContext.get().getMainConfig().getDefaultResultNames();
- if (resultNamesList != null) {
- result = new ArrayList<String>();
- String[] resultNames = StringUtil.split(resultNamesList, ",");
- result.addAll(Arrays.asList(resultNames));
- }
+
+ public String getJavadocURL() {
+ String result = getOption(Option.JAVADOC_URL.key);
return result;
}
- //////////////////////////////////////////////////
- // mutateurs statiques de propriétés (avec sauvegarde de config)
- //////////////////////////////////////////////////
-
- private static final char SEP=',';
-
- /**
- * Mutateur de la propriété {@link #DEFAULT_EXPORT_NAMES_PROPERTY_KEY} à
- * partir d'une liste de noms d'export.
- * <p/>
- * <b>Note : Ce mutateur lance une sauvegarde automatique de la configuration d'Isis.</b>
- *
- * @param exportNames la liste des exports par défaut d'une simulation à sauver
- * @see #DEFAULT_EXPORT_NAMES_PROPERTY_KEY
- */
- static public void setDefaultExportNames(List<String> exportNames) {
- StringBuilder sb = new StringBuilder();
- for (String exportName : exportNames) {
- sb.append(SEP).append(exportName);
- }
- IsisContext.get().getMainConfig().setDefaultExportNames(sb.toString().substring(1));
- IsisContext.get().saveSafely();
+ public File getBackupDirectory() {
+ File result = getOptionAsFile(Option.BACKUP_DIRECTORY.key);
+ return result;
}
- /**
- * Mutateur de la propriété {@link #DEFAULT_TAG_VALUE_PROPERTY_KEY} à partir
- * d'un dictionnaire.
- * <p/>
- * <b>Note : Ce mutateur lance une sauvegarde automatique de la configuration d'Isis.</b>
- *
- * @param tagValues le dictionnaire des tag value par défaut d'une simulation à sauver.
- * @see #DEFAULT_TAG_VALUE_PROPERTY_KEY
- */
- static public void setDefaultTagValues(Map<String, String> tagValues) {
- StringBuilder sb = new StringBuilder();
- for (Map.Entry<String, String> entry : tagValues.entrySet()) {
- sb.append(SEP).append('"').append(entry.getKey()).append("\":\"").append(entry.getValue()).append('"');
+ public long getStartingTime() {
+ return startingTime;
+ }
+
+ public String getElapsedTimeAsString() {
+ long diff = System.nanoTime() - getStartingTime();
+ String result = DurationFormatUtils.formatDuration(diff / 1000000, "s'.'S");
+ return result;
+ }
+
+ public File getBackupSessionDirectory() {
+ if (backupSessionDirectory == null) {
+ // le timestamp est en nano (on le veut en ms)
+ long time = getStartingTime() / 1000;
+ // creation de l'unique répertoire de backup pour la session
+ String path = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(new java.util.Date(time));
+ backupSessionDirectory = new File(getBackupDirectory(), path);
+ if (!backupSessionDirectory.exists()) {
+ backupSessionDirectory.mkdirs();
+ }
}
- IsisContext.get().getMainConfig().setDefaultTagValue(sb.toString().substring(1));
- IsisContext.get().saveSafely();
+ return backupSessionDirectory;
}
/**
- * Mutateur de la propriété {@link #DEFAULT_EXPORT_DIRECTORY_PROPERTY_KEY}
- * à partir de son chemin.
- * <p/>
- * <b>Note : Ce mutateur lance une sauvegarde automatique de la configuration d'Isis.</b>
+ * Retourne un class loader contenant le repertoire de compilation
+ * Il permet alors de charger des classes qui viennent d'etre compilees
+ * dans isis
+ * If current thread is in simulation then return specific simulation
+ * compilation directory, else default compilation directory
*
- * @param exportDirectory le nouveau répertoire par défaut des exports d'une simulation
- * @see #DEFAULT_EXPORT_DIRECTORY_PROPERTY_KEY
+ * @return the class loader adequate
*/
- static public void setDefaultExportDirectory(String exportDirectory) {
- IsisContext.get().getMainConfig().setDefaultExportDirectory(new File(exportDirectory));
- IsisContext.get().saveSafely();
- }
-
- /**
- * Mutateur de la propriété {@link #DEFAULT_RESULT_NAMES_PROPERTY_KEY} à
- * partir d'une liste de noms de résultats.
- * <p/>
- * <b>Note : Ce mutateur lance une sauvegarde automatique de la configuration d'Isis.</b>
- *
- * @param resultNames la liste des résultats par défaut à traiter dans une simulation
- * @see #DEFAULT_RESULT_NAMES_PROPERTY_KEY
- */
- static public void setDefaultResultNames(List<String> resultNames) {
- StringBuilder sb = new StringBuilder();
- for (String resultName : resultNames) {
- sb.append(SEP).append(resultName);
+ public ClassLoader getScriptClassLoader() {
+ SimulationContext simContext = SimulationContext.get();
+ ClassLoader result = simContext.getClassLoader();
+ if (result == null) {
+ // on est pas dans une simulation, il faut retourner un nouveau
+ // a chaque fois. on force la creation d'un nouveau classloader
+ // a chaque fois pour
+ // que l'ancienne class compiler et charg<E9> ne soit pas presente
+ File f = getCompileDirectory();
+ try {
+ URL[] cp = new URL[]{f.toURI().toURL()};
+ // il faut prendre le ClassLoader du thread courant comme parent
+ // car pour les simulations il a ete modifi<E9>, et il faut
+ // que les classes de script soit recherch<E9> dedans avant
+ // la recherche dans le getCompileDirectory().
+ // ce qui est le cas avec les URLClassLoader
+ ClassLoader parent = Thread.currentThread().getContextClassLoader();
+ result = new URLClassLoader(cp, parent);
+ } catch (MalformedURLException eee) {
+ throw new IsisFishRuntimeException(_("isisfish.error.load.classloader", f, eee.getMessage()), eee);
+ }
}
- IsisContext.get().getMainConfig().setDefaultResultNames(sb.toString().substring(1));
- IsisContext.get().saveSafely();
+ return result;
}
//////////////////////////////////////////////////
- // surcharge de la config abstraite
+ // Toutes les options disponibles
//////////////////////////////////////////////////
- //@Override
- //protected void init() throws Exception {
- // generic init
- // super.init();
- // à ce stade, la config est normale
- //clearModified();
- //clearUnsafeData();
- //}
+ static public enum Option {
- @Override
- public File getCompileDirectory() {
- SimulationContext simContext = SimulationContext.get();
- File result = simContext.getScriptDirectory();
- if (result == null) {
- result = super.getCompileDirectory();
+ COMPILATION_DIRECTORY("compilation.directory", _("isisfish.config.main.compileDirectory.description"), getUserHome() + File.separator + "isis-build"),
+ CONFIG_FILE("config.file", _("isisfish.config.main.configFileName.description"), getUserHome() + File.separator + "." + CONFIG_FILENAME),
+ BACKUP_DIRECTORY("backup.directory", _("isisfish.config.main.defaultBackupDirectory.description"), getUserHome() + File.separator + "isis-backup"),
+ DEFAULT_EXPORT_DIRECTORY("default.export.directory", _("isisfish.config.main.defaultExportDirectory.description"), getUserHome() + File.separator + "isis-export"),
+ DEFAULT_EXPORT_NAMES("default.export.names", _("isisfish.config.main.defaultExportNames.description"), ""),
+ DEFAULT_RESULT_NAMES("default.result.names", _("isisfish.config.main.defaultResultNames.description"), ""),
+ DEFAULT_MAP_FILENAME("default.map.filename", _("isisfish.config.main.defaultMapFile.description"), "maps/vmap_area_thin"),
+ DEFAULT_TAG_VALUE("default.tagvalue", _("isisfish.config.main.defaultTagValue.description"), ""),
+ ENCODING("encoding", _("isisfish.config.main.encoding.description"), "UTF-8"),
+ JAVADOC_URL("javadoc.url", _("isisfish.config.main.javadocURL.description"), "http://isis-fish.labs.libre-entreprise.org/apidocs/"),
+ SIMULATOR_CLASSFILE("simulator.classfile", _("isisfish.config.main.defaultSimulator.description"), "DefaultSimulator.java"),
+ /** prevu pour l'architecture de lancement en plugin: local, isis-server, caparmor, ... */
+ SIMULATOR_LAUNCHER("simulator.launcher", _("isisfish.config.main.localSimulator.description"), "local"),
+ SIMULATOR_SERVER("simulation.server", _("isisfish.config.main.simulationServer.description"), "http://simulateur.ifremer.fr:9090"),
+ /** le login a utiliser pour les launcher distant, le type du launcher est ajouter a la cle (car 1 login par launcher) */
+ SIMULATOR_USER_NAME("simulator.username", _("isisfish.config.main.login.description"), "anonymous"),
+ SIMULATOR_PASSWORD("simulator.password", _("isisfish.config.main.password.description"), "guest"),
+ LOCALE("locale", _("isisfish.config.main.locale.description"), "fr_FR"),
+// REGION_MAP("regionMap", _("isisfish.config.main.regionMap.description"), "maps"),
+// RESULT_EXPORT("resultExport", String.class, 15, n_("isisfish.config.main.resultExport.description"), "resultExports"),
+ SIMULATION_SHOW_ONLY_ERROR("simulationShowOnlyError", _("isisfish.config.main.simulationShowOnlyError.description"), "true"),
+ SIMULATION_SHOW_ONLY_QUEUE("simulationShowOnlyQueue", _("isisfish.config.main.simulationShowOnlyQueue.description"), "true"),
+
+ // if false no graphical interface
+ LAUNCH_UI("launch.ui", _("isisfish.config.main.launchUI.description"), "true"),
+
+ DATABASE_DIRECTORY("database.directory", _("isisfish.config.vcs.localDatabasePath.description"), getUserHome() + File.separator + "isis-database-3"),
+
+ SSH_KEY_FILE("ssh.key.file", _("isisfish.config.vcs.keyFile.description"), getUserHome() + File.separator + ".ssh" + File.separator + "isis_rsa"),
+ SSH_PASSPHRASE_ENABLED("ssh.passphrase.enabled", _("isisfish.config.vcs.noPassPhrase.description"), "false"),
+ SSH_PASSPHRASE("ssh.passphrase", _("isisfish.config.vcs.passphrase.description"), ""),
+
+ // can be None, CVS or SVN. only None or SVN work
+ VCS_TYPE(VCS.VCS_TYPE, _("isisfish.config.vcs.type.description"), VCS.TYPE_SVN),
+ // depend of VCS_TYPE, for SVN can be http or ssh
+ VCS_CONNECTION(VCS.VCS_CONNECTION, _("isisfish.config.vcs.useSshConnexion.description"), "http"),
+ // user login to access vcs
+ VCS_USER_NAME(VCS.VCS_USER_NAME, _("isisfish.config.vcs.userName.description"), "anonymous"),
+ VCS_HOST_NAME(VCS.VCS_HOST_NAME, _("isisfish.config.vcs.hostName.description"), "labs.libre-entreprise.org"),
+ VCS_PATH(VCS.VCS_PATH, _("isisfish.config.vcs.remotePath.description"), "svnroot/isis-fish-data"),
+ VCS_TAG(VCS.VCS_TAG, _("isisfish.config.vcs.remoteDatabase.description"), "tag/" + VERSION_DATABASE),
+// TYPE_REPO_PROPERTY_KEY = newConfigPropertyKey("typeRepo", VCSTypeRepo.class, 9, n_("isisfish.config.vcs.typeRepo.description"), "TAG"),
+// PROJECT_NAME_PROPERTY_KEY = newConfigPropertyKey("projectName", String.class, 11, n_("isisfish.config.main.projectName.description"), "Isis-Fish"),
+
+ USER_NAME("user.name", _("isisfish.config.main.userName.description"), System.getProperty("user.name")),
+ SMTP_SERVER("smtpServer", _("isisfish.config.main.smtpServer.description"), "smtp"),
+ USER_MAIL("userMail", _("isisfish.config.main.userMail.description"), USER_NAME.key + "@" + VCS_HOST_NAME.key),
+
+ ;
+
+ public final String key;
+ public final String description;
+ public final String defaultValue;
+
+ private Option(String key, String description, String defaultValue) {
+ this.key = key;
+ this.description = description;
+ this.defaultValue = defaultValue;
}
- return result;
}
+
+ //////////////////////////////////////////////////
+ // Toutes les actions disponibles
+ //////////////////////////////////////////////////
- /**
- * Mutateur de la propriété {@link #DEFAULT_SIMULATOR_PROPERTY_KEY}.
- * <p/>
- * <b>Note : Ce mutateur lance une sauvegarde automatique de la configuration d'Isis.</b>
- *
- * @param simulatorName le nom du simulateur pà utiliser par défaut
- * @see #DEFAULT_SIMULATOR_PROPERTY_KEY
- */
- @Override
- public void setDefaultSimulator(String simulatorName) {
- super.setDefaultSimulator(simulatorName);
- IsisContext.get().saveSafely();
- }
+ static public enum Action {
+ HELP(_("Show help"), OtherAction.class.getName() + "#help", "-h", "--help"),
+
+ IMPORT_ANALYSE_PLAN(_(""), ImportAction.class.getName() + "#importAnalysePlan", "--importAnalysePlan"),
+ IMPORT_EXPORT(_(""), ImportAction.class.getName() + "#importExport", "--importExport"),
+ IMPORT_RULE(_(""), ImportAction.class.getName() + "#importRule", "--importRule"),
+ IMPORT_SCRIPT(_("Import one java file script source"), ImportAction.class.getName() + "#importScript", "--importScript"),
+ IMPORT_SIMULATOR(_(""), ImportAction.class.getName() + "#importSimulator", "--importSimulator"),
+ IMPORT_FORMULA(_(""), ImportAction.class.getName() + "#importFormula", "--importFormula"),
+ IMPORT_REGION(_(""), ImportAction.class.getName() + "#importRegion", "--importRegion"),
+ IMPORT_REGION_AND_RENAME(_(""), ImportAction.class.getName() + "#importRegionAndRename", "--importRegionAndRename"),
+ IMPORT_SIMULATION(_(""), ImportAction.class.getName() + "#importSimulation", "--importSimulation"),
+ IMPORT_SCRIPT_MODULE(_("Import zipped file containing all scripts directory structure"), ImportAction.class.getName() + "#importScriptModule", "--importScriptModule"),
- /**
- * Mutateur de la propriété {@link #LOCAL_SIMULATOR_PROPERTY_KEY}.
- * <p/>
- * <b>Note : Ce mutateur lance une sauvegarde automatique de la configuration d'Isis.</b>
- *
- * @param local le flag pour indiquer si on doit utiliser ou non le simulateur locale
- * @see #LOCAL_SIMULATOR_PROPERTY_KEY
- */
- @Override
- public void setLocalSimulator(boolean local) {
- super.setLocalSimulator(local);
- IsisContext.get().saveSafely();
- }
+ LIST_ANALYSE_PLAN(_(""), ExportAction.class.getName() + "#listAnalysePlan", "--listAnalysePlan"),
+ LIST_EXPORT(_(""), ExportAction.class.getName() + "#listExport", "--listExport"),
+ LIST_RULE(_(""), ExportAction.class.getName() + "#listRule", "--listRule"),
+ LIST_SCRIPT(_(""), ExportAction.class.getName() + "#listScript", "--listScript"),
+ LIST_SIMULATOR(_(""), ExportAction.class.getName() + "#listSimulator", "--listSimulator"),
+ LIST_FORMULA(_(""), ExportAction.class.getName() + "#listFormula", "--listFormula"),
+ LIST_REGION(_(""), ExportAction.class.getName() + "#listRegion", "--listRegion"),
+ LIST_SIMULATION(_(""), ExportAction.class.getName() + "#listSimulation", "--listSimulation"),
- @Override
- protected void loadFromSource() throws IOException {
- super.loadFromSource();
- // alwyas used the java program version, should even never stored...
- setVersion(VERSION_PROPERTY_KEY.getDefaultValue());
- // we do not deal with inter-config properties
- clearUnsafeData();
+ EXPORT_ANALYSE_PLAN(_(""), ExportAction.class.getName() + "#exportAnalysePlan", "--exportAnalysePlan"),
+ EXPORT_EXPORT(_(""), ExportAction.class.getName() + "#exportExport", "--exportExport"),
+ EXPORT_RULE(_(""), ExportAction.class.getName() + "#exportRule", "--exportRule"),
+ EXPORT_SCRIPT(_(""), ExportAction.class.getName() + "#exportScript", "--exportScript"),
+ EXPORT_SIMULATOR(_(""), ExportAction.class.getName() + "#exportSimulator", "--exportSimulator"),
+ EXPORT_FORMULA(_(""), ExportAction.class.getName() + "#exportFormula", "--exportFormula"),
+ EXPORT_REGION(_(""), ExportAction.class.getName() + "#exportRegion", "--exportRegion"),
+ EXPORT_SIMULATION(_(""), ExportAction.class.getName() + "#exportSimulation", "--exportSimulation"),
+
+ VCS_SSH_CREATE_KEY(_(""), VCSAction.class.getName() + "#sshCreateKey", "--sshCreateKey"),
+ VCS_UPDATE(_(""), VCSAction.class.getName() + "#vcsUpdate", "--vcsUpdate"),
+ VCS_ADD(_(""), VCSAction.class.getName() + "#vcsAdd", "--vcsAdd"),
+ VCS_REMOVE(_(""), VCSAction.class.getName() + "#vcsRemove", "--vcsRemove"),
+ VCS_COMMIT(_(""), VCSAction.class.getName() + "#vcsCommit", "--vcsCommit"),
+
+ SIMULATE_WITH_REGION(_(""), SimulationAction.class.getName() + "#simulateWithRegion", "--simulateWithRegion"),
+ SIMULATE_WITH_SIMULATION(_(""), SimulationAction.class.getName() + "#simulateWithSimulation", "--simulateWithSimulation"),
+ ;
+
+ public String description;
+ public String action;
+ public String[] aliases;
+
+ private Action(String description, String action, String ... aliases) {
+ this.description = description;
+ this.action = action;
+ this.aliases = aliases;
+ }
}
}
Deleted: trunk/isis-fish/src/java/fr/ifremer/isisfish/IsisContext.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/IsisContext.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/IsisContext.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -1,331 +0,0 @@
-/*
-* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin,
-* 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 2
-* 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, write to the Free Software
-* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-* ##% */
-package fr.ifremer.isisfish;
-
-import fr.ifremer.isisfish.commandline.IsisAbstractContext;
-import fr.ifremer.isisfish.commandline.IsisOptionParser;
-import fr.ifremer.isisfish.datastore.IsisH2Config;
-import fr.ifremer.isisfish.versionning.IsisVcsConfig;
-import org.codelutin.i18n.I18n;
-import org.codelutin.option.OptionKey;
-import org.codelutin.option.ParserException;
-import org.codelutin.vcs.ConnectionState;
-import org.codelutin.vcs.VCSException;
-import org.codelutin.vcs.VCSHandler;
-import org.codelutin.vcs.VCSHandlerFactory;
-import org.swixat.model.Context;
-
-import javax.swing.JOptionPane;
-import javax.swing.JLabel;
-import java.io.File;
-import java.io.IOException;
-import java.text.SimpleDateFormat;
-
-/**
- * A simple context for Isis.
- * <p/>
- * The class defines a single shared (none multithread safe) instance {@link #context}
- * <p/>
- *
- * @author chemit
- */
-public class IsisContext extends IsisAbstractContext {
-
- public static final String ISIS_CONTEXT = "isisContext";
-
- private static IsisContext context;
-
- static public synchronized IsisContext get() {
- if (context == null) {
- try {
- context = new IsisContext();
- } catch (Exception e) {
- throw new RuntimeException("could not init " + IsisContext.class + "for reason " + e.getMessage());
- }
- }
- return context;
- }
-
- //////////////////////////////////////////////////
- // Les répertoires de backup
- //////////////////////////////////////////////////
-
- static public File getSessionBackupDirectory() {
- // on ne crée que lors d'un besoin
- IsisContext context = get();
- IsisConfig inst = context.getMainConfig();
- if (context.sessionBackupDirectory == null) {
- // le timestamp est en nano (on le veut en ms)
- long time = context.getStartingTime() / 1000;
- // creation de l'unique répertoire de backup pour la session
- String path = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(new java.util.Date(time));
- context.sessionBackupDirectory = new File(inst.getDefaultBackupDirectory(), path);
- context.sessionBackupDirectory.mkdirs();
- }
- return context.sessionBackupDirectory;
- }
-
- /**
- * @param rootDir le répertoire parent
- * @return le répertoire de backup à partir de son répertoire parent, dont
- * le nom est exactement celui défini pour la session d'Isis.
- * @see #getSessionBackupDirectory(java.io.File, String)
- */
- static public File getSessionBackupDirectory(File rootDir) {
- File result;
- result = getSessionBackupDirectory(rootDir, null);
- return result;
- }
-
- /**
- * @param rootDir le répertoire parent
- * @param prefixName le préfixe à ajouter au nom du répertoire
- * @return le répertoire de backup à partir de son répertoire parent, dont
- * le nom est celui défini pour la session d'Isis préfixé par le préfixe donné.
- * @see IsisConfig#DEFAULT_BACKUP_DIRECTORY_PROPERTY_KEY
- * @see #sessionBackupDirectory
- * @see fr.ifremer.isisfish.IsisContext#startingTime
- */
- static public File getSessionBackupDirectory(File rootDir, String prefixName) {
- String name = getSessionBackupDirectory().getName();
- return new File(rootDir, (prefixName == null ? "" : prefixName) + name);
- }
-
- /**
- * Cette enumération contient les différentes étapes de l'init.
- * <p/>
- * Elle permet de définir un mapping entre les étapes de l'init et les
- * actions d'option à exécuter pour chaque étape de l'init.
- * <p/>
- * TODO, effectuer cela par annotation sur la définition des actions.
- *
- * @author chemit
- */
- public enum InitStage {
- /**
- * premier état de l'init :
- * <p/>
- * on est rentré dans la méthode {@link IsisFish#init()}, juste avant
- * de charger la configuraton {@link IsisConfig#init()}
- */
- BEFORE_LOAD(
- IsisOptionParser.UI_OPTION_KEY
- ),
- /**
- * second état de l'init :
- * <p/>
- * on est toujours dans la méthode {@link IsisFish#init()}, juste avant
- * de valider la configuration vcs.
- */
- BEFORE_VALIDATE_VCS(
- IsisOptionParser.HELP_OPTION_KEY,
- IsisOptionParser.HELP_CONFIG_OPTION_KEY,
- IsisOptionParser.SHOW_CONFIG_OPTION_KEY,
- IsisOptionParser.EDIT_CONFIG_OPTION_KEY,
- IsisOptionParser.SSH_KEY_FILE_OPTION_KEY,
- IsisOptionParser.CREATE_SSH_KEY_OPTION_KEY
- ),
- /**
- * troisième état de l'init :
- * <p/>
- * la configuration vcs est validé, on a sauvé la configuration,
- * le répository n'a pas encore été initialisé.
- */
- BEFORE_INIT_REPOSITORY(
- IsisOptionParser.IMPORT_OPTION_KEY,
- IsisOptionParser.EXPORT_DATA_OPTION_KEY,
- IsisOptionParser.EXPORT_SCRIPT_OPTION_KEY,
- IsisOptionParser.IMPORT_AND_RENAME_REGION_OPTION_KEY,
- IsisOptionParser.LIST_OPTION_KEY
- ),
- /**
- * quatrième état de l'init :
- * <p/>
- * au retour de la méthode {@link IsisFish#init()},
- * le répository est opérationnel et la connexion vcs établie.
- */
- AFTER_INIT(
- IsisOptionParser.VCS_ADD_REMOVE_OPTION_KEY,
- IsisOptionParser.VCS_UPDATE_COMMIT_STATE_OPTION_KEY,
- IsisOptionParser.MAVEN_FILE_OPTION_KEY,
- IsisOptionParser.UPDATE_OPTION_KEY
- ),
- /**
- * cinquième état de l'init :
- * <p/>
- * le dernier état avant le lancement de l'application (si requis).
- */
- AFTER_ALL(
- IsisOptionParser.SIMULATE_OPTION_KEY,
- IsisOptionParser.UI_OPTION_KEY
- );
-
- transient final OptionKey[] optionKeys;
-
- InitStage(OptionKey... optionKeys) {
- this.optionKeys = optionKeys;
- }
- }
-
- /** flag to use or not vcs */
- protected boolean useVCS = true;
-
- /** the vcs handler to use */
- protected VCSHandler handler;
-
-
- /** le répertoire ou effectuer les backup pour cette session */
- protected File sessionBackupDirectory;
-
- protected Context uiContext;
-
- public IsisContext() throws Exception {
- // instanciate with concrete config
- super( IsisConfig.class, IsisVcsConfig.class, IsisH2Config.class);
- }
-
- public IsisOptionParser parseOptions(String... args) throws ParserException, IOException {
- // récupération du parseur
- IsisOptionParser result = getParser();
- // lecture des arguments de la ligne de commandes
- result.doParse(args);
- return result;
- }
-
- public VCSHandler getVCSHanler() {
- return handler;
- }
-
- public Context getUiContext() {
- return uiContext;
- }
-
- public void initI18n() {
- I18n.init(getMainConfig().getLocale(),getMainConfig().getEncoding());
- }
-
- @Override
- public IsisConfig getMainConfig() {
- return (IsisConfig) super.getMainConfig();
- }
-
- @Override
- public IsisVcsConfig getVcsConfig() {
- return (IsisVcsConfig) super.getVcsConfig();
- }
-
- @Override
- public IsisH2Config getH2Config() {
- return (IsisH2Config) super.getH2Config();
- }
-
- public boolean isUseParser() {
- return parser != null;
- }
-
- public boolean isUseVCS() {
- return useVCS;
- }
-
- boolean needUIForVCS() {
- return firstLaunch || getVcsConfig() != null && getVcsConfig().needMigration();
- }
-
-
- public void setUseVCS(boolean useVcs) {
- this.useVCS = useVcs;
- }
-
- public void setUiContext(Context uiContext) {
- this.uiContext = uiContext;
- }
-
- void doActionsForStage(InitStage stage) throws Exception {
- if (isUseParser()) {
- for (OptionKey optionName : stage.optionKeys) {
- getParser().getLastResult().doActions(this, optionName);
- }
- }
- }
-
- /**
- * Validate VCS configuration, could ask user some data via the vcs
- * configuration ui (if ui enable).
- *
- * @throws Exception if any problem
- */
- void validateVCS() throws Exception {
-
- // validate vcs configuration
- IsisVcsConfig vcsConfig = getVcsConfig();
- vcsConfig.validateConfig(needUIForVCS(), useUI);
- // instanciation du vcs hanlder
- handler = VCSHandlerFactory.getHandler();
- if (vcsConfig.canConnect()) {
- // must test the vcs connection (TODO test with ssh)
- try {
- handler.testConnection();
- vcsConfig.setConnectionState(ConnectionState.ON_LINE);
- } catch (VCSException e) {
- vcsConfig.setConnectionState(ConnectionState.ERROR);
- log.warn(e.getMessage());
- if (isUseUI()) {
- JOptionPane.showOptionDialog(null, new JLabel(e.getMessage()), "ssh connexion error", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null, null, null);
- }
- if (vcsConfig.isUseSshConnexion()) {
- // try with a anonymous connexion ?
- getVcsConfig().setUseSshConnexion(false);
-
- try {
- handler.reinitWorkingCopy();
- handler.testConnection();
- vcsConfig.setConnectionState(ConnectionState.ON_LINE);
- } catch (VCSException e1) {
- log.warn(e.getMessage());
- if (isUseUI()) {
- JOptionPane.showOptionDialog(null, new JLabel(e.getMessage()), "anonymous connexion error", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null, null, null);
- }
- }
- }
- }
- }
- // mark as valid vcs configuration
- useVCS &= vcsConfig.canConnect();
- }
-
- void putDefaultUserNameAndMail() {
- IsisConfig config = getMainConfig();
- // this case can only appears if at first usage we force to noUI, otherwise
- // it could not appear
- String email = config.getUserMail();
- if (email == null || email.isEmpty()) {
- // if no email remplace with vcsLogin at vcsHost
- config.setUserMail(getVcsConfig().getUserName() + '@' + getVcsConfig().getHostName());
- } else {
- config.setUserMail(email);
- }
- String userName = config.getUserName();
- if (userName == null || userName.isEmpty()) {
- // if no userName remplace with vcsLogin
- config.setUserName(getVcsConfig().getUserName());
- } else {
- config.setUserName(userName);
- }
- }
-}
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/IsisFish.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/IsisFish.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/IsisFish.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -31,14 +31,13 @@
package fr.ifremer.isisfish;
-import static fr.ifremer.isisfish.IsisConfig.Module.ANALYSE_PLAN;
-import static fr.ifremer.isisfish.IsisConfig.Module.EXPORT;
-import static fr.ifremer.isisfish.IsisConfig.Module.FORMULE;
-import static fr.ifremer.isisfish.IsisConfig.Module.REGION;
-import static fr.ifremer.isisfish.IsisConfig.Module.RULE;
-import static fr.ifremer.isisfish.IsisConfig.Module.SCRIPT;
-import static fr.ifremer.isisfish.IsisConfig.Module.SIMULATION;
-import static fr.ifremer.isisfish.IsisConfig.Module.SIMULATOR;
+import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
+import fr.ifremer.isisfish.datastore.FormuleStorage;
+import fr.ifremer.isisfish.datastore.RegionStorage;
+import fr.ifremer.isisfish.datastore.RuleStorage;
+import fr.ifremer.isisfish.datastore.ScriptStorage;
+import fr.ifremer.isisfish.datastore.SimulationStorage;
+import fr.ifremer.isisfish.datastore.SimulatorStorage;
import fr.ifremer.isisfish.simulator.SimulationManager;
import fr.ifremer.isisfish.swix.LayoutConverter;
import fr.ifremer.isisfish.types.Date;
@@ -50,24 +49,21 @@
import fr.ifremer.isisfish.util.RangeOfValuesConverter;
import fr.ifremer.isisfish.util.StringConverter;
import fr.ifremer.isisfish.util.TimeUnitConverter;
-import fr.ifremer.isisfish.versionning.IsisVCSHelper;
-import fr.ifremer.isisfish.versionning.IsisVcsConfig;
+import fr.ifremer.isisfish.vcs.VCS;
+import java.io.File;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.logging.LogFactory;
import static org.codelutin.i18n.I18n._;
import org.codelutin.log.LutinLogFactory;
import org.codelutin.math.matrix.DoubleBigVector;
import org.codelutin.math.matrix.MatrixFactory;
-import org.codelutin.vcs.ConnectionState;
-import org.codelutin.vcs.VCSException;
-import org.codelutin.vcs.VCSHandlerFactory;
-import org.codelutin.vcs.VCSHelper;
+import java.util.Locale;
import org.swixat.SwiXAT;
import org.swixat.model.Context;
import org.swixml.ConverterLibrary;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
+import org.codelutin.i18n.I18n;
+import org.codelutin.util.LocaleConverter;
import static javax.swing.JOptionPane.showOptionDialog;
@@ -82,6 +78,7 @@
/** ui context location */
static final private String CONTEXT_FILE = "fr/ifremer/isisfish/ui/context.xml";
+ static final public String LAST_RELEASE_LAUNCH = "lastReleaseLaunched";
/** to use log facility, just put in your code: log.info(\"...\"); */
static final private org.apache.commons.logging.Log log;
@@ -93,186 +90,220 @@
log = LogFactory.getLog(IsisFish.class);
}
+ static public IsisConfig config = null;
+ static public int step = 0; // action step
+ static public VCS vcs = null;
+ static public Context uiContext = null;
+ static protected boolean quit = false;
+
+ /**
+ * ask for application quit
+ */
+ static public void quit() {
+ quit = true;
+ }
+
+ public static boolean isQuit() {
+ return quit;
+ }
+
static public void main(String... args) {
- boolean quit = false;
- IsisContext context = null;
try {
- // initialisation du context
- context = IsisContext.get();
+ // initialisation de l'application
+ IsisFish.init(args);
- log.info(_("isisfish.launch.start", java.util.Arrays.toString(args)));
- StringBuilder builder = new StringBuilder();
- builder.append(java.text.SimpleDateFormat.getInstance().format(new java.util.Date()));
- builder.append(" Java version: ").append(System.getProperty("java.runtime.version"));
- builder.append(" Isis-fish version: ").append(IsisConfig.VERSION_PROPERTY_KEY.getDefaultValue().toString());
- log.info(builder.toString());
- log.debug(_("isisfish.launch.debugMode"));
+ log.debug(_("isisfish.launch.init.done", config.getElapsedTimeAsString()));
- // parsing des options à partir des arguments passés
- context.parseOptions(args);
+ // action before check database
+ config.doAction(step++);
- // initialisation de l'application
- IsisFish.init();
+ checkReleaseLaunched();
- log.debug(_("isisfish.launch.init.done", context.getElapsedTimeAsString()));
+ checkDatabase();
- if (context.isQuit()) {
- return;
- }
+ // action before check vcs
+ config.doAction(step++);
- if (context.isUseVCS()) {
- // post load options with vcs connexion required
- context.doActionsForStage(IsisContext.InitStage.AFTER_INIT);
+ initVCS();
- // recuperation a partir du vcs des modules non presents
- // uniquement si une migration n'a pas eu lieu
- if (context.getVcsConfig().getMigrationType() == null) {
- checkout();
- }
- }
+ log.info(_("isisfish.launching", config.getElapsedTimeAsString()));
- log.info(_("isisfish.launching", context.getElapsedTimeAsString()));
-
// last actions before launching or quitting
- context.doActionsForStage(IsisContext.InitStage.AFTER_ALL);
+ config.doAction(step++);
- if (!context.isQuit()) {
- quit = launch(quit, context);
+ launchUI();
- }
- //TODO See with Benjamin if this is correct to quit if no ui lanched?
+ // action after ui launched
+ config.doAction(step++);
} catch (Exception e) {
e.printStackTrace();
- quit = true;
+ quit();
} finally {
- if (quit || (context != null && context.isQuit())) {
- // nothing more to do
- System.exit(0);
- }
+ startQuitDaemon();
}
}
/**
- * All main in other class must call this method
+ * Start daemon that monitor quit value, if value is true, quit isis
+ */
+ static public void startQuitDaemon() {
+ Thread quitDaemon = new Thread(new Runnable() {
+ public void run() {
+ while(true) {
+ try {
+ if (isQuit()) {
+ config.doAction(step);
+ System.exit(0);
+ }
+ Thread.sleep(1000);
+ } catch (Exception eee) {
+ log.info("Error in quit daemon", eee);
+ }
+ }
+ }
+ }, "Isis quit daemon");
+ quitDaemon.setDaemon(true);
+ quitDaemon.start();
+ }
+
+ /**
+ * All main in other class must call this method, parse arguement,
+ * load configuration file, init language and load converter.
*
* @throws Exception if any exception while build configuration
*/
- static public void init() throws Exception {
+ static public void init(String ... args) throws Exception {
+ config = new IsisConfig();
- // obtain isis shared instance context
- IsisContext context = IsisContext.get();
+ log.info(_("isisfish.launch.start", java.util.Arrays.toString(args)));
+ StringBuilder builder = new StringBuilder();
+ builder.append(java.text.SimpleDateFormat.getInstance().format(new java.util.Date()));
+ builder.append(" Java version: ").append(System.getProperty("java.runtime.version"));
+ builder.append(" Isis-fish version: ").append(IsisConfig.getVersion());
+ log.info(builder.toString());
+ log.debug(_("isisfish.launch.debugMode"));
- // init context and configs
- context.init(null);
+ // parsing des options à partir des arguments passés
+ config.parse(args);
- // chargement de la configuration vcs
- IsisVcsConfig vcsConfig = context.getVcsConfig();
- VCSHandlerFactory.setConfig(vcsConfig);
+ I18n.init(config.getLocale(), config.getEncoding());
- StringBuilder sb = new StringBuilder();
- sb.append("connectionState : ").append(vcsConfig.getConnectionState());
- sb.append("\nhasPreviousConfig : ").append(vcsConfig.hasPreviousConfig());
- sb.append("\nisTypeChanged : ").append(vcsConfig.isTypeChanged());
- sb.append("\nneedMigration : ").append(vcsConfig.needMigration());
- if (vcsConfig.needMigration()) {
- sb.append("\nmigrationType ").append(vcsConfig.getMigrationType());
- }
- for (String s : sb.toString().split("\n")) {
- log.info(s);
- }
-
// post load hook (converter and matrixFactory)
initConvertersAndMatrixFactory();
+ }
- // post load options before save (with no vcs)
- context.doActionsForStage(IsisContext.InitStage.BEFORE_VALIDATE_VCS);
- notifyVCSError(context,vcsConfig);
-
- if (context.isQuit() || !context.isUseVCS()) {
- return;
- }
- try {
- // validate vcs config (should launch ui if required)
- context.validateVCS();
- } finally {
- context.putDefaultUserNameAndMail();
- // after vcs configuration validation, we can save the configuration
- context.save();
- }
- // post save options with vcs config required, but not vcs connexion
- context.doActionsForStage(IsisContext.InitStage.BEFORE_INIT_REPOSITORY);
- if (context.isQuit() || !context.isUseVCS()) {
- return;
- }
+// public static void initVCS() {
+// StringBuilder sb = new StringBuilder();
+// sb.append("connectionState : ").append(vcsConfig.getConnectionState());
+// sb.append("\nhasPreviousConfig : ").append(vcsConfig.hasPreviousConfig());
+// sb.append("\nisTypeChanged : ").append(vcsConfig.isTypeChanged());
+// sb.append("\nneedMigration : ").append(vcsConfig.needMigration());
+// if (vcsConfig.needMigration()) {
+// sb.append("\nmigrationType ").append(vcsConfig.getMigrationType());
+// }
+// for (String s : sb.toString().split("\n")) {
+// log.info(s);
+// }
+//
+// }
- try {
- // vcs config is now init (prepare repository or perform a migration)
- vcsConfig.initVCS(context.handler, context.isUseUI());
- } catch (VCSException e) {
- // eror with vcs, close close connexion
- log.error("error with vcs " + e.getMessage());
- vcsConfig.setConnectionState(ConnectionState.ERROR);
- context.setUseVCS(false);
+ /**
+ * Check last version launch to determine is user change his release
+ */
+ static public void checkReleaseLaunched() {
+ String version = config.getOption(LAST_RELEASE_LAUNCH);
+ if (version == null) { // first launch of isis ?
+ // ask user for some configuration
+ // FIXME
+ // try to checkout vcs data
+ // FIXME
+ } else if(!version.equals(config.getVersion())) {
+ // user has upgraded isis
+ // TODO: utiliser ce block pour faire des actions d'upgrade entre deux versions
}
-
- notifyVCSError(context, vcsConfig);
+ // update last version launch
+ config.setOption(LAST_RELEASE_LAUNCH, config.getVersion());
}
- private static void notifyVCSError(IsisContext context, IsisVcsConfig vcsConfig) {
- if (vcsConfig.getConnectionState() == ConnectionState.ERROR) {
- // notify user there is a vcs pb
- StringBuilder sb2 = new StringBuilder();
- sb2.append(_("isisfish.error.vcs.connect"));
- if (context.isUseUI()) {
- showOptionDialog(null, new JLabel(sb2.toString()), "vcs error", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null, null, null);
- } else {
- log.error(sb2.toString());
+ /**
+ * Check and recreate necessary directory for isis work successfull
+ */
+ static public void checkDatabase() {
+ // check database repository directory
+ File[] dirs = new File[]{
+ config.getDatabaseDirectory(),
+ AnalysePlanStorage.getAnalysePlanDirectory(),
+ FormuleStorage.getFormuleDirectory(),
+ RegionStorage.getRegionDirectory(),
+ RuleStorage.getRuleDirectory(),
+ ScriptStorage.getScriptDirectory(),
+ SimulationStorage.getSimulationDirectory(),
+ SimulatorStorage.getSimulatorDirectory(),
+ };
+
+ for(File f : dirs) {
+ if (!f.exists()) {
+ f.mkdirs();
}
- context.setUseVCS(false);
}
}
- static public boolean launch(boolean quit, IsisContext context) {
+ /**
+ * Initialise le VCS et check s'il y a des mises a jour pour prevenir
+ * l'utilisateur
+ */
+ static public void initVCS() {
+ // init vcs
+ vcs = VCS.createVCS(config);
+ // check connection status
+ vcs.checkConnection();
+
+ // check release
+ vcs.checkRelease();
+
+ // check file status
+ vcs.checkFileStatus();
+ }
+
+ /**
+ * initialise et lance l'interface graphique si elle est demandee
+ */
+ static public void launchUI() {
// init simulater manager
SimulationManager.getInstance();
- if (context.isLaunchUI()) {
+ if (config.isLaunchUI()) {
// init IsisTray
IsisTray.getInstance();
// init context (will luanch remote server thread)
- Context uiContext = new org.swixat.model.GenericContext();
- // push in swixat context isisContext for facilities
- uiContext.setData(IsisContext.ISIS_CONTEXT, context);
- // keep a reference of uiConext in application context
- // to make possible bridge with others codes (jaxx,...)
- context.setUiContext(uiContext);
+ uiContext = new org.swixat.model.GenericContext();
+ // push in swixat context isis config for facilities
+ uiContext.setData(config.getClass().getSimpleName(), config);
// lauch first UI (welcome.xml)
SwiXAT.launch(CONTEXT_FILE, uiContext);
- quit = false;
}
- return quit;
}
- static public void checkout() throws VCSException {
- checkout(true);
- }
+// static public void checkout() throws VCSException {
+// checkout(true);
+// }
+//
+// static public void checkout(boolean createRegion) throws VCSException {
+// if (config.isUseVCS()) {
+// IsisVCSHelper.doCheckoutModule(context.handler, SCRIPT, EXPORT, SIMULATOR, FORMULE, RULE, ANALYSE_PLAN);
+// VCSHelper.doCheckoutDir(context.handler, SIMULATION.getDirectory(), REGION.getDirectory());
+// IsisVCSHelper.doCheckoutRegion(context.handler, "DemoRegion", createRegion);
+// }
+// }
- static public void checkout(boolean createRegion) throws VCSException {
- IsisContext context = IsisContext.get();
- if (!context.isUseVCS()) {
- return;
- }
- IsisVCSHelper.doCheckoutModule(context.handler, SCRIPT, EXPORT, SIMULATOR, FORMULE, RULE, ANALYSE_PLAN);
- VCSHelper.doCheckoutDir(context.handler, SIMULATION.getDirectory(), REGION.getDirectory());
- IsisVCSHelper.doCheckoutRegion(context.handler, "DemoRegion", createRegion);
- }
-
public static void initConvertersAndMatrixFactory() {
// ajout du support de XMLGridLayout dans SwiXml
ConverterLibrary.getInstance().register(java.awt.LayoutManager.class, new LayoutConverter());
+ ConvertUtils.register(new LocaleConverter(), Locale.class);
+
// init converters
ConvertUtils.register(new DateConverter(), Date.class);
ConvertUtils.register(new MonthConverter(), Month.class);
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/AnalysePlanStorage.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/AnalysePlanStorage.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/AnalysePlanStorage.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -30,14 +30,13 @@
package fr.ifremer.isisfish.datastore;
-import static fr.ifremer.isisfish.IsisConfig.Module.ANALYSE_PLAN;
import fr.ifremer.isisfish.IsisFishException;
-import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.simulator.AnalysePlan;
import fr.ifremer.isisfish.util.Doc;
import fr.ifremer.isisfish.util.DocHelper;
import fr.ifremer.isisfish.util.Docable;
-import org.codelutin.vcs.VCSException;
+import fr.ifremer.isisfish.vcs.VCSException;
import static org.codelutin.i18n.I18n._;
@@ -63,6 +62,8 @@
public class AnalysePlanStorage extends JavaSourceStorage implements Docable { // AnalysePlanStorage
+ public final static String ANALYSE_PLAN_PATH = "analyseplans";
+
private final static String PARAM_PREFIX = "param_";
/** to use log facility, just put in your code: log.info(\"...\"); */
@@ -84,13 +85,19 @@
super(rootSrc, directory, name);
}
+ static public File getAnalysePlanDirectory() {
+ File result = IsisFish.config.getDatabaseDirectory();
+ result = new File(result, ANALYSE_PLAN_PATH);
+ return result;
+ }
+
/**
* Retourne le nom de toutes les plans existantes
*
* @return TODO
*/
static public List<String> getAnalysePlanNames() {
- File dir = IsisConfig.getAnalysePlanDirectory();
+ File dir = getAnalysePlanDirectory();
return AnalysePlanStorage.getStorageNames(dir);
}
@@ -103,8 +110,8 @@
static public AnalysePlanStorage getAnalysePlan(String name) {
AnalysePlanStorage result = plansCache.get(name);
if (result == null) {
- result = new AnalysePlanStorage(IsisConfig.getDatabaseDirectory(),
- IsisConfig.getAnalysePlanDirectory(), name);
+ result = new AnalysePlanStorage(IsisFish.config.getDatabaseDirectory(),
+ getAnalysePlanDirectory(), name);
plansCache.put(name, result);
}
return result;
@@ -246,7 +253,7 @@
}
static public void checkout() throws VCSException {
- checkout(IsisConfig.getDatabaseDirectory(), ANALYSE_PLAN.value());
+ checkout(IsisFish.config.getDatabaseDirectory(), ANALYSE_PLAN_PATH);
}
/**
@@ -270,7 +277,7 @@
* vide.
*/
static public List<String> getRemoteAnalysePlanNames() {
- File dir = IsisConfig.getAnalysePlanDirectory();
+ File dir = getAnalysePlanDirectory();
return getRemoteStorageNames(dir);
}
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/CodeSourceStorage.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/CodeSourceStorage.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/CodeSourceStorage.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -31,7 +31,7 @@
package fr.ifremer.isisfish.datastore;
import fr.ifremer.isisfish.IsisFishRuntimeException;
-import org.codelutin.vcs.VCSException;
+import fr.ifremer.isisfish.vcs.VCSException;
import org.codelutin.util.FileUtil;
@@ -91,6 +91,10 @@
// Il n'y a rien a faire pour les code sources
}
+ /**
+ * Check if script exists
+ * @return
+ */
public boolean exists() {
return getFile().exists();
}
@@ -152,7 +156,7 @@
public String diff() throws VCSException, IOException {
- return getVCSHanler().getDiff(getFile());
+ return getVCS().getDiff(getFile());
}
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/DataStorage.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/DataStorage.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/DataStorage.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -47,7 +47,7 @@
import org.codelutin.util.ZipUtil;
import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.IsisFish;
/**
* Class abstraite dont herite tous les storages qui on besoin d'un TopiaContext
@@ -60,6 +60,8 @@
public abstract class DataStorage extends VersionStorage {
+ static final public String DATA_BACKUP_FILENAME = "data-backup.sql.gz";
+
/** Logger for this class */
private static final Log log = LogFactory.getLog(DataStorage.class);
@@ -81,7 +83,7 @@
* nom du storage (nom du dernier répertoire)
*/
protected DataStorage(File directory, String name) {
- super(IsisConfig.getDatabaseDirectory(), directory);
+ super(IsisFish.config.getDatabaseDirectory(), directory);
this.name = name;
if (!directory.exists()) {
directory.mkdirs();
@@ -102,8 +104,7 @@
*/
protected File getDataBackupFile() {
File result;
- result = IsisConfig.getDataBackupFile(getDirectory());
- //result = new File(getDirectory(), IsisConfig.DATA_BACKUP_FILE);
+ result = new File(getDirectory(), DATA_BACKUP_FILENAME);
return result;
}
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/ExportStorage.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/ExportStorage.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/ExportStorage.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -31,15 +31,14 @@
package fr.ifremer.isisfish.datastore;
-import static fr.ifremer.isisfish.IsisConfig.Module.EXPORT;
import fr.ifremer.isisfish.IsisFishException;
import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.export.Export;
import fr.ifremer.isisfish.util.Doc;
import fr.ifremer.isisfish.util.DocHelper;
import fr.ifremer.isisfish.util.Docable;
-import org.codelutin.vcs.VCSException;
+import fr.ifremer.isisfish.vcs.VCSException;
import static org.codelutin.i18n.I18n._;
@@ -59,6 +58,8 @@
*/
public class ExportStorage extends JavaSourceStorage implements Docable {
+ static final public String EXPORT_PATH = "exports";
+
/** to use log facility, just put in your code: log.info(\"...\"); */
static private Log log = LogFactory.getLog(ExportStorage.class);
@@ -77,6 +78,12 @@
super(rootSrc, directory, name);
}
+ static public File getExportDirectory() {
+ File result = IsisFish.config.getDatabaseDirectory();
+ result = new File(result, EXPORT_PATH);
+ return result;
+ }
+
/**
* Retourne une nouvelle instance de la regle. Compile le fichier si besoin
*
@@ -97,8 +104,8 @@
static public ExportStorage getExport(String name) {
ExportStorage result = scriptsCache.get(name);
if (result == null) {
- result = new ExportStorage(IsisConfig.getDatabaseDirectory(),
- IsisConfig.getExportDirectory(), name);
+ result = new ExportStorage(IsisFish.config.getDatabaseDirectory(),
+ getExportDirectory(), name);
scriptsCache.put(name, result);
}
return result;
@@ -110,12 +117,12 @@
* @return la liste des noms de toutes les régions disponible en local
*/
static public List<String> getExportNames() {
- File dir = IsisConfig.getExportDirectory();
+ File dir = getExportDirectory();
return getStorageNames(dir);
}
static public void checkout() throws VCSException {
- checkout(IsisConfig.getDatabaseDirectory(), EXPORT.value());
+ checkout(IsisFish.config.getDatabaseDirectory(), EXPORT_PATH);
}
/**
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/FormuleStorage.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/FormuleStorage.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/FormuleStorage.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -47,12 +47,12 @@
import org.codelutin.topia.TopiaException;
import org.codelutin.util.FileUtil;
-import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.IsisFishDAOHelper;
import fr.ifremer.isisfish.entities.Equation;
import fr.ifremer.isisfish.entities.EquationDAO;
import fr.ifremer.isisfish.entities.Formule;
-import org.codelutin.vcs.VCSException;
+import fr.ifremer.isisfish.vcs.VCSException;
/**
@@ -62,6 +62,8 @@
public class FormuleStorage extends CodeSourceStorage implements Formule {
+ public static final String FORMULE_PATH = "formules";
+
/**
* la categorie de la formule
*/
@@ -79,6 +81,12 @@
this.category = category;
}
+ static public File getFormuleDirectory() {
+ File result = IsisFish.config.getDatabaseDirectory();
+ result = new File(result, FORMULE_PATH);
+ return result;
+ }
+
/**
* @return Returns the category.
@@ -96,11 +104,13 @@
static public List<FormuleStorage> getFormules(String category) {
List<FormuleStorage> result = new ArrayList<FormuleStorage>();
try {
- File dir = new File(IsisConfig.getFormuleDirectory(), category);
- dir.mkdirs();
- for (File f : dir.listFiles(getVCSHanler().getVersionnableFilenameFilter())) {
- String name = FileUtil.basename(f);
- result.add(getFormule(category, name));
+ File dir = new File(getFormuleDirectory(), category);
+ dir.mkdirs();
+ for (File f : dir.listFiles()) {
+ if (getVCS().isVersionnableAbleFile(f)) {
+ String name = FileUtil.basename(f);
+ result.add(getFormule(category, name));
+ }
}
} catch (Exception eee) {
if (log.isErrorEnabled()) {
@@ -119,11 +129,13 @@
static public List<String> getFormuleNames(String category) {
List<String> result = new ArrayList<String>();
try {
- File dir = new File(IsisConfig.getFormuleDirectory(), category);
+ File dir = new File(getFormuleDirectory(), category);
dir.mkdirs();
- for (File f : dir.listFiles(getVCSHanler().getVersionnableFilenameFilter())) {
- String name = FileUtil.basename(f);
- result.add(name);
+ for (File f : dir.listFiles()) {
+ if (getVCS().isVersionnableAbleFile(f)) {
+ String name = FileUtil.basename(f);
+ result.add(name);
+ }
}
} catch (Exception eee) {
if (log.isErrorEnabled()) {
@@ -197,10 +209,9 @@
*/
static public List<String> getCategories() {
List<String> result = new ArrayList<String>();
- File dir = IsisConfig.getFormuleDirectory();
- FilenameFilter filter = getVCSHanler().getVersionnableFilenameFilter();
+ File dir = getFormuleDirectory();
for (File f : dir.listFiles()) {
- if (f.isDirectory() && filter.accept(f.getParentFile(), f.getName())) {
+ if (f.isDirectory() && getVCS().isVersionnableAbleFile(f)) {
result.add(f.getName());
}
}
@@ -222,8 +233,8 @@
if (!"".equals(extension)) {
name = name.substring(0, name.length() - (extension.length() + 1));
}
- result = new FormuleStorage(IsisConfig.getDatabaseDirectory(),
- IsisConfig.getFormuleDirectory(), category, name, extension);
+ result = new FormuleStorage(IsisFish.config.getDatabaseDirectory(),
+ getFormuleDirectory(), category, name, extension);
formulesCache.put(key, result);
}
return result;
@@ -242,15 +253,15 @@
String key = category + File.separator + name + extension;
FormuleStorage result = formulesCache.get(key);
if (result == null) {
- result = new FormuleStorage(IsisConfig.getDatabaseDirectory(),
- IsisConfig.getFormuleDirectory(), category, name, extension);
+ result = new FormuleStorage(IsisFish.config.getDatabaseDirectory(),
+ getFormuleDirectory(), category, name, extension);
formulesCache.put(key, result);
}
return result;
}
static public void checkout() throws VCSException {
- checkout(IsisConfig.getDatabaseDirectory(), IsisConfig.Module.FORMULE.value());
+ checkout(IsisFish.config.getDatabaseDirectory(), FORMULE_PATH);
}
/**
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/IsisH2Config.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/IsisH2Config.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/IsisH2Config.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -19,7 +19,6 @@
package fr.ifremer.isisfish.datastore;
import fr.ifremer.isisfish.commandline.configs.IsisAbstractConfigH2;
-import fr.ifremer.isisfish.IsisContext;
import fr.ifremer.isisfish.IsisFishRuntimeException;
import fr.ifremer.isisfish.IsisFishDAOHelper;
import org.codelutin.topia.migration.TopiaMigrationServiceImpl;
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/JavaSourceStorage.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/JavaSourceStorage.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/JavaSourceStorage.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -31,8 +31,7 @@
package fr.ifremer.isisfish.datastore;
import fr.ifremer.isisfish.IsisFishException;
-import fr.ifremer.isisfish.IsisContext;
-import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.util.CompileHelper;
import org.apache.commons.lang.ClassUtils;
import static org.codelutin.i18n.I18n._;
@@ -95,7 +94,7 @@
* @return 0 si la compilation a reussi une autre valeur sinon
*/
public int compile(boolean force, PrintWriter out) {
- return CompileHelper.compile(this, IsisContext.get().getMainConfig().getCompileDirectory(), force, out);
+ return CompileHelper.compile(this, IsisFish.config.getCompileDirectory(), force, out);
}
/**
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/RegionStorage.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/RegionStorage.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/RegionStorage.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -30,12 +30,12 @@
package fr.ifremer.isisfish.datastore;
-import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.IsisFishDAOHelper;
import fr.ifremer.isisfish.entities.FisheryRegion;
import fr.ifremer.isisfish.entities.FisheryRegionDAO;
import fr.ifremer.isisfish.entities.Result;
-import org.codelutin.vcs.VCSException;
+import fr.ifremer.isisfish.vcs.VCSException;
import org.apache.commons.collections.map.ReferenceMap;
import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.commons.logging.Log;
@@ -62,6 +62,16 @@
*/
public class RegionStorage extends DataStorage { // RegionStorage
+ static final public String REGION_PATH = "regions";
+ static final public String MAP_DIRECTORY = "maps";
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(RegionStorage.class);
+
+ @SuppressWarnings("unchecked")
+ static protected Map<String, RegionStorage> regions = (Map<String, RegionStorage>) new ReferenceMap();
+
+
/** File to use to store next commit region comment */
protected File commentForNextCommitFile = null;
@@ -69,7 +79,19 @@
super(directory, name);
commentForNextCommitFile = new File(getDirectory(), "commentForNextCommit.txt");
}
+
+ static public File getRegionDirectory() {
+ File result = IsisFish.config.getDatabaseDirectory();
+ result = new File(result, REGION_PATH);
+ return result;
+ }
+ static public File getRegionDirectory(String name) {
+ File result = getRegionDirectory();
+ result = new File(result, name);
+ return result;
+ }
+
/**
* @return Returns the commentForNextCommit.
* @throws IOException if IO problem while reading file
@@ -163,9 +185,7 @@
}
public File getMapRepository() {
- File result;
- result = IsisConfig.getRegionMapDirectory(getDirectory());
- //result = new File(getDirectory(), IsisConfig.REGION_MAP);
+ File result = new File(getDirectory(), MAP_DIRECTORY);
return result;
}
@@ -178,7 +198,7 @@
* @return le sotrage après checkout
*/
static public RegionStorage checkout(String name) throws VCSException, TopiaException {
- checkout(IsisConfig.getDatabaseDirectory(), IsisConfig.Module.REGION.value() + "/" + name);
+ checkout(IsisFish.config.getDatabaseDirectory(), REGION_PATH + "/" + name);
RegionStorage region = getRegion(name);
if (region != null) {
File file = region.getDataBackupFile();
@@ -191,7 +211,7 @@
}
return region;
}
-
+
/**
* Recupere le TopiaContext d'une region
*
@@ -203,7 +223,7 @@
RegionStorage result = regions.get(name);
if (result == null) {
// recherche du repertoire de la region en fonction de la config
- File directory = IsisConfig.getRegionDirectory(name);
+ File directory = getRegionDirectory(name);
log.info("Try to open region " + name + "(" + directory + ")");
if (directory.exists()) {
result = new RegionStorage(directory, name);
@@ -240,7 +260,7 @@
throw new StorageException(
"Can't create region this region name exists: " + name);
}
- File directory = IsisConfig.getRegionDirectory(name);
+ File directory = getRegionDirectory(name);
RegionStorage result = new RegionStorage(directory, name);
try {
@@ -274,7 +294,7 @@
* @return la liste des noms de toutes les régions disponible en local
*/
static public List<String> getRegionNames() {
- File dir = IsisConfig.getRegionDirectory();
+ File dir = getRegionDirectory();
List<String> result;
result = getStorageNames(dir);
return result;
@@ -315,7 +335,7 @@
* vide.
*/
static public List<String> getRemoteRegionNames() {
- File dir = IsisConfig.getRegionDirectory();
+ File dir = getRegionDirectory();
List<String> result;
result = getRemoteStorageNames(dir);
return result;
@@ -384,7 +404,7 @@
renameFrom = "^.*?/(.*)$";
renameTo = newName + "/$1";
}
- String lastEntry = ZipUtil.uncompressAndRename(file, IsisConfig.getRegionDirectory(), renameFrom, renameTo);
+ String lastEntry = ZipUtil.uncompressAndRename(file, getRegionDirectory(), renameFrom, renameTo);
String name = lastEntry.substring(0, lastEntry.indexOf("/"));
RegionStorage result = RegionStorage.getRegion(name);
if (result != null) {
@@ -412,11 +432,5 @@
}
}
- /** to use log facility, just put in your code: log.info(\"...\"); */
- static private Log log = LogFactory.getLog(RegionStorage.class);
-
- @SuppressWarnings("unchecked")
- static protected Map<String, RegionStorage> regions = (Map<String, RegionStorage>) new ReferenceMap();
-
} // RegionStorage
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/RuleStorage.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/RuleStorage.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/RuleStorage.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -30,14 +30,13 @@
package fr.ifremer.isisfish.datastore;
-import static fr.ifremer.isisfish.IsisConfig.Module.RULE;
import fr.ifremer.isisfish.IsisFishException;
-import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.util.Doc;
import fr.ifremer.isisfish.util.DocHelper;
import fr.ifremer.isisfish.util.Docable;
import fr.ifremer.isisfish.rule.Rule;
-import org.codelutin.vcs.VCSException;
+import fr.ifremer.isisfish.vcs.VCSException;
import static org.codelutin.i18n.I18n._;
@@ -65,6 +64,8 @@
*/
public class RuleStorage extends JavaSourceStorage implements Docable { // RulesStorage
+ public static final String RULE_PATH = "rules";
+
private final static String PARAM_PREFIX = "param_";
/** to use log facility, just put in your code: log.info(\"...\"); */
@@ -85,13 +86,19 @@
super(rootSrc, directory, name);
}
+ static public File getRuleDirectory() {
+ File result = IsisFish.config.getDatabaseDirectory();
+ result = new File(result, RULE_PATH);
+ return result;
+ }
+
/**
* Retourne le nom de toutes les regles existantes pour cette region
*
* @return all rule names found in local user database
*/
static public List<String> getRuleNames() {
- File dir = IsisConfig.getRuleDirectory();
+ File dir = getRuleDirectory();
return RuleStorage.getStorageNames(dir);
}
@@ -104,8 +111,8 @@
static public RuleStorage getRule(String name) {
RuleStorage result = rulesCache.get(name);
if (result == null) {
- result = new RuleStorage(IsisConfig.getDatabaseDirectory(),
- IsisConfig.getRuleDirectory(), name);
+ result = new RuleStorage(IsisFish.config.getDatabaseDirectory(),
+ getRuleDirectory(), name);
rulesCache.put(name, result);
}
return result;
@@ -248,7 +255,7 @@
}
static public void checkout() throws VCSException {
- checkout(IsisConfig.getDatabaseDirectory(), RULE.value());
+ checkout(IsisFish.config.getDatabaseDirectory(), RULE_PATH);
}
/**
@@ -272,7 +279,7 @@
* vide.
*/
static public List<String> getRemoteRuleNames() {
- File dir = IsisConfig.getRuleDirectory();
+ File dir = getRuleDirectory();
return getRemoteStorageNames(dir);
}
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/ScriptStorage.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/ScriptStorage.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/ScriptStorage.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -31,14 +31,13 @@
package fr.ifremer.isisfish.datastore;
-import static fr.ifremer.isisfish.IsisConfig.Module.SCRIPT;
import fr.ifremer.isisfish.IsisFishException;
import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.util.DocHelper;
import fr.ifremer.isisfish.util.Doc;
import fr.ifremer.isisfish.util.Docable;
-import org.codelutin.vcs.VCSException;
+import fr.ifremer.isisfish.vcs.VCSException;
import static org.codelutin.i18n.I18n._;
@@ -53,13 +52,12 @@
/**
*
* Gestion des fichers CVS de type scripts (appratenant au module scripts).
- *
- * @author dessard
- *
*/
public class ScriptStorage extends JavaSourceStorage implements Docable {
+ static final public String SCRIPT_PATH = "scripts";
+
/** to use log facility, just put in your code: log.info(\"...\"); */
static private Log log = LogFactory.getLog(ScriptStorage.class);
@@ -79,6 +77,12 @@
super(rootSrc, directory, name);
}
+ static public File getScriptDirectory() {
+ File result = IsisFish.config.getDatabaseDirectory();
+ result = new File(result, SCRIPT_PATH);
+ return result;
+ }
+
/**
* Retourne une nouvelle instance de la regle. Compile le fichier si besoin
*
@@ -98,15 +102,15 @@
static public ScriptStorage getScript(String name) {
ScriptStorage result = scriptsCache .get(name);
if (result == null) {
- result = new ScriptStorage(IsisConfig.getDatabaseDirectory(),
- IsisConfig.getScriptDirectory(), name);
+ result = new ScriptStorage(IsisFish.config.getDatabaseDirectory(),
+ getScriptDirectory(), name);
scriptsCache.put(name, result);
}
return result;
}
static public void checkout() throws VCSException {
- checkout(IsisConfig.getDatabaseDirectory(), SCRIPT.value());
+ checkout(IsisFish.config.getDatabaseDirectory(), SCRIPT_PATH);
}
/**
@@ -115,7 +119,7 @@
* @return la liste des noms de toutes les régions disponible en local
*/
static public List<String> getScriptNames() {
- File dir = IsisConfig.getScriptDirectory();
+ File dir = getScriptDirectory();
return getStorageNames(dir);
}
@@ -140,7 +144,7 @@
* vide.
*/
static public List<String> getRemoteScriptNames() {
- File dir = IsisConfig.getScriptDirectory();
+ File dir = getScriptDirectory();
return getRemoteStorageNames(dir);
}
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/SimulationStorage.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/SimulationStorage.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/SimulationStorage.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -31,7 +31,6 @@
package fr.ifremer.isisfish.datastore;
-import static fr.ifremer.isisfish.IsisConfig.Module.SIMULATION;
import static org.codelutin.i18n.I18n._;
import java.io.File;
@@ -51,14 +50,14 @@
import org.codelutin.util.FileUtil;
import org.codelutin.util.ZipUtil;
-import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.IsisFishDAOHelper;
import fr.ifremer.isisfish.IsisFishRuntimeException;
import fr.ifremer.isisfish.entities.FisheryRegion;
import fr.ifremer.isisfish.entities.FisheryRegionDAO;
import fr.ifremer.isisfish.logging.SimulationLoggerUtil;
import fr.ifremer.isisfish.simulator.SimulationParameter;
-import org.codelutin.vcs.VCSException;
+import fr.ifremer.isisfish.vcs.VCSException;
/**
* Class permettant la gestion de la persistance d'une simulation
@@ -67,6 +66,14 @@
*
*/
public class SimulationStorage extends DataStorage { // SimulationStorage
+
+ static final public String SIMULATION_PATH = "simulations";
+ static final public String INFORMATION_FILENAME = "information";
+ static final public String PARAMETERS_FILENAME = "parameters.properties";
+ static final public String RESULT_XML_FILENAME = "isis-mexico-output.xml";
+ static final public String RESULT_EXPORT_DIRECTORY = "resultExports";
+
+
/** to use log facility, just put in your code: log.info(\"...\"); */
static private Log log = LogFactory.getLog(SimulationStorage.class);
@@ -94,17 +101,58 @@
setParameter(parameter);
}
- protected File getSimulationParameterFile() {
- return IsisConfig.getSimulationParametersFile(getDirectory());
- //return new File(getDirectory(), IsisConfig.SIMULATION_PARAMETERS);
+ static public File getSimulationDirectory() {
+ File result = IsisFish.config.getDatabaseDirectory();
+ result = new File(result, SIMULATION_PATH);
+ if (!result.exists()) {
+ result.mkdirs();
+ }
+ return result;
}
+ static public File getSimulationDirectory(String name) {
+ File result = getSimulationDirectory();
+ result = new File(result, name);
+ if (!result.exists()) {
+ result.mkdirs();
+ }
+ return result;
+ }
+
+ static public File getResultExportDirectory(File root) {
+ File result = new File(root, RESULT_EXPORT_DIRECTORY);
+ if (!result.exists()) {
+ result.mkdirs();
+ }
+ return result;
+ }
+
+ static public File getSimulationParametersFile(File root) {
+ File result = new File(root, PARAMETERS_FILENAME);
+ return result;
+ }
+
+ static public File getSimulationInformationFile(File root) {
+ File result = new File(root, INFORMATION_FILENAME);
+ return result;
+ }
+
+ static public File getSimulationResultXmlFile(File root) {
+ File result = new File(root, RESULT_XML_FILENAME);
+ return result;
+ }
+
+ protected File getSimulationParametersFile() {
+ File result = getSimulationParametersFile(getDirectory());
+ return result;
+ }
+
public void setParameter(SimulationParameter parameter) {
this.parameter = parameter;
if (parameter != null) {
Properties prop = parameter.toProperties();
log.info("DEBUG: store param: " + prop);
- File file = getSimulationParameterFile();
+ File file = getSimulationParametersFile();
try {
FileOutputStream out = new FileOutputStream(file);
prop.store(out, "Parameters");
@@ -123,7 +171,7 @@
public SimulationParameter getParameter() {
if(parameter == null){
Properties prop = new Properties();
- File file = getSimulationParameterFile();
+ File file = getSimulationParametersFile();
try {
FileInputStream in = new FileInputStream(file);
prop.load(in);
@@ -152,7 +200,7 @@
}
Properties prop = new Properties();
- File file = getSimulationParameterFile();
+ File file = getSimulationParametersFile();
try {
FileInputStream in = new FileInputStream(file);
prop.load(in);
@@ -166,8 +214,8 @@
}
protected File getInformationFile() {
- return IsisConfig.getSimulationInformationFile(getDirectory());
- //return new File(getDirectory(), IsisConfig.SIMULATION_INFORMATION_FILENAME);
+ File result = new File(getDirectory(), INFORMATION_FILENAME);
+ return result;
}
/**
@@ -220,7 +268,7 @@
SimulationStorage result = simulations.get(name);
if (result == null) {
// recherche du repertoire de la simulation en fonction de la config
- File directory = IsisConfig.getSimulationDirectory(name);
+ File directory = getSimulationDirectory(name);
log.info("Try to open simulation " + name + "(" + directory + ")");
if (directory.exists()) {
result = new SimulationStorage(directory, name, null);
@@ -246,7 +294,7 @@
if (localyExists(name)) {
throw new IllegalArgumentException("Can't create simulation this simulation name exists: " + name);
}
- File directory = IsisConfig.getSimulationDirectory(name);
+ File directory = getSimulationDirectory(name);
SimulationStorage result = new SimulationStorage(directory, name, parameter);
// 20060819: poussin
@@ -268,7 +316,7 @@
* @return la liste des noms de toutes les régions disponible en local
*/
static public List<String> getSimulationNames() {
- File dir = IsisConfig.getSimulationDirectory();
+ File dir = getSimulationDirectory();
return getStorageNames(dir);
}
@@ -291,7 +339,7 @@
* est vide.
*/
static public List<String> getRemoteSimulationNames() {
- File dir = IsisConfig.getSimulationDirectory();
+ File dir = getSimulationDirectory();
return getRemoteStorageNames(dir);
}
@@ -345,7 +393,7 @@
* @throws TopiaException si problème lors de l'opération sur la base embarquée
*/
static public void checkout(String name) throws VCSException, TopiaException {
- checkout(IsisConfig.getDatabaseDirectory(), SIMULATION.value() + "/" + name);
+ checkout(IsisFish.config.getDatabaseDirectory(), SIMULATION_PATH + "/" + name);
SimulationStorage sim = getSimulation(name);
File file = sim.getDataBackupFile();
TopiaContext tx = sim.getStorage().beginTransaction();
@@ -392,7 +440,7 @@
renameFrom = "^.*?/(.*)$";
renameTo = newName + "/$1";
}
- String lastEntry = ZipUtil.uncompressAndRename(file, IsisConfig.getSimulationDirectory(), renameFrom, renameTo);
+ String lastEntry = ZipUtil.uncompressAndRename(file, getSimulationDirectory(), renameFrom, renameTo);
String name = lastEntry.substring(0, lastEntry.indexOf("/"));
SimulationStorage result = SimulationStorage.getSimulation(name);
if (result != null) {
@@ -425,8 +473,8 @@
List<File> forZip = new ArrayList<File>(2);
File file1;
forZip.add(file1 = new File(tmpDir, oldRegionName));
- forZip.add(file1 = IsisConfig.getDataBackupFile(file1));
- //forZip.add(file1 = new File(file1, IsisConfig.DATA_BACKUP_FILE));
+ //forZip.add(file1 = getDataBackupFile(file1));
+ forZip.add(file1 = new File(file1, DATA_BACKUP_FILENAME));
if (!file1.exists()) {
// we must prepare storage (no file found)
prepare();
@@ -500,7 +548,7 @@
/** @return the simulation log file */
public String getSimulationLogFile() {
- File root = IsisConfig.getSimulationDirectory(name);
+ File root = getSimulationDirectory(name);
//TODO Should be IsisCOnfig.DEFAULT_SIMULATION_LOGFILE ?
return root + File.separator + "simulation.log";
}
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/SimulatorStorage.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/SimulatorStorage.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/SimulatorStorage.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -37,10 +37,10 @@
import org.apache.commons.collections.map.ReferenceMap;
-import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.IsisFishException;
import fr.ifremer.isisfish.simulator.Simulator;
-import org.codelutin.vcs.VCSException;
+import fr.ifremer.isisfish.vcs.VCSException;
/**
*
@@ -51,6 +51,8 @@
*/
public class SimulatorStorage extends JavaSourceStorage {
+ static final public String SIMULATOR_PATH = "simulators";
+
/**
*
* Constructeur
@@ -61,6 +63,13 @@
super(rootSrc, directory, name);
}
+ static public File getSimulatorDirectory() {
+ File result = IsisFish.config.getDatabaseDirectory();
+ result = new File(result, SIMULATOR_PATH);
+ return result;
+ }
+
+
/**
* Retourne une nouvelle instance de la regle. Compile le fichier si besoin
*
@@ -81,15 +90,15 @@
static public SimulatorStorage getSimulator(String name) {
SimulatorStorage result = simulatorsCache .get(name);
if (result == null) {
- result = new SimulatorStorage(IsisConfig.getDatabaseDirectory(),
- IsisConfig.getSimulatorDirectory(), name);
+ result = new SimulatorStorage(IsisFish.config.getDatabaseDirectory(),
+ getSimulatorDirectory(), name);
simulatorsCache.put(name, result);
}
return result;
}
static public void checkout() throws VCSException {
- checkout(IsisConfig.getDatabaseDirectory(), IsisConfig.Module.SIMULATOR.value());
+ checkout(IsisFish.config.getDatabaseDirectory(), SIMULATOR_PATH);
}
/**
@@ -98,7 +107,7 @@
* @return la liste des noms de toutes les régions disponible en local
*/
static public List<String> getSimulatorNames() {
- File dir = IsisConfig.getSimulatorDirectory();
+ File dir = getSimulatorDirectory();
List<String> result = getStorageNames(dir);
return result;
}
@@ -124,7 +133,7 @@
* vide.
*/
static public List<String> getRemoteSimulatorNames() {
- File dir = IsisConfig.getSimulatorDirectory();
+ File dir = getSimulatorDirectory();
List<String> result = getRemoteStorageNames(dir);
return result;
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/VersionStorage.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/VersionStorage.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/datastore/VersionStorage.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -31,9 +31,9 @@
package fr.ifremer.isisfish.datastore;
-import org.codelutin.vcs.VCSException;
-import org.codelutin.vcs.VCSHandler;
-import fr.ifremer.isisfish.IsisContext;
+import fr.ifremer.isisfish.IsisFish;
+import fr.ifremer.isisfish.vcs.VCSException;
+import fr.ifremer.isisfish.vcs.VCS;
import static org.codelutin.i18n.I18n._;
import org.codelutin.util.FileUtil;
@@ -56,8 +56,8 @@
/** Logger for this class */
private static final Log log = LogFactory.getLog(VersionStorage.class);
- protected static VCSHandler getVCSHanler() {
- return IsisContext.get().getVCSHanler();
+ static protected VCS getVCS() {
+ return IsisFish.vcs;
}
protected File root = null;
@@ -104,8 +104,8 @@
*
* @return vrai si deja dans le VCS
*/
- public boolean isOnRemote() {
- return getVCSHanler().isOnRemote(getFile());
+ public boolean isOnRemote() throws VCSException {
+ return getVCS().isOnRemote(getFile());
}
/**
@@ -117,8 +117,7 @@
* @return <code>true</code> si le fichier est versionné
*/
protected boolean isVersionnableAbleFile(File file) {
- return !getVCSHanler().getConfLocalDirname().equalsIgnoreCase(
- file.getName());
+ return !getVCS().isVersionnableAbleFile(file);
}
/**
@@ -179,10 +178,10 @@
prepare();
List<File> files = getFiles(true);
// we can sure remove module directory and root directory
- files.remove(getVCSHanler().getLocalDatabasePath());
+ files.remove(IsisFish.config.getDatabaseDirectory());
log.debug("files to add: " + files);
- getVCSHanler().add(files, msg);
+ getVCS().add(files, msg);
}
/**
@@ -196,15 +195,17 @@
if (cvsDelete) {
List<File> files = getFiles(true);
try {
- getVCSHanler().delete(files, _("isisfish.versionStorage.removed"));
+ getVCS().delete(files, _("isisfish.versionStorage.removed"));
} catch (VCSException eee) {
throw new StorageException(_("isisfish.error.delete.vcs.files"), eee);
}
}
//TODO There is a bug to fix ? some files are not deleted!
- if (getFile().isDirectory())
+ if (getFile().isDirectory()){
FileUtil.deleteRecursively(getFile());
- else getFile().delete();
+ } else {
+ getFile().delete();
+ }
}
/**
@@ -229,18 +230,17 @@
*/
public void update() throws VCSException {
prepare();
- getVCSHanler().update(getFile());
+ getVCS().update(getFile());
}
public boolean isUpToDate() throws VCSException {
prepare();
- return getVCSHanler().isUpToDate(getFile());
+ return getVCS().isUpToDate(getFile());
}
/**
* Permet de ramener tout un répertoire du VCS. Utile seulement pour le
- * premier lancement pour scipts et exports. Pour les regles de gestion
- * le repertoire est checkouté en meme temps que la region
+ * premier lancement pour scipts et exports.
*
* @param destDir le repertoire parent
* @param module le repertoire qui peut etre scripts ou exports
@@ -248,7 +248,7 @@
*
*/
static public void checkout(File destDir, String module) throws VCSException {
- getVCSHanler().checkout(destDir, module, true);
+ getVCS().checkout(destDir, module, true);
}
/**
@@ -261,7 +261,11 @@
List<String> result = new ArrayList<String>();
if (directory.exists()) {
- Collections.addAll(result, directory.list(getVCSHanler().getVersionnableFilenameFilter()));
+ for(File f : directory.listFiles()) {
+ if(getVCS().isVersionnableAbleFile(f)) {
+ result.add(f.getName());
+ }
+ }
}
Collections.sort(result);
@@ -282,7 +286,7 @@
static public List<String> getRemoteStorageNames(File directory) {
List<String> result = null;
try {
- result = getVCSHanler().getRemoteStorageNames(directory);
+ result = getVCS().getFileList(directory);
} catch (VCSException e) {
log.warn("Error during connection to VCS serveur", e);
result = new ArrayList<String>();
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/entities/EquationImpl.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/entities/EquationImpl.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/entities/EquationImpl.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -35,6 +35,7 @@
import fr.ifremer.isisfish.IsisConfig;
import fr.ifremer.isisfish.IsisFishException;
import fr.ifremer.isisfish.IsisFishRuntimeException;
+import fr.ifremer.isisfish.datastore.FormuleStorage;
import fr.ifremer.isisfish.equation.Language;
import fr.ifremer.isisfish.simulator.SimulationContext;
import fr.ifremer.isisfish.util.EvaluatorHelper;
@@ -83,7 +84,7 @@
}
} else // default Java if there are javaInterface
if (Language.JAVA.equals(getLanguage()) || getJavaInterface() != null) {
- Object val = EvaluatorHelper.evaluate(IsisConfig.Module.FORMULE.value(),
+ Object val = EvaluatorHelper.evaluate(FormuleStorage.FORMULE_PATH,
getTopiaId(), getJavaInterface(), getContent(), param);
if (val instanceof Number) {
double result =((Number)val).doubleValue();
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/logging/SimulationLoggerUtil.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/logging/SimulationLoggerUtil.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/logging/SimulationLoggerUtil.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -19,8 +19,9 @@
* ##% */
package fr.ifremer.isisfish.logging;
+import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.IsisFishException;
-import fr.ifremer.isisfish.IsisContext;
import fr.ifremer.isisfish.datastore.SimulationStorage;
import fr.ifremer.isisfish.logging.console.LogConsole;
import org.apache.commons.logging.Log;
@@ -169,10 +170,10 @@
File logFile = new File(storage.getSimulationLogFile());
- String smtpServer = IsisContext.get().getMainConfig().getSmtpServer();
- String defaultFrom = IsisContext.get().getMainConfig().getUserMail();
+ String smtpServer = IsisFish.config.getSmtpServer();
+ String defaultFrom = IsisFish.config.getUserMail();
- String defaultTo = IsisContext.get().getMainConfig().getSimulationReportMail();
+ String defaultTo = IsisConfig.REPORT_EMAIL;
String title = _("isisfish.simulation.log.console.title", simulationName);
LogConsole.newConsole(logFile, smtpServer, defaultFrom, defaultTo, title);
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/logging/console/LogConsole.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/logging/console/LogConsole.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/logging/console/LogConsole.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -108,7 +108,7 @@
// create ui
ui = new LogConsole(handler, title);
- // launch ui
+ // launchUI ui
ui.setVisible(true);
// notify the model to adjust the nbLinesInEditor
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/map/IsisMapBean.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/map/IsisMapBean.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/map/IsisMapBean.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -56,9 +56,9 @@
import com.bbn.openmap.layer.shape.ShapeLayer;
import com.bbn.openmap.omGraphics.DrawingAttributes;
+import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.IsisFishDAOHelper;
import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.IsisContext;
import fr.ifremer.isisfish.entities.Cell;
import fr.ifremer.isisfish.entities.CellDAO;
import fr.ifremer.isisfish.entities.FisheryRegion;
@@ -369,7 +369,7 @@
if(!shapeLoaded){
// a pas reussi a charger les fichiers demandés, on charge la
// carte du monde
- String filename = IsisContext.get().getMainConfig().getDefaultMapFile();
+ String filename = IsisFish.config.getDefaultMapFilename();
String shp = filename + ".shp";
String ssx = filename + ".ssx";
addShapeLayer(filename, shp, ssx, "ff000000", "ffbdde83");
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationCheckpointThread.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationCheckpointThread.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationCheckpointThread.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -22,7 +22,7 @@
import org.apache.xmlrpc.XmlRpcClient;
import fr.ifremer.isisfish.IsisConfig;
-import fr.ifremer.isisfish.IsisContext;
+import fr.ifremer.isisfish.IsisFish;
/**
* This thread is responsable to synchronized SimulationControl used localy with
@@ -78,13 +78,14 @@
public void updateControl(SimulationControl control) throws Exception {
// essai l'ancienne etait en dur: "http://localhost:9090"
- IsisConfig config = IsisContext.get().getMainConfig();
- XmlRpcClient c = new XmlRpcClient(config.getSimulationServer());
- c.setBasicAuthentication(config.getLogin(), config.getPassword());
+ XmlRpcClient c = new XmlRpcClient(IsisFish.config.getSimulatorServer());
+ c.setBasicAuthentication(IsisFish.config.getSimulatorUsername(),
+ IsisFish.config.getSimulatorPassword());
Vector a = new Vector();
a.add(control.getUpdateHashtable());
- Hashtable<String, Object> result = (Hashtable<String, Object>)c.execute("checkPoint", a);
+ Hashtable<String, Object> result =
+ (Hashtable<String, Object>)c.execute("checkPoint", a);
// on remet de le temps normal, vu que la connexion a reussi
control.updateFromHashtable(result);
}
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationExportResultWrapper.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationExportResultWrapper.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationExportResultWrapper.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -57,7 +57,7 @@
//
if (parameters.getExportNames() != null
&& parameters.getExportNames().size() > 0) {
- File exportDir = IsisConfig.getResultExportDirectory(rootDirectory);
+ File exportDir = SimulationStorage.getResultExportDirectory(rootDirectory);
exportDir.mkdirs();
ExportHelper.doExport(simulation, exportDir, parameters.getExportNames(), rootDirectory);
}
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationHelper.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationHelper.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationHelper.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -60,15 +60,16 @@
import org.codelutin.util.StringUtil;
import org.codelutin.util.ZipUtil;
-import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.IsisContext;
import fr.ifremer.isisfish.aspect.AspectClassLoader;
import fr.ifremer.isisfish.aspect.Cache;
import fr.ifremer.isisfish.aspect.Trace;
import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
+import fr.ifremer.isisfish.datastore.ExportStorage;
import fr.ifremer.isisfish.datastore.RegionStorage;
import fr.ifremer.isisfish.datastore.RuleStorage;
+import fr.ifremer.isisfish.datastore.ScriptStorage;
import fr.ifremer.isisfish.datastore.SimulationStorage;
import fr.ifremer.isisfish.datastore.SimulatorStorage;
import fr.ifremer.isisfish.rule.Rule;
@@ -122,12 +123,13 @@
SimulationParameter param, boolean compile) throws SimulationException {
try {
File tmpDirectory = FileUtil.createTempDirectory("isisfish-simultation-", "-preparation");
- File regionXML = IsisConfig.getDataBackupFile(tmpDirectory);
- //File regionXML = new File(tmpDirectory, IsisConfig.DATA_BACKUP_FILE);
+ //File regionXML = IsisConfig.getDataBackupFile(tmpDirectory);
+ File regionXML = new File(tmpDirectory, SimulationStorage.DATA_BACKUP_FILENAME);
// sauvegarde des parametres
Properties prop = param.toProperties();
- File f = IsisConfig.getSimulationParametersFile(tmpDirectory);
+ //File f = IsisConfig.getSimulationParametersFile(tmpDirectory);
+ File f = new File(tmpDirectory, SimulationStorage.PARAMETERS_FILENAME);
FileOutputStream out = new FileOutputStream(f);
//FileOutputStream out = new FileOutputStream(new File(tmpDirectory, IsisConfig.SIMULATION_PARAMETERS));
prop.store(out, "Parameters");
@@ -146,36 +148,36 @@
List<Rule> rules = param.getRules();
for (Rule rule : rules) {
String name = RuleStorage.getName(rule);
- FileUtil.copy(new File(IsisConfig.getRuleDirectory(), name + ".java"),
- new File(tmpDirectory, IsisConfig.Module.RULE.value() + File.separator + name + ".java"));
+ FileUtil.copy(new File(RuleStorage.getRuleDirectory(), name + ".java"),
+ new File(tmpDirectory, RuleStorage.RULE_PATH + File.separator + name + ".java"));
}
// copie des regles reclamées par les plans d'analyse
for(String name : param.getExtraRules()) {
- FileUtil.copy(new File(IsisConfig.getRuleDirectory(), name + ".java"),
- new File(tmpDirectory, IsisConfig.Module.RULE.value() + File.separator + name + ".java"));
+ FileUtil.copy(new File(RuleStorage.getRuleDirectory(), name + ".java"),
+ new File(tmpDirectory, RuleStorage.RULE_PATH + File.separator + name + ".java"));
}
// copie de toutes regles a utiliser
List<AnalysePlan> plans = param.getAnalysePlans();
for (AnalysePlan plan : plans) {
String name = AnalysePlanStorage.getName(plan);
- FileUtil.copy(new File(IsisConfig.getAnalysePlanDirectory(), name + ".java"),
- new File(tmpDirectory, IsisConfig.Module.ANALYSE_PLAN.value() + File.separator + name + ".java"));
+ FileUtil.copy(new File(AnalysePlanStorage.getAnalysePlanDirectory(), name + ".java"),
+ new File(tmpDirectory, AnalysePlanStorage.ANALYSE_PLAN_PATH + File.separator + name + ".java"));
}
// copie de tous les exports a utiliser
for (String name : param.getExportNames()) {
name = name.endsWith(".java")?name:name + ".java";
- FileUtil.copy(new File(IsisConfig.getExportDirectory(), name),
- new File(tmpDirectory, IsisConfig.Module.EXPORT.value() + File.separator + name));
+ FileUtil.copy(new File(ExportStorage.getExportDirectory(), name),
+ new File(tmpDirectory, ExportStorage.EXPORT_PATH + File.separator + name));
}
// copie de tous les scripts a utiliser
- FileUtil.copyRecursively(IsisConfig.getScriptDirectory(), tmpDirectory, ".*\\.java$");
+ FileUtil.copyRecursively(ScriptStorage.getScriptDirectory(), tmpDirectory, ".*\\.java$");
// copie de tous les simulateurs a utiliser
- FileUtil.copy(new File(IsisConfig.getSimulatorDirectory(), param.getSimulatorName()),
- new File(tmpDirectory, IsisConfig.Module.SIMULATOR.value() + File.separator + param.getSimulatorName()));
+ FileUtil.copy(new File(SimulatorStorage.getSimulatorDirectory(), param.getSimulatorName()),
+ new File(tmpDirectory, SimulatorStorage.SIMULATOR_PATH + File.separator + param.getSimulatorName()));
if (compile) {
compileAllFile(control, tmpDirectory);
@@ -225,16 +227,16 @@
List<File> fileToCompile = new ArrayList<File>();
- List<File> tmp = FileUtil.find(new File(directory, IsisConfig.Module.EXPORT.value()), ".*\\.java$", true);
+ List<File> tmp = FileUtil.find(new File(directory, ExportStorage.EXPORT_PATH), ".*\\.java$", true);
fileToCompile.addAll(tmp);
- tmp = FileUtil.find(new File(directory, IsisConfig.Module.RULE.value()), ".*\\.java$", true);
+ tmp = FileUtil.find(new File(directory, RuleStorage.RULE_PATH), ".*\\.java$", true);
fileToCompile.addAll(tmp);
- tmp = FileUtil.find(new File(directory, IsisConfig.Module.ANALYSE_PLAN.value()), ".*\\.java$", true);
+ tmp = FileUtil.find(new File(directory, AnalysePlanStorage.ANALYSE_PLAN_PATH), ".*\\.java$", true);
fileToCompile.addAll(tmp);
- tmp = FileUtil.find(new File(directory, IsisConfig.Module.SIMULATOR.value()), ".*\\.java$", true);
+ tmp = FileUtil.find(new File(directory, SimulatorStorage.SIMULATOR_PATH), ".*\\.java$", true);
fileToCompile.addAll(tmp);
//
@@ -347,9 +349,9 @@
a.add(FileUtil.fileToByte(zip));
// lancement de la simulation
- IsisConfig config = IsisContext.get().getMainConfig();
- XmlRpcClient c = new XmlRpcClient(config.getSimulationServer());
- c.setBasicAuthentication(config.getLogin(), config.getPassword());
+ XmlRpcClient c = new XmlRpcClient(IsisFish.config.getSimulatorServer());
+ c.setBasicAuthentication(IsisFish.config.getSimulatorUsername(),
+ IsisFish.config.getSimulatorPassword());
byte[] callResult = (byte[])c.execute("simulate", a);
// ecriture du resultat dans un fichier
@@ -433,7 +435,7 @@
String jvmVersion = System.getProperty("java.runtime.version");
log.info(SimpleDateFormat.getInstance().format(new java.util.Date())
+ " Java version: " + jvmVersion + " Isis-fish version: "
- + IsisContext.get().getMainConfig().getVersion().toString());
+ + IsisFish.config.getVersion());
long start = System.nanoTime();
simulation.getInformation().setSimulationStart(new java.util.Date());
AspectClassLoader classLoader;
@@ -457,7 +459,7 @@
context.setSimulationControl(control!=null?control:new SimulationControl(simulation.getName()));
SimulationParameter parameters = simulation.getParameter();
- parameters.setIsisFishVersion(IsisConfig.getVERSION());
+ parameters.setIsisFishVersion(IsisFish.config.getVersion());
// forceReload, save all modification in parameter and reread it
parameters = simulation.getForceReloadParameter();
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationManager.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationManager.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationManager.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -31,8 +31,7 @@
package fr.ifremer.isisfish.simulator;
-import fr.ifremer.isisfish.IsisConfig;
-import fr.ifremer.isisfish.IsisContext;
+import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.datastore.SimulationStorage;
import fr.ifremer.isisfish.types.Date;
import org.apache.commons.logging.Log;
@@ -275,14 +274,13 @@
boolean result = true;
QueueItem item = map.get(id);
SimulationParameter simulationParameter = getParameter(id);
- IsisConfig config = IsisContext.get().getMainConfig();
- if (config.isSimulationShowOnlyQueue() && !simulationParameter.getLocal()) {
+ if (IsisFish.config.isSimulationShowOnlyQueue() && !simulationParameter.getLocal()) {
return false;
}
try {
//TODO cela ne fonctionne pas, le fichier existe-il à ce moment ?
- if (config.isSimulationShowOnlyError() && item.lastSimulation.getInformation().getException() != null) {
+ if (IsisFish.config.isSimulationShowOnlyError() && item.lastSimulation.getInformation().getException() != null) {
return true;
}
} catch (Exception e) {
@@ -372,7 +370,7 @@
// souhaiter par l'utilisateur
SimulationParameter param = sim.getParameter();
if (param.getExportNames() != null && param.getExportNames().size() > 0) {
- File exportDir = IsisConfig.getResultExportDirectory(sim.getDirectory());
+ File exportDir = SimulationStorage.getResultExportDirectory(sim.getDirectory());
FileUtil.copyAndRenameRecursively(
exportDir,
new File(param.getExportDirectory()),
@@ -400,7 +398,7 @@
if (param.getOnlyExport()) {
if (param.getUseAnalysePlan()) {
for(File file : FileUtil.find(
- IsisConfig.getSimulationDirectory(),
+ SimulationStorage.getSimulationDirectory(),
item.id + "_[0-9]+$", false)) {
log.debug("Delete simulation " + file);
FileUtil.deleteRecursively(file);
@@ -542,6 +540,13 @@
return result;
}
+ @Override
+ public int hashCode() {
+ int hash = 3;
+ hash = 37 * hash + (this.param != null ? this.param.hashCode() : 0);
+ return hash;
+ }
+
/* (non-Javadoc)
* @see java.lang.Comparable#compareTo(java.lang.Object)
*/
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationParameter.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationParameter.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationParameter.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -81,7 +81,7 @@
/** Isis-fish version that permit to do the simulation, must be set just
* before simulation by simulator */
- protected String isisFishVersion = IsisConfig.getVERSION();
+ protected String isisFishVersion = IsisConfig.getVersion();
/** description de la simulation */
protected String description = "";
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationProperties.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationProperties.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationProperties.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -2,6 +2,7 @@
import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.datastore.SimulationStorage;
import org.codelutin.i18n.I18n;
import org.apache.commons.logging.Log;
@@ -33,12 +34,12 @@
protected Properties data;
public SimulationProperties(String name) throws IOException {
- File simulationDirectory = IsisConfig.getSimulationDirectory(name);
+ File simulationDirectory = SimulationStorage.getSimulationDirectory(name);
this.name = simulationDirectory.getName();
this.data = new Properties();
data.put(SimulationMeta.simulationName.name(), this.name);
- loadProperties(IsisConfig.getSimulationParametersFile(simulationDirectory));
- loadProperties(IsisConfig.getSimulationInformationFile(simulationDirectory));
+ loadProperties(SimulationStorage.getSimulationParametersFile(simulationDirectory));
+ loadProperties(SimulationStorage.getSimulationInformationFile(simulationDirectory));
}
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationResultXML.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationResultXML.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/SimulationResultXML.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -45,6 +45,7 @@
import fr.ifremer.isisfish.IsisConfig;
import fr.ifremer.isisfish.IsisFishException;
+import fr.ifremer.isisfish.datastore.SimulationStorage;
import fr.ifremer.isisfish.types.Date;
@@ -131,7 +132,7 @@
//TODO validate this modification
if (file==null) {
File simulationDir = context.getSimulationStorage().getDirectory();
- file = IsisConfig.getSimulationResultXmlFile(simulationDir);
+ file = SimulationStorage.getSimulationResultXmlFile(simulationDir);
setOutFilename(file);
}
file.getParentFile().mkdirs();
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/ScriptActionHelper.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/ScriptActionHelper.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/ScriptActionHelper.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -25,7 +25,7 @@
import fr.ifremer.isisfish.ui.script.action.CancelAction;
import fr.ifremer.isisfish.ui.script.action.ExportAction;
import fr.ifremer.isisfish.ui.script.action.ImportAction;
-import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.IsisFish;
import org.codelutin.vcs.ui.FieldModelUtil;
import org.apache.commons.logging.Log;
import static org.apache.commons.logging.LogFactory.getLog;
@@ -61,7 +61,7 @@
String message = _("isisfish.message.import.scripts.file", file);
logMessage(useUI, frame, message);
- File root = IsisConfig.getDatabaseDirectory();
+ File root = IsisFish.config.getDatabaseDirectory();
// get two list of relative path (one for new files,one for exisiting files)
List<String>[] explode = ZipUtil.scanAndExplodeZip(file, root, Action.getSCRIPT_FILE_FILTER());
@@ -125,7 +125,7 @@
throw new IllegalArgumentException(_("isisfish.error.export.scripts.force"));
}
}
- File root = IsisConfig.getDatabaseDirectory();
+ File root = IsisFish.config.getDatabaseDirectory();
String message = _("isisfish.message.export.scripts.file", dst);
logMessage(useUI, frame, message);
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/Welcome.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/Welcome.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/Welcome.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -31,15 +31,9 @@
package fr.ifremer.isisfish.ui;
-import static fr.ifremer.isisfish.IsisConfig.Module.ANALYSE_PLAN;
-import static fr.ifremer.isisfish.IsisConfig.Module.EXPORT;
-import static fr.ifremer.isisfish.IsisConfig.Module.FORMULE;
-import static fr.ifremer.isisfish.IsisConfig.Module.RULE;
-import static fr.ifremer.isisfish.IsisConfig.Module.SCRIPT;
-import static fr.ifremer.isisfish.IsisConfig.Module.SIMULATOR;
import fr.ifremer.isisfish.ui.input.Input;
import fr.ifremer.isisfish.ui.result.ResultView;
-import org.codelutin.vcs.VCSException;
+import fr.ifremer.isisfish.vcs.VCSException;
import org.codelutin.vcs.VCSAction;
import org.codelutin.vcs.VCSRepositoryState;
import org.codelutin.vcs.VCSFileState;
@@ -47,8 +41,15 @@
import fr.ifremer.isisfish.versionning.ui.VCSUIHelper;
import fr.ifremer.isisfish.versionning.IsisRepositoryState;
import fr.ifremer.isisfish.IsisConfig;
-import fr.ifremer.isisfish.IsisContext;
+import fr.ifremer.isisfish.IsisFish;
+import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
+import fr.ifremer.isisfish.datastore.ExportStorage;
+import fr.ifremer.isisfish.datastore.FormuleStorage;
+import fr.ifremer.isisfish.datastore.RuleStorage;
+import fr.ifremer.isisfish.datastore.ScriptStorage;
+import fr.ifremer.isisfish.datastore.SimulatorStorage;
+import fr.ifremer.isisfish.vcs.VCS;
import org.swixat.framework.AbstractFrame;
import org.swixat.framework.OutputView;
import org.swixat.model.GenericContext;
@@ -73,6 +74,10 @@
/** to use log facility, just put in your code: log.info(\"...\"); */
static private Log log = LogFactory.getLog(Welcome.class);
+ static protected VCS getVCS() {
+ return IsisFish.config.getVCS();
+ }
+
/**
* Permet d'ouvrir une nouvelle fenetre de rendu des resultats
*
@@ -131,7 +136,7 @@
boolean hasFrame = frame != null;
- if (!VCSHelper.isConnected()) {
+ if (!getVCS().isConnected()) {
String errorMsg = I18n._("isisfish.error.not.connected");
if (hasFrame) {
frame.viewOutput(new OutputView("Error.xml", "error", errorMsg));
@@ -147,8 +152,13 @@
EnumSet<VCSAction> actions = VCSHelper.getAuthorizedActions();
// init repo synchrinization
- VCSRepositoryState repoState = new IsisRepositoryState(IsisConfig.getDatabaseDirectory(),actions,
- ANALYSE_PLAN, EXPORT, FORMULE, RULE, SCRIPT, SIMULATOR);
+ VCSRepositoryState repoState = new IsisRepositoryState(IsisFish.config.getDatabaseDirectory(),actions,
+ AnalysePlanStorage.getAnalysePlanDirectory(),
+ ExportStorage.getExportDirectory(),
+ FormuleStorage.getFormuleDirectory(),
+ RuleStorage.getRuleDirectory(),
+ ScriptStorage.getScriptDirectory(),
+ SimulatorStorage.getSimulatorDirectory());
// create ui models
repoState.createUIModels();
@@ -188,18 +198,22 @@
static public Object showConfig() {
try {
- getUi().setVisible(true);
+ // FIXME a voir avec l'autre FIXME
+ throw new UnsupportedOperationException("En reparation");
+// getUi().setVisible(true);
} catch (Exception eee) {
new OutputView("Error.xml", "error", eee.getMessage());
}
return null;
}
- static ConfigUI getUi() {
- if (ui == null) {
- IsisContext context = IsisContext.get();
- ui = new ConfigUI().init(context,context.getMainConfig(), context.getVcsConfig(), context.getH2Config());
- }
- return ui;
- }
+ // FIXME voir comment remplacer ca
+// static ConfigUI getUi() {
+// if (ui == null) {
+// IsisContext context = IsisContext.get();
+// ui = new ConfigUI().init(IsisFish.config,
+// context.getVcsConfig(), context.getH2Config());
+// }
+// return ui;
+// }
}
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/script/Action.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/script/Action.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/script/Action.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -31,15 +31,8 @@
package fr.ifremer.isisfish.ui.script;
-import fr.ifremer.isisfish.IsisContext;
import fr.ifremer.isisfish.IsisConfig;
-import fr.ifremer.isisfish.IsisConfig.Module;
-import static fr.ifremer.isisfish.IsisConfig.Module.ANALYSE_PLAN;
-import static fr.ifremer.isisfish.IsisConfig.Module.EXPORT;
-import static fr.ifremer.isisfish.IsisConfig.Module.FORMULE;
-import static fr.ifremer.isisfish.IsisConfig.Module.RULE;
-import static fr.ifremer.isisfish.IsisConfig.Module.SCRIPT;
-import static fr.ifremer.isisfish.IsisConfig.Module.SIMULATOR;
+import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
import fr.ifremer.isisfish.datastore.CodeSourceStorage;
import fr.ifremer.isisfish.datastore.ExportStorage;
@@ -346,8 +339,8 @@
category.isEmpty() ? "" : '.' + category.replaceAll("\\/", "."),
realFilename,
new Date(),
- IsisContext.get().getMainConfig().getUserName(),
- IsisContext.get().getMainConfig().getUserMail());
+ IsisFish.config.getUserName(),
+ IsisFish.config.getUserMail());
script.setContent(content);
// ajout du nouveau script dans l'arbre
if (parentNode == null) {
@@ -627,7 +620,7 @@
return null;
}
// first step : acquire list of files required
- int prefixLength = IsisConfig.getDatabaseDirectory().getAbsolutePath().length() + 1;
+ int prefixLength = IsisFish.config.getDatabaseDirectory().getAbsolutePath().length() + 1;
List<String> listFiles = extractFiles(prefixLength, selectedPaths);
if (listFiles.isEmpty()) {
return null;
@@ -668,8 +661,7 @@
TreeNodeWrapper node = (TreeNodeWrapper) selectedPath.getPathComponent(1);
String moduleDisplayName = String.valueOf(node.getUserObject());
- Module module = ScriptMapping.valueOf(moduleDisplayName).getModule();
- File file = module.getDirectory();
+ File file = ScriptMapping.valueOf(moduleDisplayName).getModule();
int nbPaths = selectedPath.getPathCount();
if (nbPaths > 2)
for (int i = 2; i < nbPaths; i++) {
@@ -711,7 +703,7 @@
/** enum to encapsulate a script module */
enum ScriptMapping {
- Script(SCRIPT,
+ Script(ScriptStorage.getScriptDirectory(),
/**
* 0 = package name,
* 1 = class name,
@@ -749,7 +741,7 @@
" // add your method here\n" +
"'}'\n"),
- Simulator(SIMULATOR,
+ Simulator(SimulatorStorage.getSimulatorDirectory(),
/**
* 0 = package name,
* 1 = class name,
@@ -790,7 +782,7 @@
" '}'\n" +
"\n" +
"'}'\n"),
- Export(EXPORT,
+ Export(ExportStorage.getExportDirectory(),
/**
* 0 = package name,
* 1 = class name,
@@ -860,7 +852,7 @@
" '}'\n" +
"\n" +
"'}'\n"),
- Rule(RULE,
+ Rule(RuleStorage.getRuleDirectory(),
/**
* 0 = package name,
* 1 = class name,
@@ -963,7 +955,7 @@
" '}'\n" +
"\n" +
"'}'\n"),
- AnalysePlan(ANALYSE_PLAN,
+ AnalysePlan(AnalysePlanStorage.getAnalysePlanDirectory(),
/**
* 0 = package name,
* 1 = class name,
@@ -1055,7 +1047,7 @@
" '}'\n" +
"\n" +
"'}'\n"),
- EquationModel(FORMULE,
+ EquationModel(FormuleStorage.getFormuleDirectory(),
/**
* 0 = package name,
* 1 = class name,
@@ -1078,15 +1070,15 @@
"// put your code here\n" +
"\n");
- private Module module;
+ private File module;
private String defaultContent;
- ScriptMapping(Module module, String defaultContent) {
+ ScriptMapping(File module, String defaultContent) {
this.module = module;
this.defaultContent = defaultContent;
}
- Module getModule() {
+ File getModule() {
return module;
}
@@ -1112,7 +1104,7 @@
public static FileFilter getSCRIPT_FILE_FILTER() {
if (SCRIPT_FILE_FILTER == null) {
- SCRIPT_FILE_FILTER = new ScriptFileFilter(IsisContext.get().getVCSHanler().getVersionnableFileFilter());
+ SCRIPT_FILE_FILTER = new ScriptFileFilter(IsisFish.config.getVCS());
}
return SCRIPT_FILE_FILTER;
}
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/script/action/BackupAction.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/script/action/BackupAction.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/script/action/BackupAction.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -1,7 +1,7 @@
package fr.ifremer.isisfish.ui.script.action;
+import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.IsisContext;
import fr.ifremer.isisfish.ui.util.IsisAction;
import org.apache.commons.logging.Log;
import static org.apache.commons.logging.LogFactory.getLog;
@@ -39,7 +39,7 @@
protected void perform(ActionEvent e) {
log.info("directory for backup [" + dst+']');
- String suffix = "_" + IsisContext.getSessionBackupDirectory().getName();
+ String suffix = "_" + IsisFish.config.getBackupSessionDirectory().getName();
try {
for (String path : paths) {
backup(new File(src, path), path, suffix);
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/simulator/SimulatorAction.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/simulator/SimulatorAction.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/simulator/SimulatorAction.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -31,8 +31,7 @@
package fr.ifremer.isisfish.ui.simulator;
-import fr.ifremer.isisfish.IsisConfig;
-import fr.ifremer.isisfish.IsisContext;
+import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.datastore.AnalysePlanStorage;
import fr.ifremer.isisfish.datastore.ExportStorage;
import fr.ifremer.isisfish.datastore.RegionStorage;
@@ -98,12 +97,12 @@
// put default value in param
param.setlocal(true);
- param.setSimulatorName(IsisContext.get().getMainConfig().getDefaultSimulator());
- param.setlocal(IsisContext.get().getMainConfig().isLocalSimulator());
- param.setTagValue(IsisConfig.getDefaultTagValueAsMap());
- param.setExportDirectory(IsisContext.get().getMainConfig().getDefaultExportDirectory().toString());
- param.setExportNames(IsisConfig.getDefaultExportNamesAsList());
- List<String> defaultResultNames = IsisConfig.getDefaultResultNamesAsList();
+ param.setSimulatorName(IsisFish.config.getSimulatorClassfile());
+ param.setlocal(IsisFish.config.isSimulatorLocal());
+ param.setTagValue(IsisFish.config.getDefaultTagValueAsMap());
+ param.setExportDirectory(IsisFish.config.getDefaultExportDirectory().toString());
+ param.setExportNames(IsisFish.config.getDefaultExportNamesAsList());
+ List<String> defaultResultNames = IsisFish.config.getDefaultResultNamesAsList();
if (defaultResultNames != null)
param.setResultEnabled(defaultResultNames);
else
@@ -282,22 +281,22 @@
* @param local <code>true</code> to use local simulator
*/
static public void saveSimulatorChoice(String simulatorName, boolean local) {
- IsisContext.get().getMainConfig().setDefaultSimulator(simulatorName);
- IsisContext.get().getMainConfig().setLocalSimulator(local);
+ IsisFish.config.setSimulatorClassfile(simulatorName);
+ IsisFish.config.setSimulatorLauncher(local?"local":"isis-server");
}
static public void saveExport(String exportDirectory, List<String> exportNames) {
- IsisConfig.setDefaultExportDirectory(exportDirectory);
- IsisConfig.setDefaultExportNames(exportNames);
+ IsisFish.config.setDefaultExportDirectory(exportDirectory);
+ IsisFish.config.setDefaultExportNames(exportNames);
}
static public void saveResultNames(List<String> resultNames) {
- IsisConfig.setDefaultResultNames(resultNames);
+ IsisFish.config.setDefaultResultNames(resultNames);
}
static public void saveTagValue(Map<String, String> tagValues) {
log.debug("call saveTagValue: " + tagValues);
- IsisConfig.setDefaultTagValues(tagValues);
+ IsisFish.config.setDefaultTagValues(tagValues);
}
static public void addTagValue(SimulationParameter param, String tag, String value) {
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/util/IsisActionWithBackup.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/util/IsisActionWithBackup.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/ui/util/IsisActionWithBackup.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -1,6 +1,6 @@
package fr.ifremer.isisfish.ui.util;
-import fr.ifremer.isisfish.IsisContext;
+import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.ui.script.action.BackupAction;
import javax.swing.JDialog;
@@ -16,7 +16,7 @@
protected IsisActionWithBackup(JDialog dialog, File root) {
super(dialog);
this.root = root;
- this.backupRoot = IsisContext.getSessionBackupDirectory();
+ this.backupRoot = IsisFish.config.getBackupSessionDirectory();
}
/**
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/util/CompileHelper.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/util/CompileHelper.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/util/CompileHelper.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -56,8 +56,7 @@
import com.sun.tools.javac.api.JavacTool;
-import fr.ifremer.isisfish.IsisContext;
-import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.IsisFish;
import fr.ifremer.isisfish.datastore.JavaSourceStorage;
@@ -107,7 +106,7 @@
static public Class loadClass(String fqn) {
Class result = null;
try {
- ClassLoader cl = IsisConfig.getScriptClassLoader();
+ ClassLoader cl = IsisFish.config.getScriptClassLoader();
result = cl.loadClass(fqn);
} catch (ClassNotFoundException eee) {
log.info(_("isisfish.error.load.class", fqn), eee);
@@ -323,7 +322,7 @@
}
static private String createHREF(String type, String ... texts) {
- String ref = IsisContext.get().getMainConfig().getJavadocURL() + type.replaceAll("\\.", "/") + ".html";
+ String ref = IsisFish.config.getJavadocURL() + type.replaceAll("\\.", "/") + ".html";
String text = type;
if (texts.length > 0) {
text = texts[0];
Modified: trunk/isis-fish/src/java/fr/ifremer/isisfish/util/EvaluatorHelper.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/util/EvaluatorHelper.java 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/util/EvaluatorHelper.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -46,8 +46,7 @@
import org.codelutin.util.FileUtil;
import fr.ifremer.isisfish.IsisFishRuntimeException;
-import fr.ifremer.isisfish.IsisContext;
-import fr.ifremer.isisfish.IsisConfig;
+import fr.ifremer.isisfish.IsisFish;
/**
@@ -134,7 +133,7 @@
String classname = packageName + "." + className;
- File fileRootSrc = IsisContext.get().getMainConfig().getCompileDirectory();
+ File fileRootSrc = IsisFish.config.getCompileDirectory();
File fileCheckSum = new File(fileRootSrc, packageName + File.separator + className + ".hashCode");
File fileSrc = new File(fileRootSrc, packageName + File.separator + className + ".java");
File fileDest = new File(fileRootSrc, packageName + File.separator + className + ".class");
@@ -184,7 +183,7 @@
// try to load class
try {
- ClassLoader cl = IsisConfig.getScriptClassLoader();
+ ClassLoader cl = IsisFish.config.getScriptClassLoader();
clazz = cl.loadClass(classname);
} catch (Exception zzz) {
throw new IsisFishRuntimeException(_("isisfish.error.load.class", classname), zzz);
Added: trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCS.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCS.java (rev 0)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCS.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -0,0 +1,163 @@
+/* *##%
+ * Copyright (C) 2002-2008 Code Lutin, Benjamin Poussin
+ *
+ * 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ *##%*/
+
+package fr.ifremer.isisfish.vcs;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import static org.codelutin.i18n.I18nf._;
+
+import org.apache.commons.beanutils.ConstructorUtils;
+import org.apache.commons.beanutils.ConvertUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codelutin.util.ApplicationConfig;
+
+/**
+ * VCS (svn or vcs) must extends this class. This class can be used as dummy
+ * VCS if not valid VCS found.
+ *
+ * @author poussin
+ * @version $Revision$
+ *
+ * Last update: $Date$
+ * by : $Author$
+ */
+public class VCS implements FileFilter {
+
+ static final public String TYPE_NONE = "none";
+ static final public String TYPE_SVN = "svn";
+ static final public String TYPE_CVS = "cvs";
+
+ // can be None, CVS or SVN. only None or SVN work
+ static final public String VCS_TYPE = "vcs.type";
+ static final public String VCS_CONNECTION = "vcs.connection";
+ // user login to access vcs
+ static final public String VCS_USER_NAME = "vcs.username";
+ static final public String VCS_HOST_NAME = "vcs.hostName";
+ static final public String VCS_PATH = "vcs.path";
+ static final public String VCS_TAG = "vcs.tag";
+
+ /** to use log facility, just put in your code: log.info(\"...\"); */
+ static private Log log = LogFactory.getLog(VCS.class);
+
+ protected ApplicationConfig config;
+
+ /**
+ * VCS factory, looking for vcs.type key in config to find vcs class to used
+ * If no vcs.type found or is not valid class, use {@link VCS}.
+ * @param config
+ * @return usable VCS
+ */
+ static public VCS createVCS(ApplicationConfig config) {
+ Properties aliases = new Properties();
+ aliases.setProperty("", VCS.class.getName());
+ aliases.setProperty(TYPE_NONE, VCS.class.getName());
+// aliases.setProperty(TYPE_SVN, VCSSVN.class.getName());
+// aliases.setProperty(TYPE_CVS, VCSCVS.class.getName());
+
+ VCS result = null;
+ String type = config.getOption(VCS_TYPE);
+ // try to convert if type is not class name but an alias
+ String classname = aliases.getProperty(type, type);
+ try {
+ Class clazz = (Class)ConvertUtils.convert(classname, Class.class);
+ result = (VCS) ConstructorUtils.invokeConstructor(clazz, config);
+ } catch (Exception eee) {
+ log.error(_("Can't instanciate wanted VCS (%s), use default",
+ config.getOption(VCS_TYPE)), eee);
+ result = new VCS(config);
+ }
+ return result;
+ }
+
+ protected VCS(ApplicationConfig config) {
+ this.config = config;
+ }
+
+ public void add(List<File> files, String msg) throws VCSException {
+ throw new VCSException("Can't add file with dummy VCS");
+ }
+
+ public void checkout(File destDir, String module, boolean b) throws VCSException {
+ throw new VCSException("Can't checkout with dummy VCS");
+ }
+
+ public void delete(List<File> files, String msg) throws VCSException {
+ // do nothing
+ }
+
+ public String getDiff(File file) throws VCSException {
+ throw new VCSException("Can't diff with dummy VCS");
+ }
+
+ /**
+ * Return list of all file on directory on remote server
+ * @param directory
+ * @return
+ */
+ public List<String> getFileList(File directory) throws VCSException {
+ List<String> result = new ArrayList<String>();
+ return result;
+ }
+
+ public boolean isConnected() {
+ return false;
+ }
+
+ public boolean isOnRemote(File file) throws VCSException {
+ return false;
+ }
+
+ public boolean isUpToDate(File file) throws VCSException {
+ return true;
+ }
+
+ /**
+ * Must be overwriten, this default implementation return true.
+ * Check if file can be put in vcs repository, for example when you used
+ * CVS, you must not put CVS file.
+ *
+ * @param file
+ * @return
+ */
+ public boolean isVersionnableAbleFile(File file) {
+ return true;
+ }
+
+ public void update(File file) throws VCSException {
+ throw new VCSException("Can't update file with dummy VCS");
+ }
+
+ /**
+ * Usefull to permit to use VCS as filter
+ * @param pathname
+ * @return
+ */
+ public boolean accept(File pathname) {
+ return isVersionnableAbleFile(pathname);
+ }
+
+
+}
Added: trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCSException.java
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCSException.java (rev 0)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/VCSException.java 2008-08-04 16:59:55 UTC (rev 1281)
@@ -0,0 +1,51 @@
+/* *##%
+* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Code Lutin,
+* Benjamin Poussin, 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 2
+* 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, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*##%*/
+package fr.ifremer.isisfish.vcs;
+
+
+/**
+ * A generic vcs exception.
+ *
+ * @author chemit
+ */
+
+public class VCSException extends Exception {
+
+ private static final long serialVersionUID = -2665066202505740998L;
+
+ public VCSException() {
+ super();
+ }
+
+ public VCSException(String message) {
+ super(message);
+ }
+
+ public VCSException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public VCSException(Throwable cause) {
+ super(cause);
+ }
+
+}
+
+
Added: trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/package.html
===================================================================
--- trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/package.html (rev 0)
+++ trunk/isis-fish/src/java/fr/ifremer/isisfish/vcs/package.html 2008-08-04 16:59:55 UTC (rev 1281)
@@ -0,0 +1,37 @@
+Try to keep this class agnostic about IsisFish specific objet. This permit
+library creation in near futur.
+
+<h1>Politique d'utilisation du VCS pour les datas</h1>
+
+<p>
+ Si on a la derniere version d'isis alors on utilise le trunk. Si on a pas la
+ derniere version, on utilise le tag de cette version (impossible de commiter).
+</p>
+<p>
+ Si l'utilisateur ne souhaite pas passer a la derniere release, il ne pourra
+ plus commit ou updater. On detect qu'il n'a pas la derniere version car un
+ tag existe avec sa release.
+</p>
+<p>
+ Pour le developpement, on cree une branch pour la futur version, lors de la
+ release passage de 3.1.0.1 à 4.0.0.0
+</p>
+<ul>
+ <li>un tag est fait avec le trunk pour la dernier version stable (3.1.0)</li>
+ <li>la branch de developpement est fusionne avec le trunk (branch/4.0.0)</li>
+ <li>une nouvelle branch est crée (branch/4.0.1)</li>
+</ul>
+<p>
+ Pour les releases qui ne font evoluer que le 4eme chiffre, rien n'est fait.
+</p>
+<p>
+ Les differents etats possibles sont:
+ <ul>
+ <li>Sur le trunk en ecriture</li>
+ <li>Sur le trunk en lecture (anonymous)</li>
+ <li>Sur le trunk en lecture (car release obsolete)</li>
+ <li>Sur un tag car ancienne release</li>
+ <li>Sur une branch (en developpement)</li>
+ <li>En lecture (trunk, tag, branch) car reseau indisponible</li>
+ </ul>
+</p>
\ No newline at end of file
Modified: trunk/isis-fish/src/resources/i18n/isis-fish-en_GB.properties
===================================================================
--- trunk/isis-fish/src/resources/i18n/isis-fish-en_GB.properties 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/resources/i18n/isis-fish-en_GB.properties 2008-08-04 16:59:55 UTC (rev 1281)
@@ -1,17 +1,78 @@
-Can''t\ add\ result\ ''{0}''\ at\ date\ {1}=Can''t add result ''{0}'' at date {1}
-Can''t\ evaluate\ simulation\ prescript=Can''t evaluate simulation prescript
-Can''t\ get\ result\:\ {0}=Can''t get result\: {0}
-Can't\ create\ simulation\ logger=Can't create simulation logger
-Can't\ instanciate\ export\ {0}=Can't instanciate export {0}
-Checkout\ pom.xml\ to\ {0}=
+=
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ new\ JInternalFrame(simulation.getName(),\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ true,\ //resizable\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ true,\ //closable\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ true,\ //maximizable\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ true);//iconifiable\ \ \ \ \ \ \ \ \ \ \ \ intFrame.setContentPane(resEdit.getRootPane());\ \ \ \ \ \ \ \ \ \ \ \ intFrame.setVisible(true);\ \ \ \ \ \ \ \ \ \ \ \ //\t\ \ \ \ intFrame.pack();\ \ \ \ \ \ \ \ \ \ \ \ intFrame.setSize(new\ Dimension(800,700));\ \ \ \ \ \ \ \ \ \ \ \ getDesktopPane().add(intFrame);\ \ \ \ \ \ \ \ \ \ \ \ try{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ intFrame.setSelected(true);\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (PropertyVetoException\ eee)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn("Error\ dans\ l\ internalFrame\ ",\ eee);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ void\ on_voirSimulationLogButton_clicked()\ {\ \ \ \ \ \ \ \ String\ name\ =
+\ (String)getSimulation().getSelectedItem();\ \ \ \ \ \ \ \ if\ (name\ \!=
+\ (String)getSimulation().getSelectedItem();\ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ SimulationLoggerUtil.showSimulationLogConsole(name);\ \ \ \ \ \ \ \ }\ catch\ (Exception\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ ignore\ ?\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ void\ on_filterSimulationLogButton_clicked()\ {\ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ List<String>\ result\ =
+\ -5643196187139951889L;\ \ \ \ public\ SimulationException(String\ msg)\ {\ \ \ \ \ \ \ \ super(msg);\ \ \ \ }\ \ \ \ public\ SimulationException(String\ msg,\ Throwable\ e)\ {\ \ \ \ \ \ \ \ super(msg,\ e);\ \ \ \ }}\ //\ SimulationException/*\ *\#\#%\ *\ Copyright\ (C)\ 2007\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ Benjamin\ Poussin\ *\ *\ 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\ 2\ *\ 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,\ write\ to\ the\ Free\ Software\ *\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.\ *\#\#%*//*\ *\ *\ SimulationResultListener.java\ *\ *\ Created\:\ 13\ nov.\ 07\ 11\:59\:53\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 739\ $\ *\ *\ Last\ update\:\ $Date\:\ 2007-11-20\ 18\:46\:38\ +0100\ (mar,\ 20\ nov\ 2007)\ $\ *\ by\ \:\ $Author\:\ bpoussin\ $\ */package\ fr.ifremer.isisfish.simulator;import\ org.codelutin.math.matrix.MatrixND;import\ fr.ifremer.isisfish.IsisFishException;import\ fr.ifremer.isisfish.types.Date;/**\ *\ @author\ poussin\ *\ */public\ interface\ SimulationResultListener\ extends\ SimulationListener\ {\ \ \ \ \ \ \ \ public\ void\ addResult(SimulationContext\ context,\ \ \ \ \ \ \ \ \ \ \ \ Date\ date,\ String\ name,\ MatrixND\ mat)\ throws\ IsisFishException;\ \ \ \ }/*\ *\#\#%\ *\ Copyright\ (C)\ 2006\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ Benjamin\ Poussin\ *\ *\ 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\ 2\ *\ 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,\ write\ to\ the\ Free\ Software\ *\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.\ *\#\#%*//*\ *\ *\ SimulationQueueEvent.java\ *\ *\ Created\:\ 17\ ao\uFFFDt\ 2006\ 22\:00\:41\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 217\ $\ *\ *\ Last\ update\:\ $Date\:\ 2006-08-21\ 17\:43\:41\ +0200\ (lun,\ 21\ ao\u00FB\ 2006)\ $\ *\ by\ \:\ $Author\:\ bpoussin\ $\ */package\ fr.ifremer.isisfish.simulator;import\ java.util.EventObject;/**\ *\ @author\ poussin\ *\ */public\ class\ SimulationQueueEvent\ extends\ EventObject\ {\ \ \ \ /**\ simulation\ id\ */\ \ \ \ protected\ String\ id;\ \ \ \ \ \ \ \ /**\ \ \ \ \ *\ @param\ source\ \ \ \ \ */\ \ \ \ public\ SimulationQueueEvent(Object\ source,\ String\ id)\ {\ \ \ \ \ \ \ \ super(source);\ \ \ \ \ \ \ \ this.id\ =
+\ 0)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ this\ is\ the\ all\ levels\ reader\ to\ create,\ depends\ on\ no\ others\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ reader\ =
+\ 0;\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ //log.debug("\ offset\:"\ +\ offset\ +\ "\ width\:"\ +\ model.nbLinesInEditor);\ \ \ \ \ \ \ \ String[]\ result;\ \ \ \ \ \ \ \ //\ obtain\ lines\ from\ reader\ \ \ \ \ \ \ \ result\ =
+\ 4449196856169240128L;\ \ \ \ public\ SimulatorServerBadIdException(String\ msg)\ {\ \ \ \ \ \ \ \ super(msg);\ \ \ \ }\ \ \ \ public\ SimulatorServerBadIdException(String\ msg,\ Throwable\ e)\ {\ \ \ \ \ \ \ \ super(msg,\ e);\ \ \ \ }}\ //\ SimulatorServerBadIdException/*\ *\#\#%\ *\ Copyright\ (C)\ 2002-2005\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ \ \ \ \ Benjamin\ Poussin\ *\ *\ 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\ 2\ *\ 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,\ write\ to\ the\ Free\ Software\ *\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.\ *\#\#%*//*\ *\ *\ SimulationException.java\ *\ *\ Created\:\ Wed\ Aug\ 14\ 2002\ *\ *\ @author\ \ <poussin at codelutin.com>\ *\ @version\ $Revision\:\ 167\ $\ *\ *\ Mise\ a\ jour\:\ $Date\:\ 2006-01-23\ 15\:00\:17\ +0100\ (lun,\ 23\ jan\ 2006)\ $\ *\ par\ \:\ $Author\:\ bpoussin\ $\ */package\ fr.ifremer.isisfish.simulator;public\ class\ SimulationException\ extends\ RuntimeException\ {\ //\ SimulationException\ \ \ \ /**\ \ */\ \ \ \ private\ static\ final\ long\ serialVersionUID\ =
+\ IsisConfig.Module.REGION;\ \ \ \ \ \ \ \ if\ (create)\ {\ \ \ \ \ \ \ \ \ \ \ \ doCheckoutModule(handler,module,category);\ \ \ \ \ \ \ \ }\ else\ {\ \ \ \ \ \ \ \ \ \ \ \ File\ f\ =
+\ IsisConfig.getResultExportDirectory(rootDirectory);\ \ \ \ \ \ \ \ \ \ \ \ exportDir.mkdirs();\ \ \ \ \ \ \ \ \ \ \ \ ExportHelper.doExport(simulation,\ exportDir,\ parameters.getExportNames(),\ rootDirectory);\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ fr.ifremer.isisfish.simulator.SimulationListener\#beforeSimulation(fr.ifremer.isisfish.simulator.SimulationContext)\ \ \ \ \ */\ \ \ \ public\ void\ beforeSimulation(SimulationContext\ context)\ {\ \ \ \ }}/*\ *\#\#%\ *\ Copyright\ (C)\ 2006\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ Benjamin\ Poussin\ *\ *\ 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\ 2\ *\ 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,\ write\ to\ the\ Free\ Software\ *\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.\ *\#\#%*//*\ *\ *\ MetierMonitor.java\ *\ *\ Created\:\ 21\ ao\uFFFDt\ 2006\ 15\:43\:19\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 652\ $\ *\ *\ Last\ update\:\ $Date\:\ 2007-11-08\ 15\:04\:16\ +0100\ (jeu,\ 08\ nov\ 2007)\ $\ *\ by\ \:\ $Author\:\ ruchaud\ $\ */package\ fr.ifremer.isisfish.simulator;import\ static\ org.codelutin.i18n.I18n.n_;import\ java.util.ArrayList;import\ java.util.Collection;import\ java.util.HashMap;import\ java.util.HashSet;import\ java.util.List;import\ java.util.Map;import\ java.util.Set;import\ org.apache.commons.collections.MapIterator;import\ org.apache.commons.collections.keyvalue.MultiKey;import\ org.apache.commons.collections.map.MultiKeyMap;import\ org.apache.commons.logging.Log;import\ org.apache.commons.logging.LogFactory;import\ org.codelutin.math.matrix.MatrixFactory;import\ org.codelutin.math.matrix.MatrixND;import\ org.codelutin.topia.TopiaContext;import\ org.codelutin.topia.TopiaException;import\ fr.ifremer.isisfish.IsisFishRuntimeException;import\ fr.ifremer.isisfish.entities.Metier;import\ fr.ifremer.isisfish.entities.SetOfVessels;import\ fr.ifremer.isisfish.entities.Strategy;import\ fr.ifremer.isisfish.entities.StrategyMonthInfo;import\ fr.ifremer.isisfish.types.Date;import\ fr.ifremer.isisfish.types.Month;/**\ *\ ATTENTION\:\ l'implantation\ de\ cette\ classe\ n'est\ peut-etre\ pas\ correct.\ Il\ faut\ *\ absolument\ verifier\ le\ FIXME,\ mais\ il\ est\ difficile\ de\ le\ faire\ car\ *\ la\ plupart\ des\ methodes\ de\ cette\ objets\ ne\ semble\ plus\ utilis\uFFFD\ dans\ la\ *\ version\ 2.3.x\ de\ isis\ *\ \ *\ @author\ poussin\ */public\ class\ MetierMonitor\ {\ \ \ \ /**\ to\ use\ log\ facility,\ just\ put\ in\ your\ code\:\ log.info(\\"...\\=
+\ IsisContext.get().getMainConfig().getDefaultMapFile();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ String\ shp\ =
+\ LogLevelUtil.getLogLevels(levels);\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ create\ the\ levels\ reader\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ reader\ =
+\ Session.getDefaultInstance(props,\ null);\ \ \ \ \ \ \ \ //\ --\ Create\ a\ new\ message\ --\ \ \ \ \ \ \ \ Message\ msg\ =
+\ SimulationFilterUtil.createFilterModel(value);\ \ \ \ \ \ \ \ //\ to\ used\ directly\ model.getFilteredResult()\ in\ xml\ \ \ \ \ \ \ \ //\ we\ must\ fill\ filterModel\ result\ with\ original\ items\ \ \ \ \ \ \ \ filterModel.selectAll();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ getSimulation().setEditable(false);\ \ \ \ \ \ \ \ model\ =
+\ SimulationFilterUtil.filterSimulation(filterModel);\ \ \ \ \ \ \ \ \ \ \ \ model.removeAllElements();\ \ \ \ \ \ \ \ \ \ \ \ for\ (String\ s\ \:\ result)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ model.addElement(s);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ catch\ (Exception\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ log.warn(I18n._("could\ not\ filter\ on\ simulations=
+\ SimulationStorage.getSimulation(name);\ \ \ \ \ \ \ \ \ \ \ \ ResultEdit\ resEdit\ =
+\ SimulationStorage.getSimulation(name);\ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ storage.delete(false);\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ initSimulation();\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (Exception\ eee)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn("Can't\ delete\ simulation",\ eee);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ void\ on_openWindowButton_clicked(){\ \ \ \ \ \ \ \ String\ name\ =
+\ System.getProperties();\ \ \ \ \ \ \ \ //\ --\ Attaching\ to\ default\ Session,\ or\ we\ could\ start\ a\ new\ one\ --\ \ \ \ \ \ \ \ props.put("mail.smtp.host",\ smtpServer);\ \ \ \ \ \ \ \ Session\ session\ =
+\ context.getSimulationStorage();\ \ \ \ \ \ \ \ SimulationParameter\ parameters\ =
+\ e.getId();\ \ \ \ \ \ \ \ SimulationControl\ control\ =
+\ e.getUnitsToScroll();\ \ \ \ \ \ \ \ long\ newOffset;\ \ \ \ \ \ \ \ newOffset\ =
+\ evt.getPropertyName();\ \ \ \ \ \ \ \ if\ (properyName.equals(LogConsole.DISPOSE_CHANGED_PROPERTY))\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ ui\ required\ a\ dispose\ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ close();\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (Exception\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn(_("isisfish.error.log.console.dispose"\ ,this,e.getMessage()));\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ return;\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ //log.info(properyName\ +\ "\ \:\ "\ +\ evt.getNewValue());\ \ \ \ \ \ \ \ if\ (properyName.equals(RESET_CHANGED_PROPERTY))\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ reset\ filter\ model\ \ \ \ \ \ \ \ \ \ \ \ model.setLevels(0);\ \ \ \ \ \ \ \ \ \ \ \ model.setSearchText("=
+\ false;\ \ \ \ }\ \ \ \ public\ void\ propertyChange(PropertyChangeEvent\ evt)\ {\ \ \ \ \ \ \ \ String\ properyName\ =
+\ filename\ +\ ".shp";\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ String\ ssx\ =
+\ filename\ +\ ".ssx";\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ addShapeLayer(filename,\ shp,\ ssx,\ "ff000000",\ "ffbdde83=
+\ from;\ \ \ \ \ \ \ \ this.logFile\ =
+\ getRowCount();\ \ \ \ \ \ \ \ fireTableRowsInserted(row,\ row);\ \ \ \ \ \ \ \ SimulationControl\ control\ =
+\ getSimulationControl(e.getId());\ \ \ \ \ \ \ \ control.addPropertyChangeListener(this);\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ SimulationQueueListener\#simulationRemoved(fr.ifremer.isisfish.simulator.SimulationQueueEvent)\ \ \ \ \ */\ \ \ \ public\ void\ simulationWillBeRemoved(SimulationQueueEvent\ e)\ {\ \ \ \ \ \ \ \ String\ id\ =
+\ getSimulationControl(e.getId());\ \ \ \ \ \ \ \ if\ (control\ \!=
+\ getSimulationIndex(id);\ \ \ \ \ \ \ \ if\ (isRowIndexValid(row))\ {\ \ \ \ \ \ \ \ \ \ \ \ fireTableRowsDeleted(row,\ row);\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ progress.remove(id);\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ SimulationQueueListener\#simulationStart(fr.ifremer.isisfish.simulator.SimulationQueueEvent)\ \ \ \ \ */\ \ \ \ public\ void\ simulationStart(SimulationQueueEvent\ e)\ {\ \ \ \ \ \ \ \ //\ nothing\ to\ do\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ *\ @see\ SimulationQueueListener\#simulationStop(fr.ifremer.isisfish.simulator.SimulationQueueEvent)\ \ \ \ */\ \ \ \ public\ void\ simulationStop(SimulationQueueEvent\ e)\ {\ \ \ \ \ \ \ \ //\ nothing\ to\ do\ \ \ \ }}\ //\ SimulationQueueModel/*\ *\#\#%\ *\ Copyright\ (C)\ 2007\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ Benjamin\ Poussin\ *\ *\ 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\ 2\ *\ 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,\ write\ to\ the\ Free\ Software\ *\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.\ *\#\#%*//*\ *\ *\ SimulationExportResultWrapper.java\ *\ *\ Created\:\ 14\ nov.\ 07\ 00\:22\:51\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 1128\ $\ *\ *\ Last\ update\:\ $Date\:\ 2008-01-08\ 20\:21\:28\ +0100\ (mar,\ 08\ jan\ 2008)\ $\ *\ by\ \:\ $Author\:\ tchemit\ $\ */package\ fr.ifremer.isisfish.simulator;import\ java.io.File;import\ fr.ifremer.isisfish.IsisConfig;import\ fr.ifremer.isisfish.datastore.SimulationStorage;import\ fr.ifremer.isisfish.export.ExportHelper;/**\ *\ @author\ poussin\ *\ */public\ class\ SimulationExportResultWrapper\ implements\ SimulationListener\ {\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ fr.ifremer.isisfish.simulator.SimulationListener\#afterSimulation(fr.ifremer.isisfish.simulator.SimulationContext)\ \ \ \ \ */\ \ \ \ public\ void\ afterSimulation(SimulationContext\ context)\ {\ \ \ \ \ \ \ \ SimulationStorage\ simulation\ =
+\ getSimulationNames();\ \ \ \ \ \ \ \ //\ create\ filter\ model\ \ \ \ \ \ \ \ filterModel\ =
+\ id;\ \ \ \ }\ \ \ \ \ \ \ \ /**\ \ \ \ \ *\ @return\ Returns\ the\ id.\ \ \ \ \ */\ \ \ \ public\ String\ getId()\ {\ \ \ \ \ \ \ \ return\ this.id;\ \ \ \ }\ \ \ \ }/*\ *\#\#%\ *\ Copyright\ (C)\ 2006\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ Benjamin\ Poussin\ *\ *\ 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\ 2\ *\ 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,\ write\ to\ the\ Free\ Software\ *\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.\ *\#\#%*//*\ *\ *\ PopulationMonitor.java\ *\ *\ Created\:\ 21\ ao\uFFFDt\ 2006\ 15\:41\:18\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 428\ $\ *\ *\ Last\ update\:\ $Date\:\ 2007-10-15\ 14\:56\:13\ +0200\ (lun,\ 15\ oct\ 2007)\ $\ *\ by\ \:\ $Author\:\ bpoussin\ $\ */package\ fr.ifremer.isisfish.simulator;import\ java.util.ArrayList;import\ java.util.HashMap;import\ java.util.List;import\ java.util.Map;import\ org.apache.commons.collections.MapIterator;import\ org.apache.commons.collections.keyvalue.MultiKey;import\ org.apache.commons.collections.map.MultiKeyMap;import\ org.apache.commons.logging.Log;import\ org.apache.commons.logging.LogFactory;import\ org.codelutin.math.matrix.MatrixFactory;import\ org.codelutin.math.matrix.MatrixIterator;import\ org.codelutin.math.matrix.MatrixND;import\ fr.ifremer.isisfish.entities.Population;import\ fr.ifremer.isisfish.entities.PopulationGroup;import\ fr.ifremer.isisfish.entities.PopulationSeasonInfo;import\ fr.ifremer.isisfish.entities.Species;import\ fr.ifremer.isisfish.entities.Zone;import\ fr.ifremer.isisfish.types.Date;import\ fr.ifremer.isisfish.types.Month;/**\ *\ \ *\ @author\ poussin\ */public\ class\ PopulationMonitor\ {\ \ \ \ \ \ \ \ /**\ to\ use\ log\ facility,\ just\ put\ in\ your\ code\:\ log.info(\\"...\\=
+\ levels\ +\ "";\ \ \ \ \ \ \ \ LevelsLineReader\ reader\ =
+\ levelsReader;\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ if\ (reader\ =
+\ logFile;\ \ \ \ \ \ \ \ this.simulationFile\ =
+\ model.getFirstLinePosition()\ +\ unitsToScroll;\ \ \ \ \ \ \ \ if\ (unitsToScroll\ >\ 0)\ {\ \ \ \ \ \ \ \ \ \ \ \ if\ (model.isEOF())\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ nothing\ to\ do\ we\ are\ already\ at\ the\ tail\ of\ the\ stream\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ return;\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ else\ {\ \ \ \ \ \ \ \ \ \ \ \ if\ (model.isBOF())\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ nothing\ to\ do\ we\ are\ already\ at\ the\ head\ of\ the\ stream\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ return;\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ dontAdjust\ =
+\ module.getClazz().getMethod("checkout",String.class);\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ method.invoke(module.getClazz(),category);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ catch\ (Exception\ eee)\ {\ \ \ \ \ \ \ \ \ \ \ \ log.warn(org.codelutin.i18n.I18n._("isisfish.error.checkout.module",\ f.getAbsolutePath()),\ eee);\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ static\ void\ doCheckoutRegion(VCSHandler\ handler,\ \ String\ category,boolean\ create)\ {\ \ \ \ \ \ \ \ IsisConfig.Module\ module\ =
+\ new\ DefaultComboBoxModel(value.toArray());\ \ \ \ \ \ \ \ getSimulation().setModel(model);\ \ \ \ \ \ \ \ getSimulation().setSelectedItem(null);\ \ \ \ }\ \ \ \ public\ void\ on_Resultat_destroy_event(){\ \ \ \ \ \ \ \ dispose();\ \ \ \ }\ \ \ \ public\ void\ on_simulation_selection_notify_event(ItemEvent\ e){\ \ \ \ \ \ \ \ //\tsetSelectedSimulation((Simulation)getSimulation().getSelectedItem());\ \ \ \ }\ \ \ \ /**\ \ \ \ *\ Get\ the\ value\ of\ selectedSimulation.\ \ \ \ *\ @return\ value\ of\ selectedSimulation.\ \ \ \ */\ \ \ \ //\ \ \ \ public\ Simulation\ getSelectedSimulation()\ {\ \ \ \ \ \ \ \ //return\ selectedSimulation;\ \ \ \ //}\ \ \ \ /**\ \ \ \ *\ Set\ the\ value\ of\ selectedSimulation.\ \ \ \ *\ @param\ v\ \ Value\ to\ assign\ to\ selectedSimulation.\ \ \ \ */\ \ \ \ //public\ void\ setSelectedSimulation(Simulation\ v)\ {\ \ \ \ \ \ \ \ //this.selectedSimulation\ =
+\ new\ File(module.getDirectory(),category);\ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ (\!f.exists()||\ \!VCSHelper.isFileInWorkingCopy(f,\ handler,true))\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ fr.ifremer.isisfish.datastore.RegionStorage.checkout(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ handler.getLocalDatabasePath(),\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ module.value()\ +\ "/"\ +category\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ );\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (Exception\ eee)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn(org.codelutin.i18n.I18n._("isisfish.error.checkout.module",\ f.getAbsolutePath()),\ eee);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ }}/*\ *\#\#%*\ Copyright\ (C)\ 2002,\ 2003,\ 2004,\ 2005,\ 2006,\ 2007\ Code\ Lutin,*\ Benjamin\ Poussin,\ 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\ 2*\ 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,\ write\ to\ the\ Free\ Software*\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.*\#\#%*/package\ fr.ifremer.isisfish.versionning.vcsSvn;import\ fr.ifremer.isisfish.versionning.IsisVcsConfig;import\ static\ org.codelutin.i18n.I18n._;import\ org.codelutin.vcs.AbstractVCSHandler;import\ org.codelutin.vcs.VCSConfig;import\ org.codelutin.vcs.VCSException;import\ org.codelutin.vcs.VCSHelper;import\ static\ org.codelutin.vcs.VCSHelper.isFileInCheckedDir;import\ org.codelutin.vcs.VCSRuntimeException;import\ org.codelutin.vcs.VCSState;import\ static\ org.codelutin.vcs.VCSState.OUT_OF_DATE;import\ static\ org.codelutin.vcs.VCSState.OUT_OF_DATE_AND_MODIFIED;import\ static\ org.codelutin.vcs.VCSState.UP_TO_DATE;import\ org.codelutin.vcs.VCSStatus;import\ org.tmatesoft.svn.core.ISVNDirEntryHandler;import\ org.tmatesoft.svn.core.ISVNLogEntryHandler;import\ org.tmatesoft.svn.core.SVNCommitInfo;import\ org.tmatesoft.svn.core.SVNDirEntry;import\ org.tmatesoft.svn.core.SVNException;import\ org.tmatesoft.svn.core.SVNLogEntry;import\ org.tmatesoft.svn.core.SVNNodeKind;import\ org.tmatesoft.svn.core.SVNURL;import\ org.tmatesoft.svn.core.io.SVNRepository;import\ org.tmatesoft.svn.core.wc.ISVNOptions;import\ org.tmatesoft.svn.core.wc.SVNClientManager;import\ org.tmatesoft.svn.core.wc.SVNRevision;import\ org.tmatesoft.svn.core.wc.SVNStatus;import\ org.tmatesoft.svn.core.wc.SVNStatusType;import\ static\ org.tmatesoft.svn.core.wc.SVNStatusType.*;import\ org.tmatesoft.svn.core.wc.SVNWCClient;import\ org.tmatesoft.svn.core.wc.SVNWCUtil;import\ java.io.ByteArrayOutputStream;import\ java.io.File;import\ java.io.IOException;import\ java.util.ArrayList;import\ java.util.Arrays;import\ java.util.Collection;import\ java.util.Collections;import\ java.util.Iterator;import\ java.util.List;/**\ *\ VCSHandler\ implementation\ for\ svn\ *\ *\ @author\ chemit\ */public\ final\ class\ SVNHandler\ extends\ AbstractVCSHandler\ {\ \ \ \ protected\ SVNURL\ repositoryURL;\ \ \ \ protected\ SVNRepository\ repository;\ \ \ \ protected\ SVNClientManager\ ourClientManager;\ \ \ \ protected\ SVNWCClient\ ourWcClient;\ \ \ \ public\ SVNHandler(VCSConfig\ config)\ {\ \ \ \ \ \ \ \ super(config,\ ".svn",\ "entries=
+\ new\ File(module.getDirectory(),category);\ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ if\ (\!f.exists()||\ \!VCSHelper.isFileInWorkingCopy(f,\ handler,true))\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Method\ method\ =
+\ new\ File(readerDirectory,\ "offsets_"\ +\ levels);\ \ \ \ \ \ \ \ \ \ \ \ FileOffsetReader\ offsetReader\ =
+\ new\ FileOffsetReader(offsetFile);\ \ \ \ \ \ \ \ \ \ \ \ if\ (levels\ =
+\ new\ LevelsLineReader(getLevelReader(0),\ offsetReader,\ logLevels);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ reader.setId(levelsStr);\ \ \ \ \ \ \ \ \ \ \ \ levelsReaders.add(reader);\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ if\ (\!reader.isOpen())\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ open\ reader\ \ \ \ \ \ \ \ \ \ \ \ reader.open();\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ log.info(reader);\ \ \ \ \ \ \ \ return\ reader;\ \ \ \ }\ \ \ \ protected\ void\ openReader(LineReader\ reader)\ throws\ IOException\ {\ \ \ \ \ \ \ \ this.reader\ =
+\ new\ LevelsLineReader(model.getLogFile(),\ offsetReader);\ \ \ \ \ \ \ \ \ \ \ \ }\ else\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ other\ level\ readers\ depens\ on\ all\ levels\ reader\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ LogLevel[]\ logLevels\ =
+\ new\ LogMail(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ statusBar,\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ model.getFrom(),\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ model.getLogFile(),\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ model.getLogFile().getParentFile(),\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ model.getSmtpServer());\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ logMail.setVisible(true);\ \ \ \ }}/**\ \#\#%\ Copyright\ (C)\ 2002,\ 2003,\ 2004,\ 2005,\ 2006,\ 2007\ Code\ Lutin,*\ Benjamin\ Poussin,\ 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\ 2*\ 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,\ write\ to\ the\ Free\ Software*\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.*\ \#\#%\ */package\ fr.ifremer.isisfish.logging.console;import\ javax.swing.event.ChangeEvent;import\ javax.swing.event.ChangeListener;import\ javax.swing.event.EventListenerList;import\ java.io.File;import\ java.util.ArrayList;import\ java.util.List;/**\ *\ This\ class\ is\ the\ model\ used\ in\ LogConsole.\ *\ <p/>\ *\ The\ model\ deals\ with\ ChangeEvent\ to\ notify\ ui,\ model\ has\ changed.\ *\ *\ @author\ chemit\ */public\ class\ LogConsoleModel\ {\ \ \ \ /**\ to\ use\ log\ facility,\ just\ put\ in\ your\ code\:\ log.info(\\"...\\=
+\ new\ MimeMessage(session);\ \ \ \ \ \ \ \ //\ --\ Set\ the\ FROM\ and\ TO\ fields\ --\ \ \ \ \ \ \ \ msg.setFrom(new\ InternetAddress(from));\ \ \ \ \ \ \ \ msg.setRecipients(Message.RecipientType.TO,\ InternetAddress.parse(to,\ false));\ \ \ \ \ \ \ \ MimeMultipart\ bodyMime\ =
+\ new\ MimeMultipart("mixed=
+\ new\ PatternLineReader(parent,\ new\ MemoryOffsetReader(5000),\ searchText,\ 0);\ \ \ \ \ \ \ \ reader.setId(parent.getId()\ +\ "\:"\ +\ searchText);\ \ \ \ \ \ \ \ log.info(reader);\ \ \ \ \ \ \ \ return\ reader;\ \ \ \ }\ \ \ \ //TODO\ Improve\ algorithm\ \:\ always\ try\ to\ find\ the\ closest\ reader\ to\ use\ \ \ \ protected\ LineReader\ getLevelReader(int\ levels)\ throws\ IOException\ {\ \ \ \ \ \ \ \ String\ levelsStr\ =
+\ new\ ResultEdit(simulation);\ \ \ \ \ \ \ \ \ \ \ \ JInternalFrame\ intFrame\ =
+\ null\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ &&\ parameters.getExportNames().size()\ >\ 0)\ {\ \ \ \ \ \ \ \ \ \ \ \ File\ exportDir\ =
+\ null\ &&\ reader.isOpen())\ {\ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ reader.close();\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (IOException\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn(I18n._("could\ not\ close\ reader\ {0}",\ reader));\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ @Override\ \ \ \ protected\ void\ finalize()\ throws\ Throwable\ {\ \ \ \ \ \ \ \ super.finalize();\ \ \ \ \ \ \ \ close();\ \ \ \ }\ \ \ \ /**\ \ \ \ \ *\ read\ the\ required\ frame\ from\ current\ reader\ \ \ \ \ *\ \ \ \ \ *\ @param\ offset\ the\ offset\ to\ use\ \ \ \ \ *\ @throws\ IOException\ if\ any\ problem\ while\ reading\ \ \ \ \ */\ \ \ \ public\ void\ read(long\ offset)\ throws\ IOException\ {\ \ \ \ \ \ \ \ if\ (offset\ <\ 0)\ {\ \ \ \ \ \ \ \ \ \ \ \ offset\ =
+\ null)\ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ reader.close();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (IOException\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //TODO\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ Properties\ getData()\ {\ \ \ \ \ \ \ \ return\ data;\ \ \ \ }\ \ \ \ public\ String\ getName()\ {\ \ \ \ \ \ \ \ return\ name;\ \ \ \ }}/*\ *\#\#%\ *\ Copyright\ (C)\ 2006\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ Benjamin\ Poussin\ *\ *\ 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\ 2\ *\ 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,\ write\ to\ the\ Free\ Software\ *\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.\ *\#\#%*//*\ *\ *\ SimulationQueueModel.java\ *\ *\ Created\:\ 18\ ao\uFFFDt\ 2006\ 00\:05\:41\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 602\ $\ *\ *\ Last\ update\:\ $Date\:\ 2007-11-01\ 21\:39\:12\ +0100\ (jeu,\ 01\ nov\ 2007)\ $\ *\ by\ \:\ $Author\:\ tchemit\ $\ */package\ fr.ifremer.isisfish.simulator;/**\ @author\ poussin\ */public\ class\ SimulationQueueModel\ extends\ AbstractSimulationQueueModel\ {\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ AbstractSimulationQueueModel()\ \ \ \ \ */\ \ \ \ public\ SimulationQueueModel()\ {\ \ \ \ \ \ \ \ super();\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ AbstractSimulationQueueModel(SimulationManager)\ \ \ \ \ */\ \ \ \ public\ SimulationQueueModel(SimulationManager\ queue)\ {\ \ \ \ \ \ \ \ super(queue);\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ AbstractSimulationQueueModel at getSimulationIds()\ \ \ \ \ */\ \ \ \ protected\ java.util.List<String>\ getSimulationIds()\ {\ \ \ \ \ \ \ \ return\ getQueue().ids;\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ AbstractSimulationQueueModel at getQueueItemsAsMap()\ \ \ \ \ */\ \ \ \ protected\ java.util.Map<String,\ SimulationManager.QueueItem>\ getQueueItemsAsMap()\ {\ \ \ \ \ \ \ \ return\ getQueue().map;\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ SimulationQueueListener\#simulationAdded(fr.ifremer.isisfish.simulator.SimulationQueueEvent)\ \ \ \ \ */\ \ \ \ public\ void\ simulationAdded(SimulationQueueEvent\ e)\ {\ \ \ \ \ \ \ \ int\ row\ =
+\ null)\ {\ \ \ \ \ \ \ \ \ \ \ \ File\ offsetFile\ =
+\ null)\ {\ \ \ \ \ \ \ \ \ \ \ \ control.removePropertyChangeListener(this);\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ int\ row\ =
+\ null){\ \ \ \ \ \ \ \ \ \ \ \ SimulationStorage\ simulation\ =
+\ null){\ \ \ \ \ \ \ \ \ \ \ \ SimulationStorage\ storage\ =
+\ null;\ \ \ \ \ \ \ \ for\ (LineReaderUtil.LevelsLineReader\ levelsReader\ \:\ levelsReaders)\ {\ \ \ \ \ \ \ \ \ \ \ \ if\ (levelsReader.getId().equals(levelsStr))\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ reader\ =
+\ reader.readLine(offset,\ model.nbLinesInEditor);\ \ \ \ \ \ \ \ //\ mark\ the\ new\ first\ position\ \ \ \ \ \ \ \ model.setFirstLinePosition(offset);\ \ \ \ \ \ \ \ //\ add\ lines\ in\ model\ \ \ \ \ \ \ \ model.allItems.clear();\ \ \ \ \ \ \ \ model.allItems.addAll(Arrays.asList(result));\ \ \ \ \ \ \ \ //\ notify\ ui\ that\ model\ changed\ \ \ \ \ \ \ \ model.fireStateChanged();\ \ \ \ }\ \ \ \ public\ void\ mouseWheelMoved(MouseWheelEvent\ e)\ {\ \ \ \ \ \ \ \ int\ unitsToScroll\ =
+\ reader;\ \ \ \ \ \ \ \ if\ (\!this.reader.isOpen())\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ open\ reader\ \ \ \ \ \ \ \ \ \ \ \ this.reader.open();\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ //\ save\ the\ number\ of\ lines\ of\ reader\ in\ model\ \ \ \ \ \ \ \ model.nbLines\ =
+\ simulation.getDirectory();\ \ \ \ \ \ \ \ //\ \ \ \ \ \ \ \ //\ Export\ des\ r\uFFFDsultats\ \ \ \ \ \ \ \ //\ \ \ \ \ \ \ \ if\ (parameters.getExportNames()\ \!=
+\ simulation.getParameter();\ \ \ \ \ \ \ \ File\ rootDirectory\ =
+\ simulationFile;\ \ \ \ \ \ \ \ this.smtpServer\ =
+\ smtpServer;\ \ \ \ \ \ \ \ this.statusBar\ =
+\ statusBar;\ \ \ \ \ \ \ \ sendMail.addActionListener(new\ ActionListener()\ {\ \ \ \ \ \ \ \ \ \ \ \ public\ void\ actionPerformed(ActionEvent\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ sendMail(mailTo.getText(),\ content.getText(),\ sendAll.isSelected());\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ statusBar.setStatus(_("isisfish.log.mail.send"\ ,\ to));\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (Exception\ eee)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ statusBar.setStatus(_("isisfish.log.mail.failed",\ smtpServer));\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ finally\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ dispose();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ });\ \ \ \ }\ \ \ \ public\ void\ setTo(String\ to)\ {\ \ \ \ \ \ \ \ this.to\ =
+\ statusBar;\ \ \ \ }\ \ \ \ public\ void\ openLogMail()\ {\ \ \ \ \ \ \ \ if\ (logMail=
+\ this.reader.getNbLines();\ \ \ \ }\ \ \ \ public\ void\ addPropertyChangeListener(PropertyChangeListener\ listener)\ {\ \ \ \ \ \ \ \ propertyListeners.addPropertyChangeListener(listener);\ \ \ \ }\ \ \ \ public\ void\ addPropertyChangeListener(String\ propertyName,\ PropertyChangeListener\ listener)\ {\ \ \ \ \ \ \ \ propertyListeners.addPropertyChangeListener(propertyName,\ listener);\ \ \ \ }\ \ \ \ public\ void\ removePropertyChangeListener(PropertyChangeListener\ listener)\ {\ \ \ \ \ \ \ \ propertyListeners.removePropertyChangeListener(listener);\ \ \ \ }\ \ \ \ public\ void\ removePropertyChangeListener(String\ propertyName,\ PropertyChangeListener\ listener)\ {\ \ \ \ \ \ \ \ propertyListeners.removePropertyChangeListener(propertyName,\ listener);\ \ \ \ }\ \ \ \ public\ StatusBar\ getStatusBar()\ {\ \ \ \ \ \ \ \ return\ statusBar;\ \ \ \ }\ \ \ \ public\ void\ setStatusBar(StatusBar\ statusBar)\ {\ \ \ \ \ \ \ \ this.statusBar\ =
+\ to;\ \ \ \ }\ \ \ \ /**\ \ \ \ \ *\ Send\ an\ email\ using\ the\ given\ informations\ (stmpServer,\ toAddress,\ \ \ \ \ *\ fromAddress,\ subject\ and\ body).\ \ \ \ \ *\ \ \ \ \ *\ @param\ to\ \ \ \ \ \ \ adr\ to\ send\ the\ mail\ \ \ \ \ *\ @param\ text\ \ \ \ \ message\ text\ \ \ \ \ *\ @param\ selected\ if\ <code>true</code>\ send\ all\ simulation\ zip,\ \ \ \ \ *\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ or\ just\ the\ file\ \ \ \ \ *\ @throws\ java.io.IOException\ \ \ \ \ \ \ \ \ \ \ if\ any\ problem\ while\ creatingthe\ zip\ \ \ \ \ *\ @throws\ javax.mail.MessagingException\ if\ any\ problem\ while\ creating\ \ \ \ \ *\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ the\ message\ or\ while\ the\ send\ \ \ \ \ */\ \ \ \ public\ void\ sendMail(String\ to,\ String\ text,\ boolean\ selected)\ throws\ IOException,\ MessagingException\ {\ \ \ \ \ \ \ \ Properties\ props\ =
+\ true;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ read(e.getValue());\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (IOException\ e1)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn(I18n._("could\ not\ read\ at\ offset\ {0}\ for\ reason\ {1}",\ e.getValue(),\ e1.getMessage()));\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ dontAdjust\ =
+\ true;\ \ \ \ \ \ \ \ \ \ \ \ read(newOffset);\ \ \ \ \ \ \ \ }\ catch\ (IOException\ e1)\ {\ \ \ \ \ \ \ \ \ \ \ \ log.warn(I18n._("could\ not\ read\ at\ offset\ {0}\ for\ reason\ {1}",\ newOffset,\ e1.getMessage()));\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ void\ adjustmentValueChanged(AdjustmentEvent\ e)\ {\ \ \ \ \ \ \ \ if\ (\!e.getValueIsAdjusting()\ &&\ \!dontAdjust)\ {\ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //TODO\ Fix\ bug\ \:sometimes\ when\ going\ at\ tail,\ it\ goes\ head\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //TODO\ (the\ offset\ must\ not\ be\ good...)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //log.info("value\:"+e.getValue());\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ dontAdjust\ =
+\ v;\ \ \ \ //}\ \ \ \ public\ void\ on_supprimerSimulationButton_clicked(){\ \ \ \ \ \ \ \ String\ name\ =
+Checkout\ pom.xml\ to\ {0}",\ file.getPath()));\ \ \ \ \ \ \ \ vcsHandler.update(file);\ \ \ \ \ \ \ \ getContext().setQuit(true);\ \ \ \ }}\ /*\ *\ \#\#%\ Copyright\ (C)\ 2002,\ 2003,\ 2004,\ 2005,\ 2006,\ 2007\ Code\ Lutin,*\ Benjamin\ Poussin,\ 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\ 2*\ 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,\ write\ to\ the\ Free\ Software*\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.*\ \#\#%\ */package\ fr.ifremer.isisfish.commandline.actions;import\ fr.ifremer.isisfish.IsisConfig;import\ fr.ifremer.isisfish.datastore.AnalysePlanStorage;import\ fr.ifremer.isisfish.datastore.ExportStorage;import\ fr.ifremer.isisfish.datastore.FormuleStorage;import\ fr.ifremer.isisfish.datastore.RuleStorage;import\ fr.ifremer.isisfish.datastore.ScriptStorage;import\ fr.ifremer.isisfish.datastore.SimulatorStorage;import\ java.io.File;import\ java.util.ArrayList;import\ java.util.List;import\ java.util.regex.Pattern;/**\ *\ The\ class\ to\ define\ all\ actions\ on\ scripts\ or\ data\ (region,\ simulations)\ \ that\ *\ IsisFish\ can\ launch\ at\ init\ time.\ *\ *\ @author\ chemit\ */public\ class\ ScriptUtil\ {\ \ \ \ /**\ \ \ \ \ *\ Pour\ v\uFFFDrifier\ q'un\ fichier\ existe.\ \ \ \ \ *\ \ \ \ \ *\ @param\ file\ \ the\ file\ dont\ on\ doit\ v\uFFFDrifier\ l'existence\ \ \ \ \ *\ @param\ force\ flag\ pour\ d\uFFFDclancher\ une\ exception,\ si\ fichier\ non\ trouv\uFFFD.\ \ \ \ \ */\ \ \ \ public\ static\ void\ checkNotFileExist(File\ file,\ boolean\ force)\ {\ \ \ \ \ \ \ \ if\ (file.exists()\ &&\ \!force)\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ fatal\ error\ \ \ \ \ \ \ \ \ \ \ \ throw\ new\ IllegalArgumentException("destination\ already\ exists\ "\ +\ file\ +\ "\ use\ \\'force\\'\ argument\ to\ force\ overwrite=
Info=Info
-Region\ {0}\ allready\ exist\ in\ repository.\ Can''t\ import=
-could\ not\ close\ reader\ {0}=could not close reader {0}
-could\ not\ create\ simulation\ filter\ model\ for\ reason\ {0}=could not create simulation filter model for reason {0}
-could\ not\ filter\ on\ simulations=could not filter on simulations
-could\ not\ found\ log\ file\ {0}=could not found log file {0}
-could\ not\ read\ at\ offset\ {0}\ for\ reason\ {1}=could not read at offset {0} for reason {1}
-filter\ loaded\ in\ {0}\ ms\ \:\ found\ {1}\ lines.=filter loaded in {0} ms \: found {1} lines.
+could\ not\ close\ reader\ {0}",\ levelsReader));\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ if\ (reader\ \!=
+could\ not\ create\ simulation\ filter\ model\ for\ reason\ {0}",e.getMessage()),e);\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ private\ void\ initSimulation()\ throws\ IOException,\ ParseException\ {\ \ \ \ \ \ \ \ //\ keep\ in\ context\ list\ of\ old\ simulation\ names\ (for\ filter\ process)\ \ \ \ \ \ \ \ java.util.List<String>\ value\ =
+filter\ loaded\ in\ {0}\ ms\ \:\ found\ {1}\ lines.",\ (System.currentTimeMillis()\ -\ t0),\ reader.getNbLines()));\ \ \ \ \ \ \ \ }\ catch\ (IOException\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ log.warn("could\ not\ open\ reader\ ["\ +\ this.reader\ +\ "]\ for\ reason\ "\ +\ e.getMessage());\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ protected\ LineReader\ getPatternReader(String\ searchText,\ LineReader\ parent)\ {\ \ \ \ \ \ \ \ LineReader\ reader;\ \ \ \ \ \ \ \ reader\ =
isisfish.about.site=site
isisfish.about.text=text
isisfish.about.title=title
@@ -30,7 +91,6 @@
isisfish.cell.longitude=longitude
isisfish.cell.name=name
isisfish.cell.title=title
-isisfish.change.equation=Can't change equation
isisfish.common.add=add
isisfish.common.add.short=add short
isisfish.common.addQueue=addQueue
@@ -47,17 +107,14 @@
isisfish.common.emigration=emigration
isisfish.common.empty=vide
isisfish.common.error=error
-isisfish.common.file=File
isisfish.common.finish=finish
isisfish.common.gear=gear
isisfish.common.immigration=immigration
isisfish.common.info=info
isisfish.common.migration=migration
-isisfish.common.month=month {0}
isisfish.common.new=new
isisfish.common.newMatrix=new Matrix
isisfish.common.next=next
-isisfish.common.no=No
isisfish.common.ok=ok
isisfish.common.openEditor=openEditor
isisfish.common.populationGroup=populationGroup
@@ -84,73 +141,6 @@
isisfish.common.warn=warn
isisfish.common.year=annee
isisfish.common.zone=zone
-isisfish.config.h2.description=
-isisfish.config.h2.h2BytecodeProvider.description=
-isisfish.config.h2.h2CurrentSessionContextClass.description=
-isisfish.config.h2.h2Dialect.description=
-isisfish.config.h2.h2Driver.description=
-isisfish.config.h2.h2MemBytecodeProvider.description=
-isisfish.config.h2.h2MemDialect.description=
-isisfish.config.h2.h2MemDriver.description=
-isisfish.config.h2.h2MemPass.description=
-isisfish.config.h2.h2MemType.description=
-isisfish.config.h2.h2MemURL.description=
-isisfish.config.h2.h2MemUser.description=
-isisfish.config.h2.h2Pass.description=
-isisfish.config.h2.h2Type.description=
-isisfish.config.h2.h2URL.description=
-isisfish.config.h2.h2User.description=
-isisfish.config.h2.migrationApplicationVersion.description=
-isisfish.config.h2.migrationCallBackhandlers.description=
-isisfish.config.h2.migrationModelNames.description=
-isisfish.config.h2.migrationPreviousMappingDirectory.description=
-isisfish.config.h2.migrationTopiaService.description=
-isisfish.config.h2.storageData.description=
-isisfish.config.h2.updateschemaDatabase.description=
-isisfish.config.main.compileDirectory.description=
-isisfish.config.main.configFileName.description=
-isisfish.config.main.dataBackupFilename.description=
-isisfish.config.main.defaultBackupDirectory.description=
-isisfish.config.main.defaultExportDirectory.description=
-isisfish.config.main.defaultExportNames.description=
-isisfish.config.main.defaultMapFile.description=
-isisfish.config.main.defaultResultNames.description=
-isisfish.config.main.defaultSimulator.description=
-isisfish.config.main.defaultTagValue.description=
-isisfish.config.main.description=
-isisfish.config.main.encoding.description=encoding used on system
-isisfish.config.main.javadocURL.description=
-isisfish.config.main.localSimulator.description=
-isisfish.config.main.locale.description=user locale
-isisfish.config.main.login.description=
-isisfish.config.main.password.description=
-isisfish.config.main.projectName.description=name of project
-isisfish.config.main.regionMap.description=
-isisfish.config.main.resultExport.description=
-isisfish.config.main.simulationInformationFilename.description=
-isisfish.config.main.simulationParametersFilename.description=
-isisfish.config.main.simulationReportMail.description=
-isisfish.config.main.simulationResultXmlFilename.description=
-isisfish.config.main.simulationServer.description=
-isisfish.config.main.simulationShowOnlyError.description=
-isisfish.config.main.simulationShowOnlyQueue.description=
-isisfish.config.main.smtpServer.description=
-isisfish.config.main.userMail.description=
-isisfish.config.main.userName.description=
-isisfish.config.main.version.description=
-isisfish.config.vcs.databaseVersion.description=
-isisfish.config.vcs.description=
-isisfish.config.vcs.hostName.description=
-isisfish.config.vcs.keyFile.description=
-isisfish.config.vcs.localDatabasePath.description=
-isisfish.config.vcs.noPassPhrase.description=
-isisfish.config.vcs.passphrase.description=
-isisfish.config.vcs.remoteDatabase.description=
-isisfish.config.vcs.remotePath.description=
-isisfish.config.vcs.type.description=
-isisfish.config.vcs.typeRepo.description=
-isisfish.config.vcs.useSshConnexion.description=
-isisfish.config.vcs.userName.description=
isisfish.dataResult.descriptionLabel=defaultToolTip-fr.ifremer.resultat.DataResult.descriptionLabel
isisfish.dataResult.export.csv=Export to CSV
isisfish.dataResult.exportButton=defaultToolTip-fr.ifremer.resultat.DataResult.exportButton
@@ -158,7 +148,6 @@
isisfish.dataResult.matriceTable=defaultToolTip-fr.ifremer.resultat.DataResult.matriceTable
isisfish.dataResult.scrolledwindow2=defaultToolTip-fr.ifremer.resultat.DataResult.scrolledwindow2
isisfish.dataResult.table2=defaultToolTip-fr.ifremer.resultat.DataResult.table2
-isisfish.date.toString={0} {1}
isisfish.effortDescription.crewFoodCost=isisfish.effortDescription.crewFoodCost
isisfish.effortDescription.crewShareRate=isisfish.effortDescription.crewShareRate
isisfish.effortDescription.crewSize=isisfish.effortDescription.crewSize
@@ -170,31 +159,14 @@
isisfish.effortDescription.otherRunningCost=isisfish.effortDescription.otherRunningCost
isisfish.effortDescription.repairAndMaintenanceGearCost=isisfish.effortDescription.repairAndMaintenanceGearCost
isisfish.effortDescription.title=isisfish.effortDescription.title
-isisfish.effortDescription.toString=EffortDescription for {0} with {1}
isisfish.effortDescription.unitCostOfFishing=isisfish.effortDescription.unitCostOfFishing
isisfish.equation.editor.title=Equation Editor
-isisfish.error.acceptable.population=New value isn't acceptable value for this population
isisfish.error.add.card=Error while adding of result to the map.
-isisfish.error.add.file=Can't add file {0}
-isisfish.error.add.logger.simulation\ =isisfish.error.add.logger.simulation
+isisfish.error.add.logger.simulation\ ",\ e));\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ simThread.start();\ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ simThread.join();\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (InterruptedException\ eee)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ (log.isWarnEnabled())\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn(I18n._("isisfish.error.wait.simThread=
isisfish.error.add.result.data=Error while adding result ot data.
isisfish.error.add.result.graph=Error while adding result to graph
-isisfish.error.add.tray=Can''t add system tray icon
-isisfish.error.change.classloader=Can''t change classloader because can''t create URL from file {0}
-isisfish.error.change.equation=Can't change equation
-isisfish.error.check.region=Can't check region
-isisfish.error.checkout.module=Can''t checkout module {0}
-isisfish.error.commit.files=Can't commit files {0}
-isisfish.error.compile.script=Can't compile script\: {0}
-isisfish.error.compiled.parameter=Can't get rule parameter from compiled class
-isisfish.error.connect.server=Can't connect to server
+isisfish.error.checkout.module",\ module),\ eee);\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ break;\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ static\ void\ doCheckoutModule(VCSHandler\ handler,\ IsisConfig.Module\ module,\ String\ category)\ {\ \ \ \ \ \ \ \ File\ f\ =
isisfish.error.conversion.data=Erreur lors de la conversion du fichier de donn\u00E9es
-isisfish.error.create.equation=Can't create equation
-isisfish.error.delete.database=Can''t delete database
-isisfish.error.delete.file=could not delete file {0}
-isisfish.error.delete.vcs.files=Can''t delete vcs files
-isisfish.error.during.simulation=Error during simulation
-isisfish.error.during.simulation.information.file=Could not save Error during simulation of {0} in his information file
isisfish.error.emigration.negative=emigration negative
isisfish.error.empty.code.rubbin=rubbin's code is empty
isisfish.error.empty.emigration=emigration empty
@@ -212,122 +184,31 @@
isisfish.error.empty.unit=measure unit is empty
isisfish.error.emty.emigration=emigration empty
isisfish.error.emty.migration=Migration empty
-isisfish.error.equation.retun.number=EquationImpl must retun a number\: {0}
-isisfish.error.evaluate.equation=Can''t evaluate equation\: {0}
-isisfish.error.evaluate.plan.script=Can''t evaluate plan script
-isisfish.error.evaluate.preplan.script=Can''t evaluate preplan script
-isisfish.error.evalute.plan.script=Can''t evaluate plan script
-isisfish.error.export.scripts.force=The export file {0} already exists, you MUST use option [force] pour force overwrite.
-isisfish.error.file.already.exists=The file {0} already exist
-isisfish.error.get.fisheryRegion=Can't get FisheryRegion
-isisfish.error.get.information.file=Can't get information on file {0]
-isisfish.error.get.status.files=Can't get status files\: {0}
-isisfish.error.growth.equation.before.create.group.population=Error, You must input growth equation before create the group population
isisfish.error.immigration.negative=immigration negative
isisfish.error.import.convertible=Erreur lors de l'import, la version du fichier que vous souhaitez importer n'est pas transformable en une version importable.
-isisfish.error.import.file=Can''t import file {0}
isisfish.error.import.recent.files=Erreur lors de l'import, la version du fichier que vous souhaitez importer est plus r\u00E9cente que la version souhait\u00E9e.
-isisfish.error.import.scripts.force=Some files already exist, you MUST use option [force] pour force overwrite.
isisfish.error.init.map=Can't init map.
-isisfish.error.init.remove.button=could not init remove button (button
-isisfish.error.instanciate=Can't instanciate {0}
-isisfish.error.instanciate.export=Can't instanciate export {0}
-isisfish.error.integer.positif=Your input must be a positif integer (>1)
-isisfish.error.invalid.category.name=The category's name {0} is not valid.
-isisfish.error.invalid.configuration=Configuration is not full, could not launch IsisFish, try again ?
-isisfish.error.invalid.configuration.title=Error while loading IsisFish
isisfish.error.invalid.costs.fix=les co\u00FBts fixes sont invalides
-isisfish.error.invalid.distribution.recruitment=distribution de recrutement invalide
isisfish.error.invalid.equation=Equation invalid
-isisfish.error.invalid.equation.name=Invalid equation name
-isisfish.error.invalid.file.name=The script name {0} is not valid.
isisfish.error.invalid.interval.reproduction.recruitment=interval entre la reproduction et le recrutement invalide
isisfish.error.invalid.mean.weight=poids moyen invalide
isisfish.error.invalid.natural.death=natural mortality on classes naissantes invalide
isisfish.error.invalid.number=the number is invalid
isisfish.error.invalid.range=La gamme possible n'a pas de valeur acceptable
-isisfish.error.invalid.simulation.id=Invalid simulation id {0}, availables \: {1}
-isisfish.error.invalid.simulation.index=Invalid simulation index {0}
-isisfish.error.invalid.simulation.index.availables=Invalid simulation index {0}, availables \: {1}
isisfish.error.invalid.values.params=Parametre controlable hors valeurs possibles
isisfish.error.invalidate.natural.death=natural mortality invalid
-isisfish.error.invalide.simulation.index=Invalide simulation index
-isisfish.error.invoke.method=Can't invoke method '{0}' for class {1}
-isisfish.error.load.class=Can't load class\: {0}
-isisfish.error.load.classloader=Can''t create ClassLoader for script, bad directory\: {0} for reason {1}
-isisfish.error.load.file=could not load file {0}
-isisfish.error.load.map=Can't load map file\: {0}
-isisfish.error.log.closeAppender=could not close appender {0} for category {1}
-isisfish.error.log.console.dispose=Une erreur est survenue pendant la fermeture de la console {0} de log, raison {1}
-isisfish.error.log.createAppender=could not create appender [{0}] \: {1} for reason {2}
-isisfish.error.log.foundAppender=\=could not found log appender {0} for category {1}
+isisfish.error.load.file",\ file));\ \ \ \ \ \ \ \ \ \ \ \ }\ finally\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ (reader\ \!=
+isisfish.error.load.map",\ filename),\ eee);\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ if(\!shapeLoaded){\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ a\ pas\ reussi\ a\ charger\ les\ fichiers\ demand\uFFFDs,\ on\ charge\ la\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ carte\ du\ monde\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ String\ filename\ =
isisfish.error.matrix.more.2d=Matrice de plus de 2 dimensions\!\!\\nSelectionnez moins d'\u00E9l\u00E9ments ou utilisez l'op\u00E9rateur somme.
isisfish.error.migration.negative=Migration negative
-isisfish.error.no.matrix=No matrix for\:
-isisfish.error.no.null.time.step=Error, the time step should not be null
+isisfish.error.no.matrix"\ +\ name));\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ resume.append("\\n\\n=
isisfish.error.no.sector=No sector defined
-isisfish.error.no.select.simulation=could not select simulation
-isisfish.error.no.selected.simulation=No Simulation selected
-isisfish.error.no.target.species=no target species in {0} for {1}
isisfish.error.not.connected=Error \: not connected
-isisfish.error.not.find.status=could not find status for file {0} for reason {1}
-isisfish.error.not.found.class=this class does not
-isisfish.error.not.found.code=could not found codeclass for {0}
-isisfish.error.not.found.description=could not found description for {0}
-isisfish.error.not.found.field=could not found field {0} doc for {0}
-isisfish.error.not.found.field.class=could not found field {0} for class {1}
-isisfish.error.not.found.species.population.container=Can't find species ({0}) for Population container
isisfish.error.not.null.class.grown=classe mature vaut nul
isisfish.error.not.null.mean.weight=poids moyen nul
isisfish.error.not.null.natiral.death=natural mortality null
isisfish.error.not.possible.metier=Pas de m\u00E9tier possible
-isisfish.error.not.species.node.population.container=Population container not in Species node
-isisfish.error.not.support.class=this class does not support
-isisfish.error.number.classes.upper.zero=Error, the number of classes must be upper than 0
-isisfish.error.obtain.analyseplan=Can''t obtain description of AnalysePlan
-isisfish.error.obtain.doc.export=Can''t obtain @Doc on class export
-isisfish.error.obtain.doc.resultName=Can't obtain @Doc on ResultName
-isisfish.error.obtain.doc.rule=Can't obtain description for a Rule class
-isisfish.error.obtain.field=Can''t obtain field @Doc for Rule {0}
-isisfish.error.obtain.field.analyseplan=Can''t obtain field @Doc for AnalysePlan {0}
-isisfish.error.obtain.information.file=could not obtain information file for simulation {0}
-isisfish.error.out.memory=Out of memory try with more memory (option -mx)
isisfish.error.overlap.season=Cette saison chevauche une autre saison
-isisfish.error.parse.date=Can''t parse date {0}
-isisfish.error.parse.long=Can''t parse long {0}
-isisfish.error.plan.parameter=Can't get plan parameter from compiled class
-isisfish.error.prepare.data=Can't prepare data
-isisfish.error.prepare.information.simulation=Can't prepare information for simulation
-isisfish.error.read.simulation=Can''t read simulation information {0}
-isisfish.error.read.simulation.parameters=Can''t read simulation parameters from file {0}
-isisfish.error.region.already.exists=This region already exists
-isisfish.error.region.name.empty=Region name is empty
-isisfish.error.remove.directory=Can''t remove directory {0}
-isisfish.error.remove.file=Can't remove file {0}
-isisfish.error.rename.region=Can't rename region to {0}
-isisfish.error.save.checkSum.compilation=Can't save checkSum to compilation\: {0}
-isisfish.error.save.region=Can't save region
-isisfish.error.save.script.compilation=Can't save script to compilation\: {0}
-isisfish.error.save.simulation.parameters=Can't save simulation parameters in file {0}
-isisfish.error.script.check=Can''t check file {0} for reason {1}
-isisfish.error.script.commit=Can''t commit file {0} for reason {1}
-isisfish.error.script.create=isisfish.error.script.create
-isisfish.error.script.delete=Can''t delete file {0} for reason {1}
-isisfish.error.script.diff=Can''t diff file {0} for reason {1}
-isisfish.error.script.evaluate=Can''t evaluate file {0} for reason {1}
-isisfish.error.script.export=Can''t export for reason {0}
-isisfish.error.script.import=Can''t import file for reason {0}
-isisfish.error.script.load=Can''t load file {0} for reason {1}
-isisfish.error.script.save=Can''t save file {0} for reason {1}
-isisfish.error.script.update=Can''t update file {0} for reason {1}
-isisfish.error.simulation.log.openAppender=could not open appender of simulation {0} for reason {1}
-isisfish.error.simulation.resultXml.close=Can't close simulation result XML for reason {0}
-isisfish.error.simulation.resultXml.open=Can't open simulation result XML for reason {0}
-isisfish.error.simulation.resultXml.write=Can't write simulation result XML for reason {0}
-isisfish.error.source.parameter=Can't get parameter from source
-isisfish.error.start=Can''t start
-isisfish.error.status.files=Can't get status files\: {0}
-isisfish.error.strategy.order=Strategy {0} don't have 12 StrategyMonthInfo but {1}. Recreate them
isisfish.error.text=The follow error occur during action
isisfish.error.title=Error
isisfish.error.undefined.classes=No classes defined
@@ -343,16 +224,8 @@
isisfish.error.undefined.zone.population=No population's zone defined
isisfish.error.undefined.zone.recruitment=No recrutment's zone defined
isisfish.error.undefined.zone.reproduction=No reprodution's zone defined
-isisfish.error.unsupported.equation.langage=unsupported langage ''{0}'' for equation\: {1}
-isisfish.error.update.file=Can''t update file ''{0}''
-isisfish.error.update.repository=Can't update local repository
-isisfish.error.vcs.connect=could not connect to vcs server, check the configuration... or contact us for help
-isisfish.error.vcs.no.anonymous.connection=
-isisfish.error.vcs.no.ssh.connection=could not connect with ssh configuration user {0}, private key {1}
-isisfish.error.vcs.pre.migrate=While migration, could not backup your old database {0} for reason {1}, a new database will be created at location {2}.
-isisfish.error.wait.simThread=Can't wait SimThread
-isisfish.error.while.simulation=error while simulation {0}
-isisfish.error.write.simulation=Can''t write information {0}
+isisfish.error.while.simulation",\ infos.getException()));\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ control.setText(I18n._("isisfish.message.stop.with.error=
+isisfish.error.while.simulation",\ infos.getException()));\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ control.setText(I18n._("isisfish.message.stop.with.error",infos.getException()));\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ I\ don't\ known\ if\ you\ can\ come\ here\ with\ no\ previous\ simulation\ ?\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (Exception\ e1)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn(I18n._("isisfish.error.obtain.information.file",\ e.getId()));\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ control.addPropertyChangeListener(this);\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ SimulationQueueListener\#simulationStart(fr.ifremer.isisfish.simulator.SimulationQueueEvent)\ \ \ \ \ */\ \ \ \ public\ void\ simulationStart(SimulationQueueEvent\ e)\ {\ \ \ \ \ \ \ \ //\ nothing\ to\ do\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ *\ @see\ SimulationQueueListener\#simulationStop(fr.ifremer.isisfish.simulator.SimulationQueueEvent)\ \ \ \ */\ \ \ \ public\ void\ simulationStop(SimulationQueueEvent\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ nothing\ to\ do\ \ \ \ }}//\ SimulationDoneQueueModel/*\ *\#\#%\ *\ Copyright\ (C)\ 2007\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ Benjamin\ Poussin\ *\ *\ 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\ 2\ *\ 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,\ write\ to\ the\ Free\ Software\ *\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.\ *\#\#%*//*\ *\ *\ SimulationResultGetter.java\ *\ *\ Created\:\ 13\ nov.\ 07\ 12\:00\:14\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 722\ $\ *\ *\ Last\ update\:\ $Date\:\ 2007-11-14\ 01\:16\:35\ +0100\ (mer,\ 14\ nov\ 2007)\ $\ *\ by\ \:\ $Author\:\ bpoussin\ $\ */package\ fr.ifremer.isisfish.simulator;import\ org.codelutin.math.matrix.MatrixND;import\ fr.ifremer.isisfish.types.Date;/**\ *\ Some\ SimulationResultListener\ can\ implement\ this\ interface\ to\ show\ that\ can\ *\ be\ used\ to\ retrieve\ result\ *\ \ *\ @author\ poussin\ */public\ interface\ SimulationResultGetter\ {\ \ \ \ /**\ \ \ \ \ *\ Retourne\ la\ matrice\ stocke\ pour\ un\ pas\ de\ temps\ \ \ \ \ *\ @param\ date\ le\ pas\ de\ temps\ que\ l'on\ souhaite\ \ \ \ \ *\ @param\ name\ le\ nom\ des\ resultats\ dont\ on\ veut\ la\ matrice\ \ \ \ \ *\ @return\ La\ matrice\ demand\uFFFDe\ ou\ null\ si\ aucune\ matrice\ ne\ correspond\ a\ \ \ \ \ *\ la\ demande.\ \ \ \ \ */\ \ \ \ \ public\ MatrixND\ getMatrix(SimulationContext\ context,\ Date\ date,\ String\ name);\ \ \ \ \ \ \ \ \ \ /**\ \ \ \ \ \ *\ Retourne\ une\ matrice\ contenant\ tous\ les\ pas\ de\ temps.\ \ \ \ \ \ *\ @param\ name\ le\ nom\ des\ resultats\ dont\ on\ veut\ une\ matrice\ globale.\ \ \ \ \ \ */\ \ \ \ \ public\ MatrixND\ getMatrix(SimulationContext\ context,\ String\ name);\ \ \ \ \ }/*\ *\#\#%\ *\ Copyright\ (C)\ 2002-2005\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ \ \ \ \ Benjamin\ Poussin\ *\ *\ 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\ 2\ *\ 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,\ write\ to\ the\ Free\ Software\ *\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.\ *\#\#%*//*\ **\ SimulatorServerBadIdException.java**\ Created\:\ Fri\ Sep\ \ 6\ 2002**\ @author\ \ <poussin at codelutin.com>*\ Copyright\ Code\ Lutin*\ @version\ $Revision\:\ 167\ $**\ Mise\ a\ jour\:\ $Date\:\ 2006-01-23\ 15\:00\:17\ +0100\ (lun,\ 23\ jan\ 2006)\ $*\ par\ \:\ $Author\:\ bpoussin\ $*/package\ fr.ifremer.isisfish.simulator;public\ class\ SimulatorServerBadIdException\ extends\ RuntimeException\ {\ //\ SimulatorServerBadIdException\ \ \ \ /**\ \ */\ \ \ \ private\ static\ final\ long\ serialVersionUID\ =
isisfish.exit.text=Something has change, please enter a comment
isisfish.exit.title=Exit
isisfish.export.directory=Export directory
@@ -375,8 +248,6 @@
isisfish.filter.log.tooltip.message=filter.log.tooltip.message
isisfish.filter.reset=filter.reset
isisfish.filter.result=filter.result
-isisfish.filter.select=filter.select
-isisfish.filter.select.simulation=select.simulation
isisfish.filter.simulation=filter.simulation
isisfish.filter.simulation.analysePlanNumber=analysePlanNumber
isisfish.filter.simulation.description=description
@@ -480,149 +351,35 @@
isisfish.input.selectNodeTree=Select node in tree
isisfish.input.title=Fishery Input
isisfish.launch.anonymous=read only
-isisfish.launch.debugMode=debug mode
isisfish.launch.email=email
-isisfish.launch.find.public.key=Public ssh key (*.pub) associated with the required private key
-isisfish.launch.first=First launch type vcs {0} - version {1}
isisfish.launch.firstname=firstname
-isisfish.launch.howto.save.key=Howto register your public ssh key in labs
-isisfish.launch.init.done=init done in {0}.
isisfish.launch.lasstname=lasstname
-isisfish.launch.save.key=Goto to labs for register your ssh public key
isisfish.launch.server.authenticationMethod=server access
isisfish.launch.server.login=server login
-isisfish.launch.server.ssh.confirm.change.method=Changing authentication method requires a migration at next launch, confirm this action.
-isisfish.launch.server.ssh.confirm.overwrite.key=Ssh key {0} already exists, confirm to overwrite.
isisfish.launch.server.ssh.confirm.passphrase=confirm passphrase
isisfish.launch.server.ssh.key.change=Change your ssh key
-isisfish.launch.server.ssh.key.clipboard=Your public key was copied in clipboard
isisfish.launch.server.ssh.key.generate=Generate ssh key
-isisfish.launch.server.ssh.key.generate.error=An error occurs while generating ssh key {0} ({1})
-isisfish.launch.server.ssh.key.generate.succes=The ssh key {0} was generated with success. Do you want to register it to labs ?
-isisfish.launch.server.ssh.key.no.key=No ssh key found or your have not selected ssh authentication method, really wants to go to labs ?
-isisfish.launch.server.ssh.key.register=Register your public ssh key in labs.
isisfish.launch.server.ssh.no.passphrase=no passphrase
isisfish.launch.server.ssh.passphrase=passphrase
isisfish.launch.server.ssh.privateKeyFile=private ssh key
isisfish.launch.server.ssh.publicKeyFile=public ssh key
isisfish.launch.ssh=read-write (ssh)
-isisfish.launch.start=Launching Isis-fish ... {0}
-isisfish.launch.stop=Stopping simulation...
-isisfish.launching=after init done in {0}.
-isisfish.log.addAppender=add appender [{0}]
isisfish.log.body=Message to add
-isisfish.log.closeAppender=closing appender {0} for category {1}
-isisfish.log.mail.failed=Can't send report by mail. Is your mail server up ? (I'm trying to contact the < {0} > smtp server)
-isisfish.log.mail.send=A report has been sent to {0}
-isisfish.log.mail.send.title=Send simulation {0} by email
+isisfish.log.mail.send.title",\ simulationFile.getName()));\ \ \ \ \ \ \ \ this.from\ =
isisfish.log.mailTo=Destination adress
-isisfish.log.removeAppender=remove appender [{0}]
-isisfish.log.restoreLogLevel=swap back level for logger {0} from level {1} to level {2}
isisfish.log.sendAll=Send the complete simulation archive
isisfish.log.sendMail=Send by email
-isisfish.log.simulation.name=IsisFish simulation {0}
-isisfish.log.swapLogLevel=swap level for logger {0} from level {1} to level{2}
isisfish.log.tooltip.body=The message will be join to email
isisfish.log.tooltip.mailTo=Enter destination adress
isisfish.log.tooltip.sendAll=Send the complete simulation archive, or just the log file
isisfish.log.tooltip.sendMail=Click here to send the email with files
-isisfish.message.add.cvs=Add from {0} files {1}.
-isisfish.message.add.objets.simulation=Add new objets simulation
-isisfish.message.add.queue={0} added to queue simulation
-isisfish.message.add.queue.remote={0} added to remote queue simulation
-isisfish.message.backup.database.finished=backup database finished
-isisfish.message.backup.database.progress=backup database in progress
-isisfish.message.cancel.finished=Cancel finished
-isisfish.message.check.finished=check finished
-isisfish.message.check.region=Check region ...
-isisfish.message.checking.cell=Checking cell
isisfish.message.choose.archive=choose archive file or directory
-isisfish.message.comment.region.modification=Enter comment about your region modification
-isisfish.message.commit=Commit the change
-isisfish.message.commit.cancelled=commit cancelled
-isisfish.message.commit.finished=commit finished
-isisfish.message.commit.region.canceled=Commit region canceled
-isisfish.message.commiting.region=Commiting region {0} ...
-isisfish.message.compilation.time=Compilation time {0}s
-isisfish.message.confirm.delete.object=Do you really want delete object {0}
-isisfish.message.confirm.remove.region=Do you really want to remove the region {0} ?
-isisfish.message.confirm.remove.script=Do you want to remove script ? ''{0}''
-isisfish.message.copy.finished=Copy finished
-isisfish.message.copy.region=Copy region to {0}
-isisfish.message.copy.revision=Working copy initialize fine... Revision \: [ {0} - {1} ]
-isisfish.message.create.region.canceled=Create region canceled
-isisfish.message.creating.region=Creating region {0}
-isisfish.message.creation.done=creation done {0}
-isisfish.message.creation.finished=Creation finished
-isisfish.message.delete.canceled=delete canceled
-isisfish.message.delete.entities=Delete entities
-isisfish.message.delete.entity=Delete entity
-isisfish.message.delete.finished=delete finished
-isisfish.message.delete.object=To delete object {0}, all next object will be deleted\\n\\n
-isisfish.message.diff.finished=file in state {0}
-isisfish.message.directory.not.exists=Parent directory of file {0} does not exists, Do you want to create it ?
-isisfish.message.evaluation.finished=evaluation finished
-isisfish.message.export.cancelled=export cancelled
-isisfish.message.export.done=export done
-isisfish.message.export.path.tozip=toZip {0}
-isisfish.message.export.result=zip {0} file(s) in {1} (size {2})
-isisfish.message.export.scripts.file=Export scripts to file {0}
-isisfish.message.export.zip=Export to zip file {0}
-isisfish.message.file.already.exists=File {0} already exists, Do you want to overwrite it ?
-isisfish.message.file.overwrite=File exists, do you want overwrite it ?
-isisfish.message.import=Import {0}
-isisfish.message.import.finished=Import finished
-isisfish.message.import.region.name=Enter name for imported region
-isisfish.message.import.region.xml=XMLed Region
-isisfish.message.import.region.zipped=Zipped Region
-isisfish.message.import.scripts.file=Import scripts from file {0}
-isisfish.message.import.scripts.file.cancelled=Import scripts cancelled
-isisfish.message.import.scripts.file.done=Import scripts done
-isisfish.message.import.scripts.zipped=Zipped Scripts
-isisfish.message.import.xml.v2.file\ =Import xml v2 file
-isisfish.message.import.zip=Import zip file
-isisfish.message.load.finished=load finished
-isisfish.message.load.map=Try to load map file\: {0} ({1}, {2})
-isisfish.message.load.region.canceled=load region canceled
-isisfish.message.loading.old.simulation=Loading old simulation ...
-isisfish.message.loading.region=Loading region ...
-isisfish.message.name.imported.region=Enter name for imported region
-isisfish.message.new.filename=Enter the name of the new file. (use only chars and _ and start with uppercase)
-isisfish.message.new.region.name=Enter new region name
-isisfish.message.no.diff=No diff found for file {0}, since it is a {1}
-isisfish.message.old.simulation.loaded=Old simulation loaded
-isisfish.message.page.modified=This page has been modified, do you want to save it ?
-isisfish.message.presimulation.script.execution=Presimulation Script execution
-isisfish.message.recruitment.number.month=Input the number of month of recruitment
-isisfish.message.region.commited=Region commited
-isisfish.message.region.loaded=Region loaded
-isisfish.message.region.remove.canceled=Region remove canceled
-isisfish.message.region.removed=Region removed
-isisfish.message.remove.canceled=Remove canceled
-isisfish.message.remove.files=Remove files {0}.
-isisfish.message.remove.finished=Remove finished
-isisfish.message.remove.unnecessary.cells=Remove unnecessary cells
-isisfish.message.removing.region=Removing region {0} ...
+isisfish.message.load.map",\ filename,\ shp,\ ssx));\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ addShapeLayer(filename,\ shp,\ ssx,\ "ff000000",\ "ffbdde83=
isisfish.message.result.verif.region=R\u00E9sultat de la v\u00E9rification de la r\u00E9gion
-isisfish.message.save.finished=save finished
-isisfish.message.saveModel.finished=Save model finished
-isisfish.message.search.data=Search data ...
-isisfish.message.setting.cache.aspects=Setting Cache aspects
-isisfish.message.setting.trace.aspects=Setting Trace aspects
-isisfish.message.simulation.ended=Simulation ended
-isisfish.message.simulation.execution=Simulation execution
-isisfish.message.spacialized.visualisation=Spacialized visualisation
-isisfish.message.stop.with.error=stop with error {0}
-isisfish.message.synchronize.done=synchronize done.
-isisfish.message.tray.disabled=SystemTray disabled
-isisfish.message.update.finished=update finished
isisfish.metier.comments=Comments
isisfish.metier.name=Name
isisfish.metier.rangeValues=Range of values
isisfish.metier.title=Metier
-isisfish.metierMonitor.metiers=Metiers
-isisfish.metierMonitor.strategies=Strategies
-isisfish.metierSeasonInfo.toString={0} season {1}-{2}
isisfish.metierSeasonInfoSpecies.mainSpecies=Main species for the metier
isisfish.metierSeasonInfoSpecies.selectSeason=Select a season
isisfish.metierSeasonInfoSpecies.selectSpecies=Select a species
@@ -632,44 +389,7 @@
isisfish.metierSeasonInfoZone.season=Season
isisfish.metierSeasonInfoZone.selectSeason=Select a season
isisfish.metierSeasonInfoZone.title=Seasons / Zones
-isisfish.migration.cvs.description=Migrate from CVS to SVN [v {0}]
-isisfish.migration.svn.protocol.description=Migrate from SVN [v {0} - {1}] to SVN [v {2} - {3}]
-isisfish.migration.svn.version.description=Migrate from SVN [v {0} - {1}] to SVN [v {2} - {3}]
isisfish.monitor.title=Application Monitor
-isisfish.month.april=april
-isisfish.month.august=august
-isisfish.month.december=december
-isisfish.month.february=february
-isisfish.month.january=january
-isisfish.month.july=july
-isisfish.month.june=june
-isisfish.month.march=march
-isisfish.month.may=may
-isisfish.month.november=november
-isisfish.month.october=october
-isisfish.month.september=september
-isisfish.option.description.addScript=
-isisfish.option.description.changeConfig=
-isisfish.option.description.changeFileConfig=
-isisfish.option.description.createSshKey=
-isisfish.option.description.editConfig=
-isisfish.option.description.exportData=
-isisfish.option.description.exportScript=
-isisfish.option.description.help=
-isisfish.option.description.helpConfig=
-isisfish.option.description.import=
-isisfish.option.description.importAndRenameRegion=
-isisfish.option.description.list=
-isisfish.option.description.mavenFile=
-isisfish.option.description.resetConfig=
-isisfish.option.description.showConfig=
-isisfish.option.description.simulate=
-isisfish.option.description.sshKeyFile=
-isisfish.option.description.ui=
-isisfish.option.description.update=
-isisfish.option.description.vcsAddRemove=
-isisfish.option.description.vcsUpdateCommitState=
-isisfish.params.changeLogLev=Change from level ''{0}'' to level ''{1}''
isisfish.params.clearFilter=Clear filter
isisfish.params.description=Description
isisfish.params.filter=Filter
@@ -680,31 +400,9 @@
isisfish.params.ruleParameters=Rule's parameters
isisfish.params.simulationName=Simulation name
isisfish.params.title=Parameters
-isisfish.params.toString.fishery=P\u00EAcherie\: {0}\\n\\n
-isisfish.params.toString.lib.logger.level=Level of libraries' logger {0}
-isisfish.params.toString.number.years=Number of years\: {0}\\n\\n
-isisfish.params.toString.plan=Plan\: {0}
-isisfish.params.toString.plan.number=Analyse plan sequence number\: {0}\\n\\n
-isisfish.params.toString.populations=Populations\:
-isisfish.params.toString.rule=Rule\: {0}
-isisfish.params.toString.script.logger.level=Level of scripts' logger {0}
-isisfish.params.toString.script.presimulation=Script de presimulation
-isisfish.params.toString.simul.logger.level=Level of simulator's logger {0}
-isisfish.params.toString.simulation.done=Simulation done with {0}\:
-isisfish.params.toString.strategies=Strat\u00E9gies d'exploitation\:
isisfish.params.useAnalysePlan=Use analyse plan
isisfish.params.usePreSimulationScript=Use pre simulation script
-isisfish.population.capturability=Capturability
isisfish.population.comments=Comments
-isisfish.population.group=Group
-isisfish.population.groups=Groups
-isisfish.population.mappingZoneReproZoneRecru=MappingZoneReproZoneRecru
-isisfish.population.matrixAbundance=matrixAbundance
-isisfish.population.matrixAbundance1D=matrixAbundance1D
-isisfish.population.recruitment=Recruitment
-isisfish.population.reproduction=Reproduction
-isisfish.population.season=Season
-isisfish.population.zones=Zones
isisfish.populationBasics.geographicID=geographicID
isisfish.populationBasics.growth=growth
isisfish.populationBasics.growthReverse=growthReverse
@@ -729,7 +427,6 @@
isisfish.populationGroup.price=price
isisfish.populationGroup.reproductionRate=reproductionRate
isisfish.populationGroup.title=inputPopulationGroup
-isisfish.populationGroup.toString={0} Group {1}
isisfish.populationMigration.comments=Comments
isisfish.populationMigration.selectSeason=Select a season
isisfish.populationMigration.title=inputPopulationMigration
@@ -749,15 +446,6 @@
isisfish.populationRecruitment.recruitmentDistribution=Recruitment Distribution
isisfish.populationRecruitment.reproductionEquation=ReproductionEquation
isisfish.populationRecruitment.title=inputPopulationRecruitment
-isisfish.populationSeasonInfo.arrival=Arrival
-isisfish.populationSeasonInfo.departure=Departure
-isisfish.populationSeasonInfo.distributionSpawing=Distribution of spawing
-isisfish.populationSeasonInfo.emigration=Emigration
-isisfish.populationSeasonInfo.group=Group
-isisfish.populationSeasonInfo.immigration=Immigration
-isisfish.populationSeasonInfo.migration=Migration
-isisfish.populationSeasonInfo.months=Months
-isisfish.populationSeasonInfo.toString={0} season {1}-{2}
isisfish.populationSeasons.Reproduction=Reproduction
isisfish.populationSeasons.changeGroup=Change of group
isisfish.populationSeasons.comments=Comments
@@ -780,14 +468,8 @@
isisfish.preScript.backParameter=Back to parameter tab
isisfish.preScript.title=Pre simulation script
isisfish.queue.cancelled=cancelled
-isisfish.queue.id=id
-isisfish.queue.local=Local
-isisfish.queue.name=Queue
-isisfish.queue.plan=Plan
-isisfish.queue.progression=Progression
isisfish.queue.showLog=Show simulation log
isisfish.queue.simulationLaunch=Simulation queue launch
-isisfish.queue.status=Status
isisfish.queue.stopSimulation=Stop simulation
isisfish.queue.title=Queue
isisfish.result.abundance=Abondance
@@ -802,7 +484,6 @@
isisfish.result.dimension\ =Dimension
isisfish.result.end.simulation=En fin de Simulation\:
isisfish.result.export=Export
-isisfish.result.export.file=Export text file
isisfish.result.file=File
isisfish.result.graph=Graph
isisfish.result.graphRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.graphRadioButton
@@ -895,7 +576,6 @@
isisfish.script.title=Script Editor
isisfish.script.txtExport=txtExport
isisfish.script.update=Update
-isisfish.season.toString=season {0}-{1}
isisfish.selectivity.equation=Equation
isisfish.selectivity.selectPopulation=Select a population
isisfish.selectivity.title=Selectivity
@@ -930,8 +610,6 @@
isisfish.simpleResult.resultatMap=defaultToolTip-fr.ifremer.isisfish.map.SimpleIsisMapBeanBean.resultatMap
isisfish.simpleResult.resultatMapToolBar=defaultToolTip-fr.ifremer.isisfish.map.SimpleIsisMapBeanBean.resultatMapToolBar
isisfish.simpleResult.table=defaultToolTip-fr.ifremer.isisfish.map.SimpleResultatMapBean.table12
-isisfish.simulation.log.console.title=Log console for simulation ''{0}''
-isisfish.simulation.log.showConsole=display log console for simulation {0}
isisfish.simulation.menu.about=About
isisfish.simulation.menu.close=Close
isisfish.simulation.menu.file=File
@@ -952,16 +630,9 @@
isisfish.strategy.name=name
isisfish.strategy.proportionSetOfVessels=proportionSetOfVessels
isisfish.strategy.title=Caracteristics
-isisfish.strategyMonthInfo.metier=Metier
isisfish.strategyMonthInfo.minInactivityDays=minInactivityDays
isisfish.strategyMonthInfo.numberOfTrips=numberOfTrips
-isisfish.strategyMonthInfo.proportion=Proportion
isisfish.strategyMonthInfo.title=StrategyMonthInfo
-isisfish.strategyMonthInfo.toString={0} {1}
-isisfish.timeUnit.day=Day
-isisfish.timeUnit.hours=Hours
-isisfish.tray.simulation=<b>Isis-fish<b><p>{0} - {1}/{2}
-isisfish.tray.simulation.no=<b>Isis-fish<b><p><i>No simulation<i>
isisfish.tripType.comments=Comments
isisfish.tripType.duration=Duration
isisfish.tripType.minTime=Minimum time between trips
@@ -973,9 +644,6 @@
isisfish.vcs.commit.cancel=vcs.commit.cancel
isisfish.vcs.commit.label=vcs.commit.label
isisfish.vcs.commit.ok=vcs.commit.ok
-isisfish.vcs.config.title=Vcs configuration Modifier
-isisfish.vcs.configuration.title=VCS server configuration
-isisfish.vcs.migrate.end=Migration done in {0}s.<br/>New database in is located at [{1}]
isisfish.vcs.update=vcs.update
isisfish.vcs.update.cancel=cancel
isisfish.vcs.update.checkAll=checkAll
@@ -1002,7 +670,6 @@
isisfish.vcs.updateconfirm.label2=
isisfish.vcs.updateconfirm.ok=ok
isisfish.vcs.updateconfirm.tooltip.checkAll=
-isisfish.versionStorage.removed=Removed
isisfish.vesselType.activityRange=Activity range
isisfish.vesselType.comments=Comments
isisfish.vesselType.fuelCost=Fuel cost of travel
@@ -1046,36 +713,4 @@
isisfish.zone.comments=Comments
isisfish.zone.name=Name
isisfish.zone.title=inputZone
-lutinutil.common.action=Action
-lutinutil.common.file=File
-lutinutil.common.logDiff=show diff
-lutinutil.common.module=Module
-lutinutil.common.rev=Revision
-lutinutil.common.select=Select
-lutinutil.error.checkout.dir=Can''t checkout dir {0}
-lutinutil.error.fieldmodel.already.registred=FieldAccess [{0}] is already registred
-lutinutil.error.fieldmodel.not.registred=could not found a matching entry in cache for [{0}]
-lutinutil.error.fieldmodel.unmatchin.options=you can not defined a such model with no the same number of optionClass and optionNames
-lutinutil.error.init.config=config is not init, you should invoke on the config validate(true) method to validate it and finish his init {0}
-lutinutil.error.init.no.config=should invoke {0}\#init(VCSType,Properties) before required instance.
-lutinutil.vcs.action.add=add
-lutinutil.vcs.action.changeLog=changeLog
-lutinutil.vcs.action.checkout=checkout
-lutinutil.vcs.action.commit=commit
-lutinutil.vcs.action.delete=delete
-lutinutil.vcs.action.diff=diff
-lutinutil.vcs.action.overwriteAndUpdate=overwriteAndUpdate
-lutinutil.vcs.action.revert=revert
-lutinutil.vcs.action.update=update
-lutinutil.vcs.state.missing=missing
-lutinutil.vcs.state.modified=modified
-lutinutil.vcs.state.outofdate=outofdate
-lutinutil.vcs.state.outofdateAndModified=outofdateAndModified
-lutinutil.vcs.state.unknown=unknown
-lutinutil.vcs.state.unversionned=unversionned
-lutinutil.vcs.state.unversionnedOrMissing=unversionnedOrMissing
-lutinutil.vcs.state.uptodate=uptodate
-no\ properties\ found\ or\ unsafe\ properties\ found\ {0}=no properties found or unsafe properties found {0}
-the\ property\ {0}\ is\ mandatory\ but\ missed.=the property {0} is mandatory but missed.
-to\ use\ ssh\ authentication\ mode,\ you\ must\ have\ a\ username.\ {0}.=to use ssh authentication mode, you must have a username. {0}.
-to\ use\ ssh\ authentication\ mode,\ you\ must\ have\ an\ existing\ private\ key\ {0}\ \:\ {1}.=to use ssh authentication mode, you must have an existing private key {0} \: {1}.
+null)\ {\ \ \ \ \ \ \ \ \ \ \ \ logMail\ =
Modified: trunk/isis-fish/src/resources/i18n/isis-fish-fr_FR.properties
===================================================================
--- trunk/isis-fish/src/resources/i18n/isis-fish-fr_FR.properties 2008-08-04 16:48:31 UTC (rev 1280)
+++ trunk/isis-fish/src/resources/i18n/isis-fish-fr_FR.properties 2008-08-04 16:59:55 UTC (rev 1281)
@@ -1,17 +1,78 @@
-Can''t\ add\ result\ ''{0}''\ at\ date\ {1}=Can''t add result ''{0}'' at date {1}
-Can''t\ evaluate\ simulation\ prescript=Can''t evaluate simulation prescript
-Can''t\ get\ result\:\ {0}=Can''t get result\: {0}
-Can't\ create\ simulation\ logger=Can't create simulation logger
-Can't\ instanciate\ export\ {0}=Can't instanciate export {0}
-Checkout\ pom.xml\ to\ {0}=
+=
+\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ new\ JInternalFrame(simulation.getName(),\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ true,\ //resizable\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ true,\ //closable\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ true,\ //maximizable\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ true);//iconifiable\ \ \ \ \ \ \ \ \ \ \ \ intFrame.setContentPane(resEdit.getRootPane());\ \ \ \ \ \ \ \ \ \ \ \ intFrame.setVisible(true);\ \ \ \ \ \ \ \ \ \ \ \ //\t\ \ \ \ intFrame.pack();\ \ \ \ \ \ \ \ \ \ \ \ intFrame.setSize(new\ Dimension(800,700));\ \ \ \ \ \ \ \ \ \ \ \ getDesktopPane().add(intFrame);\ \ \ \ \ \ \ \ \ \ \ \ try{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ intFrame.setSelected(true);\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (PropertyVetoException\ eee)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn("Error\ dans\ l\ internalFrame\ ",\ eee);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ void\ on_voirSimulationLogButton_clicked()\ {\ \ \ \ \ \ \ \ String\ name\ =
+\ (String)getSimulation().getSelectedItem();\ \ \ \ \ \ \ \ if\ (name\ \!=
+\ (String)getSimulation().getSelectedItem();\ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ SimulationLoggerUtil.showSimulationLogConsole(name);\ \ \ \ \ \ \ \ }\ catch\ (Exception\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ ignore\ ?\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ void\ on_filterSimulationLogButton_clicked()\ {\ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ List<String>\ result\ =
+\ -5643196187139951889L;\ \ \ \ public\ SimulationException(String\ msg)\ {\ \ \ \ \ \ \ \ super(msg);\ \ \ \ }\ \ \ \ public\ SimulationException(String\ msg,\ Throwable\ e)\ {\ \ \ \ \ \ \ \ super(msg,\ e);\ \ \ \ }}\ //\ SimulationException/*\ *\#\#%\ *\ Copyright\ (C)\ 2007\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ Benjamin\ Poussin\ *\ *\ 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\ 2\ *\ 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,\ write\ to\ the\ Free\ Software\ *\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.\ *\#\#%*//*\ *\ *\ SimulationResultListener.java\ *\ *\ Created\:\ 13\ nov.\ 07\ 11\:59\:53\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 739\ $\ *\ *\ Last\ update\:\ $Date\:\ 2007-11-20\ 18\:46\:38\ +0100\ (mar,\ 20\ nov\ 2007)\ $\ *\ by\ \:\ $Author\:\ bpoussin\ $\ */package\ fr.ifremer.isisfish.simulator;import\ org.codelutin.math.matrix.MatrixND;import\ fr.ifremer.isisfish.IsisFishException;import\ fr.ifremer.isisfish.types.Date;/**\ *\ @author\ poussin\ *\ */public\ interface\ SimulationResultListener\ extends\ SimulationListener\ {\ \ \ \ \ \ \ \ public\ void\ addResult(SimulationContext\ context,\ \ \ \ \ \ \ \ \ \ \ \ Date\ date,\ String\ name,\ MatrixND\ mat)\ throws\ IsisFishException;\ \ \ \ }/*\ *\#\#%\ *\ Copyright\ (C)\ 2006\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ Benjamin\ Poussin\ *\ *\ 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\ 2\ *\ 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,\ write\ to\ the\ Free\ Software\ *\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.\ *\#\#%*//*\ *\ *\ SimulationQueueEvent.java\ *\ *\ Created\:\ 17\ ao\uFFFDt\ 2006\ 22\:00\:41\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 217\ $\ *\ *\ Last\ update\:\ $Date\:\ 2006-08-21\ 17\:43\:41\ +0200\ (lun,\ 21\ ao\u00FB\ 2006)\ $\ *\ by\ \:\ $Author\:\ bpoussin\ $\ */package\ fr.ifremer.isisfish.simulator;import\ java.util.EventObject;/**\ *\ @author\ poussin\ *\ */public\ class\ SimulationQueueEvent\ extends\ EventObject\ {\ \ \ \ /**\ simulation\ id\ */\ \ \ \ protected\ String\ id;\ \ \ \ \ \ \ \ /**\ \ \ \ \ *\ @param\ source\ \ \ \ \ */\ \ \ \ public\ SimulationQueueEvent(Object\ source,\ String\ id)\ {\ \ \ \ \ \ \ \ super(source);\ \ \ \ \ \ \ \ this.id\ =
+\ 0)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ this\ is\ the\ all\ levels\ reader\ to\ create,\ depends\ on\ no\ others\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ reader\ =
+\ 0;\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ //log.debug("\ offset\:"\ +\ offset\ +\ "\ width\:"\ +\ model.nbLinesInEditor);\ \ \ \ \ \ \ \ String[]\ result;\ \ \ \ \ \ \ \ //\ obtain\ lines\ from\ reader\ \ \ \ \ \ \ \ result\ =
+\ 4449196856169240128L;\ \ \ \ public\ SimulatorServerBadIdException(String\ msg)\ {\ \ \ \ \ \ \ \ super(msg);\ \ \ \ }\ \ \ \ public\ SimulatorServerBadIdException(String\ msg,\ Throwable\ e)\ {\ \ \ \ \ \ \ \ super(msg,\ e);\ \ \ \ }}\ //\ SimulatorServerBadIdException/*\ *\#\#%\ *\ Copyright\ (C)\ 2002-2005\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ \ \ \ \ Benjamin\ Poussin\ *\ *\ 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\ 2\ *\ 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,\ write\ to\ the\ Free\ Software\ *\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.\ *\#\#%*//*\ *\ *\ SimulationException.java\ *\ *\ Created\:\ Wed\ Aug\ 14\ 2002\ *\ *\ @author\ \ <poussin at codelutin.com>\ *\ @version\ $Revision\:\ 167\ $\ *\ *\ Mise\ a\ jour\:\ $Date\:\ 2006-01-23\ 15\:00\:17\ +0100\ (lun,\ 23\ jan\ 2006)\ $\ *\ par\ \:\ $Author\:\ bpoussin\ $\ */package\ fr.ifremer.isisfish.simulator;public\ class\ SimulationException\ extends\ RuntimeException\ {\ //\ SimulationException\ \ \ \ /**\ \ */\ \ \ \ private\ static\ final\ long\ serialVersionUID\ =
+\ IsisConfig.Module.REGION;\ \ \ \ \ \ \ \ if\ (create)\ {\ \ \ \ \ \ \ \ \ \ \ \ doCheckoutModule(handler,module,category);\ \ \ \ \ \ \ \ }\ else\ {\ \ \ \ \ \ \ \ \ \ \ \ File\ f\ =
+\ IsisConfig.getResultExportDirectory(rootDirectory);\ \ \ \ \ \ \ \ \ \ \ \ exportDir.mkdirs();\ \ \ \ \ \ \ \ \ \ \ \ ExportHelper.doExport(simulation,\ exportDir,\ parameters.getExportNames(),\ rootDirectory);\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ fr.ifremer.isisfish.simulator.SimulationListener\#beforeSimulation(fr.ifremer.isisfish.simulator.SimulationContext)\ \ \ \ \ */\ \ \ \ public\ void\ beforeSimulation(SimulationContext\ context)\ {\ \ \ \ }}/*\ *\#\#%\ *\ Copyright\ (C)\ 2006\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ Benjamin\ Poussin\ *\ *\ 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\ 2\ *\ 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,\ write\ to\ the\ Free\ Software\ *\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.\ *\#\#%*//*\ *\ *\ MetierMonitor.java\ *\ *\ Created\:\ 21\ ao\uFFFDt\ 2006\ 15\:43\:19\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 652\ $\ *\ *\ Last\ update\:\ $Date\:\ 2007-11-08\ 15\:04\:16\ +0100\ (jeu,\ 08\ nov\ 2007)\ $\ *\ by\ \:\ $Author\:\ ruchaud\ $\ */package\ fr.ifremer.isisfish.simulator;import\ static\ org.codelutin.i18n.I18n.n_;import\ java.util.ArrayList;import\ java.util.Collection;import\ java.util.HashMap;import\ java.util.HashSet;import\ java.util.List;import\ java.util.Map;import\ java.util.Set;import\ org.apache.commons.collections.MapIterator;import\ org.apache.commons.collections.keyvalue.MultiKey;import\ org.apache.commons.collections.map.MultiKeyMap;import\ org.apache.commons.logging.Log;import\ org.apache.commons.logging.LogFactory;import\ org.codelutin.math.matrix.MatrixFactory;import\ org.codelutin.math.matrix.MatrixND;import\ org.codelutin.topia.TopiaContext;import\ org.codelutin.topia.TopiaException;import\ fr.ifremer.isisfish.IsisFishRuntimeException;import\ fr.ifremer.isisfish.entities.Metier;import\ fr.ifremer.isisfish.entities.SetOfVessels;import\ fr.ifremer.isisfish.entities.Strategy;import\ fr.ifremer.isisfish.entities.StrategyMonthInfo;import\ fr.ifremer.isisfish.types.Date;import\ fr.ifremer.isisfish.types.Month;/**\ *\ ATTENTION\:\ l'implantation\ de\ cette\ classe\ n'est\ peut-etre\ pas\ correct.\ Il\ faut\ *\ absolument\ verifier\ le\ FIXME,\ mais\ il\ est\ difficile\ de\ le\ faire\ car\ *\ la\ plupart\ des\ methodes\ de\ cette\ objets\ ne\ semble\ plus\ utilis\uFFFD\ dans\ la\ *\ version\ 2.3.x\ de\ isis\ *\ \ *\ @author\ poussin\ */public\ class\ MetierMonitor\ {\ \ \ \ /**\ to\ use\ log\ facility,\ just\ put\ in\ your\ code\:\ log.info(\\"...\\=
+\ IsisContext.get().getMainConfig().getDefaultMapFile();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ String\ shp\ =
+\ LogLevelUtil.getLogLevels(levels);\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ create\ the\ levels\ reader\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ reader\ =
+\ Session.getDefaultInstance(props,\ null);\ \ \ \ \ \ \ \ //\ --\ Create\ a\ new\ message\ --\ \ \ \ \ \ \ \ Message\ msg\ =
+\ SimulationFilterUtil.createFilterModel(value);\ \ \ \ \ \ \ \ //\ to\ used\ directly\ model.getFilteredResult()\ in\ xml\ \ \ \ \ \ \ \ //\ we\ must\ fill\ filterModel\ result\ with\ original\ items\ \ \ \ \ \ \ \ filterModel.selectAll();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ getSimulation().setEditable(false);\ \ \ \ \ \ \ \ model\ =
+\ SimulationFilterUtil.filterSimulation(filterModel);\ \ \ \ \ \ \ \ \ \ \ \ model.removeAllElements();\ \ \ \ \ \ \ \ \ \ \ \ for\ (String\ s\ \:\ result)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ model.addElement(s);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ catch\ (Exception\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ log.warn(I18n._("could\ not\ filter\ on\ simulations=
+\ SimulationStorage.getSimulation(name);\ \ \ \ \ \ \ \ \ \ \ \ ResultEdit\ resEdit\ =
+\ SimulationStorage.getSimulation(name);\ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ storage.delete(false);\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ initSimulation();\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (Exception\ eee)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn("Can't\ delete\ simulation",\ eee);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ void\ on_openWindowButton_clicked(){\ \ \ \ \ \ \ \ String\ name\ =
+\ System.getProperties();\ \ \ \ \ \ \ \ //\ --\ Attaching\ to\ default\ Session,\ or\ we\ could\ start\ a\ new\ one\ --\ \ \ \ \ \ \ \ props.put("mail.smtp.host",\ smtpServer);\ \ \ \ \ \ \ \ Session\ session\ =
+\ context.getSimulationStorage();\ \ \ \ \ \ \ \ SimulationParameter\ parameters\ =
+\ e.getId();\ \ \ \ \ \ \ \ SimulationControl\ control\ =
+\ e.getUnitsToScroll();\ \ \ \ \ \ \ \ long\ newOffset;\ \ \ \ \ \ \ \ newOffset\ =
+\ evt.getPropertyName();\ \ \ \ \ \ \ \ if\ (properyName.equals(LogConsole.DISPOSE_CHANGED_PROPERTY))\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ ui\ required\ a\ dispose\ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ close();\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (Exception\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn(_("isisfish.error.log.console.dispose"\ ,this,e.getMessage()));\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ return;\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ //log.info(properyName\ +\ "\ \:\ "\ +\ evt.getNewValue());\ \ \ \ \ \ \ \ if\ (properyName.equals(RESET_CHANGED_PROPERTY))\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ reset\ filter\ model\ \ \ \ \ \ \ \ \ \ \ \ model.setLevels(0);\ \ \ \ \ \ \ \ \ \ \ \ model.setSearchText("=
+\ false;\ \ \ \ }\ \ \ \ public\ void\ propertyChange(PropertyChangeEvent\ evt)\ {\ \ \ \ \ \ \ \ String\ properyName\ =
+\ filename\ +\ ".shp";\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ String\ ssx\ =
+\ filename\ +\ ".ssx";\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ addShapeLayer(filename,\ shp,\ ssx,\ "ff000000",\ "ffbdde83=
+\ from;\ \ \ \ \ \ \ \ this.logFile\ =
+\ getRowCount();\ \ \ \ \ \ \ \ fireTableRowsInserted(row,\ row);\ \ \ \ \ \ \ \ SimulationControl\ control\ =
+\ getSimulationControl(e.getId());\ \ \ \ \ \ \ \ control.addPropertyChangeListener(this);\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ SimulationQueueListener\#simulationRemoved(fr.ifremer.isisfish.simulator.SimulationQueueEvent)\ \ \ \ \ */\ \ \ \ public\ void\ simulationWillBeRemoved(SimulationQueueEvent\ e)\ {\ \ \ \ \ \ \ \ String\ id\ =
+\ getSimulationControl(e.getId());\ \ \ \ \ \ \ \ if\ (control\ \!=
+\ getSimulationIndex(id);\ \ \ \ \ \ \ \ if\ (isRowIndexValid(row))\ {\ \ \ \ \ \ \ \ \ \ \ \ fireTableRowsDeleted(row,\ row);\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ progress.remove(id);\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ SimulationQueueListener\#simulationStart(fr.ifremer.isisfish.simulator.SimulationQueueEvent)\ \ \ \ \ */\ \ \ \ public\ void\ simulationStart(SimulationQueueEvent\ e)\ {\ \ \ \ \ \ \ \ //\ nothing\ to\ do\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ *\ @see\ SimulationQueueListener\#simulationStop(fr.ifremer.isisfish.simulator.SimulationQueueEvent)\ \ \ \ */\ \ \ \ public\ void\ simulationStop(SimulationQueueEvent\ e)\ {\ \ \ \ \ \ \ \ //\ nothing\ to\ do\ \ \ \ }}\ //\ SimulationQueueModel/*\ *\#\#%\ *\ Copyright\ (C)\ 2007\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ Benjamin\ Poussin\ *\ *\ 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\ 2\ *\ 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,\ write\ to\ the\ Free\ Software\ *\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.\ *\#\#%*//*\ *\ *\ SimulationExportResultWrapper.java\ *\ *\ Created\:\ 14\ nov.\ 07\ 00\:22\:51\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 1128\ $\ *\ *\ Last\ update\:\ $Date\:\ 2008-01-08\ 20\:21\:28\ +0100\ (mar,\ 08\ jan\ 2008)\ $\ *\ by\ \:\ $Author\:\ tchemit\ $\ */package\ fr.ifremer.isisfish.simulator;import\ java.io.File;import\ fr.ifremer.isisfish.IsisConfig;import\ fr.ifremer.isisfish.datastore.SimulationStorage;import\ fr.ifremer.isisfish.export.ExportHelper;/**\ *\ @author\ poussin\ *\ */public\ class\ SimulationExportResultWrapper\ implements\ SimulationListener\ {\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ fr.ifremer.isisfish.simulator.SimulationListener\#afterSimulation(fr.ifremer.isisfish.simulator.SimulationContext)\ \ \ \ \ */\ \ \ \ public\ void\ afterSimulation(SimulationContext\ context)\ {\ \ \ \ \ \ \ \ SimulationStorage\ simulation\ =
+\ getSimulationNames();\ \ \ \ \ \ \ \ //\ create\ filter\ model\ \ \ \ \ \ \ \ filterModel\ =
+\ id;\ \ \ \ }\ \ \ \ \ \ \ \ /**\ \ \ \ \ *\ @return\ Returns\ the\ id.\ \ \ \ \ */\ \ \ \ public\ String\ getId()\ {\ \ \ \ \ \ \ \ return\ this.id;\ \ \ \ }\ \ \ \ }/*\ *\#\#%\ *\ Copyright\ (C)\ 2006\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ Benjamin\ Poussin\ *\ *\ 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\ 2\ *\ 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,\ write\ to\ the\ Free\ Software\ *\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.\ *\#\#%*//*\ *\ *\ PopulationMonitor.java\ *\ *\ Created\:\ 21\ ao\uFFFDt\ 2006\ 15\:41\:18\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 428\ $\ *\ *\ Last\ update\:\ $Date\:\ 2007-10-15\ 14\:56\:13\ +0200\ (lun,\ 15\ oct\ 2007)\ $\ *\ by\ \:\ $Author\:\ bpoussin\ $\ */package\ fr.ifremer.isisfish.simulator;import\ java.util.ArrayList;import\ java.util.HashMap;import\ java.util.List;import\ java.util.Map;import\ org.apache.commons.collections.MapIterator;import\ org.apache.commons.collections.keyvalue.MultiKey;import\ org.apache.commons.collections.map.MultiKeyMap;import\ org.apache.commons.logging.Log;import\ org.apache.commons.logging.LogFactory;import\ org.codelutin.math.matrix.MatrixFactory;import\ org.codelutin.math.matrix.MatrixIterator;import\ org.codelutin.math.matrix.MatrixND;import\ fr.ifremer.isisfish.entities.Population;import\ fr.ifremer.isisfish.entities.PopulationGroup;import\ fr.ifremer.isisfish.entities.PopulationSeasonInfo;import\ fr.ifremer.isisfish.entities.Species;import\ fr.ifremer.isisfish.entities.Zone;import\ fr.ifremer.isisfish.types.Date;import\ fr.ifremer.isisfish.types.Month;/**\ *\ \ *\ @author\ poussin\ */public\ class\ PopulationMonitor\ {\ \ \ \ \ \ \ \ /**\ to\ use\ log\ facility,\ just\ put\ in\ your\ code\:\ log.info(\\"...\\=
+\ levels\ +\ "";\ \ \ \ \ \ \ \ LevelsLineReader\ reader\ =
+\ levelsReader;\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ if\ (reader\ =
+\ logFile;\ \ \ \ \ \ \ \ this.simulationFile\ =
+\ model.getFirstLinePosition()\ +\ unitsToScroll;\ \ \ \ \ \ \ \ if\ (unitsToScroll\ >\ 0)\ {\ \ \ \ \ \ \ \ \ \ \ \ if\ (model.isEOF())\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ nothing\ to\ do\ we\ are\ already\ at\ the\ tail\ of\ the\ stream\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ return;\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ else\ {\ \ \ \ \ \ \ \ \ \ \ \ if\ (model.isBOF())\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ nothing\ to\ do\ we\ are\ already\ at\ the\ head\ of\ the\ stream\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ return;\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ dontAdjust\ =
+\ module.getClazz().getMethod("checkout",String.class);\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ method.invoke(module.getClazz(),category);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ catch\ (Exception\ eee)\ {\ \ \ \ \ \ \ \ \ \ \ \ log.warn(org.codelutin.i18n.I18n._("isisfish.error.checkout.module",\ f.getAbsolutePath()),\ eee);\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ static\ void\ doCheckoutRegion(VCSHandler\ handler,\ \ String\ category,boolean\ create)\ {\ \ \ \ \ \ \ \ IsisConfig.Module\ module\ =
+\ new\ DefaultComboBoxModel(value.toArray());\ \ \ \ \ \ \ \ getSimulation().setModel(model);\ \ \ \ \ \ \ \ getSimulation().setSelectedItem(null);\ \ \ \ }\ \ \ \ public\ void\ on_Resultat_destroy_event(){\ \ \ \ \ \ \ \ dispose();\ \ \ \ }\ \ \ \ public\ void\ on_simulation_selection_notify_event(ItemEvent\ e){\ \ \ \ \ \ \ \ //\tsetSelectedSimulation((Simulation)getSimulation().getSelectedItem());\ \ \ \ }\ \ \ \ /**\ \ \ \ *\ Get\ the\ value\ of\ selectedSimulation.\ \ \ \ *\ @return\ value\ of\ selectedSimulation.\ \ \ \ */\ \ \ \ //\ \ \ \ public\ Simulation\ getSelectedSimulation()\ {\ \ \ \ \ \ \ \ //return\ selectedSimulation;\ \ \ \ //}\ \ \ \ /**\ \ \ \ *\ Set\ the\ value\ of\ selectedSimulation.\ \ \ \ *\ @param\ v\ \ Value\ to\ assign\ to\ selectedSimulation.\ \ \ \ */\ \ \ \ //public\ void\ setSelectedSimulation(Simulation\ v)\ {\ \ \ \ \ \ \ \ //this.selectedSimulation\ =
+\ new\ File(module.getDirectory(),category);\ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ (\!f.exists()||\ \!VCSHelper.isFileInWorkingCopy(f,\ handler,true))\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ fr.ifremer.isisfish.datastore.RegionStorage.checkout(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ handler.getLocalDatabasePath(),\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ module.value()\ +\ "/"\ +category\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ );\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (Exception\ eee)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn(org.codelutin.i18n.I18n._("isisfish.error.checkout.module",\ f.getAbsolutePath()),\ eee);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ }}/*\ *\#\#%*\ Copyright\ (C)\ 2002,\ 2003,\ 2004,\ 2005,\ 2006,\ 2007\ Code\ Lutin,*\ Benjamin\ Poussin,\ 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\ 2*\ 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,\ write\ to\ the\ Free\ Software*\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.*\#\#%*/package\ fr.ifremer.isisfish.versionning.vcsSvn;import\ fr.ifremer.isisfish.versionning.IsisVcsConfig;import\ static\ org.codelutin.i18n.I18n._;import\ org.codelutin.vcs.AbstractVCSHandler;import\ org.codelutin.vcs.VCSConfig;import\ org.codelutin.vcs.VCSException;import\ org.codelutin.vcs.VCSHelper;import\ static\ org.codelutin.vcs.VCSHelper.isFileInCheckedDir;import\ org.codelutin.vcs.VCSRuntimeException;import\ org.codelutin.vcs.VCSState;import\ static\ org.codelutin.vcs.VCSState.OUT_OF_DATE;import\ static\ org.codelutin.vcs.VCSState.OUT_OF_DATE_AND_MODIFIED;import\ static\ org.codelutin.vcs.VCSState.UP_TO_DATE;import\ org.codelutin.vcs.VCSStatus;import\ org.tmatesoft.svn.core.ISVNDirEntryHandler;import\ org.tmatesoft.svn.core.ISVNLogEntryHandler;import\ org.tmatesoft.svn.core.SVNCommitInfo;import\ org.tmatesoft.svn.core.SVNDirEntry;import\ org.tmatesoft.svn.core.SVNException;import\ org.tmatesoft.svn.core.SVNLogEntry;import\ org.tmatesoft.svn.core.SVNNodeKind;import\ org.tmatesoft.svn.core.SVNURL;import\ org.tmatesoft.svn.core.io.SVNRepository;import\ org.tmatesoft.svn.core.wc.ISVNOptions;import\ org.tmatesoft.svn.core.wc.SVNClientManager;import\ org.tmatesoft.svn.core.wc.SVNRevision;import\ org.tmatesoft.svn.core.wc.SVNStatus;import\ org.tmatesoft.svn.core.wc.SVNStatusType;import\ static\ org.tmatesoft.svn.core.wc.SVNStatusType.*;import\ org.tmatesoft.svn.core.wc.SVNWCClient;import\ org.tmatesoft.svn.core.wc.SVNWCUtil;import\ java.io.ByteArrayOutputStream;import\ java.io.File;import\ java.io.IOException;import\ java.util.ArrayList;import\ java.util.Arrays;import\ java.util.Collection;import\ java.util.Collections;import\ java.util.Iterator;import\ java.util.List;/**\ *\ VCSHandler\ implementation\ for\ svn\ *\ *\ @author\ chemit\ */public\ final\ class\ SVNHandler\ extends\ AbstractVCSHandler\ {\ \ \ \ protected\ SVNURL\ repositoryURL;\ \ \ \ protected\ SVNRepository\ repository;\ \ \ \ protected\ SVNClientManager\ ourClientManager;\ \ \ \ protected\ SVNWCClient\ ourWcClient;\ \ \ \ public\ SVNHandler(VCSConfig\ config)\ {\ \ \ \ \ \ \ \ super(config,\ ".svn",\ "entries=
+\ new\ File(module.getDirectory(),category);\ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ if\ (\!f.exists()||\ \!VCSHelper.isFileInWorkingCopy(f,\ handler,true))\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Method\ method\ =
+\ new\ File(readerDirectory,\ "offsets_"\ +\ levels);\ \ \ \ \ \ \ \ \ \ \ \ FileOffsetReader\ offsetReader\ =
+\ new\ FileOffsetReader(offsetFile);\ \ \ \ \ \ \ \ \ \ \ \ if\ (levels\ =
+\ new\ LevelsLineReader(getLevelReader(0),\ offsetReader,\ logLevels);\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ reader.setId(levelsStr);\ \ \ \ \ \ \ \ \ \ \ \ levelsReaders.add(reader);\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ if\ (\!reader.isOpen())\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ open\ reader\ \ \ \ \ \ \ \ \ \ \ \ reader.open();\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ log.info(reader);\ \ \ \ \ \ \ \ return\ reader;\ \ \ \ }\ \ \ \ protected\ void\ openReader(LineReader\ reader)\ throws\ IOException\ {\ \ \ \ \ \ \ \ this.reader\ =
+\ new\ LevelsLineReader(model.getLogFile(),\ offsetReader);\ \ \ \ \ \ \ \ \ \ \ \ }\ else\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ other\ level\ readers\ depens\ on\ all\ levels\ reader\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ LogLevel[]\ logLevels\ =
+\ new\ LogMail(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ statusBar,\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ model.getFrom(),\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ model.getLogFile(),\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ model.getLogFile().getParentFile(),\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ model.getSmtpServer());\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ logMail.setVisible(true);\ \ \ \ }}/**\ \#\#%\ Copyright\ (C)\ 2002,\ 2003,\ 2004,\ 2005,\ 2006,\ 2007\ Code\ Lutin,*\ Benjamin\ Poussin,\ 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\ 2*\ 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,\ write\ to\ the\ Free\ Software*\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.*\ \#\#%\ */package\ fr.ifremer.isisfish.logging.console;import\ javax.swing.event.ChangeEvent;import\ javax.swing.event.ChangeListener;import\ javax.swing.event.EventListenerList;import\ java.io.File;import\ java.util.ArrayList;import\ java.util.List;/**\ *\ This\ class\ is\ the\ model\ used\ in\ LogConsole.\ *\ <p/>\ *\ The\ model\ deals\ with\ ChangeEvent\ to\ notify\ ui,\ model\ has\ changed.\ *\ *\ @author\ chemit\ */public\ class\ LogConsoleModel\ {\ \ \ \ /**\ to\ use\ log\ facility,\ just\ put\ in\ your\ code\:\ log.info(\\"...\\=
+\ new\ MimeMessage(session);\ \ \ \ \ \ \ \ //\ --\ Set\ the\ FROM\ and\ TO\ fields\ --\ \ \ \ \ \ \ \ msg.setFrom(new\ InternetAddress(from));\ \ \ \ \ \ \ \ msg.setRecipients(Message.RecipientType.TO,\ InternetAddress.parse(to,\ false));\ \ \ \ \ \ \ \ MimeMultipart\ bodyMime\ =
+\ new\ MimeMultipart("mixed=
+\ new\ PatternLineReader(parent,\ new\ MemoryOffsetReader(5000),\ searchText,\ 0);\ \ \ \ \ \ \ \ reader.setId(parent.getId()\ +\ "\:"\ +\ searchText);\ \ \ \ \ \ \ \ log.info(reader);\ \ \ \ \ \ \ \ return\ reader;\ \ \ \ }\ \ \ \ //TODO\ Improve\ algorithm\ \:\ always\ try\ to\ find\ the\ closest\ reader\ to\ use\ \ \ \ protected\ LineReader\ getLevelReader(int\ levels)\ throws\ IOException\ {\ \ \ \ \ \ \ \ String\ levelsStr\ =
+\ new\ ResultEdit(simulation);\ \ \ \ \ \ \ \ \ \ \ \ JInternalFrame\ intFrame\ =
+\ null\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ &&\ parameters.getExportNames().size()\ >\ 0)\ {\ \ \ \ \ \ \ \ \ \ \ \ File\ exportDir\ =
+\ null\ &&\ reader.isOpen())\ {\ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ reader.close();\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (IOException\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn(I18n._("could\ not\ close\ reader\ {0}",\ reader));\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ @Override\ \ \ \ protected\ void\ finalize()\ throws\ Throwable\ {\ \ \ \ \ \ \ \ super.finalize();\ \ \ \ \ \ \ \ close();\ \ \ \ }\ \ \ \ /**\ \ \ \ \ *\ read\ the\ required\ frame\ from\ current\ reader\ \ \ \ \ *\ \ \ \ \ *\ @param\ offset\ the\ offset\ to\ use\ \ \ \ \ *\ @throws\ IOException\ if\ any\ problem\ while\ reading\ \ \ \ \ */\ \ \ \ public\ void\ read(long\ offset)\ throws\ IOException\ {\ \ \ \ \ \ \ \ if\ (offset\ <\ 0)\ {\ \ \ \ \ \ \ \ \ \ \ \ offset\ =
+\ null)\ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ reader.close();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (IOException\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //TODO\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ Properties\ getData()\ {\ \ \ \ \ \ \ \ return\ data;\ \ \ \ }\ \ \ \ public\ String\ getName()\ {\ \ \ \ \ \ \ \ return\ name;\ \ \ \ }}/*\ *\#\#%\ *\ Copyright\ (C)\ 2006\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ Benjamin\ Poussin\ *\ *\ 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\ 2\ *\ 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,\ write\ to\ the\ Free\ Software\ *\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.\ *\#\#%*//*\ *\ *\ SimulationQueueModel.java\ *\ *\ Created\:\ 18\ ao\uFFFDt\ 2006\ 00\:05\:41\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 602\ $\ *\ *\ Last\ update\:\ $Date\:\ 2007-11-01\ 21\:39\:12\ +0100\ (jeu,\ 01\ nov\ 2007)\ $\ *\ by\ \:\ $Author\:\ tchemit\ $\ */package\ fr.ifremer.isisfish.simulator;/**\ @author\ poussin\ */public\ class\ SimulationQueueModel\ extends\ AbstractSimulationQueueModel\ {\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ AbstractSimulationQueueModel()\ \ \ \ \ */\ \ \ \ public\ SimulationQueueModel()\ {\ \ \ \ \ \ \ \ super();\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ AbstractSimulationQueueModel(SimulationManager)\ \ \ \ \ */\ \ \ \ public\ SimulationQueueModel(SimulationManager\ queue)\ {\ \ \ \ \ \ \ \ super(queue);\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ AbstractSimulationQueueModel at getSimulationIds()\ \ \ \ \ */\ \ \ \ protected\ java.util.List<String>\ getSimulationIds()\ {\ \ \ \ \ \ \ \ return\ getQueue().ids;\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ AbstractSimulationQueueModel at getQueueItemsAsMap()\ \ \ \ \ */\ \ \ \ protected\ java.util.Map<String,\ SimulationManager.QueueItem>\ getQueueItemsAsMap()\ {\ \ \ \ \ \ \ \ return\ getQueue().map;\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ SimulationQueueListener\#simulationAdded(fr.ifremer.isisfish.simulator.SimulationQueueEvent)\ \ \ \ \ */\ \ \ \ public\ void\ simulationAdded(SimulationQueueEvent\ e)\ {\ \ \ \ \ \ \ \ int\ row\ =
+\ null)\ {\ \ \ \ \ \ \ \ \ \ \ \ File\ offsetFile\ =
+\ null)\ {\ \ \ \ \ \ \ \ \ \ \ \ control.removePropertyChangeListener(this);\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ int\ row\ =
+\ null){\ \ \ \ \ \ \ \ \ \ \ \ SimulationStorage\ simulation\ =
+\ null){\ \ \ \ \ \ \ \ \ \ \ \ SimulationStorage\ storage\ =
+\ null;\ \ \ \ \ \ \ \ for\ (LineReaderUtil.LevelsLineReader\ levelsReader\ \:\ levelsReaders)\ {\ \ \ \ \ \ \ \ \ \ \ \ if\ (levelsReader.getId().equals(levelsStr))\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ reader\ =
+\ reader.readLine(offset,\ model.nbLinesInEditor);\ \ \ \ \ \ \ \ //\ mark\ the\ new\ first\ position\ \ \ \ \ \ \ \ model.setFirstLinePosition(offset);\ \ \ \ \ \ \ \ //\ add\ lines\ in\ model\ \ \ \ \ \ \ \ model.allItems.clear();\ \ \ \ \ \ \ \ model.allItems.addAll(Arrays.asList(result));\ \ \ \ \ \ \ \ //\ notify\ ui\ that\ model\ changed\ \ \ \ \ \ \ \ model.fireStateChanged();\ \ \ \ }\ \ \ \ public\ void\ mouseWheelMoved(MouseWheelEvent\ e)\ {\ \ \ \ \ \ \ \ int\ unitsToScroll\ =
+\ reader;\ \ \ \ \ \ \ \ if\ (\!this.reader.isOpen())\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ open\ reader\ \ \ \ \ \ \ \ \ \ \ \ this.reader.open();\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ //\ save\ the\ number\ of\ lines\ of\ reader\ in\ model\ \ \ \ \ \ \ \ model.nbLines\ =
+\ simulation.getDirectory();\ \ \ \ \ \ \ \ //\ \ \ \ \ \ \ \ //\ Export\ des\ r\uFFFDsultats\ \ \ \ \ \ \ \ //\ \ \ \ \ \ \ \ if\ (parameters.getExportNames()\ \!=
+\ simulation.getParameter();\ \ \ \ \ \ \ \ File\ rootDirectory\ =
+\ simulationFile;\ \ \ \ \ \ \ \ this.smtpServer\ =
+\ smtpServer;\ \ \ \ \ \ \ \ this.statusBar\ =
+\ statusBar;\ \ \ \ \ \ \ \ sendMail.addActionListener(new\ ActionListener()\ {\ \ \ \ \ \ \ \ \ \ \ \ public\ void\ actionPerformed(ActionEvent\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ sendMail(mailTo.getText(),\ content.getText(),\ sendAll.isSelected());\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ statusBar.setStatus(_("isisfish.log.mail.send"\ ,\ to));\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (Exception\ eee)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ statusBar.setStatus(_("isisfish.log.mail.failed",\ smtpServer));\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ finally\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ dispose();\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ });\ \ \ \ }\ \ \ \ public\ void\ setTo(String\ to)\ {\ \ \ \ \ \ \ \ this.to\ =
+\ statusBar;\ \ \ \ }\ \ \ \ public\ void\ openLogMail()\ {\ \ \ \ \ \ \ \ if\ (logMail=
+\ this.reader.getNbLines();\ \ \ \ }\ \ \ \ public\ void\ addPropertyChangeListener(PropertyChangeListener\ listener)\ {\ \ \ \ \ \ \ \ propertyListeners.addPropertyChangeListener(listener);\ \ \ \ }\ \ \ \ public\ void\ addPropertyChangeListener(String\ propertyName,\ PropertyChangeListener\ listener)\ {\ \ \ \ \ \ \ \ propertyListeners.addPropertyChangeListener(propertyName,\ listener);\ \ \ \ }\ \ \ \ public\ void\ removePropertyChangeListener(PropertyChangeListener\ listener)\ {\ \ \ \ \ \ \ \ propertyListeners.removePropertyChangeListener(listener);\ \ \ \ }\ \ \ \ public\ void\ removePropertyChangeListener(String\ propertyName,\ PropertyChangeListener\ listener)\ {\ \ \ \ \ \ \ \ propertyListeners.removePropertyChangeListener(propertyName,\ listener);\ \ \ \ }\ \ \ \ public\ StatusBar\ getStatusBar()\ {\ \ \ \ \ \ \ \ return\ statusBar;\ \ \ \ }\ \ \ \ public\ void\ setStatusBar(StatusBar\ statusBar)\ {\ \ \ \ \ \ \ \ this.statusBar\ =
+\ to;\ \ \ \ }\ \ \ \ /**\ \ \ \ \ *\ Send\ an\ email\ using\ the\ given\ informations\ (stmpServer,\ toAddress,\ \ \ \ \ *\ fromAddress,\ subject\ and\ body).\ \ \ \ \ *\ \ \ \ \ *\ @param\ to\ \ \ \ \ \ \ adr\ to\ send\ the\ mail\ \ \ \ \ *\ @param\ text\ \ \ \ \ message\ text\ \ \ \ \ *\ @param\ selected\ if\ <code>true</code>\ send\ all\ simulation\ zip,\ \ \ \ \ *\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ or\ just\ the\ file\ \ \ \ \ *\ @throws\ java.io.IOException\ \ \ \ \ \ \ \ \ \ \ if\ any\ problem\ while\ creatingthe\ zip\ \ \ \ \ *\ @throws\ javax.mail.MessagingException\ if\ any\ problem\ while\ creating\ \ \ \ \ *\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ the\ message\ or\ while\ the\ send\ \ \ \ \ */\ \ \ \ public\ void\ sendMail(String\ to,\ String\ text,\ boolean\ selected)\ throws\ IOException,\ MessagingException\ {\ \ \ \ \ \ \ \ Properties\ props\ =
+\ true;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ read(e.getValue());\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (IOException\ e1)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn(I18n._("could\ not\ read\ at\ offset\ {0}\ for\ reason\ {1}",\ e.getValue(),\ e1.getMessage()));\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ dontAdjust\ =
+\ true;\ \ \ \ \ \ \ \ \ \ \ \ read(newOffset);\ \ \ \ \ \ \ \ }\ catch\ (IOException\ e1)\ {\ \ \ \ \ \ \ \ \ \ \ \ log.warn(I18n._("could\ not\ read\ at\ offset\ {0}\ for\ reason\ {1}",\ newOffset,\ e1.getMessage()));\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ void\ adjustmentValueChanged(AdjustmentEvent\ e)\ {\ \ \ \ \ \ \ \ if\ (\!e.getValueIsAdjusting()\ &&\ \!dontAdjust)\ {\ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //TODO\ Fix\ bug\ \:sometimes\ when\ going\ at\ tail,\ it\ goes\ head\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //TODO\ (the\ offset\ must\ not\ be\ good...)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //log.info("value\:"+e.getValue());\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ dontAdjust\ =
+\ v;\ \ \ \ //}\ \ \ \ public\ void\ on_supprimerSimulationButton_clicked(){\ \ \ \ \ \ \ \ String\ name\ =
+Checkout\ pom.xml\ to\ {0}",\ file.getPath()));\ \ \ \ \ \ \ \ vcsHandler.update(file);\ \ \ \ \ \ \ \ getContext().setQuit(true);\ \ \ \ }}\ /*\ *\ \#\#%\ Copyright\ (C)\ 2002,\ 2003,\ 2004,\ 2005,\ 2006,\ 2007\ Code\ Lutin,*\ Benjamin\ Poussin,\ 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\ 2*\ 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,\ write\ to\ the\ Free\ Software*\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.*\ \#\#%\ */package\ fr.ifremer.isisfish.commandline.actions;import\ fr.ifremer.isisfish.IsisConfig;import\ fr.ifremer.isisfish.datastore.AnalysePlanStorage;import\ fr.ifremer.isisfish.datastore.ExportStorage;import\ fr.ifremer.isisfish.datastore.FormuleStorage;import\ fr.ifremer.isisfish.datastore.RuleStorage;import\ fr.ifremer.isisfish.datastore.ScriptStorage;import\ fr.ifremer.isisfish.datastore.SimulatorStorage;import\ java.io.File;import\ java.util.ArrayList;import\ java.util.List;import\ java.util.regex.Pattern;/**\ *\ The\ class\ to\ define\ all\ actions\ on\ scripts\ or\ data\ (region,\ simulations)\ \ that\ *\ IsisFish\ can\ launch\ at\ init\ time.\ *\ *\ @author\ chemit\ */public\ class\ ScriptUtil\ {\ \ \ \ /**\ \ \ \ \ *\ Pour\ v\uFFFDrifier\ q'un\ fichier\ existe.\ \ \ \ \ *\ \ \ \ \ *\ @param\ file\ \ the\ file\ dont\ on\ doit\ v\uFFFDrifier\ l'existence\ \ \ \ \ *\ @param\ force\ flag\ pour\ d\uFFFDclancher\ une\ exception,\ si\ fichier\ non\ trouv\uFFFD.\ \ \ \ \ */\ \ \ \ public\ static\ void\ checkNotFileExist(File\ file,\ boolean\ force)\ {\ \ \ \ \ \ \ \ if\ (file.exists()\ &&\ \!force)\ {\ \ \ \ \ \ \ \ \ \ \ \ //\ fatal\ error\ \ \ \ \ \ \ \ \ \ \ \ throw\ new\ IllegalArgumentException("destination\ already\ exists\ "\ +\ file\ +\ "\ use\ \\'force\\'\ argument\ to\ force\ overwrite=
Info=Info
-Region\ {0}\ allready\ exist\ in\ repository.\ Can''t\ import=
-could\ not\ close\ reader\ {0}=could not close reader {0}
-could\ not\ create\ simulation\ filter\ model\ for\ reason\ {0}=could not create simulation filter model for reason {0}
-could\ not\ filter\ on\ simulations=could not filter on simulations
-could\ not\ found\ log\ file\ {0}=could not found log file {0}
-could\ not\ read\ at\ offset\ {0}\ for\ reason\ {1}=could not read at offset {0} for reason {1}
-filter\ loaded\ in\ {0}\ ms\ \:\ found\ {1}\ lines.=filter loaded in {0} ms \: found {1} lines.
+could\ not\ close\ reader\ {0}",\ levelsReader));\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ if\ (reader\ \!=
+could\ not\ create\ simulation\ filter\ model\ for\ reason\ {0}",e.getMessage()),e);\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ private\ void\ initSimulation()\ throws\ IOException,\ ParseException\ {\ \ \ \ \ \ \ \ //\ keep\ in\ context\ list\ of\ old\ simulation\ names\ (for\ filter\ process)\ \ \ \ \ \ \ \ java.util.List<String>\ value\ =
+filter\ loaded\ in\ {0}\ ms\ \:\ found\ {1}\ lines.",\ (System.currentTimeMillis()\ -\ t0),\ reader.getNbLines()));\ \ \ \ \ \ \ \ }\ catch\ (IOException\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ log.warn("could\ not\ open\ reader\ ["\ +\ this.reader\ +\ "]\ for\ reason\ "\ +\ e.getMessage());\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ protected\ LineReader\ getPatternReader(String\ searchText,\ LineReader\ parent)\ {\ \ \ \ \ \ \ \ LineReader\ reader;\ \ \ \ \ \ \ \ reader\ =
isisfish.about.site=http\://isisfish.labs.libre-entreprise.org - by B.Poussin
isisfish.about.text=Simulateur Isis-Fish
isisfish.about.title=A propos...
@@ -30,7 +91,6 @@
isisfish.cell.longitude=Longitude
isisfish.cell.name=Nom
isisfish.cell.title=Saisie des mailles
-isisfish.change.equation=Ne peut pas changer l'\u00E9quation
isisfish.common.add=Ajouter
isisfish.common.add.short=isisfish.common.add.short
isisfish.common.addQueue=Ajouter \u00E0 la queue des simulations
@@ -47,17 +107,14 @@
isisfish.common.emigration=\u00E9migration
isisfish.common.empty=vide
isisfish.common.error=Erreur
-isisfish.common.file=Fichier
isisfish.common.finish=Terminer
isisfish.common.gear=Engin
isisfish.common.immigration=immigration
isisfish.common.info=Info
isisfish.common.migration=migration
-isisfish.common.month=mois {0}
isisfish.common.new=Nouveau
isisfish.common.newMatrix=Nouvelle matrice
isisfish.common.next=Suivant
-isisfish.common.no=No
isisfish.common.ok=Ok
isisfish.common.openEditor=Ouvrir l'\u00E9diteur
isisfish.common.populationGroup=Groupe de population
@@ -84,73 +141,6 @@
isisfish.common.warn=Warn
isisfish.common.year=ann\u00E9e
isisfish.common.zone=Zone
-isisfish.config.h2.description=La configuration h2 utilis\u00E9e
-isisfish.config.h2.h2BytecodeProvider.description=TODO
-isisfish.config.h2.h2CurrentSessionContextClass.description=TODO
-isisfish.config.h2.h2Dialect.description=TODO
-isisfish.config.h2.h2Driver.description=TODO
-isisfish.config.h2.h2MemBytecodeProvider.description=TODO
-isisfish.config.h2.h2MemDialect.description=TODO
-isisfish.config.h2.h2MemDriver.description=TODO
-isisfish.config.h2.h2MemPass.description=TODO
-isisfish.config.h2.h2MemType.description=TODO
-isisfish.config.h2.h2MemURL.description=TODO
-isisfish.config.h2.h2MemUser.description=TODO
-isisfish.config.h2.h2Pass.description=TODO
-isisfish.config.h2.h2Type.description=TODO
-isisfish.config.h2.h2URL.description=TODO
-isisfish.config.h2.h2User.description=TODO
-isisfish.config.h2.migrationApplicationVersion.description=TODO
-isisfish.config.h2.migrationCallBackhandlers.description=TODO
-isisfish.config.h2.migrationModelNames.description=TODO
-isisfish.config.h2.migrationPreviousMappingDirectory.description=TODO
-isisfish.config.h2.migrationTopiaService.description=TODO
-isisfish.config.h2.storageData.description=le nom du r\u00E9pertoire o\u00F9 stocker les donn\u00E9es d'un data storage (r\u00E9gion, simulation)
-isisfish.config.h2.updateschemaDatabase.description=flag pour indiquer s'il faut ou non updater le sch\u00E9ma de la base
-isisfish.config.main.compileDirectory.description=le r\u00E9pertoire o\u00F9 sont compil\u00E9s les scripts
-isisfish.config.main.configFileName.description=le fichier de configuration \u00E0 utiliser
-isisfish.config.main.dataBackupFilename.description=le nom du fichier contenant la d\u00E9finition d'un data storage (r\u00E9gion, simulation)
-isisfish.config.main.defaultBackupDirectory.description=le r\u00E9pertoire o\u00F9 stocker les backups des donn\u00E9es
-isisfish.config.main.defaultExportDirectory.description=le r\u00E9pertoire o\u00F9 exporter les r\u00E9sultats des simulations
-isisfish.config.main.defaultExportNames.description=les noms des exports \u00E0 effectuer apr\u00E8s une simulation
-isisfish.config.main.defaultMapFile.description=TODO
-isisfish.config.main.defaultResultNames.description=les noms des r\u00E9sultats \u00E0 traiter apr\u00E8s une simulation
-isisfish.config.main.defaultSimulator.description=le nom du simulateur par d\u00E9faut \u00E0 utiliser lors d'une simulation
-isisfish.config.main.defaultTagValue.description=TODO
-isisfish.config.main.description=La configuration principale d'IsisFish
-isisfish.config.main.encoding.description=l'encoding du syst\u00E8me
-isisfish.config.main.javadocURL.description=l'url de la javadoc des scripts
-isisfish.config.main.localSimulator.description=pour indiquer si les simulations sont \u00E0 effectuer localement
-isisfish.config.main.locale.description=la locale utilisateur
-isisfish.config.main.login.description=le login pour se connecter au serveur de simulations distant
-isisfish.config.main.password.description=le mot de passe pour se connecter au serveur de simulations distant
-isisfish.config.main.projectName.description=le nom du projet
-isisfish.config.main.regionMap.description=le nom du r\u00E9pertoire contenant les maps d'une r\u00E9gion
-isisfish.config.main.resultExport.description=TODO
-isisfish.config.main.simulationInformationFilename.description=le nom du fichier d'informations d'une simulation
-isisfish.config.main.simulationParametersFilename.description=le nom du fichier de param\u00E9trage d'une simulation
-isisfish.config.main.simulationReportMail.description=Le courriel \u00E0 utiliser pour envoyer les rapports de simulation
-isisfish.config.main.simulationResultXmlFilename.description=le nom du fichier d'export des r\u00E9sultats d'une simulation au format xml
-isisfish.config.main.simulationServer.description=l'url du serveur de simulations distant
-isisfish.config.main.simulationShowOnlyError.description=pour indiquer si l'on doit conserver dans l'UI des simulations termin\u00E9es uniquement celles avec erreur
-isisfish.config.main.simulationShowOnlyQueue.description=pour indiquer si l'on doit conserver dans l'UI des simulations termin\u00E9es uniquement celles effectu\u00E9es localement
-isisfish.config.main.smtpServer.description=le nom du serveur smpt \u00E0 utiliser pour envoyer les courriels
-isisfish.config.main.userMail.description=le courriel de l'utilisateur
-isisfish.config.main.userName.description=le nom - pr\u00E9nom de l'utilisateur
-isisfish.config.main.version.description=la version d'IsisFish
-isisfish.config.vcs.databaseVersion.description=la version de des donn\u00E9es \u00E0 utiliser
-isisfish.config.vcs.description=La configuration vcs d'IsisFish
-isisfish.config.vcs.hostName.description=le nom du serveur vcs \u00E0 utiliser
-isisfish.config.vcs.keyFile.description=le chemin complet du fichier de clef priv\u00E9e ssh2 \u00E0 utiliser lors d'une connexion s\u00E9curis\u00E9e
-isisfish.config.vcs.localDatabasePath.description=
-isisfish.config.vcs.noPassPhrase.description=pour indiquer si la clef priv\u00E9e ssh2 utilis\u00E9e pour communiquer avec le serveur vcs contient est prot\u00E9g\u00E9 par une passe-phrase
-isisfish.config.vcs.passphrase.description=la passe-phrase utilis\u00E9e pour prot\u00E9ger la clef priv\u00E9e ssh
-isisfish.config.vcs.remoteDatabase.description=le nom du module de donn\u00E9es sur le serveur vcs
-isisfish.config.vcs.remotePath.description=le chemin jusqu'au parent du module de donn\u00E9es sur le serveur vcs
-isisfish.config.vcs.type.description=le type de communication vcs utilis\u00E9
-isisfish.config.vcs.typeRepo.description=le type de r\u00E9pository vcs utilis\u00E9
-isisfish.config.vcs.useSshConnexion.description=pour indiquer si l'on utilise une connexion s\u00E9curis\u00E9e pour communiquer avec le serveur vcs (ssh2)
-isisfish.config.vcs.userName.description=le login de l'utilisateur sur le serveur vcs
isisfish.dataResult.descriptionLabel=defaultToolTip-fr.ifremer.resultat.DataResult.descriptionLabel
isisfish.dataResult.export.csv=Exporter en CSV
isisfish.dataResult.exportButton=defaultToolTip-fr.ifremer.resultat.DataResult.exportButton
@@ -158,7 +148,6 @@
isisfish.dataResult.matriceTable=defaultToolTip-fr.ifremer.resultat.DataResult.matriceTable
isisfish.dataResult.scrolledwindow2=defaultToolTip-fr.ifremer.resultat.DataResult.scrolledwindow2
isisfish.dataResult.table2=defaultToolTip-fr.ifremer.resultat.DataResult.table2
-isisfish.date.toString={0} {1}
isisfish.effortDescription.crewFoodCost=Co\u00FBt de l'alimentation pour l'\u00E9quipage
isisfish.effortDescription.crewShareRate=Taux de partage de l'\u00E9quipage
isisfish.effortDescription.crewSize=Taille de l'\u00E9quipage
@@ -170,31 +159,14 @@
isisfish.effortDescription.otherRunningCost=Autres co\u00FBts
isisfish.effortDescription.repairAndMaintenanceGearCost=repairAndMaintenanceGearCost
isisfish.effortDescription.title=inputEffortDescription
-isisfish.effortDescription.toString=EffortDescription for {0} with {1}
isisfish.effortDescription.unitCostOfFishing=Co\u00FBt unitaire de la p\u00EAche
isisfish.equation.editor.title=Editeur d'\u00E9quation
-isisfish.error.acceptable.population=New value isn't acceptable value for this population
isisfish.error.add.card=Erreur lors de l'ajout du r\u00E9sultat \u00E0 la carte.
-isisfish.error.add.file=Can't add file {0}
-isisfish.error.add.logger.simulation\ =isisfish.error.add.logger.simulation
+isisfish.error.add.logger.simulation\ ",\ e));\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ simThread.start();\ \ \ \ \ \ \ \ \ \ \ \ try\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ simThread.join();\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (InterruptedException\ eee)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ (log.isWarnEnabled())\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn(I18n._("isisfish.error.wait.simThread=
isisfish.error.add.result.data=Erreur lors de l'ajout du r\u00E9sultat au data.
isisfish.error.add.result.graph=Erreur lors de l'ajout du r\u00E9sultat au graph.
-isisfish.error.add.tray=Can't add system tray icon
-isisfish.error.change.classloader=Can''t change classloader because can''t create URL from file {0}
-isisfish.error.change.equation=Can't change equation
-isisfish.error.check.region=Can't check region
-isisfish.error.checkout.module=Can''t checkout module {0}
-isisfish.error.commit.files=Can''t commit files {0}
-isisfish.error.compile.script=Can''t compile script\: {0}
-isisfish.error.compiled.parameter=Can't get rule parameter from compiled class
-isisfish.error.connect.server=Can't connect to server
+isisfish.error.checkout.module",\ module),\ eee);\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ break;\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ }\ \ \ \ public\ static\ void\ doCheckoutModule(VCSHandler\ handler,\ IsisConfig.Module\ module,\ String\ category)\ {\ \ \ \ \ \ \ \ File\ f\ =
isisfish.error.conversion.data=Erreur lors de la conversion du fichier de donn\u00E9es
-isisfish.error.create.equation=Can't create equation
-isisfish.error.delete.database=Can''t delete database
-isisfish.error.delete.file=could not delete file {0}
-isisfish.error.delete.vcs.files=Can''t delete vcs files
-isisfish.error.during.simulation=Error during simulation
-isisfish.error.during.simulation.information.file=Could not save Error during simulation of {0} in his information file
isisfish.error.emigration.negative=emigration negative
isisfish.error.empty.code.rubbin=le code rubbin est vide
isisfish.error.empty.emigration=emigration vide
@@ -212,122 +184,31 @@
isisfish.error.empty.unit=l'unit\u00E9 de mesure est vide
isisfish.error.emty.emigration=emigration vide
isisfish.error.emty.migration=Migration vide
-isisfish.error.equation.retun.number=EquationImpl must retun a number\: {0}
-isisfish.error.evaluate.equation=Can''t evaluate equation\: {0}
-isisfish.error.evaluate.plan.script=Can''t evaluate plan script
-isisfish.error.evaluate.preplan.script=Can''t evaluate preplan script
-isisfish.error.evalute.plan.script=Can''t evaluate plan script
-isisfish.error.export.scripts.force=Le fichier d''export {0} existe d\u00E9j\u00E9, vous devez utiliser l''option [force] pour forcer l''\u00E9crasement.
-isisfish.error.file.already.exists=The file {0} already exist
-isisfish.error.get.fisheryRegion=Can't get FisheryRegion
-isisfish.error.get.information.file=Can''t get information on file {0]
-isisfish.error.get.status.files=Can''t get status files\: {0}
-isisfish.error.growth.equation.before.create.group.population=Error, You must input growth equation before create the group population
isisfish.error.immigration.negative=immigration negative
isisfish.error.import.convertible=Erreur lors de l'import, la version du fichier que vous souhaitez importer n'est pas transformable en une version importable.
-isisfish.error.import.file=Can''t import file {0}
isisfish.error.import.recent.files=Erreur lors de l'import, la version du fichier que vous souhaitez importer est plus r\u00E9cente que la version souhait\u00E9e.
-isisfish.error.import.scripts.force=Certains fichiers existent, vous devez utiliser l''option [force] pour forcer l''\u00E9crasement.
isisfish.error.init.map=Can't init map.
-isisfish.error.init.remove.button=could not init remove button (button
-isisfish.error.instanciate=Can''t instanciate {0}
-isisfish.error.instanciate.export=Can''t instanciate export {0}
-isisfish.error.integer.positif=Your input must be a positif integer (>1)
-isisfish.error.invalid.category.name=Le nom de la cat\u00E9gorie {0} n'est pas valide.
-isisfish.error.invalid.configuration=la configuration n'est pas valide, modifier la configuration ?
-isisfish.error.invalid.configuration.title=Erreur de chargement de la configuration
isisfish.error.invalid.costs.fix=les co\u00FBts fixes sont invalides
-isisfish.error.invalid.distribution.recruitment=distribution de recrutement invalide
isisfish.error.invalid.equation=Equation invalide
-isisfish.error.invalid.equation.name=Nom d'\u00E9quation invalide
-isisfish.error.invalid.file.name=Le nom du script {0} n'est pas valide.
isisfish.error.invalid.interval.reproduction.recruitment=interval entre la reproduction et le recrutement invalide
isisfish.error.invalid.mean.weight=poids moyen invalide
isisfish.error.invalid.natural.death=mortalit\u00E9 naturelle sur les classes naissantes invalide
isisfish.error.invalid.number=le nombre est invalide
isisfish.error.invalid.range=La gamme possible n'a pas de valeur acceptable
-isisfish.error.invalid.simulation.id=Invalid simulation id {0}, availables \: {1}
-isisfish.error.invalid.simulation.index=Invalid simulation index {0}
-isisfish.error.invalid.simulation.index.availables=Invalid simulation index {0}, availables \: {1}
isisfish.error.invalid.values.params=Param\u00E8tre controlable hors valeurs possibles
isisfish.error.invalidate.natural.death=mortalite naturelle invalide
-isisfish.error.invalide.simulation.index=Invalide simulation index
-isisfish.error.invoke.method=Can't invoke method '{0}' for class {1}
-isisfish.error.load.class=Can't load class\: {0}
-isisfish.error.load.classloader=Can''t create ClassLoader for script, bad directory\: {0} for reason {1}
-isisfish.error.load.file=could not load file {0}
-isisfish.error.load.map=Can't load map file\: {0}
-isisfish.error.log.closeAppender=n''a pas pu ferme l''appender {0} et la categorie {1}
-isisfish.error.log.console.dispose=Une erreur est survenue pendant la fermeture de la console {0} de log, raison {1}
-isisfish.error.log.createAppender=n''a pas pu creer l''appender [{0}] \: {1} pour la raison {2}
-isisfish.error.log.foundAppender=n''a pas trouve l''appender {0} pour la categorie {1}
+isisfish.error.load.file",\ file));\ \ \ \ \ \ \ \ \ \ \ \ }\ finally\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ (reader\ \!=
+isisfish.error.load.map",\ filename),\ eee);\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ if(\!shapeLoaded){\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ a\ pas\ reussi\ a\ charger\ les\ fichiers\ demand\uFFFDs,\ on\ charge\ la\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ carte\ du\ monde\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ String\ filename\ =
isisfish.error.matrix.more.2d=Matrice de plus de 2 dimensions\!\!\\nSelectionnez moins d'\u00E9l\u00E9ments ou utilisez l'op\u00E9rateur somme.
isisfish.error.migration.negative=Migration negative
-isisfish.error.no.matrix=No matrix for\:
-isisfish.error.no.null.time.step=Error, the time step should not be null
+isisfish.error.no.matrix"\ +\ name));\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ resume.append("\\n\\n=
isisfish.error.no.sector=il n'y a pas de secteur de d\u00E9finit
-isisfish.error.no.select.simulation=could not select simulation
-isisfish.error.no.selected.simulation=No Simulation selected
-isisfish.error.no.target.species=no target species in {0} for {1}
isisfish.error.not.connected=Erreur \u00E0 la connexion...
-isisfish.error.not.find.status=n''a pas pu trouver le status du fichier {0} pour la raison suivante \: {1}
-isisfish.error.not.found.class=this class does not
-isisfish.error.not.found.code=could not found codeclass for {0}
-isisfish.error.not.found.description=could not found description for {0}
-isisfish.error.not.found.field=could not found field {0} doc for {0}
-isisfish.error.not.found.field.class=could not found field {0} for class {1}
-isisfish.error.not.found.species.population.container=Can't find species ({0}) for Population container
isisfish.error.not.null.class.grown=classe mature vaut nul
isisfish.error.not.null.mean.weight=poids moyen nul
isisfish.error.not.null.natiral.death=mortalite naturelle nulle
isisfish.error.not.possible.metier=Pas de m\u00E9tier possible
-isisfish.error.not.species.node.population.container=Population container not in Species node
-isisfish.error.not.support.class=this class does not support
-isisfish.error.number.classes.upper.zero=Error, the number of classes must be upper than 0
-isisfish.error.obtain.analyseplan=Can''t obtain description of AnalysePlan
-isisfish.error.obtain.doc.export=Can't obtain @Doc on class Export
-isisfish.error.obtain.doc.resultName=Can't obtain @Doc on ResultName
-isisfish.error.obtain.doc.rule=Can't obtain description for a Rule class
-isisfish.error.obtain.field=Can't obtain field @Doc for Rule {0}
-isisfish.error.obtain.field.analyseplan=Can''t obtain field @Doc for AnalysePlan {0}
-isisfish.error.obtain.information.file=could not obtain information file for simulation {0}
-isisfish.error.out.memory=Out of memory try with more memory (option -mx)
isisfish.error.overlap.season=Cette saison chevauche une autre saison
-isisfish.error.parse.date=Can''t parse date {0}
-isisfish.error.parse.long=Can''t parse long {0}
-isisfish.error.plan.parameter=Can't get plan parameter from compiled class
-isisfish.error.prepare.data=Can't prepare data
-isisfish.error.prepare.information.simulation=Can't prepare information for simulation
-isisfish.error.read.simulation=Can''t read simulation information {0}
-isisfish.error.read.simulation.parameters=Can''t read simulation parameters from file {0}
-isisfish.error.region.already.exists=Cette r\u00E9gion existe d\u00E9j\u00E0
-isisfish.error.region.name.empty=Le nom de la R\u00E9gion est vide
-isisfish.error.remove.directory=Can''t remove directory {0}
-isisfish.error.remove.file=Can't remove file {0}
-isisfish.error.rename.region=Can't rename region to {0}
-isisfish.error.save.checkSum.compilation=Can't save checkSum to compilation\: {0}
-isisfish.error.save.region=Can't save region
-isisfish.error.save.script.compilation=Can't save script to compilation\: {0}
-isisfish.error.save.simulation.parameters=Can't save simulation parameters in file {0}
-isisfish.error.script.check=N''a pas pu compiler le fichier {0} pour la raison suivante {1}
-isisfish.error.script.commit=N''a pas pu commiter le fichier {0} pour la raison suivante {1}
-isisfish.error.script.create=isisfish.error.script.create
-isisfish.error.script.delete=N''a pas pu supprimer le fichier {0} pour la raison suivante {1}
-isisfish.error.script.diff=N''a pas pu calculer le diff du fichier {0} pour la raison suivante {1}
-isisfish.error.script.evaluate=N''a pas pu \u00E9valuer le fichier {0} pour la raison suivante {1}
-isisfish.error.script.export=N''a pas pu exporter pour la raison suivante {0}
-isisfish.error.script.import=N''a pas pu importer pour la raison suivante {0}
-isisfish.error.script.load=N''a pas pu charger le fichier {0} pour la raison suivante {1}
-isisfish.error.script.save=N''a pas pu sauver le fichier {0} pour la raison suivante {1}
-isisfish.error.script.update=N''a pas pu mettre \u00E0 jour le fichier {0} pour la raison suivante {1}
-isisfish.error.simulation.log.openAppender=n''a pas pu ouvrir l''appender de la simulation {0} pour la raison {1}
-isisfish.error.simulation.resultXml.close=Can't close simulation result XML for reason {0}
-isisfish.error.simulation.resultXml.open=Can't open simulation result XML for reason {0}
-isisfish.error.simulation.resultXml.write=Can't write simulation result XML for reason {0}
-isisfish.error.source.parameter=Can't get parameter from source
-isisfish.error.start=Can''t start
-isisfish.error.status.files=Can't get status files\: {0}
-isisfish.error.strategy.order=Strategy {0} don't have 12 StrategyMonthInfo but {1}. Recreate them
isisfish.error.text=The follow error occur during action
isisfish.error.title=Erreur
isisfish.error.undefined.classes=pas de classes d\u00E9finies
@@ -343,16 +224,8 @@
isisfish.error.undefined.zone.population=il n'y a pas de zone de population de d\u00E9finit
isisfish.error.undefined.zone.recruitment=il n'y a pas de zone de recrutement de d\u00E9finit
isisfish.error.undefined.zone.reproduction=il n'y a pas de zone de reproduction de d\u00E9finit
-isisfish.error.unsupported.equation.langage=unsupported langage ''{0}'' for equation\: {1}
-isisfish.error.update.file=Can''t update file ''{0}''
-isisfish.error.update.repository=Can't update local repository
-isisfish.error.vcs.connect=Probl\u00E8me de connexion au serveur vcs, v\u00E9rifier votre configuration, ou contactez-nous si le probl\u00E8me persiste.
-isisfish.error.vcs.no.anonymous.connection=
-isisfish.error.vcs.no.ssh.connection=ne pas pu se connecter en utilisant la configuration ssh login {0}, clef priv\u00E9e {1}
-isisfish.error.vcs.pre.migrate=pendant la migration, la sauvegarde de votre base {0} n''a pas pu \u00EAtre effectu\u00E9e pour la raison suivante {1}, une nouvelle base est cr\u00E9e ici {2}.
-isisfish.error.wait.simThread=Can't wait SimThread
-isisfish.error.while.simulation=error while simulation {0}
-isisfish.error.write.simulation=Can''t write information {0}
+isisfish.error.while.simulation",\ infos.getException()));\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ control.setText(I18n._("isisfish.message.stop.with.error=
+isisfish.error.while.simulation",\ infos.getException()));\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ control.setText(I18n._("isisfish.message.stop.with.error",infos.getException()));\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ I\ don't\ known\ if\ you\ can\ come\ here\ with\ no\ previous\ simulation\ ?\ \ \ \ \ \ \ \ \ \ \ \ }\ catch\ (Exception\ e1)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ log.warn(I18n._("isisfish.error.obtain.information.file",\ e.getId()));\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ control.addPropertyChangeListener(this);\ \ \ \ \ \ \ \ }\ \ \ \ \ \ \ \ \ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ \ *\ @see\ SimulationQueueListener\#simulationStart(fr.ifremer.isisfish.simulator.SimulationQueueEvent)\ \ \ \ \ */\ \ \ \ public\ void\ simulationStart(SimulationQueueEvent\ e)\ {\ \ \ \ \ \ \ \ //\ nothing\ to\ do\ \ \ \ }\ \ \ \ /*\ (non-Javadoc)\ \ \ \ *\ @see\ SimulationQueueListener\#simulationStop(fr.ifremer.isisfish.simulator.SimulationQueueEvent)\ \ \ \ */\ \ \ \ public\ void\ simulationStop(SimulationQueueEvent\ e)\ {\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ nothing\ to\ do\ \ \ \ }}//\ SimulationDoneQueueModel/*\ *\#\#%\ *\ Copyright\ (C)\ 2007\ *\ \ \ \ \ Ifremer,\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ Benjamin\ Poussin\ *\ *\ 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\ 2\ *\ 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,\ write\ to\ the\ Free\ Software\ *\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.\ *\#\#%*//*\ *\ *\ SimulationResultGetter.java\ *\ *\ Created\:\ 13\ nov.\ 07\ 12\:00\:14\ *\ *\ @author\ poussin\ *\ @version\ $Revision\:\ 722\ $\ *\ *\ Last\ update\:\ $Date\:\ 2007-11-14\ 01\:16\:35\ +0100\ (mer,\ 14\ nov\ 2007)\ $\ *\ by\ \:\ $Author\:\ bpoussin\ $\ */package\ fr.ifremer.isisfish.simulator;import\ org.codelutin.math.matrix.MatrixND;import\ fr.ifremer.isisfish.types.Date;/**\ *\ Some\ SimulationResultListener\ can\ implement\ this\ interface\ to\ show\ that\ can\ *\ be\ used\ to\ retrieve\ result\ *\ \ *\ @author\ poussin\ */public\ interface\ SimulationResultGetter\ {\ \ \ \ /**\ \ \ \ \ *\ Retourne\ la\ matrice\ stocke\ pour\ un\ pas\ de\ temps\ \ \ \ \ *\ @param\ date\ le\ pas\ de\ temps\ que\ l'on\ souhaite\ \ \ \ \ *\ @param\ name\ le\ nom\ des\ resultats\ dont\ on\ veut\ la\ matrice\ \ \ \ \ *\ @return\ La\ matrice\ demand\uFFFDe\ ou\ null\ si\ aucune\ matrice\ ne\ correspond\ a\ \ \ \ \ *\ la\ demande.\ \ \ \ \ */\ \ \ \ \ public\ MatrixND\ getMatrix(SimulationContext\ context,\ Date\ date,\ String\ name);\ \ \ \ \ \ \ \ \ \ /**\ \ \ \ \ \ *\ Retourne\ une\ matrice\ contenant\ tous\ les\ pas\ de\ temps.\ \ \ \ \ \ *\ @param\ name\ le\ nom\ des\ resultats\ dont\ on\ veut\ une\ matrice\ globale.\ \ \ \ \ \ */\ \ \ \ \ public\ MatrixND\ getMatrix(SimulationContext\ context,\ String\ name);\ \ \ \ \ }/*\ *\#\#%\ *\ Copyright\ (C)\ 2002-2005\ Code\ Lutin,\ C\uFFFDdric\ Pineau,\ \ \ \ \ Benjamin\ Poussin\ *\ *\ 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\ 2\ *\ 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,\ write\ to\ the\ Free\ Software\ *\ Foundation,\ Inc.,\ 59\ Temple\ Place\ -\ Suite\ 330,\ Boston,\ MA\ \ 02111-1307,\ USA.\ *\#\#%*//*\ **\ SimulatorServerBadIdException.java**\ Created\:\ Fri\ Sep\ \ 6\ 2002**\ @author\ \ <poussin at codelutin.com>*\ Copyright\ Code\ Lutin*\ @version\ $Revision\:\ 167\ $**\ Mise\ a\ jour\:\ $Date\:\ 2006-01-23\ 15\:00\:17\ +0100\ (lun,\ 23\ jan\ 2006)\ $*\ par\ \:\ $Author\:\ bpoussin\ $*/package\ fr.ifremer.isisfish.simulator;public\ class\ SimulatorServerBadIdException\ extends\ RuntimeException\ {\ //\ SimulatorServerBadIdException\ \ \ \ /**\ \ */\ \ \ \ private\ static\ final\ long\ serialVersionUID\ =
isisfish.exit.text=Quelque chose a chang\u00E9, merci de saisir un commentaire
isisfish.exit.title=Exit
isisfish.export.directory=Dossier d'export
@@ -375,8 +248,6 @@
isisfish.filter.log.tooltip.message=Entrer un terme \u00E0 rechercher et appuyer sur Entr\u00E9e
isisfish.filter.reset=R\u00E9initialiser
isisfish.filter.result=R\u00E9sultats
-isisfish.filter.select=S\u00E9lectionner
-isisfish.filter.select.simulation=S\u00E9lectionner une simulation
isisfish.filter.simulation=Filter les simulations
isisfish.filter.simulation.analysePlanNumber=num\u00E9ro d"analyse
isisfish.filter.simulation.description=description
@@ -480,149 +351,35 @@
isisfish.input.selectNodeTree=S\u00E9lectionnez un noeud de l'arbre
isisfish.input.title=Saisie de la p\u00EAcherie
isisfish.launch.anonymous=lecture seule
-isisfish.launch.debugMode=debug mode
isisfish.launch.email=courriel
-isisfish.launch.find.public.key=Clef publique ssh (*.pub) associ\u00E9e \u00E0 la clef priv\u00E9e
-isisfish.launch.first=Premier d\u00E9marrage type vcs {0} - version {1}
isisfish.launch.firstname=nom
-isisfish.launch.howto.save.key=Comment enregister sa clef publique ssh aupr\u00E8s du labs
-isisfish.launch.init.done=init done in {0}.
isisfish.launch.lasstname=pr\u00E9nom
-isisfish.launch.save.key=Acc\u00E9der au labs pour enregister votre clef publique ssh
isisfish.launch.server.authenticationMethod=droit d'acc\u00E8s au serveur
isisfish.launch.server.login=nom utilisateur
-isisfish.launch.server.ssh.confirm.change.method=Changer la m\u00E9thode d'authentification requi\u00E8re une migration de votre base au prochaine red\u00E9marrage, Confirmer cette action.
-isisfish.launch.server.ssh.confirm.overwrite.key=Le clef {0} existe d\u00E9j\u00E0, confirmer pour l''\u00E9craser.
isisfish.launch.server.ssh.confirm.passphrase=confirmer la passphrase
isisfish.launch.server.ssh.key.change=Changer la clef ssh
-isisfish.launch.server.ssh.key.clipboard=Votre clef publique a \u00E9t\u00E9 copi\u00E9e dans le presse papier
isisfish.launch.server.ssh.key.generate=G\u00E9n\u00E9rer la clef ssh
-isisfish.launch.server.ssh.key.generate.error=La clef {0} n''a pas \u00E9t\u00E9 g\u00E9n\u00E9r\u00E9e.
-isisfish.launch.server.ssh.key.generate.succes=Votre clef ssh {0} a \u00E9t\u00E9 g\u00E9n\u00E9r\u00E9e,il faut d\u00E9sormais l''enregistrer aupr\u00E8s du serveur lab.
-isisfish.launch.server.ssh.key.no.key=Pas de clef ssh connu ou vous n'avez pas s\u00E9lectionn\u00E9 le mode SSH, voulez-vous quand meme continuer ?
-isisfish.launch.server.ssh.key.register=Enregister votre clef publique ssh sur le serveur du labs
isisfish.launch.server.ssh.no.passphrase=pas de passphrase
isisfish.launch.server.ssh.passphrase=passphrase
isisfish.launch.server.ssh.privateKeyFile=clef priv\u00E9e ssh
isisfish.launch.server.ssh.publicKeyFile=clef publique ssh
isisfish.launch.ssh=lecture-\u00E9criture (ssh)
-isisfish.launch.start=Lancement Isis-fish ... {0}
-isisfish.launch.stop=Stopping simulation...
-isisfish.launching=after init done in {0}.
-isisfish.log.addAppender=ajoute un appender [{0}]
isisfish.log.body=Message \u00E0 joindre
-isisfish.log.closeAppender=ferme l''appender [{0}] pour la categorie {1}
-isisfish.log.mail.failed=Impossible d'envoyer le rapport par courriel. Le serveur smtp fonctionne ? (J'essaye de contacter < {0} > smtp server)
-isisfish.log.mail.send=A report has been sent to {0}
-isisfish.log.mail.send.title=Send simulation {0} by email
+isisfish.log.mail.send.title",\ simulationFile.getName()));\ \ \ \ \ \ \ \ this.from\ =
isisfish.log.mailTo=Adresse du destinataire
-isisfish.log.removeAppender=supprime l''appender [{0}]
-isisfish.log.restoreLogLevel=repositionne le niveau du logger {0} du niveau {1} au niveau {2}
isisfish.log.sendAll=Envoyer la simulation complete
isisfish.log.sendMail=Envoyer par email
-isisfish.log.simulation.name=IsisFish simulation {0}
-isisfish.log.swapLogLevel=permute le niveau du logger {0} du niveau {1} au niveau {2}
isisfish.log.tooltip.body=Le message saisi sera joint au courriel envoy\u00E9
isisfish.log.tooltip.mailTo=Entrer l'adresse du destinataire du courriel
isisfish.log.tooltip.sendAll=Envoyer toute la simulation, ou uniquement le fichier de log
isisfish.log.tooltip.sendMail=Cliquer pour envoyer le courriel contentant les fichiers
-isisfish.message.add.cvs=Ajouter depuis {0} fichiers {1}.
-isisfish.message.add.objets.simulation=Add new objets simulation
-isisfish.message.add.queue={0} ajout\u00E9e \u00E0 la queue de simulations
-isisfish.message.add.queue.remote={0} ajout\u00E9 \u00E0 la queue de simulations distantes
-isisfish.message.backup.database.finished=backup database finished
-isisfish.message.backup.database.progress=backup database in progress
-isisfish.message.cancel.finished=Cancel finished
-isisfish.message.check.finished=v\u00E9rification termin\u00E9e
-isisfish.message.check.region=Check region ...
-isisfish.message.checking.cell=Checking cell
isisfish.message.choose.archive=choose archive file or directory
-isisfish.message.comment.region.modification=Entrer un commentaire sur la modification de la r\u00E9gion
-isisfish.message.commit=Commiter les modifications
-isisfish.message.commit.cancelled=commit annul\u00E9
-isisfish.message.commit.finished=commit termin\u00E9
-isisfish.message.commit.region.canceled=Commit de la r\u00E9gion annul\u00E9
-isisfish.message.commiting.region=En train de commiter la r\u00E9gion {0} ...
-isisfish.message.compilation.time=Temps de compilation {0}s
-isisfish.message.confirm.delete.object=Voulez-vous vraiment supprimer l'objet {0}
-isisfish.message.confirm.remove.region=Voulez-vous vraiement supprimer la r\u00E9gion {0} ?
-isisfish.message.confirm.remove.script=Voulez-vous vraiment supprimer le script ? ''{0}''
-isisfish.message.copy.finished=Copie termin\u00E9e
-isisfish.message.copy.region=Copier la r\u00E9gion vers {0}
-isisfish.message.copy.revision=Working copy initialize fine... Revision \: [ {0} - {1} ]
-isisfish.message.create.region.canceled=Creation de r\u00E9gion annul\u00E9e
-isisfish.message.creating.region=En train de cr\u00E9er la r\u00E9gion {0}
-isisfish.message.creation.done=cr\u00E9ation termin\u00E9e {0}
-isisfish.message.creation.finished=Cr\u00E9ation termin\u00E9e
-isisfish.message.delete.canceled=supression annul\u00E9e
-isisfish.message.delete.entities=Supprimer les entit\u00E9s
-isisfish.message.delete.entity=Supprimer l''entit\u00E9
-isisfish.message.delete.finished=Suppression termin\u00E9e
-isisfish.message.delete.object=Pour supprimer l'objet {0}, tous les objets suivant seront aussi supprim\u00E9s \\n\\n
-isisfish.message.diff.finished=fichier dans l''\u00E9tat {0}
-isisfish.message.directory.not.exists=Le r\u00E9pertoire parent de {0} n''existe pas, Voulez-vous le cr\u00E9er ?
-isisfish.message.evaluation.finished=\u00E9valuation termin\u00E9e
-isisfish.message.export.cancelled=Export annul\u00E9
-isisfish.message.export.done=Export termin\u00E9
-isisfish.message.export.path.tozip=toZip {0}
-isisfish.message.export.result=zip {0} fichier(s) dans l''archive {1} (taille {2})
-isisfish.message.export.scripts.file=Export vers le fichier {0}
-isisfish.message.export.zip=Exporter dans le fichier zip {0}
-isisfish.message.file.already.exists=Le fichier existe {0} d\u00E9j\u00E0, Voulez-vous l''\u00E9craser ?
-isisfish.message.file.overwrite=Le fichier existe, Voulez-vous l''\u00E9craser ?
-isisfish.message.import=Importer {0}
-isisfish.message.import.finished=Import termin\u00E9
-isisfish.message.import.region.name=Entre le nom de la r\u00E9egion \u00E0 importer
-isisfish.message.import.region.xml=XMLed Region
-isisfish.message.import.region.zipped=Zipped Region
-isisfish.message.import.scripts.file=Importation depuis le fichier {0}
-isisfish.message.import.scripts.file.cancelled=Importation des scripts annul\u00E9
-isisfish.message.import.scripts.file.done=Importation des scripts termin\u00E9
-isisfish.message.import.scripts.zipped=Zipped Scripts
-isisfish.message.import.xml.v2.file\ =Import xml v2 file
-isisfish.message.import.zip=Import zip file
-isisfish.message.load.finished=Chargement termin\u00E9
-isisfish.message.load.map=Chargement de la carte \: {0} ({1}, {2})
-isisfish.message.load.region.canceled=chargement de r\u00E9gion annul\u00E9
-isisfish.message.loading.old.simulation=Chargement d'une ancienne simulation ...
-isisfish.message.loading.region=Chargement de la r\u00E9gion
-isisfish.message.name.imported.region=Entrez le nom de la r\u00E9gion \u00E0 importer
-isisfish.message.new.filename=Entrer le nom du nouveau du fichier.\n\t (utiliser uniquemment des caract\u00E8res et _ en commencant avec une majuscule)
-isisfish.message.new.region.name=Entrer le nom de la nouvell r\u00E9gion
-isisfish.message.no.diff=Pas de diff\u00E9rences trouv\u00E9s pour le fichier {0}, \u00E9tant un ''{1}''
-isisfish.message.old.simulation.loaded=Anicenne simulation charg\uE009e
-isisfish.message.page.modified=Cette page a \u00E9t\u00E9 modifi\u00E9, voulez-vous la sauvegarder ?
-isisfish.message.presimulation.script.execution=Ex\u00E9cution des scripts de Presimulation
-isisfish.message.recruitment.number.month=Input the number of month of recruitment
-isisfish.message.region.commited=R\u00E9gion commit\u00E9e
-isisfish.message.region.loaded=R\u00E9gion charg\u00E9e
-isisfish.message.region.remove.canceled=Suppression de r\u00E9gion annul\u00E9
-isisfish.message.region.removed=R\u00E9gion supprim\u00E9e
-isisfish.message.remove.canceled=Suppression annul\u00E9e
-isisfish.message.remove.files=Suppresion des fichiers {0}.
-isisfish.message.remove.finished=Suppresison termin\u00E9
-isisfish.message.remove.unnecessary.cells=Suppression de cellules no necessaires
-isisfish.message.removing.region=Suppression de lar\u00E9gion {0} ...
+isisfish.message.load.map",\ filename,\ shp,\ ssx));\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ addShapeLayer(filename,\ shp,\ ssx,\ "ff000000",\ "ffbdde83=
isisfish.message.result.verif.region=R\u00E9sultat de la v\u00E9rification de la r\u00E9gion
-isisfish.message.save.finished=sauvegarde termin\u00E9e
-isisfish.message.saveModel.finished=Sauvegarde du mod\u00E8le termin\u00E9e
-isisfish.message.search.data=Recherche des donn\u00E9es ...
-isisfish.message.setting.cache.aspects=Mise en place des aspects Cache
-isisfish.message.setting.trace.aspects=Mise en place des aspects Trace
-isisfish.message.simulation.ended=Simulation termin\u00E9e
-isisfish.message.simulation.execution=Simulation execution
-isisfish.message.spacialized.visualisation=Spacialized visualisation
-isisfish.message.stop.with.error=stop with error {0}
-isisfish.message.synchronize.done=synchronize termin\u00E9e.
-isisfish.message.tray.disabled=SystemTray disabled
-isisfish.message.update.finished=update finished
isisfish.metier.comments=Commentaires
isisfish.metier.name=Nom
isisfish.metier.rangeValues=Range of values
isisfish.metier.title=M\u00E9tier
-isisfish.metierMonitor.metiers=M\u00E9tiers
-isisfish.metierMonitor.strategies=Strat\u00E9gies
-isisfish.metierSeasonInfo.toString={0} saison {1}-{2}
isisfish.metierSeasonInfoSpecies.mainSpecies=Esp\u00E8ces principales pour le m\u00E9tier
isisfish.metierSeasonInfoSpecies.selectSeason=S\u00E9lectionnez une saison
isisfish.metierSeasonInfoSpecies.selectSpecies=Choix de l'esp\u00E8ce
@@ -632,44 +389,7 @@
isisfish.metierSeasonInfoZone.season=Saison
isisfish.metierSeasonInfoZone.selectSeason=S\u00E9lectionnez une saison
isisfish.metierSeasonInfoZone.title=Seasons / Zones
-isisfish.migration.cvs.description=Migrate de CVS vers SVN [v {0}]
-isisfish.migration.svn.protocol.description=Migration de SVN [v {0} - {1}] vers SVN [v {2} - {3}]
-isisfish.migration.svn.version.description=Migration de SVN [v {0} - {1}] vers SVN [v {2} - {3}]
isisfish.monitor.title=Application Monitor
-isisfish.month.april=avril
-isisfish.month.august=ao\u00FBt
-isisfish.month.december=d\u00E9cembre
-isisfish.month.february=f\u00E9vrier
-isisfish.month.january=janvier
-isisfish.month.july=juillet
-isisfish.month.june=juin
-isisfish.month.march=mars
-isisfish.month.may=mai
-isisfish.month.november=novembre
-isisfish.month.october=octobre
-isisfish.month.september=september
-isisfish.option.description.addScript=ajoute un script d'un certain type (analyseplans|exports|formules\=type|rules|scripts|simulators) \u00E0 partir d'un fichier existant (file) (pour les formules il faut pr\u00E9ciser son type)
-isisfish.option.description.changeConfig=remplace la valeur d'une propri\u00E9t\u00E9 de clef **key** de la configuration [vcs] par la valeur **value**.
-isisfish.option.description.changeFileConfig=le fichier de configuration utilis\u00E9
-isisfish.option.description.createSshKey=create key pair for vcs ssh access using vcs.ssh.keyFileproperty or the given (privateKeyFile), with a (force) argument to overwrite
-isisfish.option.description.editConfig=pour lancer l'UI d'\u00E9dition de la configuration (main ou vcs)
-isisfish.option.description.exportData=export dans un nouveau fichier **fileZip** une region, ou une simulation en stipulant son nom, utilisez **force** pour \u00E9craser une archive existante.
-isisfish.option.description.exportScript=export dans un nouveau fichier (fileZip) des scripts d'un certain type **analyseplan|export|formule|rule|script|simulator** (pour les formules il faut fournir un **type**) avec possibilit\u00E9 d'effectuer un filtre **filter**, utilisez **force** pour \u00E9craser une archive existante.
-isisfish.option.description.help=Show this help
-isisfish.option.description.helpConfig=Show this help
-isisfish.option.description.import=importe un fichier existant (fileZip) pr\u00E9c\u00E9demmentexport\u00E9 d'Isis (region, simulation ou script)
-isisfish.option.description.importAndRenameRegion=import region from (regionFile) zip v3 file format and rename it (name)
-isisfish.option.description.list=affiche la liste d'un certain type d'objects Isis (analyseplans|exports|formules|regions|rules|scripts|simulations|simulators)avec possibilit\u00E9 d'appliquer un filtre (filter)
-isisfish.option.description.mavenFile=Checkout maven file from server (pom.xml)
-isisfish.option.description.resetConfig=R\u00E9initialisation de la configuration.
-isisfish.option.description.showConfig=Voir les d\u00E9tails d'une configuration
-isisfish.option.description.simulate=lance une simulation \u00E0 partir de son nom (simulation-id) et en sp\u00E9cifiant le fichier de param\u00E8tres de simulation existant (file)
-isisfish.option.description.sshKeyFile=change private ssh key file path in vcs configuration (vcs.ssh.keyFile)
-isisfish.option.description.ui=launch or not user interface (value)
-isisfish.option.description.update=update or not the local repository (value)
-isisfish.option.description.vcsAddRemove=ajoute ou supprime du r\u00E9pository local un ensemble de fichiers existants (file)
-isisfish.option.description.vcsUpdateCommitState=effectue une op\u00E9ration de communication avec le serveur distant (update|commit|state) avec possibilit\u00E9 de sp\u00E9cifier les fichiers cibles existants (file)
-isisfish.params.changeLogLev=Passe du niveau ''{0}'' au niveau ''{1}''
isisfish.params.clearFilter=Reset filtre
isisfish.params.description=Description
isisfish.params.filter=Filtrer
@@ -680,31 +400,9 @@
isisfish.params.ruleParameters=Param\u00E8tres des r\u00E8gles
isisfish.params.simulationName=Nom de la simulation
isisfish.params.title=Param\u00E8tres
-isisfish.params.toString.fishery=P\u00EAcherie\: {0}\\n\\n
-isisfish.params.toString.lib.logger.level=niveau du logger de librairies {0}
-isisfish.params.toString.number.years=Nombre d'ann\u00E9\u00E9s \: {0}\\n\\n
-isisfish.params.toString.plan=Plan\: {0}
-isisfish.params.toString.plan.number=Analyse plan sequence number\: {0}\\n\\n
-isisfish.params.toString.populations=Populations\:
-isisfish.params.toString.rule=Rule\: {0}
-isisfish.params.toString.script.logger.level=niveau du logger de scripts {0}
-isisfish.params.toString.script.presimulation=Script de presimulation
-isisfish.params.toString.simul.logger.level=niveau du logger de simulateur {0}
-isisfish.params.toString.simulation.done=Simulation r\u00E9alis\u00E9e avec {0}\:
-isisfish.params.toString.strategies=Strat\u00E9gies d'exploitation\:
isisfish.params.useAnalysePlan=Utiliser le plan d'analyse
isisfish.params.usePreSimulationScript=Utiliser un script de pr\u00E9-simulation
-isisfish.population.capturability=Capturabilit\u0E009e
isisfish.population.comments=Commentaires
-isisfish.population.group=Groupe
-isisfish.population.groups=Groupes
-isisfish.population.mappingZoneReproZoneRecru=MappingZoneReproZoneRecru
-isisfish.population.matrixAbundance=Matrice d'abondance
-isisfish.population.matrixAbundance1D=matrixAbundance1D
-isisfish.population.recruitment=Recrutement
-isisfish.population.reproduction=Reproduction
-isisfish.population.season=Saison
-isisfish.population.zones=Zones
isisfish.populationBasics.geographicID=Identifiant g\u00E9ographique
isisfish.populationBasics.growth=Croissance
isisfish.populationBasics.growthReverse=Croissance inverse
@@ -729,7 +427,6 @@
isisfish.populationGroup.price=prix
isisfish.populationGroup.reproductionRate=Taux de reproduction
isisfish.populationGroup.title=Saisie des groupes de population
-isisfish.populationGroup.toString={0} Groupe {1}
isisfish.populationMigration.comments=Commentaires
isisfish.populationMigration.selectSeason=S\u00E9lectionnez une saison
isisfish.populationMigration.title=Migration
@@ -749,15 +446,6 @@
isisfish.populationRecruitment.recruitmentDistribution=Distribution du recrutement
isisfish.populationRecruitment.reproductionEquation=Equation de reproduction
isisfish.populationRecruitment.title=Saisie des recrutements
-isisfish.populationSeasonInfo.arrival=Arriv\u00E9e
-isisfish.populationSeasonInfo.departure=D\u00E9part
-isisfish.populationSeasonInfo.distributionSpawing=Distribution of spawing
-isisfish.populationSeasonInfo.emigration=Emigration
-isisfish.populationSeasonInfo.group=Groupe
-isisfish.populationSeasonInfo.immigration=Immigration
-isisfish.populationSeasonInfo.migration=Migration
-isisfish.populationSeasonInfo.months=Mois
-isisfish.populationSeasonInfo.toString={0} saison {1}-{2}
isisfish.populationSeasons.Reproduction=Reproduction
isisfish.populationSeasons.changeGroup=Changement de groupe
isisfish.populationSeasons.comments=Commentaires
@@ -780,14 +468,8 @@
isisfish.preScript.backParameter=Retour aux param\u00E8tres
isisfish.preScript.title=Script de pr\u00E9-simulation
isisfish.queue.cancelled=annul\u00E9
-isisfish.queue.id=identifiant
-isisfish.queue.local=Locale
-isisfish.queue.name=Queue
-isisfish.queue.plan=Plan
-isisfish.queue.progression=Progression
isisfish.queue.showLog=Voir les logs de la simulation
isisfish.queue.simulationLaunch=Lanceur de la queue des simulations
-isisfish.queue.status=Etat
isisfish.queue.stopSimulation=Arreter la simulation
isisfish.queue.title=Queue
isisfish.result.abundance=Abondance
@@ -802,7 +484,6 @@
isisfish.result.dimension\ =Dimension
isisfish.result.end.simulation=En fin de Simulation\:
isisfish.result.export=Export
-isisfish.result.export.file=Exporter text file
isisfish.result.file=Fichier
isisfish.result.graph=Graphe
isisfish.result.graphRadioButton=defaultToolTip-fr.ifremer.resultat.ResultatEdit.graphRadioButton
@@ -895,7 +576,6 @@
isisfish.script.title=Editeur de scripts
isisfish.script.txtExport=Exporter
isisfish.script.update=Mettre \u00E0 jour
-isisfish.season.toString=saison {0}-{1}
isisfish.selectivity.equation=Equation
isisfish.selectivity.selectPopulation=S\u00E9lectionnez une population
isisfish.selectivity.title=S\u00E9lectivit\u00E9
@@ -930,8 +610,6 @@
isisfish.simpleResult.resultatMap=defaultToolTip-fr.ifremer.isisfish.map.SimpleIsisMapBeanBean.resultatMap
isisfish.simpleResult.resultatMapToolBar=defaultToolTip-fr.ifremer.isisfish.map.SimpleIsisMapBeanBean.resultatMapToolBar
isisfish.simpleResult.table=defaultToolTip-fr.ifremer.isisfish.map.SimpleResultatMapBean.table12
-isisfish.simulation.log.console.title=Console de log simulation ''{0}''
-isisfish.simulation.log.showConsole=affichage de la console de log pour la simulation {0}
isisfish.simulation.menu.about=A propos
isisfish.simulation.menu.close=Fermer
isisfish.simulation.menu.file=Fichier
@@ -952,16 +630,9 @@
isisfish.strategy.name=nom
isisfish.strategy.proportionSetOfVessels=Proportion des ensembles de navires
isisfish.strategy.title=Caract\u00E9ristiques
-isisfish.strategyMonthInfo.metier=M\u00E9tier
isisfish.strategyMonthInfo.minInactivityDays=Jour minimums d'inactivit\u00E9
isisfish.strategyMonthInfo.numberOfTrips=Nombre de trajets
-isisfish.strategyMonthInfo.proportion=Proportion
isisfish.strategyMonthInfo.title=StrategyMonthInfo
-isisfish.strategyMonthInfo.toString={0} {1}
-isisfish.timeUnit.day=Day
-isisfish.timeUnit.hours=Hours
-isisfish.tray.simulation=<b>Isis-fish<b><p>{0} - {1}/{2}
-isisfish.tray.simulation.no=<b>Isis-fish<b><p><i>No simulation<i>
isisfish.tripType.comments=Commentaires
isisfish.tripType.duration=Dur\u00E9e
isisfish.tripType.minTime=Temps minimal entre deux voyages
@@ -973,9 +644,6 @@
isisfish.vcs.commit.cancel=annuler
isisfish.vcs.commit.label=Entrer quelques mots concernant la modification des scripts
isisfish.vcs.commit.ok=confirmer
-isisfish.vcs.config.title=Modification de la configuration vcs d'IsisFish
-isisfish.vcs.configuration.title=Configuration du serveur vcs
-isisfish.vcs.migrate.end=La migration est termin\u00E9e en {0}s.\nLa nouvelle base est localis\u00E9e ici [{1}]
isisfish.vcs.update=R\u00E9sultats de la synchronisation avec le serveur
isisfish.vcs.update.cancel=annuler
isisfish.vcs.update.checkAll=(de)-select tout
@@ -1002,7 +670,6 @@
isisfish.vcs.updateconfirm.label2='Etes vous sur de vouloir effectuer ces op\u00E9rations ?'
isisfish.vcs.updateconfirm.ok=confirmer
isisfish.vcs.updateconfirm.tooltip.checkAll=(D\u00E9-)S\u00E9lectionner tous les scripts que vous voulez traiter
-isisfish.versionStorage.removed=Surim\u00E9
isisfish.vesselType.activityRange=Intervalle d'activit\u00E9
isisfish.vesselType.comments=Commentaires
isisfish.vesselType.fuelCost=Co\u00FBt d'un trajet en fuel
@@ -1046,36 +713,4 @@
isisfish.zone.comments=Commentaires
isisfish.zone.name=Nom
isisfish.zone.title=Saisie zone
-lutinutil.common.action=Action
-lutinutil.common.file=Fichier
-lutinutil.common.logDiff=LogDiff
-lutinutil.common.module=Module
-lutinutil.common.rev=R\u00E9vision
-lutinutil.common.select=S\u00E9lectionner
-lutinutil.error.checkout.dir=Can''t checkout dir {0}
-lutinutil.error.fieldmodel.already.registred=FieldAccess [{0}] is already registred
-lutinutil.error.fieldmodel.not.registred=could not found a matching entry in cache for [{0}]
-lutinutil.error.fieldmodel.unmatchin.options=
-lutinutil.error.init.config=config is not init, you should invoke on the config validate(true) method to validate it and finish his init {0}
-lutinutil.error.init.no.config=should invoke {0}\#init(VCSType,Properties) before required instance.
-lutinutil.vcs.action.add=Add
-lutinutil.vcs.action.changeLog=journal des changements
-lutinutil.vcs.action.checkout=R\u00E9cup\u00E9rer
-lutinutil.vcs.action.commit=Commiter
-lutinutil.vcs.action.delete=Supprimer
-lutinutil.vcs.action.diff=voir les diff\u00E9rences
-lutinutil.vcs.action.overwriteAndUpdate=Update
-lutinutil.vcs.action.revert=Rollback
-lutinutil.vcs.action.update=Update
-lutinutil.vcs.state.missing=fichier non pr\u00E9sent localement
-lutinutil.vcs.state.modified=fichier modifi\u00E9
-lutinutil.vcs.state.outofdate=fichier obsol\u00E8te
-lutinutil.vcs.state.outofdateAndModified=fichier modifi\u00E9 et obsol\u00E8te
-lutinutil.vcs.state.unknown=fichier d'\u00E9tat inconnu
-lutinutil.vcs.state.unversionned=fichier non versionn\u00E9
-lutinutil.vcs.state.unversionnedOrMissing=fichier non versionn\u00E9 ou non pr\u00E9sent localement
-lutinutil.vcs.state.uptodate=fichier \u00E0 jour
-no\ properties\ found\ or\ unsafe\ properties\ found\ {0}=no properties found or unsafe properties found {0}
-the\ property\ {0}\ is\ mandatory\ but\ missed.=the property {0} is mandatory but missed.
-to\ use\ ssh\ authentication\ mode,\ you\ must\ have\ a\ username.\ {0}.=to use ssh authentication mode, you must have a username. {0}.
-to\ use\ ssh\ authentication\ mode,\ you\ must\ have\ an\ existing\ private\ key\ {0}\ \:\ {1}.=to use ssh authentication mode, you must have an existing private key {0} \: {1}.
+null)\ {\ \ \ \ \ \ \ \ \ \ \ \ logMail\ =
1
0
Author: bpoussin
Date: 2008-08-04 16:48:31 +0000 (Mon, 04 Aug 2008)
New Revision: 1280
Added:
branches/4.0.0.0/
Log:
creation de la branvhe pour le developpement de la version 4.0.0.0
Copied: branches/4.0.0.0 (from rev 1279, trunk)
1
0