Skip to content

Commit

Permalink
feat: return resultaat values
Browse files Browse the repository at this point in the history
  • Loading branch information
DelanoWAF committed Oct 16, 2024
1 parent a5ba1ec commit 5f10200
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 1 deletion.
18 changes: 18 additions & 0 deletions src/main/configurations/Translate/Common/xsl/AddResultaat.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/>
<xsl:param name="code" select="'TechnicalError'" as="xs:string" />
<xsl:param name="reason" select="'Undefined error'" as="xs:string" />
<xsl:param name="cause" as="node()?" />
<xsl:param name="details" select="''" as="xs:string" />
<xsl:param name="detailsXml" as="node()?" />

<xsl:template match="/">
<error>
<cause><xsl:copy-of select="$cause" /></cause>
<code><xsl:value-of select="$code" /></code>
<reason><xsl:value-of select="$reason" /></reason>
<details><xsl:value-of select="$details" /></details>
<detailsXml><xsl:copy-of select="$detailsXml"/></detailsXml>
</error>
</xsl:template>
</xsl:stylesheet>
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,64 @@
styleSheetName="Common/xsl/EnrichEntity_ForEachPipeWrapped.xslt"
>
<Param name="With" sessionKey="ZdsHeeft" type="DOMDOC"/>
<Forward name="success" path="EXIT"/>
<Forward name="success" path="ResultaatExists"/>
<Forward name="error" path="EXCEPTION"/>
</XsltPipe>

<XmlIfPipe name="ResultaatExists" getInputFromSessionKey="originalMessage" xpathExpression="//resultaat != ''">
<Forward name="then" path="GetAuthorizationHeaderForZakenApi" />
<Forward name="else" path="ReturnZdsZaak" />
</XmlIfPipe>

<EchoPipe name="ReturnZdsZaak" getInputFromSessionKey="ZdsZaak">
<Forward name="success" path="EXIT" />
<Forward name="exception" path="EXCEPTION" />
</EchoPipe>

<SenderPipe name="GetAuthorizationHeaderForZakenApi"
getInputFromFixedValue="&lt;dummy/&gt;" storeResultInSessionKey="Authorization">
<IbisLocalSender
name="GetAuthorizationHeaderForZakenApiSender"
javaListener="GenerateAuthorizationHeaderForZakenApi"
returnedSessionKeys="Error,Authorization">
</IbisLocalSender>
<Forward name="success" path="GetResultaatSender" />
<Forward name="exception" path="EXCEPTION" />
</SenderPipe>

<SenderPipe
name="GetResultaatSender"
getInputFromSessionKey="originalMessage"
>
<HttpSender
name="GetResultaatSender"
methodType="GET"
headersParams="Authorization,Accept-Crs"
timeout="${zaakbrug.zgw.zaken-api.timeout}"
maxExecuteRetries="5"
/>
<Param name="url" sessionKey="ZgwZaak"
xpathExpression="//resultaat"
/>
<Param name="Accept-Crs" value="EPSG:4326" />
<Param name="Authorization" xpathExpression="concat('Bearer ', $token)">
<Param name="token" sessionKey="Authorization"/>
</Param>
<Forward name="success" path="Json2XML" />
<Forward name="exception" path="EXCEPTION" />
</SenderPipe>

<JsonPipe name="Json2XML" storeResultInSessionKey="Resultaat"/>

<XsltPipe name="EnrichZdsZaakWithResultaat"
getInputFromSessionKey="ZdsZaak"
storeResultInSessionKey="ZdsZaak"
styleSheetName="geefZaakdetails_Lv01/xsl/AddResultaat.xsl"
>
<Param name="Resultaat" sessionKey="Resultaat" type="DOMDOC"/>
<Forward name="success" path="EXIT"/>
<Forward name="error" path="EXCEPTION"/>
</XsltPipe>
</Pipeline>
</Adapter>
</Module>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ZKN="http://www.egem.nl/StUF/sector/zkn/0310">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" omit-xml-declaration="yes" />
<xsl:param name="Resultaat" />

<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:template>

<xsl:template match="ZKN:startdatum">
<ZKN:resultaat>
<ZKN:omschrijving>
<xsl:value-of select="$Resultaat/root/toelichting" />
</ZKN:omschrijving>
</ZKN:resultaat>
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:template>

</xsl:stylesheet>

0 comments on commit 5f10200

Please sign in to comment.