Skip to content

Commit

Permalink
Merge branch 'release/1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrimault committed Jun 12, 2021
2 parents 75361d0 + 716dc17 commit 70bb4b9
Show file tree
Hide file tree
Showing 33 changed files with 97 additions and 153 deletions.
10 changes: 1 addition & 9 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.4.21'
ext.kotlin_version = '1.5.10'

repositories {
google()
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'com.android.tools.build:gradle:4.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jlleitschuh.gradle:ktlint-gradle:9.4.1"
// NOTE: Do not place your application dependencies here; they belong
// NOTE: Do not place any application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()

mavenCentral()
}

apply plugin: "org.jlleitschuh.gradle.ktlint"
Expand Down
8 changes: 4 additions & 4 deletions commons/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

version = "0.8.3"
version = "0.8.4"

android {
compileSdkVersion 29
Expand Down Expand Up @@ -46,16 +46,16 @@ dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1"

implementation 'androidx.appcompat:appcompat:1.3.0-rc01'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.1"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1"
implementation 'androidx.preference:preference-ktx:1.1.1'

api 'androidx.room:room-runtime:2.2.6'
api 'androidx.room:room-runtime:2.3.0'

testImplementation 'androidx.arch.core:core-testing:2.1.0'
testImplementation 'androidx.test:core:1.3.0'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:3.0.0'
testImplementation 'org.robolectric:robolectric:4.3.1'
testImplementation 'org.robolectric:robolectric:4.5.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,23 @@ import fr.geonature.commons.data.helper.get
@Entity(
tableName = DefaultNomenclature.TABLE_NAME,
primaryKeys = [DefaultNomenclature.COLUMN_MODULE, DefaultNomenclature.COLUMN_NOMENCLATURE_ID],
foreignKeys = [
ForeignKey(
entity = Nomenclature::class,
parentColumns = [Nomenclature.COLUMN_ID],
childColumns = [DefaultNomenclature.COLUMN_NOMENCLATURE_ID],
onDelete = ForeignKey.CASCADE
)
]
foreignKeys = [ForeignKey(
entity = Nomenclature::class,
parentColumns = [Nomenclature.COLUMN_ID],
childColumns = [DefaultNomenclature.COLUMN_NOMENCLATURE_ID],
onDelete = ForeignKey.CASCADE
)]
)
open class DefaultNomenclature : Parcelable {

open class DefaultNomenclature(
@ColumnInfo(name = COLUMN_MODULE)
var module: String
var module: String,

@ColumnInfo(
name = COLUMN_NOMENCLATURE_ID,
index = true
)
var nomenclatureId: Long

constructor(
module: String,
nomenclatureId: Long
) {
this.module = module
this.nomenclatureId = nomenclatureId
}
) : Parcelable {

internal constructor(source: Parcel) : this(
source.readString()!!,
Expand Down Expand Up @@ -168,16 +158,16 @@ open class DefaultNomenclature : Parcelable {
}

@JvmField
val CREATOR: Parcelable.Creator<DefaultNomenclature> =
object : Parcelable.Creator<DefaultNomenclature> {
val CREATOR: Parcelable.Creator<DefaultNomenclature> = object :
Parcelable.Creator<DefaultNomenclature> {

override fun createFromParcel(source: Parcel): DefaultNomenclature {
return DefaultNomenclature(source)
}
override fun createFromParcel(source: Parcel): DefaultNomenclature {
return DefaultNomenclature(source)
}

override fun newArray(size: Int): Array<DefaultNomenclature?> {
return arrayOfNulls(size)
}
override fun newArray(size: Int): Array<DefaultNomenclature?> {
return arrayOfNulls(size)
}
}
}
}
46 changes: 17 additions & 29 deletions commons/src/main/java/fr/geonature/commons/data/Nomenclature.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,47 +18,35 @@ import fr.geonature.commons.data.helper.get
*
* @author [S. Grimault](mailto:[email protected])
*/
@Entity(tableName = Nomenclature.TABLE_NAME)
open class Nomenclature : Parcelable {

@Entity(
tableName = Nomenclature.TABLE_NAME,
foreignKeys = [ForeignKey(
entity = NomenclatureType::class,
parentColumns = [NomenclatureType.COLUMN_ID],
childColumns = [Nomenclature.COLUMN_TYPE_ID],
onDelete = CASCADE
)]
)
open class Nomenclature(
/**
* The unique ID of this nomenclature.
*/
@PrimaryKey(autoGenerate = true)
@ColumnInfo(name = COLUMN_ID)
var id: Long
var id: Long,

@ColumnInfo(name = COLUMN_CODE)
var code: String
var code: String,

@ColumnInfo(name = COLUMN_HIERARCHY)
var hierarchy: String

var hierarchy: String,
@ColumnInfo(name = COLUMN_DEFAULT_LABEL)
var defaultLabel: String
var defaultLabel: String,

@ForeignKey(
entity = NomenclatureType::class,
parentColumns = [NomenclatureType.COLUMN_ID],
childColumns = [COLUMN_TYPE_ID],
onDelete = CASCADE
)
@ColumnInfo(name = COLUMN_TYPE_ID)
@ColumnInfo(name = COLUMN_TYPE_ID, index = true)
var typeId: Long

constructor(
id: Long,
code: String,
hierarchy: String,
defaultLabel: String,
typeId: Long
) {
this.id = id
this.code = code
this.hierarchy = hierarchy
this.defaultLabel = defaultLabel
this.typeId = typeId
}
) : Parcelable {

internal constructor(source: Parcel) : this(
source.readLong(),
Expand Down
3 changes: 2 additions & 1 deletion commons/src/main/java/fr/geonature/commons/data/Taxonomy.kt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ class Taxonomy : Parcelable {
"autre",
"all"
).any {
value.toLowerCase(Locale.ROOT)
value
.lowercase(Locale.ROOT)
.startsWith(it)
}
) ANY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import kotlinx.coroutines.Dispatchers.IO
import kotlinx.coroutines.withContext
import java.io.File
import java.io.FileWriter
import java.io.IOException

/**
* Manage [AbstractInput]:
Expand Down Expand Up @@ -204,7 +203,6 @@ class InputManager<I : AbstractInput> private constructor(
return "${KEY_PREFERENCE_INPUT}_$id"
}

@Throws(IOException::class)
private suspend fun getInputExportFile(input: AbstractInput): File = withContext(IO) {
val inputDir = FileUtils.getInputsFolder(application)
inputDir.mkdirs()
Expand Down
4 changes: 2 additions & 2 deletions commons/version.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Sun May 23 16:23:47 CEST 2021
VERSION_CODE=2855
#Sat Jun 12 15:17:29 CEST 2021
VERSION_CODE=2890
10 changes: 2 additions & 8 deletions docs/settings.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"observers_list_id": 1,
"taxa_list_id": 100,
"code_area_type": "M1",
"page_size": 1000,
"page_max_retry": 100
"page_size": 1000
}
----

Expand Down Expand Up @@ -53,10 +52,5 @@
| `page_size`
| &#9744;
| Default page size while fetching paginated values
| 1000

| `page_max_retry`
| &#9744;
| Max attempt to fetch data according to given page size
| 20
| 10000
|===
4 changes: 2 additions & 2 deletions docs/sync.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ group Fetch GeoNature data
end
group Taxa
loop while response is not empty\nand response size matches ""page_size"" from settings\nand loop doesn't exceed ""page_max_retry"" from settings
loop while response is not empty\nand response size matches ""page_size"" from settings
sync -> gn ++ : **GET** ""/api/taxref/allnamebylist/:taxa_list_id""
note right of sync
""taxa_list_id"" from settings
Expand All @@ -142,7 +142,7 @@ group Fetch GeoNature data
end note
sync -> sync : update //taxa// table
end
loop while response is not empty\nand response size matches ""page_size"" from settings\nand loop doesn't exceed ""page_max_retry"" from settings
loop while response is not empty\nand response size matches ""page_size"" from settings
sync -> gn ++ : **GET** ""/api/synthese/color_taxon?:code_area_type""
note right of sync
""code_area_type"" from settings
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
4 changes: 2 additions & 2 deletions mountpoint/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

version = "0.0.7"
version = "0.0.8"

android {
compileSdkVersion 29
Expand Down Expand Up @@ -46,5 +46,5 @@ dependencies {

testImplementation 'androidx.test:core:1.3.0'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.robolectric:robolectric:4.3.1'
testImplementation 'org.robolectric:robolectric:4.5.1'
}
4 changes: 1 addition & 3 deletions mountpoint/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="fr.geonature.mountpoint" />
<manifest package="fr.geonature.mountpoint" />
4 changes: 2 additions & 2 deletions mountpoint/version.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Sun Mar 28 16:43:24 CEST 2021
VERSION_CODE=300
#Sat Jun 12 15:17:29 CEST 2021
VERSION_CODE=370
6 changes: 2 additions & 4 deletions sync/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ Example:
"observers_list_id": 1,
"taxa_list_id": 100,
"code_area_type": "M1",
"page_size": 1000,
"page_max_retry": 100
"page_size": 10000
}
```

Expand All @@ -46,8 +45,7 @@ Example:
| `observers_list_id` | &#9744; | GeoNature selected observer list ID in UsersHub | |
| `taxa_list_id` | &#9744; | GeoNature selected taxa list ID | |
| `code_area_type` | &#9744; | GeoNature selected area type | |
| `page_size` | &#9744; | Default page size while fetching paginated values | 1000 |
| `page_max_retry` | &#9744; | Max attempt to fetch data according to given page size | 20 |
| `page_size` | &#9744; | Default page size while fetching paginated values | 10000 |
| `sync_periodicity_data_essential` | &#9744; | Configure essential data synchronization periodicity | |
| `sync_periodicity_data` | &#9744; | Configure all data synchronization periodicity | |

Expand Down
Loading

0 comments on commit 70bb4b9

Please sign in to comment.