Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 36 additions & 36 deletions .github/workflows/create-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,8 @@ jobs:
exit 1
fi

deploy-maven-repo:
needs: check-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'temurin'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Build and deploy with Maven
run: mvn --batch-mode clean process-classes deploy -Prelease -DskipTests=true --no-transfer-progress
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

create-tag:
needs: [ check-version, deploy-maven-repo ]
needs: check-version
runs-on: ubuntu-latest
steps:
- name: Create tag
Expand All @@ -89,16 +67,38 @@ jobs:
sha: context.sha
})

deploy-comment:
needs: [ check-version, deploy-maven-repo ]
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '👋 Version ${{ needs.check-version.outputs.snapshot-version }} deployed on maven central repository'
})
# deploy-maven-repo:
# needs: check-version
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Set up Maven Central Repository
# uses: actions/setup-java@v4
# with:
# java-version: ${{ env.JAVA_VERSION }}
# distribution: 'temurin'
# server-id: ossrh
# server-username: MAVEN_USERNAME
# server-password: MAVEN_PASSWORD
# gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
# gpg-passphrase: MAVEN_GPG_PASSPHRASE
# - name: Build and deploy with Maven
# run: mvn --batch-mode clean process-classes deploy -Prelease -DskipTests=true --no-transfer-progress
# env:
# MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
# MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
# MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

# deploy-comment:
# needs: [ check-version, deploy-maven-repo ]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/github-script@v7
# with:
# script: |
# github.rest.issues.createComment({
# issue_number: context.issue.number,
# owner: context.repo.owner,
# repo: context.repo.repo,
# body: '👋 Version ${{ needs.check-version.outputs.snapshot-version }} deployed on maven central repository'
# })
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>fr.insee.eno</groupId>
<artifactId>eno-core</artifactId>
<version>2.18.3</version>
<version>2.19.0</version>
<packaging>jar</packaging>

<name>Eno – Questionnaire generator</name>
Expand Down Expand Up @@ -119,7 +119,7 @@
<log4j-slf4j2.version>2.25.1</log4j-slf4j2.version>
<!-- Build plugins -->
<source.plugin.version>3.3.1</source.plugin.version>
<javadoc.plugin.version>3.11.3</javadoc.plugin.version>
<javadoc.plugin.version>3.11.2</javadoc.plugin.version>
<!-- Sonar -->
<jacoco.version>0.8.13</jacoco.version>
<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
Expand Down
35 changes: 18 additions & 17 deletions src/main/resources/xslt/outputs/fo/models.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,11 @@
<xsl:param name="loop-navigation" as="node()" tunnel="yes"/>

<xsl:variable name="is-external-filter" select="enofo:is-external-filter($source-context)"/>
<xsl:variable name="apos"><xsl:text>'</xsl:text></xsl:variable>
<xsl:choose>
<xsl:when test="enofo:is-external-filter($source-context)">
<xsl:text>&#xd;#if (</xsl:text>
<xsl:call-template name="replaceVariablesInFormula">
<xsl:with-param name="formula" select="normalize-space(
replace(replace(replace(replace(replace(replace(replace(
enofo:get-relevant($source-context)
,'&quot;',$apos)
,'&lt;&gt;',' ne ')
,'&lt;=',' le ')
,'&gt;=',' ge ')
,'&lt;',' lt ')
,'&gt;',' gt ')
,'=',' eq '))"/>
<xsl:with-param name="formula" select="enofo:get-relevant($source-context)"/>
<xsl:with-param name="variables" as="node()">
<Variables>
<xsl:for-each select="tokenize(enofo:get-hideable-command-variables($source-context),' ')">
Expand Down Expand Up @@ -1081,7 +1071,9 @@
<xsl:copy-of select="$style-parameters/label-cell/@*"/>
<xsl:choose>
<xsl:when test="enofo:is-initializable-variable($source-context)">
<xsl:copy-of select="concat($variable-personalization-begin,$manual-content,'#{end}')"/>
<xsl:value-of select="$variable-personalization-begin"/>
<xsl:copy-of select="$manual-content"/>
<xsl:value-of select="'#{end}'"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$manual-content"/>
Expand All @@ -1095,7 +1087,9 @@
<xsl:copy-of select="$style-parameters/general-style/@*"/>
<xsl:choose>
<xsl:when test="enofo:is-initializable-variable($source-context)">
<xsl:copy-of select="concat($variable-personalization-begin,$manual-content,'#{end}')"/>
<xsl:value-of select="$variable-personalization-begin"/>
<xsl:copy-of select="$manual-content"/>
<xsl:value-of select="'#{end}'"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$manual-content"/>
Expand Down Expand Up @@ -1215,7 +1209,6 @@
<xsl:with-param name="loop-navigation" select="$loop-navigation" as="node()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="variable-personalization-begin" select="concat('#{if}(',$variable-name,')',$variable-name,'#{else}')"/>

<fo:inline>
<xsl:variable name="duration-content" as="node() *">
Expand Down Expand Up @@ -1554,15 +1547,16 @@
<xsl:with-param name="loop-navigation" select="$loop-navigation" as="node()"/>
</xsl:call-template>
</xsl:variable>
<!-- blabla¤var_id¤ in {'a','b','c)blibli
<!-- blabla¤var_id¤ in {"a","b","c")blibli
becomes:
blabla (${var_name} eq 'a' or ${var_name} eq 'b' or ${var_name} eq 'c') blibli-->
<xsl:analyze-string select="$formula" regex="^(.*){$variable-initial-name} *in *\{{(.+)\}}(.*)$">
<xsl:matching-substring>
<xsl:variable name="apos"><xsl:text>'</xsl:text></xsl:variable>
<xsl:call-template name="replaceVariablesInFormula">
<xsl:with-param name="formula">
<xsl:value-of select="concat(regex-group(1),' (',$variable-business-name,' eq ')"/>
<xsl:value-of select="string-join(tokenize(regex-group(2),','),concat(' or ',$variable-business-name,' eq '))"/>
<xsl:value-of select="string-join(tokenize(replace(regex-group(2),'&quot;',$apos),','),concat(' or ',$variable-business-name,' eq '))"/>
<xsl:value-of select="concat(') ',regex-group(3))"/>
</xsl:with-param>
<xsl:with-param name="variables" select="$variables"/>
Expand All @@ -1583,7 +1577,14 @@
</xsl:analyze-string>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$formula"/>
<xsl:value-of select="normalize-space(
replace(replace(replace(replace(replace(replace($formula
,'&lt;&gt;',' ne ')
,'&lt;=',' le ')
,'&gt;=',' ge ')
,'&lt;',' lt ')
,'&gt;',' gt ')
,'=',' eq '))"/>
</xsl:otherwise>
</xsl:choose>

Expand Down
30 changes: 27 additions & 3 deletions src/main/resources/xslt/transformations/ddi2fo/ddi2fo-fixed.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,21 @@
<xsl:param name="label"/>
<xsl:param name="variables"/>
<xsl:param name="loop-navigation" as="node()"/>

<xsl:variable name="quot"><xsl:text>"</xsl:text></xsl:variable>

<xsl:choose>
<xsl:when test="contains($label,$conditioning-variable-begin) and contains(substring-after($label,$conditioning-variable-begin),$conditioning-variable-end)">
<xsl:value-of select="substring-before($label,$conditioning-variable-begin)"/>
<!-- gestion de cast(variable,string) : début -->
<xsl:analyze-string select="$label" regex="^([^{$conditioning-variable-begin}]*)(cast\( *){$conditioning-variable-begin}(.*)$">
<xsl:matching-substring>
<!-- suppression des | et des guillemets -->
<xsl:value-of select="replace(replace(replace(replace(regex-group(1),' \|',''),'\| ',''),'\|',''),$quot,'')"/>
</xsl:matching-substring>
<xsl:non-matching-substring>
<xsl:value-of select="replace(replace(replace(replace(substring-before($label,$conditioning-variable-begin),' \|',''),'\| ',''),'\|',''),$quot,'')"/>
</xsl:non-matching-substring>
</xsl:analyze-string>
<xsl:variable name="variable-name" select="substring-before(substring-after($label,$conditioning-variable-begin),$conditioning-variable-end)"/>
<xsl:variable name="variable-type">
<xsl:call-template name="enoddi:get-variable-type">
Expand Down Expand Up @@ -421,14 +432,27 @@
<xsl:with-param name="variable" select="$variable-name"/>
</xsl:call-template>
<xsl:value-of select="'}'"/>
<!-- gestion de cast(variable,string) : fin -->
<xsl:variable name="after-variable">
<xsl:analyze-string select="substring-after(substring-after($label,$conditioning-variable-begin),$conditioning-variable-end)"
regex="^( *, *string *(, *&quot;YYYY&quot; *)?\))(.*)$">
<xsl:matching-substring>
<xsl:value-of select="regex-group(3)"/>
</xsl:matching-substring>
<xsl:non-matching-substring>
<xsl:value-of select="substring-after(substring-after($label,$conditioning-variable-begin),$conditioning-variable-end)"/>
</xsl:non-matching-substring>
</xsl:analyze-string>
</xsl:variable>
<xsl:call-template name="velocity-label">
<xsl:with-param name="label" select="substring-after(substring-after($label,$conditioning-variable-begin),$conditioning-variable-end)"/>
<xsl:with-param name="label" select="$after-variable"/>
<xsl:with-param name="variables" select="$variables"/>
<xsl:with-param name="loop-navigation" select="$loop-navigation" as="node()"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$label"/>
<!-- suppression des | et des guillemets -->
<xsl:value-of select="replace(replace(replace(replace($label,' \|',''),'\| ',''),'\|',''),$quot,'')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Expand Down
Loading