Wlo-commits
Threads by month
- ----- 2026 -----
- 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
- 141 discussions
01 Mar '14
See <http://ci.codelutin.com/jenkins/job/wlo-nightly/fr.ifremer$wlo/1/>
------------------------------------------
<===[JENKINS REMOTING CAPACITY]===> channel started
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
Executing Maven: -B -f <http://ci.codelutin.com/jenkins/job/wlo-nightly/fr.ifremer$wlo/ws/pom.xml> -s /var/local/forge/data/codelutin.com/maven/settings.xml -e -U clean verify -DperformRelease
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WLO 0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ wlo ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (ensure-no-container-api) @ wlo ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ wlo ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:share-server-secret (get-redmine-login) @ wlo ---
[INFO] Exporting server [redmine-forge.codelutin.com] username in ${redmine.username}
[INFO] Exporting server [redmine-forge.codelutin.com] privateKey in ${redmine.apiKey}
[INFO]
[INFO] --- android-maven-plugin:3.8.2:generate-sources (default-generate-sources) @ wlo ---
[DEBUG] Expanding: /var/local/forge/data/codelutin.com/maven/repository/android/support/compatibility-v7-appcompat/19.0.1/compatibility-v7-appcompat-19.0.1.apklib into <http://ci.codelutin.com/jenkins/job/wlo-nightly/fr.ifremer$wlo/ws/target/un…>
[DEBUG] expand complete
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] Manifest merging disabled. Using project manifest only
[ERROR] Error when generating sources.
org.apache.maven.plugin.MojoExecutionException: No Android SDK path could be found. You may configure it in the plugin configuration section in the pom file using <sdk><path>...</path></sdk> or <properties><android.sdk.path>...</android.sdk.path></properties> or on command-line using -Dandroid.sdk.path=... or by setting environment variable ANDROID_HOME
at com.jayway.maven.plugins.android.AbstractAndroidMojo.getAndroidHomeOrThrow(AbstractAndroidMojo.java:1176)
at com.jayway.maven.plugins.android.AbstractAndroidMojo.getAndroidSdk(AbstractAndroidMojo.java:1129)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:481)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:216)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
[JENKINS] Archiving disabled
1
6
Author: tchemit
Date: 2014-02-28 14:25:58 +0100 (Fri, 28 Feb 2014)
New Revision: 56
Url: http://codelutin.com/projects/wlo/repository/revisions/56
Log:
updates mavenpom to 5.0
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-02-28 13:13:35 UTC (rev 55)
+++ trunk/pom.xml 2014-02-28 13:25:58 UTC (rev 56)
@@ -29,7 +29,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmine</artifactId>
- <version>4.5</version>
+ <version>5.0</version>
</parent>
<groupId>fr.ifremer</groupId>
@@ -41,7 +41,7 @@
Application pour les missions de recueil d'information sur les stockes pour l'observation en criée et en mer.
</description>
<inceptionYear>2013</inceptionYear>
- <url>http://forge.codelutin.com/projects/wlo</url>
+ <url>https://forge.codelutin.com/projects/wlo</url>
<licenses>
<license>
@@ -53,7 +53,7 @@
<developers>
<developer>
- <id>chemit</id>
+ <id>tchemit</id>
<name>Tony Chemit</name>
<email>chemit at codelutin dot com</email>
<organization>CodeLutin</organization>
@@ -77,17 +77,17 @@
</developers>
<scm>
- <url>https://forge.codelutin.com/svn/wlo/trunk</url>
+ <url>https://svn.codelutin.com/wlo/trunk</url>
<connection>
- scm:svn:https://svn.forge.codelutin.com/svn/wlo/trunk
+ scm:svn:https://svn.codelutin.com/wlo/trunk
</connection>
<developerConnection>
- scm:svn:https://svn.forge.codelutin.com/svn/wlo/trunk
+ scm:svn:https://svn.codelutin.com/wlo/trunk
</developerConnection>
</scm>
<distributionManagement>
<site>
- <id>${platform}</id>
+ <id>doc.${platform}</id>
<url>${our.site.repository}/${projectId}</url>
</site>
</distributionManagement>
@@ -102,7 +102,7 @@
<signatureArtifactId>java17</signatureArtifactId>
<signatureVersion>1.0</signatureVersion>
- <platform>forge.codelutin.com</platform>
+ <platform>codelutin.com</platform>
<projectId>wlo</projectId>
<maven.test.skip>true</maven.test.skip>
<!-- locales for the site generation, by default only french -->
@@ -180,7 +180,6 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
- <version>3.1</version>
</dependency>
<dependency>
@@ -193,13 +192,11 @@
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
- <version>3.2.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
- <version>2.4</version>
</dependency>
</dependencies>
@@ -207,7 +204,7 @@
<repositories>
<repository>
<id>wlo-group</id>
- <url>http://nexus.nuiton.org/nexus/content/groups/wlo-group/</url>
+ <url>https://nexus.nuiton.org/nexus/content/groups/wlo-group/</url>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
@@ -217,21 +214,12 @@
<checksumPolicy>fail</checksumPolicy>
</releases>
</repository>
-
- <!--<repository>-->
- <!--<id>android.support-mvn-repo</id>-->
- <!--<url>https://raw.github.com/kmchugh/android.support/mvn-repo</url>-->
- <!--<snapshots>-->
- <!--<enabled>true</enabled>-->
- <!--<updatePolicy>daily</updatePolicy>-->
- <!--</snapshots>-->
- <!--</repository>-->
</repositories>
<pluginRepositories>
<pluginRepository>
<id>wlo-group</id>
- <url>http://nexus.nuiton.org/nexus/content/groups/wlo-group/</url>
+ <url>https://nexus.nuiton.org/nexus/content/groups/wlo-group/</url>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
@@ -328,19 +316,6 @@
<!--</dependencies>-->
<!--</plugin>-->
- <!--<plugin>-->
- <!--<groupId>org.codehaus.mojo</groupId>-->
- <!--<artifactId>animal-sniffer-maven-plugin</artifactId>-->
- <!--<version>${animalSnifferPluginVersion}</version>-->
- <!--<configuration>-->
- <!--<signature>-->
- <!--<groupId>org.codehaus.mojo.signature</groupId>-->
- <!--<artifactId>java16-sun</artifactId>-->
- <!--<version>1.10</version>-->
- <!--</signature>-->
- <!--</configuration>-->
- <!--</plugin>-->
-
</plugins>
</build>
@@ -400,75 +375,6 @@
</profile>
<profile>
- <id>deploy-update</id>
- <activation>
- <property>
- <name>performRelease</name>
- <value>true</value>
- </property>
- </activation>
-
- <build>
- <plugins>
- <!--<plugin>-->
- <!--<artifactId>maven-antrun-plugin</artifactId>-->
- <!--<executions>-->
- <!--<execution>-->
- <!--<id>copy update-properties to site</id>-->
- <!--<phase>package</phase>-->
- <!--<inherited>false</inherited>-->
- <!--<configuration>-->
- <!--<tasks>-->
- <!--<echo message="Copy model to site" />-->
- <!--<copy verbose="true" failonerror="false" overwrite="true" filtering="true" todir="${project.build.directory}/update">-->
- <!--<filterset>-->
- <!--<filter value="${project.version}" token="projectVersion" />-->
- <!--<filter value="${jreVersion}" token="jreVersion" />-->
- <!--<filter value="${dbVersion}" token="dbVersion" />-->
- <!--</filterset>-->
- <!--<fileset dir="${basedir}/src/update/">-->
- <!--<include name="update-tutti.properties" />-->
- <!--</fileset>-->
- <!--</copy>-->
- <!--</tasks>-->
- <!--</configuration>-->
- <!--<goals>-->
- <!--<goal>run</goal>-->
- <!--</goals>-->
- <!--</execution>-->
- <!--</executions>-->
- <!--</plugin>-->
-
- <!--<plugin>-->
- <!--<groupId>org.codehaus.mojo</groupId>-->
- <!--<artifactId>wagon-maven-plugin</artifactId>-->
- <!--<version>1.0-beta-4</version>-->
- <!--<executions>-->
- <!--<execution>-->
- <!--<phase>deploy</phase>-->
- <!--<inherited>false</inherited>-->
- <!--<goals>-->
- <!--<goal>upload-single</goal>-->
- <!--</goals>-->
- <!--<configuration>-->
- <!--<serverId>forge.codelutin.com</serverId>-->
- <!--<fromFile>-->
- <!--${project.build.directory}/update/update-tutti.properties-->
- <!--</fromFile>-->
- <!--<url>-->
- <!--scpexe://forge.codelutin.com/var/www/ApplicationUpdate/http/tutti-->
- <!--</url>-->
- <!--</configuration>-->
- <!--</execution>-->
- <!--</executions>-->
-
- <!--</plugin>-->
- </plugins>
- </build>
-
- </profile>
-
- <profile>
<id>reporting</id>
<activation>
<property>
1
0
r55 - in trunk: . assets res/values res/values-fr res/xml src/fr/ifremer/wlo src/fr/ifremer/wlo/measurement src/fr/ifremer/wlo/models src/fr/ifremer/wlo/models/calcifiedPartTaking src/fr/ifremer/wlo/models/referentials/imports src/fr/ifremer/wlo/preferences src/fr/ifremer/wlo/storage src/fr/ifremer/wlo/utils/filechooser
by kmorin@users.forge.codelutin.com 28 Feb '14
by kmorin@users.forge.codelutin.com 28 Feb '14
28 Feb '14
Author: kmorin
Date: 2014-02-28 14:13:35 +0100 (Fri, 28 Feb 2014)
New Revision: 55
Url: http://codelutin.com/projects/wlo/repository/revisions/55
Log:
refs #4122 Gestion des pr?\195?\169l?\195?\168vements de pi?\195?\168ces calcifi?\195?\169es
refs #4176 Import du param?\195?\169trage de l'algorithme de pr?\195?\169l?\195?\168vement des pi?\195?\168ces calcifi?\195?\169es
fix pom to make the release
Added:
trunk/assets/ref_import_calcified_part_takings.csv
trunk/src/fr/ifremer/wlo/models/calcifiedPartTaking/
trunk/src/fr/ifremer/wlo/models/calcifiedPartTaking/CalcifiedPartTaking.java
trunk/src/fr/ifremer/wlo/models/calcifiedPartTaking/CalcifiedPartTakingRowModel.java
Modified:
trunk/pom.xml
trunk/res/values-fr/strings.xml
trunk/res/values/strings.xml
trunk/res/xml/preferences.xml
trunk/src/fr/ifremer/wlo/MainActivity.java
trunk/src/fr/ifremer/wlo/WeightsActivity.java
trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java
trunk/src/fr/ifremer/wlo/models/BaseModel.java
trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java
trunk/src/fr/ifremer/wlo/models/MeasurementsModel.java
trunk/src/fr/ifremer/wlo/models/referentials/imports/ImportUtil.java
trunk/src/fr/ifremer/wlo/preferences/SettingsActivity.java
trunk/src/fr/ifremer/wlo/storage/Exporter.java
trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java
trunk/src/fr/ifremer/wlo/utils/filechooser/FileDialog.java
Copied: trunk/assets/ref_import_calcified_part_takings.csv (from rev 29, trunk/assets/ref_import_scientific_species.csv)
===================================================================
--- trunk/assets/ref_import_calcified_part_takings.csv (rev 0)
+++ trunk/assets/ref_import_calcified_part_takings.csv 2014-02-28 13:13:35 UTC (rev 55)
@@ -0,0 +1,6 @@
+Espece_scientifique;Classe_debut;Classe_fin;Pas_de_classe;Pas;Arret
+AAPT;10;200;1;5;Inf
+AAPT;201;400;1;2;Inf
+AAPT;401;Inf;1;1;Inf
+AAPTAAP;5;Inf;5;2;5
+ABAL;10;Inf;10;5;2
\ No newline at end of file
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/pom.xml 2014-02-28 13:13:35 UTC (rev 55)
@@ -177,6 +177,31 @@
<version>3.0-alpha-1</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.json</groupId>
+ <artifactId>json</artifactId>
+ <version>20090211</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.4</version>
+ </dependency>
+
</dependencies>
<repositories>
@@ -216,6 +241,14 @@
<checksumPolicy>fail</checksumPolicy>
</releases>
</pluginRepository>
+ <pluginRepository>
+ <id>oss.sonatype.org-jayway-snapshots</id>
+ <name>Jayway OpenSource SNAPSHOTs on Sonatype.org</name>
+ <url>http://oss.sonatype.org/content/repositories/jayway-snapshots/</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
</pluginRepositories>
<build>
@@ -232,7 +265,7 @@
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
- <version>3.8.2</version>
+ <version>3.8.3-SNAPSHOT</version>
<executions>
<execution>
<id>alignApk</id>
@@ -248,6 +281,9 @@
<platform>15</platform>
</sdk>
<extractDuplicates>true</extractDuplicates>
+ <excludeJarResources>
+ <excludeJarResource>.*nuiton.*</excludeJarResource>
+ </excludeJarResources>
<!--<sign>-->
<!--<debug>false</debug>-->
<!--</sign>-->
@@ -533,6 +569,37 @@
</build>
</profile>
+ <profile>
+ <id>analyze-dependencies</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <build>
+ <defaultGoal>verify</defaultGoal>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <inherited>true</inherited>
+ <executions>
+ <execution>
+ <id>analyze</id>
+ <goals>
+ <goal>analyze-only</goal>
+ </goals>
+ <configuration>
+ <usedDependencies>
+ <usedDependency>android.support:compatibility-v7-appcompat</usedDependency>
+ </usedDependencies>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
</project>
Modified: trunk/res/values/strings.xml
===================================================================
--- trunk/res/values/strings.xml 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/res/values/strings.xml 2014-02-28 13:13:35 UTC (rev 55)
@@ -68,6 +68,9 @@
<string name="observed_number">Number of individuals observed:</string>
+ <string name="measurement_taking_message">STOP, please take calcified parts on this individual</string>
+ <string name="measurement_taking_audio_message">STOP, taking</string>
+
<!-- Home screen -->
<string name="main_open_contexts">Watch/Input data</string>
<string name="main_export_data">Export data</string>
@@ -100,6 +103,7 @@
<string name="preferences_import_scientific_species">Import scientific species</string>
<string name="preferences_import_states">Import states</string>
<string name="preferences_import_vessels">Import vessels</string>
+ <string name="preferences_import_calcified_parts_takings">Import calcified parts taking algorithm settings</string>
<string name="preferences_import_no_external_storage_title">External storage unavailable</string>
<string name="preferences_import_no_external_storage_message">No externat storage is available.\nWould you like to import the data without saving the source file?</string>
<string name="preferences_importing_referential">Importing referential data</string>
Modified: trunk/res/values-fr/strings.xml
===================================================================
--- trunk/res/values-fr/strings.xml 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/res/values-fr/strings.xml 2014-02-28 13:13:35 UTC (rev 55)
@@ -54,14 +54,17 @@
<string name="measurement_graph_title">Observations</string>
<string name="deletion">Suppression</string>
- <string name="input_deletion_confirmation_title">Supprimer une mesure</string>
- <string name="input_deletion_confirmation_message">Êtes vous sûr de vouloir\nsupprimer la saisie\n%s ?</string>
+ <string name="input_deletion_confirmation_title">Supprimer une observation</string>
+ <string name="input_deletion_confirmation_message">Êtes vous sûr de vouloir\nsupprimer l\'observation\n%s ?</string>
<string name="item_deletion_confirmation_message">Êtes vous sûr de vouloir\nsupprimer l\'élément\n%s ?</string>
<string name="undefined">Non défini</string>
<string name="observed_number">Nombre d\'individus observés :</string>
+ <string name="measurement_taking_message">STOP, merci de réaliser le prélèvement des pièces calcifiées de cet individu</string>
+ <string name="measurement_taking_audio_message">STOP, prélèvement</string>
+
<!-- Home screen -->
<string name="main_open_contexts">Voir / saisir des données</string>
<string name="main_export_data">Export des données</string>
@@ -93,6 +96,8 @@
<string name="preferences_import_scientific_species">Importer des espèces scientifiques</string>
<string name="preferences_import_states">Importer des états</string>
<string name="preferences_import_vessels">Importer des navires</string>
+ <string name="preferences_import_calcified_parts_takings">Import des paramètres des prélèvements</string>
+ <string name="preferences_import_calcified_parts_takings_summary">des pièces calcifiées</string>
<string name="preferences_import_no_external_storage_title">Stockage externe non trouvé</string>
<string name="preferences_import_no_external_storage_message">Aucun stockage externe n\'est disponible.\nVoulez vous continuer sans sauvegarder le fichier d\'origine ?</string>
<string name="preferences_importing_referential">Import des données du référentiel en cours</string>
Modified: trunk/res/xml/preferences.xml
===================================================================
--- trunk/res/xml/preferences.xml 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/res/xml/preferences.xml 2014-02-28 13:13:35 UTC (rev 55)
@@ -63,6 +63,9 @@
android:key="import_maturities"/>
<Preference android:title="@string/preferences_import_genders"
android:key="import_genders"/>
+ <Preference android:title="@string/preferences_import_calcified_parts_takings"
+ android:summary="@string/preferences_import_calcified_parts_takings_summary"
+ android:key="import_calcified_parts_takings"/>
</PreferenceScreen>
Modified: trunk/src/fr/ifremer/wlo/MainActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/MainActivity.java 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/src/fr/ifremer/wlo/MainActivity.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -29,31 +29,24 @@
import android.bluetooth.BluetoothAdapter;
import android.content.Intent;
import android.content.res.Configuration;
-import android.database.Cursor;
import android.os.Bundle;
-import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.os.Messenger;
import android.os.RemoteException;
import android.util.Log;
import android.view.View;
-import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.Toast;
-import fr.ifremer.wlo.models.ContextModel;
import fr.ifremer.wlo.models.referentials.imports.ImportUtil;
import fr.ifremer.wlo.preferences.SettingsActivity;
import fr.ifremer.wlo.storage.DataCache;
import fr.ifremer.wlo.storage.Exporter;
-import fr.ifremer.wlo.storage.WloSqlOpenHelper;
-import fr.ifremer.wlo.utils.BigFinFeedReaderRecord;
import fr.ifremer.wlo.utils.filechooser.FileDialog;
import fr.ifremer.wlo.utils.filechooser.SelectionMode;
import org.apache.commons.io.FileUtils;
import org.json.JSONException;
-import org.json.JSONObject;
import java.io.File;
import java.io.IOException;
@@ -305,8 +298,11 @@
File file = new File(selectedFile, "export" + date + ".json");
FileUtils.write(file, jsonData);
+ Toast.makeText(this, "Export effectué dans le fichier " + file.getAbsolutePath(), Toast.LENGTH_LONG).show();
+
} catch (JSONException | IOException e) {
Log.e(TAG, "error while exporting to JSON", e);
+ Toast.makeText(this, "Erreur lors de l'export", Toast.LENGTH_SHORT).show();
}
}
break;
Modified: trunk/src/fr/ifremer/wlo/WeightsActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/WeightsActivity.java 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/src/fr/ifremer/wlo/WeightsActivity.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -1,5 +1,29 @@
package fr.ifremer.wlo;
+/*
+ * #%L
+ * WLO
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor;
Modified: trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -25,6 +25,8 @@
*/
import android.app.ActionBar;
+import android.app.AlertDialog;
+import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Configuration;
import android.database.Cursor;
@@ -63,10 +65,9 @@
import fr.ifremer.wlo.ScientificSpeciesFormActivity;
import fr.ifremer.wlo.VesselFormActivity;
import fr.ifremer.wlo.WloBaseActivity;
-import fr.ifremer.wlo.WloBaseListActivity;
import fr.ifremer.wlo.WloModelEditionActivity;
import fr.ifremer.wlo.models.CategoryWeightModel;
-import fr.ifremer.wlo.models.HierarchicalModel;
+import fr.ifremer.wlo.models.calcifiedPartTaking.CalcifiedPartTaking;
import fr.ifremer.wlo.models.referentials.Mensuration;
import fr.ifremer.wlo.storage.DataCache;
import fr.ifremer.wlo.models.BaseModel;
@@ -164,6 +165,8 @@
measurements.addMeasurement(measurement);
}
}
+ fetchCalcifiedPartTakings();
+
measurements.addMeasurementsListener(new MeasurementsModel.MeasurementsListener() {
@Override
public void onMeasurementAdded(MeasurementsModel source, MeasurementModel measurement) {
@@ -353,6 +356,7 @@
break;
case 4:
scientificSpecies = (ScientificSpeciesModel) data.getSerializableExtra(WloModelEditionActivity.INTENT_EXTRA_MODEL);
+ fetchCalcifiedPartTakings();
break;
}
setDrawerListAdapter();
@@ -462,8 +466,28 @@
}
soh.saveData(measurement);
- measurements.addMeasurement(measurement);
+ boolean take = measurements.addMeasurement(measurement);
+ if (take) {
+ if (useTextToSpeech) {
+ textToSpeech.speak(getString(R.string.measurement_taking_audio_message), TextToSpeech.QUEUE_FLUSH, null);
+ } else {
+ ToneGenerator tg = new ToneGenerator(AudioManager.STREAM_NOTIFICATION, ToneGenerator.MAX_VOLUME);
+ tg.startTone(ToneGenerator.TONE_PROP_PROMPT);
+ }
+
+ // Get instance of Vibrator from current Context
+ Vibrator v = (Vibrator) getSystemService(VIBRATOR_SERVICE);
+ // Vibrate for 300 milliseconds
+ v.vibrate(300);
+
+ AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ builder.setMessage(R.string.measurement_taking_message)
+ .setPositiveButton(android.R.string.ok, UIUtils.getCancelClickListener())
+ .create()
+ .show();
+ }
+
MeasurementModel result = measurement;
initFishMeasurement(size, cat1, cat2, cat3);
@@ -552,6 +576,21 @@
}));
}
+ protected void fetchCalcifiedPartTakings() {
+ if (scientificSpecies.isTakingActivation()) {
+ WloSqlOpenHelper soh = new WloSqlOpenHelper(this);
+ Cursor cursor = soh.getAllCalcifiedPartTakings(scientificSpecies.getName().getId());
+ List<CalcifiedPartTaking> calcifiedPartTakings = WloSqlOpenHelper.transformCursorIntoCollection(cursor, new Function<Cursor, CalcifiedPartTaking>() {
+ @Override
+ public CalcifiedPartTaking apply(Cursor input) {
+ return new CalcifiedPartTaking(input);
+ }
+ });
+ soh.close();
+ measurements.setCalcifiedPartTakings(calcifiedPartTakings);
+ }
+ }
+
private class DrawerItemClickListener implements ListView.OnItemClickListener {
@Override
public void onItemClick(AdapterView parent, View view, int position, long id) {
Modified: trunk/src/fr/ifremer/wlo/models/BaseModel.java
===================================================================
--- trunk/src/fr/ifremer/wlo/models/BaseModel.java 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/src/fr/ifremer/wlo/models/BaseModel.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -199,4 +199,13 @@
}
}
+ protected void putValue(ContentValues values, String column, Float value) {
+ if (value == null) {
+ values.putNull(column);
+ Log.d(TAG, "put value null for column " + column);
+ } else {
+ values.put(column, value);
+ }
+ }
+
}
Modified: trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java
===================================================================
--- trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -1,5 +1,29 @@
package fr.ifremer.wlo.models;
+/*
+ * #%L
+ * WLO
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
Modified: trunk/src/fr/ifremer/wlo/models/MeasurementsModel.java
===================================================================
--- trunk/src/fr/ifremer/wlo/models/MeasurementsModel.java 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/src/fr/ifremer/wlo/models/MeasurementsModel.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -3,8 +3,8 @@
/*
* #%L
* WLO
- * $Id:$
- * $HeadURL:$
+ * $Id$
+ * $HeadURL$
* %%
* Copyright (C) 2013 - 2014 Ifremer
* %%
@@ -24,9 +24,11 @@
* #L%
*/
+import android.util.Log;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
+import fr.ifremer.wlo.models.calcifiedPartTaking.CalcifiedPartTaking;
import fr.ifremer.wlo.models.referentials.Mensuration;
import java.io.Serializable;
@@ -47,6 +49,8 @@
protected Multimap<Integer, MeasurementModel> measurements = HashMultimap.create();
+ protected List<CalcifiedPartTaking> calcifiedPartTakings;
+
transient protected List<MeasurementsListener> listeners = new ArrayList<MeasurementsListener>();
public ScientificSpeciesModel getScientificSpecies() {
@@ -77,10 +81,41 @@
return measurements.get(size).size();
}
- public void addMeasurement(MeasurementModel fishMeasurement) {
+ public boolean addMeasurement(MeasurementModel fishMeasurement) {
int size = fishMeasurement.getSize();
measurements.put(size, fishMeasurement);
fireMeasurementAdded(fishMeasurement);
+
+ boolean result = false;
+ Log.d(TAG, "calcifiedPartTakings : " + calcifiedPartTakings);
+ if (calcifiedPartTakings != null) {
+ CalcifiedPartTaking calcifiedPartTaking = null;
+ for (CalcifiedPartTaking cpt : calcifiedPartTakings) {
+ Log.d(TAG, "size : " + size);
+ Integer startSize = cpt.getStartSize();
+ Log.d(TAG, "startSize : " + startSize);
+ Integer endSize = cpt.getEndSize();
+ Log.d(TAG, "endSize : " + endSize);
+ if ((startSize == null || startSize <= size)
+ && (endSize == null || endSize >= size)) {
+ calcifiedPartTaking = cpt;
+ break;
+ }
+ }
+ Log.d(TAG, "calcifiedPartTaking : " + calcifiedPartTaking);
+ if (calcifiedPartTaking != null) {
+ int nb = measurements.get(size).size();
+ Log.d(TAG, "nb : " + nb);
+ int step = calcifiedPartTaking.getStep();
+ Log.d(TAG, "step : " + step);
+ Integer stop = calcifiedPartTaking.getStop();
+ Log.d(TAG, "stop : " + stop);
+ Log.d(TAG, "nb % step : " + (nb % step));
+ result = nb == 1 || (nb % step == 0 && (stop == null || nb <= stop));
+ }
+
+ }
+ return result;
}
public void removeMeasurement(MeasurementModel fishMeasurement) {
@@ -89,6 +124,14 @@
fireMeasurementRemoved(fishMeasurement);
}
+ public List<CalcifiedPartTaking> getCalcifiedPartTakings() {
+ return calcifiedPartTakings;
+ }
+
+ public void setCalcifiedPartTakings(List<CalcifiedPartTaking> calcifiedPartTakings) {
+ this.calcifiedPartTakings = calcifiedPartTakings;
+ }
+
public void addMeasurementsListener(MeasurementsListener listener) {
ensureListeners();
listeners.add(listener);
Added: trunk/src/fr/ifremer/wlo/models/calcifiedPartTaking/CalcifiedPartTaking.java
===================================================================
--- trunk/src/fr/ifremer/wlo/models/calcifiedPartTaking/CalcifiedPartTaking.java (rev 0)
+++ trunk/src/fr/ifremer/wlo/models/calcifiedPartTaking/CalcifiedPartTaking.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -0,0 +1,142 @@
+package fr.ifremer.wlo.models.calcifiedPartTaking;
+
+/*
+ * #%L
+ * WLO
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import android.content.ContentValues;
+import android.database.Cursor;
+import android.util.Log;
+import fr.ifremer.wlo.models.BaseModel;
+import fr.ifremer.wlo.models.HierarchicalModel;
+import fr.ifremer.wlo.models.referentials.ScientificSpecies;
+
+/**
+ * @author Kevin Morin (Code Lutin)
+ * @since x.x
+ */
+public class CalcifiedPartTaking extends HierarchicalModel<ScientificSpecies> {
+
+ private static final String TAG = "CalcifiedPartTaking";
+
+ public static final String TABLE_NAME = "calcifiedPartTaking";
+ public static final String COLUMN_START_SIZE = "startSize";
+ public static final String COLUMN_END_SIZE = "endSize";
+ public static final String COLUMN_SIZE_STEP = "sizeStep";
+ public static final String COLUMN_STEP = "step";
+ public static final String COLUMN_STOP = "stop";
+ public static final String COLUMN_SCIENTIFIC_SPECIES_ID = "scientificSpeciesId";
+ public static final String[] ALL_COLUMNS = new String[] {
+ _ID,
+ COLUMN_START_SIZE,
+ COLUMN_END_SIZE,
+ COLUMN_SIZE_STEP,
+ COLUMN_STEP,
+ COLUMN_STOP,
+ COLUMN_SCIENTIFIC_SPECIES_ID
+ };
+
+ @Override
+ public String getTableName() {
+ return TABLE_NAME;
+ }
+
+ protected Integer startSize;
+ protected Integer endSize;
+ protected int sizeStep;
+ protected int step;
+ protected Integer stop;
+
+ public CalcifiedPartTaking() {
+ }
+
+ public CalcifiedPartTaking(Cursor cursor) {
+ super(cursor);
+ if (!cursor.isNull(1)) {
+ startSize = cursor.getInt(1);
+ }
+ if (!cursor.isNull(2)) {
+ endSize = cursor.getInt(2);
+ }
+ if (!cursor.isNull(3)) {
+ sizeStep = cursor.getInt(3);
+ }
+ step = cursor.getInt(4);
+ if (!cursor.isNull(5)) {
+ stop = cursor.getInt(5);
+ }
+ Log.d(TAG, startSize + " " + endSize + " " + sizeStep + " " + step + " " + stop);
+ }
+
+ public Integer getStartSize() {
+ return startSize;
+ }
+
+ public void setStartSize(Integer startSize) {
+ this.startSize = startSize;
+ }
+
+ public Integer getEndSize() {
+ return endSize;
+ }
+
+ public void setEndSize(Integer endSize) {
+ this.endSize = endSize;
+ }
+
+ public int getSizeStep() {
+ return sizeStep;
+ }
+
+ public void setSizeStep(int sizeStep) {
+ this.sizeStep = sizeStep;
+ }
+
+ public int getStep() {
+ return step;
+ }
+
+ public void setStep(int step) {
+ this.step = step;
+ }
+
+ public Integer getStop() {
+ return stop;
+ }
+
+ public void setStop(Integer stop) {
+ this.stop = stop;
+ }
+
+ @Override
+ public ContentValues convertIntoContentValues() {
+ ContentValues value = super.convertIntoContentValues();
+ putValue(value, COLUMN_START_SIZE, startSize);
+ putValue(value, COLUMN_END_SIZE, endSize);
+ putValue(value, COLUMN_SIZE_STEP, sizeStep);
+ putValue(value, COLUMN_STEP, step);
+ putValue(value, COLUMN_STOP, stop);
+ putValue(value, COLUMN_SCIENTIFIC_SPECIES_ID, getParentId());
+ return value;
+ }
+}
\ No newline at end of file
Copied: trunk/src/fr/ifremer/wlo/models/calcifiedPartTaking/CalcifiedPartTakingRowModel.java (from rev 29, trunk/src/fr/ifremer/wlo/models/referentials/imports/AgeRowModel.java)
===================================================================
--- trunk/src/fr/ifremer/wlo/models/calcifiedPartTaking/CalcifiedPartTakingRowModel.java (rev 0)
+++ trunk/src/fr/ifremer/wlo/models/calcifiedPartTaking/CalcifiedPartTakingRowModel.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -0,0 +1,132 @@
+package fr.ifremer.wlo.models.calcifiedPartTaking;
+
+/*
+ * #%L
+ * WLO
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+import android.util.Log;
+import com.google.common.base.Function;
+import com.google.common.collect.Maps;
+import fr.ifremer.wlo.models.referentials.ScientificSpecies;
+import org.nuiton.csv.ValueSetter;
+import org.nuiton.csv.ext.AbstractImportExportModel;
+
+import java.util.Collection;
+import java.util.Map;
+
+/**
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since 0.1
+ */
+public class CalcifiedPartTakingRowModel extends AbstractImportExportModel<CalcifiedPartTaking> {
+
+ private static final String TAG = "CalcifiedPartTakingRowModel";
+
+ public CalcifiedPartTakingRowModel(char separator, Collection<ScientificSpecies> scientificSpecies) {
+
+ super(separator);
+
+ final Map<String, ScientificSpecies> scientificSpeciesByCode = Maps.uniqueIndex(scientificSpecies, new Function<ScientificSpecies, String>() {
+ @Override
+ public String apply(ScientificSpecies input) {
+ return input.getCode();
+ }
+ });
+
+ newMandatoryColumn("Espece_scientifique", new ValueSetter<CalcifiedPartTaking, String>() {
+ @Override
+ public void set(CalcifiedPartTaking object, String value) throws Exception {
+ if (value == null) {
+ throw new NullPointerException("L'espece scientifique ne peut etre nulle");
+ }
+ ScientificSpecies species = scientificSpeciesByCode.get(value);
+ object.setParent(species);
+ }
+ });
+
+ newMandatoryColumn("Classe_debut", new ValueSetter<CalcifiedPartTaking, String>() {
+ @Override
+ public void set(CalcifiedPartTaking object, String value) throws Exception {
+ Integer size;
+ try {
+ size = Integer.parseInt(value);
+ } catch (NumberFormatException e) {
+ size = null;
+ }
+ Log.d(TAG, object + "setStartSize " + size);
+ object.setStartSize(size);
+ }
+ });
+
+ newMandatoryColumn("Classe_fin", new ValueSetter<CalcifiedPartTaking, String>() {
+ @Override
+ public void set(CalcifiedPartTaking object, String value) throws Exception {
+ Integer size;
+ try {
+ size = Integer.parseInt(value);
+ } catch (NumberFormatException e) {
+ size = null;
+ }
+ Log.d(TAG, object + "setEndSize " + size);
+ object.setEndSize(size);
+ }
+ });
+
+ newMandatoryColumn("Pas_de_classe", new ValueSetter<CalcifiedPartTaking, String>() {
+ @Override
+ public void set(CalcifiedPartTaking object, String value) throws Exception {
+ Integer size = Integer.parseInt(value);
+ Log.d(TAG, object + "setSizeStep " + size);
+ object.setSizeStep(size);
+ }
+ });
+
+ newMandatoryColumn("Pas", new ValueSetter<CalcifiedPartTaking, String>() {
+ @Override
+ public void set(CalcifiedPartTaking object, String value) throws Exception {
+ Integer size = Integer.parseInt(value);
+ Log.d(TAG, object + "setStep " + size);
+ object.setStep(size);
+ }
+ });
+
+ newMandatoryColumn("Arret", new ValueSetter<CalcifiedPartTaking, String>() {
+ @Override
+ public void set(CalcifiedPartTaking object, String value) throws Exception {
+ Integer size;
+ try {
+ size = Integer.parseInt(value);
+ } catch (NumberFormatException e) {
+ size = null;
+ }
+ Log.d(TAG, object + "setStop " + size);
+ object.setStop(size);
+ }
+ });
+ }
+
+ @Override
+ public CalcifiedPartTaking newEmptyInstance() {
+ return new CalcifiedPartTaking();
+ }
+}
Modified: trunk/src/fr/ifremer/wlo/models/referentials/imports/ImportUtil.java
===================================================================
--- trunk/src/fr/ifremer/wlo/models/referentials/imports/ImportUtil.java 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/src/fr/ifremer/wlo/models/referentials/imports/ImportUtil.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -35,6 +35,8 @@
import com.google.common.collect.Lists;
import fr.ifremer.wlo.R;
import fr.ifremer.wlo.models.BaseModel;
+import fr.ifremer.wlo.models.calcifiedPartTaking.CalcifiedPartTaking;
+import fr.ifremer.wlo.models.calcifiedPartTaking.CalcifiedPartTakingRowModel;
import fr.ifremer.wlo.models.referentials.HasCode;
import fr.ifremer.wlo.storage.DataCache;
import fr.ifremer.wlo.storage.WloSqlOpenHelper;
@@ -49,6 +51,7 @@
import java.io.InputStream;
import java.io.StringWriter;
import java.nio.charset.Charset;
+import java.util.ArrayList;
import java.util.Collection;
/**
@@ -237,8 +240,23 @@
return result;
}
+ public static int importCalcifiedPartTakings(Context context, String path) {
+ try {
+ return importCalcifiedPartTakings(context, new FileInputStream(path));
+ } catch (FileNotFoundException e) {
+ Log.e(TAG, "File " + path + " not found", e);
+ }
+ return 0;
+ }
+
+ public static int importCalcifiedPartTakings(Context context, InputStream inputStream) {
+ CalcifiedPartTakingRowModel calcifiedPartTakingRowModel = new CalcifiedPartTakingRowModel(CSV_SEPARATOR, DataCache.getAllScientificSpecies(context));
+ int result = importData(context, calcifiedPartTakingRowModel, inputStream, new ArrayList<CalcifiedPartTaking>());
+ return result;
+ }
+
protected static <M extends BaseModel> int importData(Context context, ImportModel<M> importModel,
- InputStream inputStream, final Collection<M> actualReferential) {
+ InputStream inputStream, final Collection<M> actualReferential) {
Preconditions.checkNotNull(actualReferential);
Import<M> importer = null;
Collection<M> models = null;
Modified: trunk/src/fr/ifremer/wlo/preferences/SettingsActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/preferences/SettingsActivity.java 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/src/fr/ifremer/wlo/preferences/SettingsActivity.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -88,6 +88,8 @@
protected static final int REQUEST_IMPORT_SCIENTIFIC_SPECIES = 8;
protected static final int REQUEST_IMPORT_STATES = 9;
protected static final int REQUEST_IMPORT_VESSELS = 10;
+ protected static final int REQUEST_IMPORT_CALCIFIED_PARTS_TAKINGS = 11;
+
@Override
protected Integer getContentView() {
return null;
@@ -133,6 +135,7 @@
requestCodeByPrefKey.put("import_scientific_species", REQUEST_IMPORT_SCIENTIFIC_SPECIES);
requestCodeByPrefKey.put("import_states", REQUEST_IMPORT_STATES);
requestCodeByPrefKey.put("import_vessels", REQUEST_IMPORT_VESSELS);
+ requestCodeByPrefKey.put("import_calcified_parts_takings", REQUEST_IMPORT_CALCIFIED_PARTS_TAKINGS);
Map<String, Integer> nbElementsByPrefKey = Maps.newHashMap();
Context context = getActivity();
@@ -151,7 +154,10 @@
for (String key : requestCodeByPrefKey.keySet()) {
final Integer requestCode = requestCodeByPrefKey.get(key);
Preference filePicker = findPreference(key);
- filePicker.setSummary(getString(R.string.preferences_import_summary, nbElementsByPrefKey.get(key)));
+ Integer nb = nbElementsByPrefKey.get(key);
+ if (nb != null) {
+ filePicker.setSummary(getString(R.string.preferences_import_summary, nb));
+ }
filePicker.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
@@ -234,7 +240,7 @@
@Override
public void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
if (resultCode == RESULT_OK
- && requestCode >= REQUEST_IMPORT_AGES && requestCode <= REQUEST_IMPORT_VESSELS) {
+ && requestCode >= REQUEST_IMPORT_AGES && requestCode <= REQUEST_IMPORT_CALCIFIED_PARTS_TAKINGS) {
Context context = getActivity();
if (!StorageUtils.isExternalStorageWritable()) {
@@ -273,8 +279,8 @@
public void run() {
String path = data.getStringExtra(FileDialog.RESULT_PATH);
Log.d(TAG, path);
- final int updatedNb;
- final int newNb;
+ final Integer updatedNb;
+ final Integer newNb;
try {
switch (requestCode) {
@@ -322,9 +328,16 @@
newNb = ImportUtil.importVessels(context, path);
updatedNb = DataCache.getAllVessels(context).size();
break;
+ case REQUEST_IMPORT_CALCIFIED_PARTS_TAKINGS:
+ WloSqlOpenHelper soh = new WloSqlOpenHelper(context);
+ soh.clearCalcifiedPartTakings();
+ soh.close();
+ newNb = ImportUtil.importCalcifiedPartTakings(context, path);
+ updatedNb = null;
+ break;
default:
- newNb = 0;
- updatedNb = 0;
+ newNb = null;
+ updatedNb = null;
}
if (backupFile) {
@@ -343,10 +356,13 @@
@Override
public void run() {
dialog.dismiss();
- String key = requestCodeByPrefKey.inverse().get(requestCode);
- Preference filePicker = findPreference(key);
- filePicker.setSummary(getString(R.string.preferences_import_summary, updatedNb));
+ if (updatedNb != null) {
+ String key = requestCodeByPrefKey.inverse().get(requestCode);
+ Preference filePicker = findPreference(key);
+ filePicker.setSummary(getString(R.string.preferences_import_summary, updatedNb));
+ }
+
Toast.makeText(context, context.getString(R.string.import_new_element_number, newNb), Toast.LENGTH_SHORT).show();
}
});
Modified: trunk/src/fr/ifremer/wlo/storage/Exporter.java
===================================================================
--- trunk/src/fr/ifremer/wlo/storage/Exporter.java 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/src/fr/ifremer/wlo/storage/Exporter.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -1,5 +1,29 @@
package fr.ifremer.wlo.storage;
+/*
+ * #%L
+ * WLO
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 - 2014 Ifremer
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import android.content.Context;
import android.database.Cursor;
import com.google.common.base.Function;
Modified: trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java
===================================================================
--- trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -28,10 +28,10 @@
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
+import android.util.Log;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
import fr.ifremer.wlo.models.BaseModel;
import fr.ifremer.wlo.models.CategoryWeightModel;
import fr.ifremer.wlo.models.CommercialSpeciesModel;
@@ -41,6 +41,7 @@
import fr.ifremer.wlo.models.MetierModel;
import fr.ifremer.wlo.models.ScientificSpeciesModel;
import fr.ifremer.wlo.models.VesselModel;
+import fr.ifremer.wlo.models.calcifiedPartTaking.CalcifiedPartTaking;
import fr.ifremer.wlo.models.referentials.Age;
import fr.ifremer.wlo.models.referentials.CommercialSpecies;
import fr.ifremer.wlo.models.referentials.Gender;
@@ -55,7 +56,6 @@
import java.util.Collection;
import java.util.List;
-import java.util.Set;
import java.util.UUID;
/**
@@ -67,11 +67,12 @@
private static final String TAG = "WloOpenHelper";
public static final String DATABASE_NAME = "wlo.db";
- public static final int DATABASE_VERSION = 17;
+ public static final int DATABASE_VERSION = 18;
public static final String TEXT_TYPE = " TEXT";
- public static final String BIGINT_TYPE = " BIGINT";
- public static final String BYTE_TYPE = " BYTE";
+ public static final String INTEGER_TYPE = " INTEGER";
+ public static final String NUMERIC_TYPE = " NUMERIC";
+ public static final String REAL_TYPE = " REAL";
public static final String COMMA_SEP = ",";
public static final String NOT_NULL = " NOT NULL";
@@ -92,8 +93,8 @@
"CREATE TABLE " + LocationModel.TABLE_NAME + " (" +
LocationModel._ID + TEXT_TYPE + " PRIMARY KEY" + COMMA_SEP +
LocationModel.COLUMN_OPERATOR + TEXT_TYPE + COMMA_SEP +
- LocationModel.COLUMN_START_DATE + BIGINT_TYPE + COMMA_SEP +
- LocationModel.COLUMN_END_DATE + BIGINT_TYPE + COMMA_SEP +
+ LocationModel.COLUMN_START_DATE + INTEGER_TYPE + COMMA_SEP +
+ LocationModel.COLUMN_END_DATE + INTEGER_TYPE + COMMA_SEP +
LocationModel.COLUMN_LOCATION + TEXT_TYPE + NOT_NULL + COMMA_SEP +
LocationModel.COLUMN_COMMENT + TEXT_TYPE + COMMA_SEP +
LocationModel.COLUMN_CONTEXT_ID + TEXT_TYPE + NOT_NULL + COMMA_SEP +
@@ -112,7 +113,7 @@
VesselModel._ID + TEXT_TYPE + " PRIMARY KEY" + COMMA_SEP +
VesselModel.COLUMN_REGISTRATION_NUMBER + TEXT_TYPE + COMMA_SEP +
VesselModel.COLUMN_NAME + TEXT_TYPE + COMMA_SEP +
- VesselModel.COLUMN_LANDING_DATE + BIGINT_TYPE + COMMA_SEP +
+ VesselModel.COLUMN_LANDING_DATE + INTEGER_TYPE + COMMA_SEP +
VesselModel.COLUMN_LANDING_LOCATION + TEXT_TYPE + COMMA_SEP +
VesselModel.COLUMN_COMMENT + TEXT_TYPE + COMMA_SEP +
VesselModel.COLUMN_LOCATION_ID + TEXT_TYPE + NOT_NULL + COMMA_SEP +
@@ -150,12 +151,12 @@
CommercialSpeciesModel.COLUMN_FAO_CODE + TEXT_TYPE + COMMA_SEP +
CommercialSpeciesModel.COLUMN_MEASUREMENT_METHOD + TEXT_TYPE + COMMA_SEP +
CommercialSpeciesModel.COLUMN_PRECISION + TEXT_TYPE + COMMA_SEP +
- CommercialSpeciesModel.COLUMN_SPECIES_MIX + BYTE_TYPE + COMMA_SEP +
+ CommercialSpeciesModel.COLUMN_SPECIES_MIX + NUMERIC_TYPE + COMMA_SEP +
CommercialSpeciesModel.COLUMN_SORT_CATEGORY + TEXT_TYPE + COMMA_SEP +
CommercialSpeciesModel.COLUMN_STATE + TEXT_TYPE + COMMA_SEP +
CommercialSpeciesModel.COLUMN_PRESENTATION + TEXT_TYPE + COMMA_SEP +
CommercialSpeciesModel.COLUMN_COMMENT + TEXT_TYPE + COMMA_SEP +
- CommercialSpeciesModel.COLUMN_TOTAL_UNLOADED_WEIGHT + BIGINT_TYPE + COMMA_SEP +
+ CommercialSpeciesModel.COLUMN_TOTAL_UNLOADED_WEIGHT + INTEGER_TYPE + COMMA_SEP +
CommercialSpeciesModel.COLUMN_METIER_ID + TEXT_TYPE + NOT_NULL + COMMA_SEP +
"FOREIGN KEY(" + CommercialSpeciesModel.COLUMN_METIER_ID + ") REFERENCES " +
MetierModel.TABLE_NAME + "(" + MetierModel._ID + ") ON DELETE CASCADE" + COMMA_SEP +
@@ -177,10 +178,10 @@
"CREATE TABLE " + ScientificSpeciesModel.TABLE_NAME + " (" +
ScientificSpeciesModel._ID + TEXT_TYPE + " PRIMARY KEY" + COMMA_SEP +
ScientificSpeciesModel.COLUMN_NAME + TEXT_TYPE + COMMA_SEP +
- ScientificSpeciesModel.COLUMN_TAKING_ACTIVATION + BYTE_TYPE + COMMA_SEP +
+ ScientificSpeciesModel.COLUMN_TAKING_ACTIVATION + NUMERIC_TYPE + COMMA_SEP +
ScientificSpeciesModel.COLUMN_COMMENT + TEXT_TYPE + COMMA_SEP +
- ScientificSpeciesModel.COLUMN_SORTED_WEIGHT + BIGINT_TYPE + COMMA_SEP +
- ScientificSpeciesModel.COLUMN_SAMPLE_WEIGHT + BIGINT_TYPE + COMMA_SEP +
+ ScientificSpeciesModel.COLUMN_SORTED_WEIGHT + INTEGER_TYPE + COMMA_SEP +
+ ScientificSpeciesModel.COLUMN_SAMPLE_WEIGHT + INTEGER_TYPE + COMMA_SEP +
ScientificSpeciesModel.COLUMN_COMMERCIAL_SPECIES_ID + TEXT_TYPE + NOT_NULL + COMMA_SEP +
"FOREIGN KEY(" + ScientificSpeciesModel.COLUMN_COMMERCIAL_SPECIES_ID + ") REFERENCES " +
CommercialSpeciesModel.TABLE_NAME + "(" + CommercialSpeciesModel._ID + ") ON DELETE CASCADE" + COMMA_SEP +
@@ -195,8 +196,8 @@
protected static final String SQL_CREATE_MEASUREMENTS =
"CREATE TABLE " + MeasurementModel.TABLE_NAME + " (" +
MeasurementModel._ID + TEXT_TYPE + " PRIMARY KEY" + COMMA_SEP +
- MeasurementModel.COLUMN_SIZE + BIGINT_TYPE + COMMA_SEP +
- MeasurementModel.COLUMN_DATE + BIGINT_TYPE + COMMA_SEP +
+ MeasurementModel.COLUMN_SIZE + INTEGER_TYPE + COMMA_SEP +
+ MeasurementModel.COLUMN_DATE + INTEGER_TYPE + COMMA_SEP +
MeasurementModel.COLUMN_CATEGORY_1 + TEXT_TYPE + COMMA_SEP +
MeasurementModel.COLUMN_CATEGORY_2 + TEXT_TYPE + COMMA_SEP +
MeasurementModel.COLUMN_CATEGORY_3 + TEXT_TYPE + COMMA_SEP +
@@ -215,7 +216,7 @@
CategoryWeightModel.COLUMN_CATEGORY_1 + TEXT_TYPE + COMMA_SEP +
CategoryWeightModel.COLUMN_CATEGORY_2 + TEXT_TYPE + COMMA_SEP +
CategoryWeightModel.COLUMN_CATEGORY_3 + TEXT_TYPE + COMMA_SEP +
- CategoryWeightModel.COLUMN_WEIGHT + BIGINT_TYPE + COMMA_SEP +
+ CategoryWeightModel.COLUMN_WEIGHT + INTEGER_TYPE + COMMA_SEP +
CategoryWeightModel.COLUMN_SCIENTIFIC_SPECIES_ID + TEXT_TYPE + NOT_NULL + COMMA_SEP +
"FOREIGN KEY(" + CategoryWeightModel.COLUMN_SCIENTIFIC_SPECIES_ID + ") REFERENCES " +
ScientificSpeciesModel.TABLE_NAME + "(" + ScientificSpeciesModel._ID + ") ON DELETE CASCADE" +
@@ -224,6 +225,23 @@
protected static final String SQL_DELETE_CATEGORY_WEIGHTS =
"DROP TABLE IF EXISTS " + CategoryWeightModel.TABLE_NAME;
+ // CALCIFIED PART TAKING
+ protected static final String SQL_CREATE_CALCIFIED_PART_TAKINGS =
+ "CREATE TABLE " + CalcifiedPartTaking.TABLE_NAME + " (" +
+ CalcifiedPartTaking._ID + TEXT_TYPE + " PRIMARY KEY" + COMMA_SEP +
+ CalcifiedPartTaking.COLUMN_START_SIZE + INTEGER_TYPE + COMMA_SEP +
+ CalcifiedPartTaking.COLUMN_END_SIZE + INTEGER_TYPE + COMMA_SEP +
+ CalcifiedPartTaking.COLUMN_SIZE_STEP + INTEGER_TYPE + COMMA_SEP +
+ CalcifiedPartTaking.COLUMN_STEP + INTEGER_TYPE + COMMA_SEP +
+ CalcifiedPartTaking.COLUMN_STOP + INTEGER_TYPE + COMMA_SEP +
+ CalcifiedPartTaking.COLUMN_SCIENTIFIC_SPECIES_ID + TEXT_TYPE + NOT_NULL + COMMA_SEP +
+ "FOREIGN KEY(" + CalcifiedPartTaking.COLUMN_SCIENTIFIC_SPECIES_ID + ") REFERENCES " +
+ ScientificSpecies.TABLE_NAME + "(" + ScientificSpecies._ID + ") ON DELETE CASCADE" +
+ " )";
+
+ protected static final String SQL_DELETE_CALCIFIED_PART_TAKINGS =
+ "DROP TABLE IF EXISTS " + CalcifiedPartTaking.TABLE_NAME;
+
// Referentials
// Ages
@@ -247,7 +265,7 @@
CommercialSpecies.COLUMN_FRENCH_LABEL + TEXT_TYPE + COMMA_SEP +
CommercialSpecies.COLUMN_FAMILY + TEXT_TYPE + COMMA_SEP +
CommercialSpecies.COLUMN_SPECIES_ORDER + TEXT_TYPE + COMMA_SEP +
- CommercialSpecies.COLUMN_ACTIVE + BYTE_TYPE +
+ CommercialSpecies.COLUMN_ACTIVE + NUMERIC_TYPE +
" )";
protected static final String SQL_DELETE_REF_COMMERCIAL_SPECIES =
@@ -308,8 +326,8 @@
Metier.COLUMN_GEAR_LABEL + TEXT_TYPE + COMMA_SEP +
Metier.COLUMN_SPECIES_CODE + TEXT_TYPE + COMMA_SEP +
Metier.COLUMN_SPECIES_LABEL + TEXT_TYPE + COMMA_SEP +
- Metier.COLUMN_FISHING + BYTE_TYPE + COMMA_SEP +
- Metier.COLUMN_ACTIVE + BYTE_TYPE +
+ Metier.COLUMN_FISHING + NUMERIC_TYPE + COMMA_SEP +
+ Metier.COLUMN_ACTIVE + NUMERIC_TYPE +
" )";
protected static final String SQL_DELETE_REF_METIERS =
@@ -390,12 +408,14 @@
db.execSQL(SQL_CREATE_SCIENTIFIC_SPECIES);
db.execSQL(SQL_CREATE_MEASUREMENTS);
db.execSQL(SQL_CREATE_CATEGORY_WEIGHTS);
+ db.execSQL(SQL_CREATE_CALCIFIED_PART_TAKINGS);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
//TODO kmorin 20131129 migrate data before droping the table
// models
+ db.execSQL(SQL_DELETE_CALCIFIED_PART_TAKINGS);
db.execSQL(SQL_DELETE_CATEGORY_WEIGHTS);
db.execSQL(SQL_DELETE_MEASUREMENTS);
db.execSQL(SQL_DELETE_SCIENTIFIC_SPECIES);
@@ -549,6 +569,21 @@
return cursor;
}
+ // CALCIFIED PART TAKING
+
+ public Cursor getAllCalcifiedPartTakings(String scientificSpeciesId) {
+ SQLiteDatabase db = getReadableDatabase();
+ Cursor cursor = db.query(CalcifiedPartTaking.TABLE_NAME, CalcifiedPartTaking.ALL_COLUMNS,
+ CalcifiedPartTaking.COLUMN_SCIENTIFIC_SPECIES_ID + " = ?", new String[]{ scientificSpeciesId },
+ null, null, CalcifiedPartTaking.COLUMN_START_SIZE + " ASC");
+ return cursor;
+ }
+
+ public void clearCalcifiedPartTakings() {
+ SQLiteDatabase db = getWritableDatabase();
+ db.delete(CalcifiedPartTaking.TABLE_NAME, null, null);
+ }
+
// Referentials
public Cursor getAllRefAges() {
Modified: trunk/src/fr/ifremer/wlo/utils/filechooser/FileDialog.java
===================================================================
--- trunk/src/fr/ifremer/wlo/utils/filechooser/FileDialog.java 2014-02-23 17:32:50 UTC (rev 54)
+++ trunk/src/fr/ifremer/wlo/utils/filechooser/FileDialog.java 2014-02-28 13:13:35 UTC (rev 55)
@@ -88,7 +88,7 @@
/**
* Parametro de entrada da Activity: tipo de selecao: pode criar novos paths
* ou nao. Padrao: nao permite.
- *
+ *
* @see {@link SelectionMode}
*/
public static final String SELECTION_MODE = "SELECTION_MODE";
@@ -224,7 +224,7 @@
/**
* Monta a estrutura de arquivos e diretorios filhos do diretorio fornecido.
- *
+ *
* @param dirPath
* Diretorio pai.
*/
@@ -385,7 +385,7 @@
/**
* Define se o botao de CREATE e visivel.
- *
+ *
* @param v
*/
private void setCreateVisible(View v) {
@@ -398,7 +398,7 @@
/**
* Define se o botao de SELECT e visivel.
- *
+ *
* @param v
*/
private void setSelectVisible(View v) {
1
0
See <http://ci.codelutin.com/jenkins/job/wlo-ci/7/changes>
Changes:
[kmorin] fixes #4207 Retour sur le mauvais écran après un "back" depuis les observations
------------------------------------------
Started by an SCM change
Building in workspace <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/>
Updating https://forge.codelutin.com/svn/wlo/trunk at revision '2014-02-19T15:20:40.114 +0100'
U AndroidManifest.xml
U src/fr/ifremer/wlo/MainActivity.java
U src/fr/ifremer/wlo/VesselFormActivity.java
U src/fr/ifremer/wlo/measurement/MeasurementActivity.java
U src/fr/ifremer/wlo/BigFinCommunicationService.java
U src/fr/ifremer/wlo/WloBaseActivity.java
U src/fr/ifremer/wlo/LocationFormActivity.java
U src/fr/ifremer/wlo/ScientificSpeciesActivity.java
U src/fr/ifremer/wlo/WloModelEditionActivity.java
U src/fr/ifremer/wlo/ContextFormActivity.java
U src/fr/ifremer/wlo/MetierFormActivity.java
U src/fr/ifremer/wlo/CommercialSpeciesFormActivity.java
U src/fr/ifremer/wlo/ScientificSpeciesFormActivity.java
U res/drawable/weight.png
D res/layout/main.xml
A res/layout/main.xml
At revision 52
Parsing POMs
[trunk] $ /opt/jdk7/bin/java -Dsettings.security=/var/local/forge/data/codelutin.com/maven/settings-security.xml -Djava.awt.headless=true -cp /var/local/forge/data/codelutin.com/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-agent-1.4.jar:/opt/maven3/boot/plexus-classworlds-2.5.1.jar:/opt/maven3/conf/logging jenkins.maven3.agent.Maven31Main /opt/maven3 /var/local/forge/exec/tomcat-codelutin.com/webapps/jenkins/WEB-INF/lib/remoting-2.33.jar /var/local/forge/data/codelutin.com/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-interceptor-1.4.jar /var/local/forge/data/codelutin.com/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.4.jar 53438
<===[JENKINS REMOTING CAPACITY]===> channel started
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
Executing Maven: -B -f <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/pom.xml> -s /var/local/forge/data/codelutin.com/maven/settings.xml -e -U clean verify
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WLO 0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ wlo ---
[INFO] Deleting <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ wlo ---
[INFO]
[INFO] --- android-maven-plugin:3.8.2:generate-sources (default-generate-sources) @ wlo ---
[DEBUG] Expanding: /var/local/forge/data/codelutin.com/maven/repository/android/support/compatibility-v7-appcompat/19.0.1/compatibility-v7-appcompat-19.0.1.apklib into <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/unpacked-libs/an…>
[DEBUG] expand complete
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] Manifest merging disabled. Using project manifest only
[INFO] /opt/android/build-tools/android-4.4/aapt [package, -f, --no-crunch, -I, /opt/android/platforms/android-15/android.jar, -M, <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/AndroidManifest.xml,> -S, <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/res,> -S, <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/unpacked-libs/an…,> -A, <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/generated-source…,> -m, -J, <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/generated-source…,> --output-text-symbols, <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target,> --auto-add-overlay]
[INFO] <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/res/layout/main.xml>:13: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/wlo_ico_transparent').
[ERROR] Error when generating sources.
org.apache.maven.plugin.MojoExecutionException:
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:593)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:216)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: com.jayway.maven.plugins.android.ExecutionException: ANDROID-040-001: Could not execute: Command = /bin/sh -c cd <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk> && /opt/android/build-tools/android-4.4/aapt package -f --no-crunch -I /opt/android/platforms/android-15/android.jar -M <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/AndroidManifest.xml> -S <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/res> -S <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/unpacked-libs/an…> -A <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/generated-source…> -m -J <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/generated-source…> --output-text-symbols <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target> --auto-add-overlay, Result = 1
at com.jayway.maven.plugins.android.CommandExecutor$Factory$DefaultCommandExecutor.executeCommand(CommandExecutor.java:246)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:589)
... 33 more
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.713s
[INFO] Finished at: Wed Feb 19 15:20:47 CET 2014
[INFO] Final Memory: 20M/437M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:generate-sources (default-generate-sources) on project wlo: MojoExecutionException: ANDROID-040-001: Could not execute: Command = /bin/sh -c cd <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk> && /opt/android/build-tools/android-4.4/aapt package -f --no-crunch -I /opt/android/platforms/android-15/android.jar -M <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/AndroidManifest.xml> -S <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/res> -S <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/unpacked-libs/an…> -A <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/generated-source…> -m -J <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/generated-source…> --output-text-symbols <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target> --auto-add-overlay, Result = 1 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:generate-sources (default-generate-sources) on project wlo:
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.apache.maven.plugin.MojoExecutionException:
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:593)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:216)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 30 more
Caused by: com.jayway.maven.plugins.android.ExecutionException: ANDROID-040-001: Could not execute: Command = /bin/sh -c cd <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk> && /opt/android/build-tools/android-4.4/aapt package -f --no-crunch -I /opt/android/platforms/android-15/android.jar -M <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/AndroidManifest.xml> -S <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/res> -S <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/unpacked-libs/an…> -A <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/generated-source…> -m -J <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target/generated-source…> --output-text-symbols <http://ci.codelutin.com/jenkins/job/wlo-ci/ws/trunk/target> --auto-add-overlay, Result = 1
at com.jayway.maven.plugins.android.CommandExecutor$Factory$DefaultCommandExecutor.executeCommand(CommandExecutor.java:246)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:589)
... 33 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Sending e-mails to: wlo-commits(a)list.forge.codelutin.com morin(a)codelutin.com
channel stopped
1
2
23 Feb '14
See <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/7/changes>
Changes:
[kmorin] fixes #4207 Retour sur le mauvais écran après un "back" depuis les observations
------------------------------------------
<===[JENKINS REMOTING CAPACITY]===> channel started
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
Executing Maven: -B -f <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/pom.xml> -s /var/local/forge/data/codelutin.com/maven/settings.xml -e -U clean verify
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WLO 0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ wlo ---
[INFO] Deleting <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/target>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ wlo ---
[INFO]
[INFO] --- android-maven-plugin:3.8.2:generate-sources (default-generate-sources) @ wlo ---
[DEBUG] Expanding: /var/local/forge/data/codelutin.com/maven/repository/android/support/compatibility-v7-appcompat/19.0.1/compatibility-v7-appcompat-19.0.1.apklib into <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/target/unpacke…>
[DEBUG] expand complete
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] Manifest merging disabled. Using project manifest only
[INFO] /opt/android/build-tools/android-4.4/aapt [package, -f, --no-crunch, -I, /opt/android/platforms/android-15/android.jar, -M, <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/AndroidManifes…,> -S, <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/res,> -S, <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/target/unpacke…,> -A, <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/target/generat…,> -m, -J, <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/target/generat…,> --output-text-symbols, <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/target,> --auto-add-overlay]
[INFO] <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/res/layout/mai…>:13: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/wlo_ico_transparent').
[ERROR] Error when generating sources.
org.apache.maven.plugin.MojoExecutionException:
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:593)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:216)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: com.jayway.maven.plugins.android.ExecutionException: ANDROID-040-001: Could not execute: Command = /bin/sh -c cd <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/> && /opt/android/build-tools/android-4.4/aapt package -f --no-crunch -I /opt/android/platforms/android-15/android.jar -M <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/AndroidManifes…> -S <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/res> -S <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/target/unpacke…> -A <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/target/generat…> -m -J <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/target/generat…> --output-text-symbols <http://ci.codelutin.com/jenkins/job/wlo-ci/fr.ifremer$wlo/ws/target> --auto-add-overlay, Result = 1
at com.jayway.maven.plugins.android.CommandExecutor$Factory$DefaultCommandExecutor.executeCommand(CommandExecutor.java:246)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR(GenerateSourcesMojo.java:589)
... 33 more
[JENKINS] Archiving disabled
1
2
Author: kmorin
Date: 2014-02-23 18:32:50 +0100 (Sun, 23 Feb 2014)
New Revision: 54
Url: http://forge.codelutin.com/projects/wlo/repository/revisions/54
Log:
refs #4193 [EXPORT] ?\195?\137cran Export des donn?\195?\169es
Added:
trunk/res/drawable/wlo_ico_small.png
trunk/res/drawable/wlo_ico_transparent.png
Added: trunk/res/drawable/wlo_ico_small.png
===================================================================
(Binary files differ)
Property changes on: trunk/res/drawable/wlo_ico_small.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/res/drawable/wlo_ico_transparent.png
===================================================================
(Binary files differ)
Property changes on: trunk/res/drawable/wlo_ico_transparent.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
1
0
r53 - in trunk: . res/layout src/fr/ifremer/wlo src/fr/ifremer/wlo/storage
by kmorin@users.forge.codelutin.com 23 Feb '14
by kmorin@users.forge.codelutin.com 23 Feb '14
23 Feb '14
Author: kmorin
Date: 2014-02-23 18:05:13 +0100 (Sun, 23 Feb 2014)
New Revision: 53
Url: http://forge.codelutin.com/projects/wlo/repository/revisions/53
Log:
refs #4193 [EXPORT] ?\195?\137cran Export des donn?\195?\169es
Added:
trunk/src/fr/ifremer/wlo/storage/Exporter.java
Modified:
trunk/pom.xml
trunk/res/layout/main.xml
trunk/src/fr/ifremer/wlo/MainActivity.java
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-02-19 14:00:00 UTC (rev 52)
+++ trunk/pom.xml 2014-02-23 17:05:13 UTC (rev 53)
@@ -166,13 +166,6 @@
</dependency>
<dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>${gsonVersion}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
<groupId>org.achartengine</groupId>
<artifactId>achartengine</artifactId>
<version>1.1.0</version>
Modified: trunk/res/layout/main.xml
===================================================================
--- trunk/res/layout/main.xml 2014-02-19 14:00:00 UTC (rev 52)
+++ trunk/res/layout/main.xml 2014-02-23 17:05:13 UTC (rev 53)
@@ -30,7 +30,8 @@
android:onClick="openContexts"/>
<Button style="@style/MainButton"
- android:text="@string/main_export_data"/>
+ android:text="@string/main_export_data"
+ android:onClick="export"/>
<Button style="@style/MainButton"
android:id="@+id/main_connect_ichtyometer_button"
Modified: trunk/src/fr/ifremer/wlo/MainActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/MainActivity.java 2014-02-19 14:00:00 UTC (rev 52)
+++ trunk/src/fr/ifremer/wlo/MainActivity.java 2014-02-23 17:05:13 UTC (rev 53)
@@ -29,7 +29,9 @@
import android.bluetooth.BluetoothAdapter;
import android.content.Intent;
import android.content.res.Configuration;
+import android.database.Cursor;
import android.os.Bundle;
+import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.os.Messenger;
@@ -40,13 +42,22 @@
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.Toast;
+import fr.ifremer.wlo.models.ContextModel;
import fr.ifremer.wlo.models.referentials.imports.ImportUtil;
import fr.ifremer.wlo.preferences.SettingsActivity;
import fr.ifremer.wlo.storage.DataCache;
+import fr.ifremer.wlo.storage.Exporter;
import fr.ifremer.wlo.storage.WloSqlOpenHelper;
import fr.ifremer.wlo.utils.BigFinFeedReaderRecord;
+import fr.ifremer.wlo.utils.filechooser.FileDialog;
+import fr.ifremer.wlo.utils.filechooser.SelectionMode;
+import org.apache.commons.io.FileUtils;
+import org.json.JSONException;
+import org.json.JSONObject;
+import java.io.File;
import java.io.IOException;
+import java.util.Date;
/**
* @author kmorin <kmorin(a)codelutin.com>
@@ -58,6 +69,7 @@
protected static final int REQUEST_ENABLE_BT = 1;
protected static final int REQUEST_CONNECT_ICHTYOMETER = 2;
+ protected static final int REQUEST_SELECT_EXPORT_FOLDER = 3;
// Local Bluetooth adapter
protected BluetoothAdapter mBluetoothAdapter = null;
@@ -215,6 +227,47 @@
setOrientation(newConfig.orientation);
}
+ public void openContexts(View source) {
+ startActivity(new Intent(this, ContextsActivity.class));
+ }
+
+ public void connectIchtyometer(View source) {
+ // If BT is not on, request that it be enabled.
+ if (!mBluetoothAdapter.isEnabled()) {
+ Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
+ startActivityForResult(enableIntent, REQUEST_ENABLE_BT);
+
+ } else {
+ selectDevice();
+ }
+ }
+
+ public void disconnectIchtyometer(View source) {
+ Message message = Message.obtain(null, BigFinCommunicationService.MESSAGE_DISCONNECT_DEVICE);
+ try {
+ mServiceMessenger.send(message);
+
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error while sending data to the service");
+ }
+ }
+
+ public void openSettings(View source) {
+ startActivity(new Intent(this, SettingsActivity.class));
+ }
+
+ public void export(View source) {
+ Intent intent = new Intent(this, FileDialog.class); //Intent to start openIntents File Manager
+ intent.putExtra(FileDialog.START_PATH, "/sdcard");
+ intent.putExtra(FileDialog.CAN_SELECT_DIR, true);
+ intent.putExtra(FileDialog.SELECTION_MODE, SelectionMode.MODE_OPEN);
+
+ //alternatively you can set file filter
+ intent.putExtra(FileDialog.FORMAT_FILTER, new String[] { "json" });
+
+ startActivityForResult(intent, REQUEST_SELECT_EXPORT_FOLDER);
+ }
+
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
@@ -239,6 +292,24 @@
}
break;
+ case REQUEST_SELECT_EXPORT_FOLDER:
+ if (resultCode == Activity.RESULT_OK) {
+ try {
+ String jsonData = Exporter.exportData(this);
+
+ File selectedFile = new File(data.getStringExtra(FileDialog.RESULT_PATH));
+ if (selectedFile.isFile()) {
+ selectedFile = selectedFile.getParentFile();
+ }
+ String date = String.format("-%1$tY%1$tm%1$td-%1$tH%1$tM%1$tS", new Date());
+ File file = new File(selectedFile, "export" + date + ".json");
+ FileUtils.write(file, jsonData);
+
+ } catch (JSONException | IOException e) {
+ Log.e(TAG, "error while exporting to JSON", e);
+ }
+ }
+ break;
}
}
@@ -248,20 +319,20 @@
if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
logoParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
- LinearLayout.LayoutParams.MATCH_PARENT);
+ LinearLayout.LayoutParams.MATCH_PARENT);
logoParams.weight = 1.0f;
buttonParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
- LinearLayout.LayoutParams.MATCH_PARENT);
+ LinearLayout.LayoutParams.MATCH_PARENT);
buttonParams.weight = 1.0f;
} else {
logoParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
- LinearLayout.LayoutParams.WRAP_CONTENT);
+ LinearLayout.LayoutParams.WRAP_CONTENT);
logoParams.weight = 1.0f;
buttonParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
- LinearLayout.LayoutParams.WRAP_CONTENT);
+ LinearLayout.LayoutParams.WRAP_CONTENT);
buttonParams.weight = 0.0f;
}
logoPanel.setLayoutParams(logoParams);
@@ -269,35 +340,6 @@
mainPanel.setOrientation(orientation);
}
- public void openContexts(View source) {
- startActivity(new Intent(this, ContextsActivity.class));
- }
-
- public void connectIchtyometer(View source) {
- // If BT is not on, request that it be enabled.
- if (!mBluetoothAdapter.isEnabled()) {
- Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
- startActivityForResult(enableIntent, REQUEST_ENABLE_BT);
-
- } else {
- selectDevice();
- }
- }
-
- public void disconnectIchtyometer(View source) {
- Message message = Message.obtain(null, BigFinCommunicationService.MESSAGE_DISCONNECT_DEVICE);
- try {
- mServiceMessenger.send(message);
-
- } catch (RemoteException e) {
- Log.e(TAG, "Error while sending data to the service");
- }
- }
-
- public void openSettings(View source) {
- startActivity(new Intent(this, SettingsActivity.class));
- }
-
protected void selectDevice() {
// Launch the DeviceListActivity to see devices and do scan
Intent serverIntent = new Intent(this, DeviceListActivity.class);
Added: trunk/src/fr/ifremer/wlo/storage/Exporter.java
===================================================================
--- trunk/src/fr/ifremer/wlo/storage/Exporter.java (rev 0)
+++ trunk/src/fr/ifremer/wlo/storage/Exporter.java 2014-02-23 17:05:13 UTC (rev 53)
@@ -0,0 +1,392 @@
+package fr.ifremer.wlo.storage;
+
+import android.content.Context;
+import android.database.Cursor;
+import com.google.common.base.Function;
+import com.google.common.base.Preconditions;
+import fr.ifremer.wlo.models.*;
+import fr.ifremer.wlo.models.referentials.*;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.text.SimpleDateFormat;
+import java.util.List;
+
+/**
+ * @author Kevin Morin (Code Lutin)
+ * @since x.x
+ */
+public class Exporter {
+
+ public static final SimpleDateFormat UTC_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSZ");
+
+ public static String exportData(Context context) throws JSONException {
+ WloSqlOpenHelper soh = new WloSqlOpenHelper(context);
+ JSONArray root = new JSONArray();
+ try {
+
+ Cursor cursor = soh.getAllContexts();
+ List<ContextModel> contexts = WloSqlOpenHelper.transformCursorIntoCollection(cursor, new Function<Cursor, ContextModel>() {
+ @Override
+ public ContextModel apply(Cursor input) {
+ return new ContextModel(input);
+ }
+ });
+ for (ContextModel contextModel : contexts) {
+ JSONObject jsonContext = createJSONContextModel(contextModel, context, soh);
+ root.put(jsonContext);
+ }
+
+ } finally {
+ soh.close();
+ }
+ return root.toString(2);
+ }
+
+ public static JSONObject createJSONContextModel(ContextModel model,
+ final Context context,
+ WloSqlOpenHelper soh) throws JSONException {
+ Preconditions.checkNotNull(model);
+ Preconditions.checkNotNull(soh);
+
+ JSONObject jsonContext = new JSONObject();
+ jsonContext.put("contexte", model.getName());
+ jsonContext.put("commentaire", model.getComment());
+
+ Cursor cursor = soh.getAllLocations(model.getId());
+ List<LocationModel> locations = WloSqlOpenHelper.transformCursorIntoCollection(cursor, new Function<Cursor, LocationModel>() {
+ @Override
+ public LocationModel apply(Cursor input) {
+ return new LocationModel(context, input);
+ }
+ });
+ JSONArray jsonLocations = new JSONArray();
+ for (LocationModel location : locations) {
+ JSONObject jsonLocation = createJSONLocationModel(location, context, soh);
+ jsonLocations.put(jsonLocation);
+ }
+ jsonContext.put("lieux", jsonLocations);
+ cursor.close();
+
+ return jsonContext;
+ }
+
+ public static JSONObject createJSONLocationModel(LocationModel model,
+ final Context context,
+ WloSqlOpenHelper soh) throws JSONException {
+ Preconditions.checkNotNull(model);
+ Preconditions.checkNotNull(soh);
+
+ JSONObject jsonLocation = new JSONObject();
+
+ jsonLocation.put("lieu", createJSONLocation(model.getLocation()));
+ if (model.getStartDate() != null) {
+ jsonLocation.put("date-début", UTC_DATE_FORMAT.format(model.getStartDate().getTime()));
+ }
+ if (model.getEndDate() != null) {
+ jsonLocation.put("date-fin", UTC_DATE_FORMAT.format(model.getEndDate().getTime()));
+ }
+ jsonLocation.put("observateur", model.getOperator());
+ jsonLocation.put("commentaire", model.getComment());
+
+ Cursor cursor = soh.getAllVessels(model.getId());
+ List<VesselModel> vessels = WloSqlOpenHelper.transformCursorIntoCollection(cursor, new Function<Cursor, VesselModel>() {
+ @Override
+ public VesselModel apply(Cursor input) {
+ return new VesselModel(context, input);
+ }
+ });
+ JSONArray jsonVessels = new JSONArray();
+ for (VesselModel vessel : vessels) {
+ JSONObject jsonVessel = createJSONVesselModel(vessel, context, soh);
+ jsonVessels.put(jsonVessel);
+ }
+ jsonLocation.put("navires", jsonVessels);
+ cursor.close();
+
+ return jsonLocation;
+ }
+
+ public static JSONObject createJSONVesselModel(VesselModel model,
+ final Context context,
+ WloSqlOpenHelper soh) throws JSONException {
+ Preconditions.checkNotNull(model);
+ Preconditions.checkNotNull(soh);
+
+ JSONObject jsonVessel = new JSONObject();
+
+ jsonVessel.put("immatriculation", model.getRegistrationNumber());
+ jsonVessel.put("nom", model.getRegistrationNumber());
+ if (model.getLandingDate() != null) {
+ jsonVessel.put("date-débarquement", UTC_DATE_FORMAT.format(model.getLandingDate().getTime()));
+ }
+ jsonVessel.put("lieu-débarquement", createJSONLocation(model.getLandingLocation()));
+ jsonVessel.put("commentaire", model.getComment());
+
+ Cursor cursor = soh.getAllMetiers(model.getId());
+ List<MetierModel> metiers = WloSqlOpenHelper.transformCursorIntoCollection(cursor, new Function<Cursor, MetierModel>() {
+ @Override
+ public MetierModel apply(Cursor input) {
+ return new MetierModel(context, input);
+ }
+ });
+ JSONArray jsonMetiers = new JSONArray();
+ for (MetierModel metier : metiers) {
+ JSONObject jsonMetier = createJSONMetierModel(metier, context, soh);
+ jsonMetiers.put(jsonMetier);
+ }
+ jsonVessel.put("métiers", jsonMetiers);
+ cursor.close();
+
+ return jsonVessel;
+ }
+
+ public static JSONObject createJSONMetierModel(MetierModel model,
+ final Context context,
+ WloSqlOpenHelper soh) throws JSONException {
+ Preconditions.checkNotNull(model);
+ Preconditions.checkNotNull(soh);
+
+ JSONObject jsonMetier = new JSONObject();
+
+ jsonMetier.put("engin-espèce", createJSONMetier(model.getGearSpecies()));
+ jsonMetier.put("secteur", model.getZone());
+ jsonMetier.put("référence-plan", model.getSampleRowCode());
+ jsonMetier.put("commentaire", model.getComment());
+
+ Cursor cursor = soh.getAllCommercialSpecies(model.getId());
+ List<CommercialSpeciesModel> commercialSpecies = WloSqlOpenHelper.transformCursorIntoCollection(cursor, new Function<Cursor, CommercialSpeciesModel>() {
+ @Override
+ public CommercialSpeciesModel apply(Cursor input) {
+ return new CommercialSpeciesModel(context, input);
+ }
+ });
+ JSONArray jsonCommercialSpeciesArray = new JSONArray();
+ for (CommercialSpeciesModel commercialSpeciesModel : commercialSpecies) {
+ JSONObject jsonCommercialSpecies = createJSONComercialSpeciesModel(commercialSpeciesModel, context, soh);
+ jsonCommercialSpeciesArray.put(jsonCommercialSpecies);
+ }
+ jsonMetier.put("espèces-fao", jsonCommercialSpeciesArray);
+ cursor.close();
+
+ return jsonMetier;
+ }
+
+ public static JSONObject createJSONComercialSpeciesModel(CommercialSpeciesModel model,
+ final Context context,
+ WloSqlOpenHelper soh) throws JSONException {
+ Preconditions.checkNotNull(model);
+ Preconditions.checkNotNull(soh);
+
+ JSONObject jsonCommercialSpecies = new JSONObject();
+
+ jsonCommercialSpecies.put("espèce-fao", createJSONCommercialSpecies(model.getFaoCode()));
+ jsonCommercialSpecies.put("méthode-mensuration", createJSONMensuration(model.getMeasurementMethod()));
+ jsonCommercialSpecies.put("état", createJSONState(model.getState()));
+ jsonCommercialSpecies.put("présentation", createJSONPresentation(model.getPresentation()));
+ jsonCommercialSpecies.put("précision", model.getPrecision().getValue());
+ jsonCommercialSpecies.put("mélange-espèces", model.isSpeciesMix());
+ jsonCommercialSpecies.put("catégorie-tri", model.getSortCategory());
+ jsonCommercialSpecies.put("poids-total-déchargé", model.getTotalUnloadedWeight());
+ jsonCommercialSpecies.put("commentaire", model.getComment());
+
+ Cursor cursor = soh.getAllScientificSpecies(model.getId());
+ List<ScientificSpeciesModel> scientificSpecies = WloSqlOpenHelper.transformCursorIntoCollection(cursor, new Function<Cursor, ScientificSpeciesModel>() {
+ @Override
+ public ScientificSpeciesModel apply(Cursor input) {
+ return new ScientificSpeciesModel(context, input);
+ }
+ });
+ JSONArray jsonScientificSpeciesArray = new JSONArray();
+ for (ScientificSpeciesModel scientificSpeciesModel : scientificSpecies) {
+ JSONObject jsonScientificSpecies = createJSONScientificSpeciesModel(scientificSpeciesModel, context, soh);
+ jsonScientificSpeciesArray.put(jsonScientificSpecies);
+ }
+ jsonCommercialSpecies.put("espèces-scientifiques", jsonScientificSpeciesArray);
+ cursor.close();
+
+ return jsonCommercialSpecies;
+ }
+
+ public static JSONObject createJSONScientificSpeciesModel(ScientificSpeciesModel model,
+ final Context context,
+ WloSqlOpenHelper soh) throws JSONException {
+ Preconditions.checkNotNull(model);
+ Preconditions.checkNotNull(soh);
+
+ JSONObject jsonScientificSpeciesModel = new JSONObject();
+ jsonScientificSpeciesModel.put("espèce-scientifique", createJSONScientificSpecies(model.getName()));
+ jsonScientificSpeciesModel.put("prélèvement-pièces-calcifiées", model.isTakingActivation());
+ jsonScientificSpeciesModel.put("commentaire", model.getComment());
+ jsonScientificSpeciesModel.put("poids-trié", model.getSortedWeight());
+ jsonScientificSpeciesModel.put("poids-échantillon", model.getSampleWeight());
+
+ Cursor cursor = soh.getAllMeasurements(model.getId());
+ List<MeasurementModel> measurements = WloSqlOpenHelper.transformCursorIntoCollection(cursor, new Function<Cursor, MeasurementModel>() {
+ @Override
+ public MeasurementModel apply(Cursor input) {
+ return new MeasurementModel(input);
+ }
+ });
+ JSONArray jsonMeasurements = new JSONArray();
+ for (MeasurementModel measurement : measurements) {
+ JSONObject jsonMeasurement = createJSONMeasurementModel(measurement, context);
+ jsonMeasurements.put(jsonMeasurement);
+ }
+ jsonScientificSpeciesModel.put("observations", jsonMeasurements);
+ cursor.close();
+
+ cursor = soh.getAllCategoryWeigths(model.getId());
+ List<CategoryWeightModel> categoryWeights = WloSqlOpenHelper.transformCursorIntoCollection(cursor, new Function<Cursor, CategoryWeightModel>() {
+ @Override
+ public CategoryWeightModel apply(Cursor input) {
+ return new CategoryWeightModel(input);
+ }
+ });
+ JSONArray jsonCategoryWeightModels = new JSONArray();
+ for (CategoryWeightModel categoryWeight : categoryWeights) {
+ JSONObject jsonCategoryWeightModel = createJSONCategoryWeightModel(categoryWeight, context);
+ jsonCategoryWeightModels.put(jsonCategoryWeightModel);
+ }
+ jsonScientificSpeciesModel.put("poids-par-categorie", jsonCategoryWeightModels);
+ cursor.close();
+
+ return jsonScientificSpeciesModel;
+ }
+
+ public static JSONObject createJSONMeasurementModel(MeasurementModel model,
+ final Context context) throws JSONException {
+ Preconditions.checkNotNull(model);
+
+ JSONObject jsonMeasurementModel = new JSONObject();
+ jsonMeasurementModel.put("sexe", createJSONGender(DataCache.getGenderById(context, model.getCategory1())));
+ Maturity maturity = DataCache.getMaturityById(context, model.getCategory2());
+ if (maturity != null) {
+ jsonMeasurementModel.put("maturité", maturity.getLabel());
+ }
+ Age age = DataCache.getAgeById(context, model.getCategory3());
+ if (age != null) {
+ jsonMeasurementModel.put("âge", age.getLabel());
+ }
+ jsonMeasurementModel.put("taille", model.getSize());
+ jsonMeasurementModel.put("date", UTC_DATE_FORMAT.format(model.getDate().getTime()));
+
+ return jsonMeasurementModel;
+ }
+
+ public static JSONObject createJSONCategoryWeightModel(CategoryWeightModel model,
+ final Context context) throws JSONException {
+ Preconditions.checkNotNull(model);
+
+ JSONObject jsonCategoryWeightModel = new JSONObject();
+ jsonCategoryWeightModel.put("sexe", createJSONGender(DataCache.getGenderById(context, model.getCategory1())));
+ Maturity maturity = DataCache.getMaturityById(context, model.getCategory2());
+ if (maturity != null) {
+ jsonCategoryWeightModel.put("maturité", maturity.getLabel());
+ }
+ Age age = DataCache.getAgeById(context, model.getCategory3());
+ if (age != null) {
+ jsonCategoryWeightModel.put("âge", age.getLabel());
+ }
+ jsonCategoryWeightModel.put("poids", model.getWeight());
+
+ return jsonCategoryWeightModel;
+ }
+
+ public static JSONObject createJSONLocation(Location location) throws JSONException {
+ if (location == null) {
+ return null;
+ }
+ JSONObject jsonLocation = new JSONObject();
+ jsonLocation.put("type", location.getTypeLabel());
+ jsonLocation.put("code", location.getCode());
+ jsonLocation.put("libellé", location.getLabel());
+ return jsonLocation;
+ }
+
+ public static JSONObject createJSONMetier(Metier metier) throws JSONException {
+ if (metier == null) {
+ return null;
+ }
+ JSONObject jsonMetier = new JSONObject();
+ jsonMetier.put("id", metier.getId());
+ jsonMetier.put("code", metier.getCode());
+ jsonMetier.put("libellé", metier.getLabel());
+ jsonMetier.put("engin-code", metier.getGearCode());
+ jsonMetier.put("engin-libellé", metier.getGearLabel());
+ jsonMetier.put("espece-code", metier.getSpeciesCode());
+ jsonMetier.put("espece-libellé", metier.getSpeciesLabel());
+ jsonMetier.put("pêche", metier.getFishing());
+ jsonMetier.put("actif", metier.getActive());
+ return jsonMetier;
+ }
+
+ public static JSONObject createJSONCommercialSpecies(CommercialSpecies commercialSpecies) throws JSONException {
+ if (commercialSpecies == null) {
+ return null;
+ }
+ JSONObject jsonCommercialSpecies = new JSONObject();
+ jsonCommercialSpecies.put("code", commercialSpecies.getCode());
+ jsonCommercialSpecies.put("isscap", commercialSpecies.getIsscap());
+ jsonCommercialSpecies.put("code-taxon", commercialSpecies.getTaxonCode());
+ jsonCommercialSpecies.put("libellé-scientifique", commercialSpecies.getScientificLabel());
+ jsonCommercialSpecies.put("libellé-français", commercialSpecies.getFrenchLabel());
+ jsonCommercialSpecies.put("famille", commercialSpecies.getFamily());
+ jsonCommercialSpecies.put("ordre", commercialSpecies.getSpeciesOrder());
+ jsonCommercialSpecies.put("actif", commercialSpecies.getActive());
+ return jsonCommercialSpecies;
+ }
+
+ public static JSONObject createJSONMensuration(Mensuration mensuration) throws JSONException {
+ if (mensuration == null) {
+ return null;
+ }
+ JSONObject jsonMensuration = new JSONObject();
+ jsonMensuration.put("code", mensuration.getCode());
+ jsonMensuration.put("libellé", mensuration.getLabel());
+ return jsonMensuration;
+ }
+
+ public static JSONObject createJSONState(State state) throws JSONException {
+ if (state == null) {
+ return null;
+ }
+ JSONObject jsonState = new JSONObject();
+ jsonState.put("code", state.getCode());
+ jsonState.put("libellé", state.getLabel());
+ return jsonState;
+ }
+
+ public static JSONObject createJSONPresentation(Presentation presentation) throws JSONException {
+ if (presentation == null) {
+ return null;
+ }
+ JSONObject jsonPresentation = new JSONObject();
+ jsonPresentation.put("code", presentation.getCode());
+ jsonPresentation.put("libellé", presentation.getLabel());
+ return jsonPresentation;
+ }
+
+ public static JSONObject createJSONScientificSpecies(ScientificSpecies scientificSpecies) throws JSONException {
+ if (scientificSpecies == null) {
+ return null;
+ }
+ JSONObject jsonScientificSpecies = new JSONObject();
+ jsonScientificSpecies.put("code", scientificSpecies.getCode());
+ jsonScientificSpecies.put("libellé", scientificSpecies.getLabel());
+ jsonScientificSpecies.put("perm-code", scientificSpecies.getPermCode());
+ return jsonScientificSpecies;
+ }
+
+ public static JSONObject createJSONGender(Gender gender) throws JSONException {
+ if (gender == null) {
+ return null;
+ }
+ JSONObject jsonGender = new JSONObject();
+ jsonGender.put("code", gender.getCode());
+ jsonGender.put("libellé", gender.getLabel());
+ return jsonGender;
+ }
+
+}
\ No newline at end of file
1
0
r52 - in trunk: . res/drawable res/layout src/fr/ifremer/wlo src/fr/ifremer/wlo/measurement
by kmorin@users.forge.codelutin.com 19 Feb '14
by kmorin@users.forge.codelutin.com 19 Feb '14
19 Feb '14
Author: kmorin
Date: 2014-02-19 15:00:00 +0100 (Wed, 19 Feb 2014)
New Revision: 52
Url: http://forge.codelutin.com/projects/wlo/repository/revisions/52
Log:
fixes #4207 Retour sur le mauvais ?\195?\169cran apr?\195?\168s un "back" depuis les observations
Added:
trunk/res/layout/main.xml
Removed:
trunk/res/layout/main.xml
Modified:
trunk/AndroidManifest.xml
trunk/res/drawable/weight.png
trunk/src/fr/ifremer/wlo/BigFinCommunicationService.java
trunk/src/fr/ifremer/wlo/CommercialSpeciesFormActivity.java
trunk/src/fr/ifremer/wlo/ContextFormActivity.java
trunk/src/fr/ifremer/wlo/LocationFormActivity.java
trunk/src/fr/ifremer/wlo/MainActivity.java
trunk/src/fr/ifremer/wlo/MetierFormActivity.java
trunk/src/fr/ifremer/wlo/ScientificSpeciesActivity.java
trunk/src/fr/ifremer/wlo/ScientificSpeciesFormActivity.java
trunk/src/fr/ifremer/wlo/VesselFormActivity.java
trunk/src/fr/ifremer/wlo/WloBaseActivity.java
trunk/src/fr/ifremer/wlo/WloModelEditionActivity.java
trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java
Modified: trunk/AndroidManifest.xml
===================================================================
--- trunk/AndroidManifest.xml 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/AndroidManifest.xml 2014-02-19 14:00:00 UTC (rev 52)
@@ -26,7 +26,7 @@
<uses-permission android:name="android.permission.VIBRATE"/>
<application android:label="@string/app_name"
- android:icon="@drawable/wlo_ico"
+ android:icon="@drawable/wlo_ico_small"
android:theme="@style/Theme.AppCompat">
<service android:name=".BigFinCommunicationService" />
Modified: trunk/res/drawable/weight.png
===================================================================
(Binary files differ)
Deleted: trunk/res/layout/main.xml
===================================================================
--- trunk/res/layout/main.xml 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/res/layout/main.xml 2014-02-19 14:00:00 UTC (rev 52)
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <ImageView android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:src="@drawable/wlo_ico"
- android:layout_weight="1"/>
-
- <TextView style="@style/MainTitle"
- android:text="@string/app_name"
- android:layout_weight="1"/>
-
- <Button style="@style/MainButton"
- android:text="@string/main_open_contexts"
- android:onClick="openContexts"/>
-
- <Button style="@style/MainButton"
- android:text="@string/main_export_data"/>
-
- <Button style="@style/MainButton"
- android:id="@+id/main_connect_ichtyometer_button"
- android:text="@string/main_connect_ichtyometer"
- android:onClick="connectIchtyometer"/>
-
- <Button style="@style/MainButton"
- android:id="@+id/main_disconnect_ichtyometer_button"
- android:text="@string/main_disconnect_ichtyometer"
- android:onClick="disconnectIchtyometer"/>
-
- <Button style="@style/MainButton"
- android:text="@string/main_settings"
- android:onClick="openSettings"/>
-
-</LinearLayout>
\ No newline at end of file
Added: trunk/res/layout/main.xml
===================================================================
--- trunk/res/layout/main.xml (rev 0)
+++ trunk/res/layout/main.xml 2014-02-19 14:00:00 UTC (rev 52)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/main_panel"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <LinearLayout android:id="@+id/logo_panel"
+ android:orientation="vertical"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content">
+
+ <ImageView android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:src="@drawable/wlo_ico_transparent"/>
+
+ <TextView style="@style/MainTitle"
+ android:text="@string/app_name"/>
+
+ </LinearLayout>
+
+ <LinearLayout android:id="@+id/button_panel"
+ android:orientation="vertical"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center">
+
+ <Button style="@style/MainButton"
+ android:text="@string/main_open_contexts"
+ android:onClick="openContexts"/>
+
+ <Button style="@style/MainButton"
+ android:text="@string/main_export_data"/>
+
+ <Button style="@style/MainButton"
+ android:id="@+id/main_connect_ichtyometer_button"
+ android:text="@string/main_connect_ichtyometer"
+ android:onClick="connectIchtyometer"/>
+
+ <Button style="@style/MainButton"
+ android:id="@+id/main_disconnect_ichtyometer_button"
+ android:text="@string/main_disconnect_ichtyometer"
+ android:onClick="disconnectIchtyometer"/>
+
+ <Button style="@style/MainButton"
+ android:text="@string/main_settings"
+ android:onClick="openSettings"/>
+
+ </LinearLayout>
+
+</LinearLayout>
\ No newline at end of file
Modified: trunk/src/fr/ifremer/wlo/BigFinCommunicationService.java
===================================================================
--- trunk/src/fr/ifremer/wlo/BigFinCommunicationService.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/BigFinCommunicationService.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -130,7 +130,8 @@
setState(STATE_NONE);
notificationBuilder = new NotificationCompat.Builder(this)
- .setSmallIcon(R.drawable.wlo_ico);
+ .setSmallIcon(R.drawable.wlo_ico_small)
+ .setContentIntent(PendingIntent.getActivity(this, -1, new Intent(this, MainActivity.class), PendingIntent.FLAG_CANCEL_CURRENT));
updateNotification(false);
Modified: trunk/src/fr/ifremer/wlo/CommercialSpeciesFormActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/CommercialSpeciesFormActivity.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/CommercialSpeciesFormActivity.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -78,6 +78,11 @@
}
@Override
+ protected Class<? extends WloBaseListActivity> getNextListActivity() {
+ return ScientificSpeciesActivity.class;
+ }
+
+ @Override
protected CommercialSpeciesModel createNewModel() {
return new CommercialSpeciesModel();
}
Modified: trunk/src/fr/ifremer/wlo/ContextFormActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/ContextFormActivity.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/ContextFormActivity.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -52,6 +52,11 @@
}
@Override
+ protected Class<? extends WloBaseListActivity> getNextListActivity() {
+ return LocationsActivity.class;
+ }
+
+ @Override
protected ContextModel createNewModel() {
return new ContextModel();
}
Modified: trunk/src/fr/ifremer/wlo/LocationFormActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/LocationFormActivity.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/LocationFormActivity.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -67,6 +67,11 @@
}
@Override
+ protected Class<? extends WloBaseListActivity> getNextListActivity() {
+ return VesselsActivity.class;
+ }
+
+ @Override
protected LocationModel createNewModel() {
return new LocationModel();
}
Modified: trunk/src/fr/ifremer/wlo/MainActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/MainActivity.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/MainActivity.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -28,6 +28,7 @@
import android.app.ProgressDialog;
import android.bluetooth.BluetoothAdapter;
import android.content.Intent;
+import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
@@ -35,7 +36,9 @@
import android.os.RemoteException;
import android.util.Log;
import android.view.View;
+import android.view.ViewGroup;
import android.widget.Button;
+import android.widget.LinearLayout;
import android.widget.Toast;
import fr.ifremer.wlo.models.referentials.imports.ImportUtil;
import fr.ifremer.wlo.preferences.SettingsActivity;
@@ -59,6 +62,10 @@
// Local Bluetooth adapter
protected BluetoothAdapter mBluetoothAdapter = null;
+ protected LinearLayout mainPanel;
+ protected LinearLayout logoPanel;
+ protected LinearLayout buttonPanel;
+
protected Button connectButton;
protected Button disconnectButton;
protected ProgressDialog dialog;
@@ -94,6 +101,10 @@
super.onCreate(savedInstanceState);
+ mainPanel = (LinearLayout) findViewById(R.id.main_panel);
+ logoPanel = (LinearLayout) findViewById(R.id.logo_panel);
+ buttonPanel = (LinearLayout) findViewById(R.id.button_panel);
+
// Get local Bluetooth adapter
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
@@ -106,6 +117,9 @@
disconnectButton = (Button) findViewById(R.id.main_disconnect_ichtyometer_button);
bigfinDisconnected();
+ Configuration config = getResources().getConfiguration();
+ setOrientation(config.orientation);
+
dialog = new ProgressDialog(this);
dialog.setIndeterminate(false);
dialog.setCancelable(false);
@@ -196,6 +210,12 @@
}
@Override
+ public void onConfigurationChanged(Configuration newConfig) {
+ super.onConfigurationChanged(newConfig);
+ setOrientation(newConfig.orientation);
+ }
+
+ @Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
@@ -223,6 +243,32 @@
}
+ protected void setOrientation(int orientation) {
+ LinearLayout.LayoutParams logoParams, buttonParams;
+
+ if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
+ logoParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
+ LinearLayout.LayoutParams.MATCH_PARENT);
+ logoParams.weight = 1.0f;
+
+ buttonParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
+ LinearLayout.LayoutParams.MATCH_PARENT);
+ buttonParams.weight = 1.0f;
+
+ } else {
+ logoParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
+ LinearLayout.LayoutParams.WRAP_CONTENT);
+ logoParams.weight = 1.0f;
+
+ buttonParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
+ LinearLayout.LayoutParams.WRAP_CONTENT);
+ buttonParams.weight = 0.0f;
+ }
+ logoPanel.setLayoutParams(logoParams);
+ buttonPanel.setLayoutParams(buttonParams);
+ mainPanel.setOrientation(orientation);
+ }
+
public void openContexts(View source) {
startActivity(new Intent(this, ContextsActivity.class));
}
Modified: trunk/src/fr/ifremer/wlo/MetierFormActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/MetierFormActivity.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/MetierFormActivity.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -59,6 +59,11 @@
}
@Override
+ protected Class<? extends WloBaseListActivity> getNextListActivity() {
+ return CommercialSpeciesActivity.class;
+ }
+
+ @Override
protected MetierModel createNewModel() {
return new MetierModel();
}
Modified: trunk/src/fr/ifremer/wlo/ScientificSpeciesActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/ScientificSpeciesActivity.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/ScientificSpeciesActivity.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -60,7 +60,7 @@
public boolean onCreateOptionsMenu(Menu menu) {
CommercialSpeciesModel parent = (CommercialSpeciesModel) parentModel;
MenuInflater inflater = getMenuInflater();
- if (parent.isSpeciesMix() || adapter.getCount() == 0) {
+ if (parent != null && parent.isSpeciesMix() || adapter.getCount() == 0) {
inflater.inflate(R.menu.model_list_menu, menu);
}
inflater.inflate(R.menu.weight_menu, menu);
Modified: trunk/src/fr/ifremer/wlo/ScientificSpeciesFormActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/ScientificSpeciesFormActivity.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/ScientificSpeciesFormActivity.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -72,6 +72,11 @@
}
@Override
+ protected Class<? extends WloBaseListActivity> getNextListActivity() {
+ return null;
+ }
+
+ @Override
protected ScientificSpeciesModel createNewModel() {
return new ScientificSpeciesModel();
}
Modified: trunk/src/fr/ifremer/wlo/VesselFormActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/VesselFormActivity.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/VesselFormActivity.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -74,6 +74,11 @@
}
@Override
+ protected Class<? extends WloBaseListActivity> getNextListActivity() {
+ return MetiersActivity.class;
+ }
+
+ @Override
protected VesselModel createNewModel() {
return new VesselModel();
}
Modified: trunk/src/fr/ifremer/wlo/WloBaseActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/WloBaseActivity.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/WloBaseActivity.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -59,7 +59,7 @@
}
ActionBar actionBar = getSupportActionBar();
- actionBar.setDisplayHomeAsUpEnabled(true);
+ actionBar.setDisplayHomeAsUpEnabled(getUpActivity() != null);
bindService(new Intent(this, BigFinCommunicationService.class), this, Context.BIND_AUTO_CREATE);
}
@@ -123,7 +123,7 @@
public Intent getSupportParentActivityIntent() {
Class upClass = getUpActivity();
if (upClass == null) {
- return null;
+ return super.getSupportParentActivityIntent();
}
Intent intent = new Intent(this, upClass);
return intent;
Modified: trunk/src/fr/ifremer/wlo/WloModelEditionActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/WloModelEditionActivity.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/WloModelEditionActivity.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -71,6 +71,8 @@
protected abstract Class<? extends WloModelEditionActivity> getNextEditionActivity();
+ protected abstract Class<? extends WloBaseListActivity> getNextListActivity();
+
protected abstract M createNewModel();
@Override
@@ -98,8 +100,7 @@
model.setModified(true);
}
});
- getWindow().setSoftInputMode(
- WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
+ getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
}
@Override
@@ -161,8 +162,8 @@
saveModel();
if (newModel) {
-
- Intent intent = new Intent(this, getNextEditionActivity());
+// Intent intent = new Intent(this, getNextEditionActivity());
+ Intent intent = new Intent(this, getNextListActivity());
intent.putExtra(WloModelEditionActivity.INTENT_EXTRA_PARENT_MODEL, model);
startActivity(intent);
Modified: trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java 2014-02-19 10:19:58 UTC (rev 51)
+++ trunk/src/fr/ifremer/wlo/measurement/MeasurementActivity.java 2014-02-19 14:00:00 UTC (rev 52)
@@ -63,8 +63,10 @@
import fr.ifremer.wlo.ScientificSpeciesFormActivity;
import fr.ifremer.wlo.VesselFormActivity;
import fr.ifremer.wlo.WloBaseActivity;
+import fr.ifremer.wlo.WloBaseListActivity;
import fr.ifremer.wlo.WloModelEditionActivity;
import fr.ifremer.wlo.models.CategoryWeightModel;
+import fr.ifremer.wlo.models.HierarchicalModel;
import fr.ifremer.wlo.models.referentials.Mensuration;
import fr.ifremer.wlo.storage.DataCache;
import fr.ifremer.wlo.models.BaseModel;
1
0
Author: kmorin
Date: 2014-02-19 11:19:58 +0100 (Wed, 19 Feb 2014)
New Revision: 51
Url: http://forge.codelutin.com/projects/wlo/repository/revisions/51
Log:
fixes #4192 [SAISIE] ?\195?\137cran des poids [niveau 5 ?\195?\160 7]
Modified:
trunk/src/fr/ifremer/wlo/WeightsActivity.java
Modified: trunk/src/fr/ifremer/wlo/WeightsActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/WeightsActivity.java 2014-02-19 10:17:11 UTC (rev 50)
+++ trunk/src/fr/ifremer/wlo/WeightsActivity.java 2014-02-19 10:19:58 UTC (rev 51)
@@ -233,11 +233,10 @@
int inputType = InputType.TYPE_CLASS_NUMBER;
String textValue = null;
+ if (weightUnit > 1) {
+ inputType |= InputType.TYPE_NUMBER_FLAG_DECIMAL;
+ }
if (value != null) {
- if (weightUnit > 1) {
- inputType |= InputType.TYPE_NUMBER_FLAG_DECIMAL;
- }
-
if (weightUnit > 1 && value != null) {
float floatValue = (float) value / weightUnit;
textValue = String.format(Locale.US, "%.3f", floatValue);
1
0
r50 - in trunk: res/values res/values-fr src/fr/ifremer/wlo src/fr/ifremer/wlo/models src/fr/ifremer/wlo/storage src/fr/ifremer/wlo/utils
by kmorin@users.forge.codelutin.com 19 Feb '14
by kmorin@users.forge.codelutin.com 19 Feb '14
19 Feb '14
Author: kmorin
Date: 2014-02-19 11:17:11 +0100 (Wed, 19 Feb 2014)
New Revision: 50
Url: http://forge.codelutin.com/projects/wlo/repository/revisions/50
Log:
fixes #4192 [SAISIE] ?\195?\137cran des poids [niveau 5 ?\195?\160 7]
Modified:
trunk/res/values-fr/strings.xml
trunk/res/values/strings.xml
trunk/src/fr/ifremer/wlo/WeightsActivity.java
trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java
trunk/src/fr/ifremer/wlo/models/CommercialSpeciesModel.java
trunk/src/fr/ifremer/wlo/models/ScientificSpeciesModel.java
trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java
trunk/src/fr/ifremer/wlo/utils/BigFinFeedReaderRecord.java
Modified: trunk/res/values/strings.xml
===================================================================
--- trunk/res/values/strings.xml 2014-02-17 13:32:31 UTC (rev 49)
+++ trunk/res/values/strings.xml 2014-02-19 10:17:11 UTC (rev 50)
@@ -171,8 +171,9 @@
<!-- Weights -->
<string name="weights_title">Weights</string>
<string name="commercial_species_total_unloaded_weight">Total unloaded weight</string>
+ <string name="scientific_species_sorted_weight">Sorted weight</string>
<string name="scientific_species_sample_weight">Sample weight</string>
- <string name="scientific_species_categories">Weights per category</string>
+ <string name="scientific_species_categories">Weights per category (gender / maturity / age)</string>
<!--File chooser-->
<string name="file_chooser_location">Location</string>
Modified: trunk/res/values-fr/strings.xml
===================================================================
--- trunk/res/values-fr/strings.xml 2014-02-17 13:32:31 UTC (rev 49)
+++ trunk/res/values-fr/strings.xml 2014-02-19 10:17:11 UTC (rev 50)
@@ -164,8 +164,9 @@
<!-- Weights -->
<string name="weights_title">Poids</string>
<string name="commercial_species_total_unloaded_weight">Poids total débarqué</string>
+ <string name="scientific_species_sample_weight">Poids trié</string>
<string name="scientific_species_sample_weight">Poids d\'échantillon</string>
- <string name="scientific_species_categories">Poids par catégorie</string>
+ <string name="scientific_species_categories">Poids par catégorie (Sexe / maturité / age)</string>
<!--File chooser-->
<string name="file_chooser_location">Emplacement</string>
Modified: trunk/src/fr/ifremer/wlo/WeightsActivity.java
===================================================================
--- trunk/src/fr/ifremer/wlo/WeightsActivity.java 2014-02-17 13:32:31 UTC (rev 49)
+++ trunk/src/fr/ifremer/wlo/WeightsActivity.java 2014-02-19 10:17:11 UTC (rev 50)
@@ -26,6 +26,7 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.Locale;
/**
* @author Kevin Morin (Code Lutin)
@@ -109,6 +110,18 @@
container.addView(labelView);
// add label
+ createWeightLabel(getString(R.string.scientific_species_sorted_weight));
+
+ // create the sorted weight field
+ createEditText(scientificSpecies.getSortedWeight(), new Function<Integer, Void>() {
+ @Override
+ public Void apply(Integer input) {
+ scientificSpecies.setSortedWeight(input);
+ return null;
+ }
+ });
+
+ // add label
createWeightLabel(getString(R.string.scientific_species_sample_weight));
// create the sample weight field
@@ -201,7 +214,12 @@
public void onTextChanged(CharSequence s, int start, int before, int count) {
Integer newValue = null;
if (StringUtils.isNotEmpty(s)) {
- newValue = Integer.parseInt(s.toString());
+ if (weightUnit > 1) {
+ newValue = (int) (Float.parseFloat(s.toString()) * weightUnit);
+
+ } else {
+ newValue = Integer.parseInt(s.toString());
+ }
}
setWeightFunction.apply(newValue);
editText.setSelection(start + count);
@@ -213,18 +231,20 @@
final EditText editText = new EditText(this);
int inputType = InputType.TYPE_CLASS_NUMBER;
- String textValue;
+ String textValue = null;
- if (weightUnit > 1) {
- inputType |= InputType.TYPE_NUMBER_FLAG_DECIMAL;
- }
+ if (value != null) {
+ if (weightUnit > 1) {
+ inputType |= InputType.TYPE_NUMBER_FLAG_DECIMAL;
+ }
- if (weightUnit > 1 && value != null) {
- float floatValue = (float) value / weightUnit;
- textValue = String.format("%.3f", floatValue);
+ if (weightUnit > 1 && value != null) {
+ float floatValue = (float) value / weightUnit;
+ textValue = String.format(Locale.US, "%.3f", floatValue);
- } else {
- textValue = String.valueOf(value);
+ } else {
+ textValue = String.valueOf(value);
+ }
}
editText.setInputType(inputType);
editText.setText(textValue);
Modified: trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java
===================================================================
--- trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java 2014-02-17 13:32:31 UTC (rev 49)
+++ trunk/src/fr/ifremer/wlo/models/CategoryWeightModel.java 2014-02-19 10:17:11 UTC (rev 50)
@@ -46,7 +46,9 @@
category1 = cursor.getString(1);
category2 = cursor.getString(2);
category3 = cursor.getString(3);
- weight = cursor.getInt(4);
+ if (!cursor.isNull(4)) {
+ weight = cursor.getInt(4);
+ }
}
public String getCategory1() {
return category1;
Modified: trunk/src/fr/ifremer/wlo/models/CommercialSpeciesModel.java
===================================================================
--- trunk/src/fr/ifremer/wlo/models/CommercialSpeciesModel.java 2014-02-17 13:32:31 UTC (rev 49)
+++ trunk/src/fr/ifremer/wlo/models/CommercialSpeciesModel.java 2014-02-19 10:17:11 UTC (rev 50)
@@ -99,7 +99,9 @@
String presentationId = cursor.getString(7);
presentation = DataCache.getPresentationById(context, presentationId);
comment = cursor.getString(8);
- totalUnloadedWeight = cursor.getInt(9);
+ if (!cursor.isNull(9)) {
+ totalUnloadedWeight = cursor.getInt(9);
+ }
}
public CommercialSpecies getFaoCode() {
Modified: trunk/src/fr/ifremer/wlo/models/ScientificSpeciesModel.java
===================================================================
--- trunk/src/fr/ifremer/wlo/models/ScientificSpeciesModel.java 2014-02-17 13:32:31 UTC (rev 49)
+++ trunk/src/fr/ifremer/wlo/models/ScientificSpeciesModel.java 2014-02-19 10:17:11 UTC (rev 50)
@@ -44,6 +44,7 @@
public static final String COLUMN_NAME = "name";
public static final String COLUMN_TAKING_ACTIVATION = "takingActivation";
public static final String COLUMN_COMMENT = "comment";
+ public static final String COLUMN_SORTED_WEIGHT = "sortedWeight";
public static final String COLUMN_SAMPLE_WEIGHT = "sampleWeight";
public static final String COLUMN_COMMERCIAL_SPECIES_ID = "commercialSpeciesId";
public static final String[] ALL_COLUMNS = new String[] {
@@ -51,6 +52,7 @@
COLUMN_NAME,
COLUMN_TAKING_ACTIVATION,
COLUMN_COMMENT,
+ COLUMN_SORTED_WEIGHT,
COLUMN_SAMPLE_WEIGHT,
COLUMN_COMMERCIAL_SPECIES_ID
};
@@ -58,6 +60,7 @@
protected ScientificSpecies name;
protected boolean takingActivation;
protected String comment;
+ protected Integer sortedWeight;
protected Integer sampleWeight;
public ScientificSpeciesModel() {
@@ -69,7 +72,12 @@
name = DataCache.getScientificSpeciesById(context, nameId);
takingActivation = cursor.getShort(2) > 0;
comment = cursor.getString(3);
- sampleWeight = cursor.getInt(4);
+ if (!cursor.isNull(4)) {
+ sortedWeight = cursor.getInt(4);
+ }
+ if (!cursor.isNull(5)) {
+ sampleWeight = cursor.getInt(5);
+ }
}
public ScientificSpecies getName() {
@@ -102,6 +110,16 @@
firePropertyChange(COLUMN_COMMENT, oldValue, comment);
}
+ public Integer getSortedWeight() {
+ return sortedWeight;
+ }
+
+ public void setSortedWeight(Integer sortedWeight) {
+ Object oldValue = this.sortedWeight;
+ this.sortedWeight = sortedWeight;
+ firePropertyChange(COLUMN_SORTED_WEIGHT, oldValue, sortedWeight);
+ }
+
public Integer getSampleWeight() {
return sampleWeight;
}
@@ -128,6 +146,7 @@
putValue(value, COLUMN_NAME, name != null ? name.getId() : null);
putValue(value, COLUMN_TAKING_ACTIVATION, takingActivation ? 1 : 0);
putValue(value, COLUMN_COMMENT, comment);
+ putValue(value, COLUMN_SORTED_WEIGHT, sortedWeight);
putValue(value, COLUMN_SAMPLE_WEIGHT, sampleWeight);
putValue(value, COLUMN_COMMERCIAL_SPECIES_ID, getParentId());
return value;
Modified: trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java
===================================================================
--- trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java 2014-02-17 13:32:31 UTC (rev 49)
+++ trunk/src/fr/ifremer/wlo/storage/WloSqlOpenHelper.java 2014-02-19 10:17:11 UTC (rev 50)
@@ -67,7 +67,7 @@
private static final String TAG = "WloOpenHelper";
public static final String DATABASE_NAME = "wlo.db";
- public static final int DATABASE_VERSION = 16;
+ public static final int DATABASE_VERSION = 17;
public static final String TEXT_TYPE = " TEXT";
public static final String BIGINT_TYPE = " BIGINT";
@@ -179,6 +179,7 @@
ScientificSpeciesModel.COLUMN_NAME + TEXT_TYPE + COMMA_SEP +
ScientificSpeciesModel.COLUMN_TAKING_ACTIVATION + BYTE_TYPE + COMMA_SEP +
ScientificSpeciesModel.COLUMN_COMMENT + TEXT_TYPE + COMMA_SEP +
+ ScientificSpeciesModel.COLUMN_SORTED_WEIGHT + BIGINT_TYPE + COMMA_SEP +
ScientificSpeciesModel.COLUMN_SAMPLE_WEIGHT + BIGINT_TYPE + COMMA_SEP +
ScientificSpeciesModel.COLUMN_COMMERCIAL_SPECIES_ID + TEXT_TYPE + NOT_NULL + COMMA_SEP +
"FOREIGN KEY(" + ScientificSpeciesModel.COLUMN_COMMERCIAL_SPECIES_ID + ") REFERENCES " +
Modified: trunk/src/fr/ifremer/wlo/utils/BigFinFeedReaderRecord.java
===================================================================
--- trunk/src/fr/ifremer/wlo/utils/BigFinFeedReaderRecord.java 2014-02-17 13:32:31 UTC (rev 49)
+++ trunk/src/fr/ifremer/wlo/utils/BigFinFeedReaderRecord.java 2014-02-19 10:17:11 UTC (rev 50)
@@ -155,7 +155,7 @@
// remove any starting 0
lengthCell = lengthCell.replaceAll("^0*", "");
- length = Float.valueOf(lengthCell) * 10;
+ length = Float.valueOf(lengthCell);
} catch (Exception e) {
Log.e(TAG, "Could not get length from " + record, e);
1
0