Skip to content

Commit

Permalink
refactor: fix typo in 'inputted' (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
nsenave committed Apr 5, 2024
1 parent a7deada commit fb4d041
Show file tree
Hide file tree
Showing 27 changed files with 2,096 additions and 1,924 deletions.
13 changes: 6 additions & 7 deletions docs/fr/components/Variables.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
### Les variables

Les variables sont toutes externalisées dans un tableau `variables`.
Elles sont de trois types :
Les variables sont toutes externalisées dans un tableau `variables`. Elles sont de trois types :

- `EXTERNAL` : variable externe à valoriser
- `COLLECTED` : référence à une variable collectée (issue des `response` dans les composants)
Expand All @@ -21,11 +20,11 @@ Strucure du tableau `variables` :
"name": "FAVOURITE_CHARACTERS",
"componentRef": "FAVOURITE_CHARACTERS_COMPONENT",
"values": {
"PREVIOUS": null,
"COLLECTED": null,
"FORCED": null,
"EDITED": null,
"INPUTED": null
"PREVIOUS": null,
"COLLECTED": null,
"FORCED": null,
"EDITED": null,
"INPUTTED": null
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions docs/fr/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"COLLECTED": "Collected",
"FORCED": null,
"EDITED": 34,
"INPUTED": "Inputed"
"INPUTTED": "Inputted"
},
"variable2": {
"PREVIOUS": ["previous individu1", "previous individu2"],
Expand Down Expand Up @@ -57,7 +57,7 @@
<COLLECTED type="string">Collected</COLLECTED>
<FORCED type="null"/>
<EDITED type="number">34</EDITED>
<INPUTED type="string">Inputed</INPUTED>
<INPUTTED type="string">Inputted</INPUTTED>
</variable1>
<variable2>
<PREVIOUS>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>fr.insee.lunatic</groupId>
<artifactId>lunatic-model</artifactId>
<version>2.5.2</version>
<version>2.6.0</version>

<packaging>jar</packaging>

Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/xsd/LunaticModel.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@
</xs:sequence>
</xs:complexType>

<xs:complexType name="INPUTEDArray">
<xs:complexType name="INPUTTEDArray">
<xs:sequence>
<xs:element name="INPUTED" type="xs:anyType" nillable="true" maxOccurs="unbounded"/>
<xs:element name="INPUTTED" type="xs:anyType" nillable="true" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

Expand All @@ -316,7 +316,7 @@
<xs:element name="COLLECTED" type="COLLECTEDArray" minOccurs="0" maxOccurs="1"/>
<xs:element name="FORCED" type="FORCEDArray" minOccurs="0" maxOccurs="1"/>
<xs:element name="EDITED" type="EDITEDArray" minOccurs="0" maxOccurs="1"/>
<xs:element name="INPUTED" type="INPUTEDArray" minOccurs="0" maxOccurs="1"/>
<xs:element name="INPUTTED" type="INPUTTEDArray" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>

Expand All @@ -326,7 +326,7 @@
<xs:element name="COLLECTED" type="xs:string" nillable="true"/>
<xs:element name="FORCED" type="xs:string" nillable="true"/>
<xs:element name="EDITED" type="xs:string" nillable="true"/>
<xs:element name="INPUTED" type="xs:string" nillable="true"/>
<xs:element name="INPUTTED" type="xs:string" nillable="true"/>
</xs:sequence>
</xs:complexType>

Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/xsd/LunaticModelFlat.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,9 @@
</xs:sequence>
</xs:complexType>

<xs:complexType name="INPUTEDArray">
<xs:complexType name="INPUTTEDArray">
<xs:sequence>
<xs:element name="INPUTED" type="xs:anyType" nillable="true" maxOccurs="unbounded"/>
<xs:element name="INPUTTED" type="xs:anyType" nillable="true" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

Expand All @@ -305,7 +305,7 @@
<xs:element name="COLLECTED" type="COLLECTEDArray" minOccurs="0" maxOccurs="1"/>
<xs:element name="FORCED" type="FORCEDArray" minOccurs="0" maxOccurs="1"/>
<xs:element name="EDITED" type="EDITEDArray" minOccurs="0" maxOccurs="1"/>
<xs:element name="INPUTED" type="INPUTEDArray" minOccurs="0" maxOccurs="1"/>
<xs:element name="INPUTTED" type="INPUTTEDArray" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>

Expand All @@ -315,7 +315,7 @@
<xs:element name="COLLECTED" type="xs:string" nillable="true"/>
<xs:element name="FORCED" type="xs:string" nillable="true"/>
<xs:element name="EDITED" type="xs:string" nillable="true"/>
<xs:element name="INPUTED" type="xs:string" nillable="true"/>
<xs:element name="INPUTTED" type="xs:string" nillable="true"/>
</xs:sequence>
</xs:complexType>

Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/xslt/data/generate-xsd.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<xsl:output indent="yes"/>

<xsl:variable name="ResponseTypeEnum" select="'PREVIOUS,COLLECTED,FORCED,EDITED,INPUTED'" as="xs:string"/>
<xsl:variable name="ResponseTypeEnum" select="'PREVIOUS,COLLECTED,FORCED,EDITED,INPUTTED'" as="xs:string"/>

<xsl:template match="/">
<xs:schema
Expand Down Expand Up @@ -94,7 +94,7 @@
</xs:element>
</xsl:template>

<xsl:template match="h:*[local-name(.)=('PREVIOUS','COLLECTED','FORCED','EDITED','INPUTED')]">
<xsl:template match="h:*[local-name(.)=('PREVIOUS','COLLECTED','FORCED','EDITED','INPUTTED')]">
<xsl:variable name="type" select="@xsi:type"/>
<xsl:variable name="name" select="local-name(.)"/>

Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/xslt/json-cleaner.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
<!-- delete type attribute except when key is linked to the suggesters block or to a label...-->
<xsl:template match="*[@key='type'][not(ancestor::*[@key=('suggesters')] or parent::*[@key=('label','min','max','iterations','conditionFilter','errorMessage','control','expression','xAxisIterations','yAxisIterations')])]" mode="clean"/>
<!-- delete map useless inside array -->
<xsl:template match="*[local-name(.)='map'][parent::*[@key=('PREVIOUS','COLLECTED','FORCED','EDITED','INPUTED') and local-name(.)='array'] | parent::*[@key=('values')]]" mode="clean">
<xsl:template match="*[local-name(.)='map'][parent::*[@key=('PREVIOUS','COLLECTED','FORCED','EDITED','INPUTTED') and local-name(.)='array'] | parent::*[@key=('values')]]" mode="clean">
<xsl:apply-templates mode="clean"/>
</xsl:template>
<xsl:template match="*[local-name(.)='map'][parent::*[@key='value' and local-name(.)='array'] or (self::*[@key='value'] and preceding-sibling::*[@key='variableType'])]" mode="clean">
<xsl:apply-templates mode="clean"/>
</xsl:template>
<!-- delete key attribute for array inside array -->
<xsl:template match="*[local-name(.)='array' and @key=('PREVIOUS','COLLECTED','FORCED','EDITED','INPUTED','value')][ancestor::*[local-name(.)='array' and @key=('PREVIOUS','COLLECTED','FORCED','EDITED','INPUTED','value')]]" mode="clean">
<xsl:template match="*[local-name(.)='array' and @key=('PREVIOUS','COLLECTED','FORCED','EDITED','INPUTTED','value')][ancestor::*[local-name(.)='array' and @key=('PREVIOUS','COLLECTED','FORCED','EDITED','INPUTTED','value')]]" mode="clean">
<xsl:copy>
<xsl:apply-templates mode="clean"/>
</xsl:copy>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
<COLLECTED xsi:nil="true"/>
<FORCED xsi:nil="true"/>
<EDITED xsi:nil="true"/>
<INPUTED xsi:nil="true"/>
<INPUTTED xsi:nil="true"/>
</values>
</variables>
<variables variableType="COLLECTED" xsi:type="VariableType">
Expand All @@ -202,7 +202,7 @@
<COLLECTED xsi:nil="true"/>
<FORCED xsi:nil="true"/>
<EDITED xsi:nil="true"/>
<INPUTED xsi:nil="true"/>
<INPUTTED xsi:nil="true"/>
</values>
</variables>
<variables variableType="COLLECTED" xsi:type="VariableType">
Expand All @@ -212,7 +212,7 @@
<COLLECTED xsi:nil="true"/>
<FORCED xsi:nil="true"/>
<EDITED xsi:nil="true"/>
<INPUTED xsi:nil="true"/>
<INPUTTED xsi:nil="true"/>
</values>
</variables>
<variables variableType="COLLECTED" xsi:type="VariableType">
Expand All @@ -222,7 +222,7 @@
<COLLECTED xsi:nil="true"/>
<FORCED xsi:nil="true"/>
<EDITED xsi:nil="true"/>
<INPUTED xsi:nil="true"/>
<INPUTTED xsi:nil="true"/>
</values>
</variables>
<variables variableType="CALCULATED" xsi:type="VariableType">
Expand Down
46 changes: 41 additions & 5 deletions src/test/resources/data/in/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,56 @@
"COLLECTED": "Collected",
"FORCED": null,
"EDITED": 34,
"INPUTED": "Inputed"
"INPUTTED": "Inputted"
},
"variable2": {
"COLLECTED": ["individu1","individu2"]
"COLLECTED": [
"individu1",
"individu2"
]
},
"variable3": {
"COLLECTED": [["individu1","individu2"],["individu3","individu4"]]
"COLLECTED": [
[
"individu1",
"individu2"
],
[
"individu3",
"individu4"
]
]
},
"variable4": {
"COLLECTED": [[[true,true],["individu3","individu4"]],[["individu5","individu6"],["individu7","individu8"]]]
"COLLECTED": [
[
[
true,
true
],
[
"individu3",
"individu4"
]
],
[
[
"individu5",
"individu6"
],
[
"individu7",
"individu8"
]
]
]
}
},
"EXTERNAL": {
"variableExt1": ["External var","External var2"],
"variableExt1": [
"External var",
"External var2"
],
"variableExt2": "External var2"
}
}
2 changes: 1 addition & 1 deletion src/test/resources/data/in/data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<COLLECTED type="string">Collected</COLLECTED>
<FORCED type="null"/>
<EDITED type="number">34</EDITED>
<INPUTED type="string">Inputed</INPUTED>
<INPUTTED type="string">Inputted</INPUTTED>
</variable1>
<variable2>
<COLLECTED>
Expand Down
101 changes: 60 additions & 41 deletions src/test/resources/data/out/data.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,60 @@

{ "COLLECTED" :
{ "variable1" :
{ "PREVIOUS" : "Previous",
"COLLECTED" : "Collected",
"FORCED" : null,
"EDITED" : 34,
"INPUTED" : "Inputed" },
"variable2" :
{ "COLLECTED" :
[ "individu1",
"individu2" ] },
"variable3" :
{ "COLLECTED" :
[
[ "individu1",
"individu2" ],

[ "individu3",
"individu4" ] ] },
"variable4" :
{ "COLLECTED" :
[
[
[ true,
true ],

[ "individu3",
"individu4" ] ],

[
[ "individu5",
"individu6" ],

[ "individu7",
"individu8" ] ] ] } },
"EXTERNAL" :
{ "variableExt1" :
[ "External var",
"External var2" ],
"variableExt2" : "External var2" } }
{
"COLLECTED": {
"variable1": {
"PREVIOUS": "Previous",
"COLLECTED": "Collected",
"FORCED": null,
"EDITED": 34,
"INPUTTED": "Inputted"
},
"variable2": {
"COLLECTED": [
"individu1",
"individu2"
]
},
"variable3": {
"COLLECTED": [
[
"individu1",
"individu2"
],
[
"individu3",
"individu4"
]
]
},
"variable4": {
"COLLECTED": [
[
[
true,
true
],
[
"individu3",
"individu4"
]
],
[
[
"individu5",
"individu6"
],
[
"individu7",
"individu8"
]
]
]
}
},
"EXTERNAL": {
"variableExt1": [
"External var",
"External var2"
],
"variableExt2": "External var2"
}
}
2 changes: 1 addition & 1 deletion src/test/resources/data/out/data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<COLLECTED type="string">Collected</COLLECTED>
<FORCED type="null"/>
<EDITED type="number">34</EDITED>
<INPUTED type="string">Inputed</INPUTED>
<INPUTTED type="string">Inputted</INPUTTED>
</variable1>
<variable2>
<COLLECTED>
Expand Down
Loading

0 comments on commit fb4d041

Please sign in to comment.