Files
Facilitor/CUST/AAXX/xsl/csun.xsl
Arthur Egberink 6927b4b966 CSUN#40729 -- Automatisering Facilitor koppelingen (gebouwcode)
svn path=/Website/branches/v2017.2/; revision=35536
2017-10-03 13:44:46 +00:00

168 lines
9.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<xsl:output method="xml" indent="yes" encoding="utf-8" />
<xsl:decimal-format name="european" decimal-separator="," grouping-separator="." />
<xsl:param name="mode" />
<xsl:variable name="Rev">
<xsl:value-of select="substring(translate('$Revision$', '$ ', ''), 10)" />
</xsl:variable>
<xsl:template match="opdracht">
<facilitor>
<xsl:element name="melding">
<xsl:attribute name="key">
<xsl:value-of select="melding_key" />/<xsl:value-of select="bedrijfopdr_volgnr" /></xsl:attribute>
<xsl:attribute name="type">insert</xsl:attribute>
<xsl:choose>
<xsl:when test="tracking/track[@code='ORDNEW']">
<datum><xsl:value-of select="tracking/track[@code='ORDNEW']/datum/jaar" />-<xsl:value-of select="tracking/track[@code='ORDNEW']/datum/maand" />-<xsl:value-of select="tracking/track[@code='ORDNEW']/datum/dag" /><xsl:text> </xsl:text><xsl:value-of select="tracking/track[@code='ORDNEW']/datum/tijd" />:00</datum>
</xsl:when>
<xsl:otherwise>
<datum><xsl:value-of select="datumbegin/jaar" />-<xsl:value-of select="datumbegin/maand" />-<xsl:value-of select="datumbegin/dag" /><xsl:text> </xsl:text><xsl:value-of select="datumbegin/tijd" />:00</datum>
</xsl:otherwise>
</xsl:choose>
<melder>
<xsl:value-of select="melding/melder/naam_full" />
</melder>
<stdmelding>
41
</stdmelding>
<prioriteit>
<xsl:value-of select="melding/spoed" />
</prioriteit>
<locatiecode>ONBEKEND</locatiecode>
<omschrijving><xsl:choose><xsl:when test="//facilitor/header/custId='AANS'">AAFM-NS</xsl:when>
<xsl:when test="//facilitor/header/custId='AARW'">AAFM-RWS</xsl:when>
<xsl:when test="//facilitor/header/custId='AAAR'">AAFM-Arcadis</xsl:when>
<xsl:when test="//facilitor/header/custId='AADB'">AAFM-DB Schenker</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>Opdrachtnummer: <xsl:value-of select="melding_key" />/<xsl:value-of select="bedrijfopdr_volgnr" />
Opdrachttype: <xsl:value-of select="opdrachttype/omschrijving" />
Melder: <xsl:value-of select="melding/melder/naam_full" />
Email: <xsl:value-of select="melding/melder/email" />
Telefoon: <xsl:choose><xsl:when test="melding/melder/mobiel!=''"><xsl:value-of select="melding/melder/mobiel" /></xsl:when><xsl:when test="melding/melder/telefoonnr!=''"><xsl:value-of select="melding/melder/telefoonnr" /></xsl:when><xsl:otherwise>-</xsl:otherwise></xsl:choose>
Vakgroep:<xsl:value-of select="melding/stdmelding/discipline/omschrijving" />
Melding:<xsl:value-of select="melding/stdmelding/omschrijving" />
Prioriteit: <xsl:choose><xsl:when test="melding/spoed=1">Kritiek</xsl:when><xsl:when test="melding/spoed=2">Hoog</xsl:when><xsl:when test="melding/spoed=3">Normaal</xsl:when><xsl:otherwise>Laag</xsl:otherwise></xsl:choose>
Einddatum: <xsl:value-of select="einddatum/datum" />
Adres: <xsl:value-of select="melding/plaats/regio/district/locatie/plaats"/>, <xsl:value-of select="melding/plaats/regio/district/locatie/adres"/>
Locatie: <xsl:value-of select="melding/plaats/regio/district/locatie/code"/> (<xsl:value-of select="melding/plaats/regio/district/locatie/omschrijving"/>)
Gebouw: <xsl:value-of select="melding/plaats/regio/district/locatie/gebouw/code"/> (<xsl:value-of select="melding/plaats/regio/district/locatie/gebouw/naam"/>)
Verdieping: <xsl:value-of select="melding/plaats/regio/district/locatie/gebouw/verdieping/code"/>
Ruimte: <xsl:value-of select="melding/plaats/regio/district/locatie/gebouw/verdieping/ruimte/nr"/> (<xsl:value-of select="melding/plaats/regio/district/locatie/gebouw/verdieping/ruimte/omschrijving"/>)
Kosten uit opdracht: € <xsl:value-of select="format-number(kosten, '0,00', 'european')"/>
Omschrijving: <xsl:value-of select="omschrijving" />
Melding: <xsl:value-of select="melding/omschrijving" /></omschrijving>
<kenmerk naam="Kosten"><xsl:value-of select="kosten" /></kenmerk>
<kenmerk naam="Locatiecode klant"><xsl:value-of select="melding/plaats/regio/district/locatie/code"/></kenmerk>
<kenmerk naam="Gebouwcode klant"><xsl:value-of select="melding/plaats/regio/district/locatie/gebouw/code"/></kenmerk>
<kenmerk naam="Werkbon/Opdracht nr. klant"><xsl:value-of select="melding_key" />/<xsl:value-of select="bedrijfopdr_volgnr" /></kenmerk>
<kenmerk naam="Einddatum klant"><xsl:value-of select="einddatum/datum" /><xsl:text> </xsl:text><xsl:value-of select="einddatum/tijd" />:00</kenmerk>
<xsl:for-each select="melding/kenmerk">
<xsl:sort select="@volgnummer" data-type="number" />
<xsl:element name="kenmerk">
<xsl:attribute name="naam">
<xsl:choose>
<xsl:when test="@type='F' or @type='M'">Bijlagen</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@naam" />
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="volgnummer">
<xsl:value-of select="@volgnummer" />
</xsl:attribute>
<xsl:attribute name="type">
<xsl:value-of select="@type" />
</xsl:attribute>
<xsl:choose>
<xsl:when test="@type='F' or @type='M'">
<xsl:element name="FCLTmeldingattachment">
<xsl:attribute name="meldingkey">
<xsl:value-of select="../key" />
</xsl:attribute>
<xsl:attribute name="kenmerkkey">
<xsl:value-of select="@key" />
</xsl:attribute>
<xsl:attribute name="nodename">bijlage</xsl:attribute>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="." />
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:for-each>
</xsl:element>
</facilitor>
</xsl:template>
<!-- Inpakken 'bon' in SOAP envelope
PutOrders voegt de tag SOAPEnvelope toe roept vervolgens deze stylesheet aan -->
<xsl:template match="SOAPEnvelope">
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<xsl:copy-of select="./node()"/>
</soap:Body>
</soap:Envelope>
</xsl:template>
<!-- Uitpakken SOAP envelope -->
<xsl:template match="soap:Envelope">
<soapResult>
<xsl:copy-of select="soap:Body/node()"/>
</soapResult>
</xsl:template>
<!-- Decoderen XML response -->
<xsl:template match="soapResult">
<Result>
<xsl:choose>
<xsl:when test="facilitor/melding/returncode = 0"></xsl:when>
<xsl:otherwise>
Foutmelding:<xsl:value-of select="facilitor/melding/returncode"/> - <xsl:value-of select="facilitor/melding/returntekst"/>
</xsl:otherwise>
</xsl:choose>
</Result>
</xsl:template>
<xsl:template match="facilitor">
<xsl:apply-templates select="opdracht" />
</xsl:template>
<xsl:template match="/">
<xsl:choose>
<xsl:when test="$mode='getExtension'">
<xsl:element name="format">
<xsl:element name="extension">cxml</xsl:element>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<!-- door SendFile.cls gebruikt voor maken 'bon' (XML die via SOAP verstuurd wordt) -->
<xsl:apply-templates select="facilitor"/>
<!-- door SendSOAP.cls gebruikt voor inpakken van 'bon' in SOAP envelope
SOAPEnvelope is een harde tag die in PutOrders gedefinieerd wordt. -->
<xsl:apply-templates select="SOAPEnvelope"/>
<!-- door SendSOAP.cls gebruikt voor uitpakken van response uit SOAP envelope -->
<xsl:apply-templates select="soap:Envelope"/>
<!-- door SendSOAP.cls gebruikt voor uitpakken van de inhoud uit het bericht -->
<xsl:apply-templates select="soapResult"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
<!-- Stylesheet edited using Stylus Studio - (c) 2004-2007. Progress Software Corporation. All rights reserved. --><!-- Stylesheet edited using Stylus Studio - (c) 2004-2007. Progress Software Corporation. All rights reserved. --><!-- Stylesheet edited using Stylus Studio - (c) 2004-2007. Progress Software Corporation. All rights reserved. --><!-- Stylesheet edited using Stylus Studio - (c) 2004-2007. Progress Software Corporation. All rights reserved. --><!-- Stylus Studio meta-information - (c) 2004-2009. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios/>
<MapperMetaTag>
<MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/>
<MapperBlockPosition></MapperBlockPosition>
<TemplateContext></TemplateContext>
<MapperFilter side="source"></MapperFilter>
</MapperMetaTag>
</metaInformation>
-->