Skip to content

Commit

Permalink
Merge pull request #59 from InseeFr/develop
Browse files Browse the repository at this point in the history
Merging develop in master
  • Loading branch information
bwerquin authored Sep 10, 2021
2 parents 23571d1 + 807dc8c commit 572dbdd
Show file tree
Hide file tree
Showing 23 changed files with 6,150 additions and 4,936 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Build and upload Release
name: Build and upload Release

on:
push:
tags:
- '*.*.*'
branches:
- 'master'

jobs:
build-release:
Expand All @@ -19,15 +19,18 @@ jobs:

- name: Build and test with Maven
run: mvn install -Djar.finalName="lunatic-model" -B -V --file pom.xml
- name: Get current version
id: version
run: echo "::set-output name=prop::$(mvn -f pom.xml help:evaluate -Dexpression=project.version -q -DforceStdout)"

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: "Release ${{ github.ref }}"
tag_name: ${{steps.version.outputs.prop}}
release_name: "Release ${{steps.version.outputs.prop}}"
draft: false
prerelease: false

Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/develop-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and upload Release Candidate

on:
push:
branches:
- 'develop'

jobs:
build-release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Build and test with Maven
run: mvn install -Djar.finalName="lunatic-model" -B -V --file pom.xml
- name: Get current version
id: version
run: echo "::set-output name=prop::$(mvn -f pom.xml help:evaluate -Dexpression=project.version -q -DforceStdout)"

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{steps.version.outputs.prop}}-rc
release_name: "Release Candidate ${{steps.version.outputs.prop}}"
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/lunatic-model.jar
asset_name: lunatic-model.jar
asset_content_type: application/java-archive
42 changes: 42 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Lunatic CI

on:
push:
branches:
- 'master'

jobs:

build-assets:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
# Because of gitbook support
node-version: 10
- run: |
npm i -g gitbook-cli
gitbook install
gitbook build
working-directory: ./docs/
- run: cp -a ./docs/_book/. ./deploy/
- name: Upload deploy artifact
uses: actions/upload-artifact@v2
with:
name: deploy
path: deploy/

deploy:
runs-on: ubuntu-latest
needs: build-assets
steps:
- name: Download deploy artifact
uses: actions/download-artifact@v2
with:
name: deploy
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

40 changes: 20 additions & 20 deletions docs/fr/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

## Guide du développeur

* [Introduction](README.md)
* [Lien avec les autres projets](projects/README.md)
* [Eno](projects/eno/README.md)
* [Lunatic](projects/lunatic/README.md)
* [Fonctionnement](working/README.md)
* [Les composants](components/README.md)
* [Variables](components/Variables.md)
* [Sequence](components/Sequence.md)
* [Subsequence](components/Subsequence.md)
* [Input](components/Input.md)
* [Textarea](components/Textarea.md)
* [InputNumber](components/InputNumber.md)
* [CheckboxBoolean](components/CheckboxBoolean.md)
* [Datepicker](components/Datepicker.md)
* [Les composants à options : Radio, Dropdown, CheckboxOne](components/OptionsComponents.md)
* [CheckboxGroup](components/CheckboxGroup.md)
* [FilterDescription](components/FilterDescription.md)
* [Table](components/Table.md)
* [Comment utiliser Lunatic-Model](usage/README.md)
- [Introduction](README.md)
- [Lien avec les autres projets](projects/README.md)
- [Eno](projects/eno/README.md)
- [Lunatic](projects/lunatic/README.md)
- [Fonctionnement](working/README.md)
- [Les composants](components/README.md)
- [Variables](components/Variables.md)
- [Sequence](components/Sequence.md)
- [Subsequence](components/Subsequence.md)
- [Input](components/Input.md)
- [Textarea](components/Textarea.md)
- [InputNumber](components/InputNumber.md)
- [CheckboxBoolean](components/CheckboxBoolean.md)
- [Datepicker](components/Datepicker.md)
- [Les composants à options : Radio, Dropdown, CheckboxOne](components/OptionsComponents.md)
- [CheckboxGroup](components/CheckboxGroup.md)
- [FilterDescription](components/FilterDescription.md)
- [Table](components/Table.md)
- [Comment utiliser Lunatic-Model](usage/README.md)
- [Les données au format Lunatic](data/README.md)
6 changes: 3 additions & 3 deletions docs/fr/components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Tous les composants (excepté Sequence et Subsequence) ont au moins ces attribut
"label":"label",
"declarations":[...],
"conditionFilter":"...",
"bindingsDependencies": [...],
"bindingDependencies": [...],
}
```

Expand All @@ -51,7 +51,7 @@ Tous les composants (excepté Sequence et Subsequence) ont au moins ces attribut
- `label` : label de la question associée au composant (expression VTL)
- `declarations` : liste des déclarations éventuelles associées au composant.
- `conditionFilter` : filtre écrit dans le langage VTL pour savoir s'il faut afficher ou non le questionnaire.
- `bindingsDependencies` : liste des variables dont le compasant dépend (labels, declarations et réponse)
- `bindingDependencies` : liste des variables dont le compasant dépend (labels, declarations et réponse)
- `mandatory` : booléen qui définit si la réponse est obligatoire ou non

---
Expand Down Expand Up @@ -90,7 +90,7 @@ Les composants qui ont pour but de collecter des réponses ont un attribut "resp

```json
"response" : {
"name" : "idVariable"
"name" : "idVariable"
}
```

Expand Down
144 changes: 144 additions & 0 deletions docs/fr/data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# Les données

## Données au format JSON

```json
{
"COLLECTED": {
"variable1": {
"PREVIOUS": "Previous",
"COLLECTED": "Collected",
"FORCED": null,
"EDITED": 34,
"INPUTED": "Inputed"
},
"variable2": {
"PREVIOUS": ["previous individu1", "previous individu2"],
"COLLECTED": ["individu1", "individu2"]
},
"variable3": {
"PREVIOUS": [
["previous individu1", "previous individu2"],
["previous individu3", "previous individu4"]
],
"COLLECTED": [
["individu1", "individu2"],
["individu3", "individu4"]
]
},
"variable4": {
"COLLECTED": [
[
[true, true],
["individu3", "individu4"]
],
[
["individu5", "individu6"],
["individu7", "individu8"]
]
]
}
},
"EXTERNAL": {
"variableExt1": ["External var", "External var2"],
"variableExt2": "External var2"
}
}
```

## Donnéee équivalente au format XML

```xml
<?xml version="1.0" encoding="UTF-8"?>
<Data>
<COLLECTED>
<variable1>
<PREVIOUS type="string">Previous</PREVIOUS>
<COLLECTED type="string">Collected</COLLECTED>
<FORCED type="null"/>
<EDITED type="number">34</EDITED>
<INPUTED type="string">Inputed</INPUTED>
</variable1>
<variable2>
<PREVIOUS>
<PREVIOUS type="string">previous individu1</PREVIOUS>
<PREVIOUS type="string">previous individu2</PREVIOUS>
</PREVIOUS>
<COLLECTED>
<COLLECTED type="string">individu1</COLLECTED>
<COLLECTED type="string">individu2</COLLECTED>
</COLLECTED>
</variable2>
<variable3>
<PREVIOUS>
<PREVIOUS>
<PREVIOUS type="string">previous individu1</PREVIOUS>
<PREVIOUS type="string">previous individu2</PREVIOUS>
</PREVIOUS>
<PREVIOUS>
<PREVIOUS type="string">previous individu3</PREVIOUS>
<PREVIOUS type="string">previous individu4</PREVIOUS>
</PREVIOUS>
</PREVIOUS>
<COLLECTED>
<COLLECTED>
<COLLECTED type="string">individu1</COLLECTED>
<COLLECTED type="string">individu2</COLLECTED>
</COLLECTED>
<COLLECTED>
<COLLECTED type="string">individu3</COLLECTED>
<COLLECTED type="string">individu4</COLLECTED>
</COLLECTED>
</COLLECTED>
</variable3>
<variable4>
<COLLECTED>
<COLLECTED>
<COLLECTED>
<COLLECTED type="boolean">true</COLLECTED>
<COLLECTED type="boolean">true</COLLECTED>
</COLLECTED>
<COLLECTED>
<COLLECTED type="string">individu3</COLLECTED>
<COLLECTED type="string">individu4</COLLECTED>
</COLLECTED>
</COLLECTED>
<COLLECTED>
<COLLECTED>
<COLLECTED type="string">individu5</COLLECTED>
<COLLECTED type="string">individu6</COLLECTED>
</COLLECTED>
<COLLECTED>
<COLLECTED type="string">individu7</COLLECTED>
<COLLECTED type="string">individu8</COLLECTED>
</COLLECTED>
</COLLECTED>
</COLLECTED>
</variable4>
</COLLECTED>
<EXTERNAL>
<variableExt1>
<variableExt1 type="string">External var</variableExt1>
<variableExt1 type="string">External var2</variableExt1>
</variableExt1>
<variableExt2 type="string">External var2</variableExt2>
</EXTERNAL>
</Data>

```

## Transformations JSON <-> XML

```java
File in = new File("/in/data.json");
JSONLunaticDataToXML translator = new JSONLunaticDataToXML();
File xmlOut = translator.transform(in);
```

## Transformations XML <-> JSON

```java
File in = new File("/in/data.xml");
XMLLunaticDataToJSON translator = new XMLLunaticDataToJSON();
File jsonData = translator.transform(in);
```
6 changes: 3 additions & 3 deletions docs/fr/usage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Pour l'utiliser/installer veuillez suivre les étapes suivantes :
<dependency>
<groupId>fr.insee.lunatic</groupId>
<artifactId>lunatic-model</artifactId>
<version>1.0.0</version>
<version>2.2.0</version>
</dependency>
```

Expand All @@ -27,8 +27,8 @@ Pour l'utiliser/installer veuillez suivre les étapes suivantes :

Il existe 2 transformations possibles :

1. XMLLunatic (sortie d'Eno ddi2js) vers JSONLunatic (sortie hiérarchique)
2. XMLLunatic (sortie d'Eno ddi2js) vers JSONLunaticFlat (sortie à plat)
1. XMLLunatic (sortie d'Eno ddi2lunatic-xml) vers JSONLunatic (sortie hiérarchique)
2. XMLLunatic (sortie d'Eno ddi2lunatic-xml) vers JSONLunaticFlat (sortie à plat)

Pour utiliser ces transformations, il faut utiliser dans un ordre précis les transformations unitaires:

Expand Down
5 changes: 3 additions & 2 deletions docs/gitbook.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ figure {
text-align: center;
}

.markdown-section code:after, .markdown-section code:before {
.markdown-section code:after,
.markdown-section code:before {
content: "";
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>fr.insee.lunatic</groupId>
<artifactId>lunatic-model</artifactId>
<packaging>jar</packaging>
<version>2.1.1</version>
<version>2.2.3</version>
<name>Lunatic Model</name>
<description>Classes and converters for the Lunatic model</description>
<url>http://www.insee.fr</url>
Expand Down
Loading

0 comments on commit 572dbdd

Please sign in to comment.