KFNS#57236 Archibus-koppeling (VolkerWessels)

svn path=/Website/branches/v2019.1/; revision=42323
This commit is contained in:
Maarten van der Heide
2019-05-01 07:04:00 +00:00
parent fd6fb3f71d
commit 1d39362a4b
2 changed files with 171 additions and 0 deletions

View File

@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" encoding="utf-8"/>
<xsl:param name="mode"/>
<xsl:decimal-format name="european" decimal-separator="." grouping-separator=","/>
<!-- Maken 'bon' (XML) -->
<xsl:template match="opdracht">
<xsl:element name="Envelope">
<xsl:element name="Header">
<MessageId>
<!--xsl:value-of select="concat(melding/discipline/srtdiscipline/prefix, melding/key)"/>/<xsl:value-of select=" bedrijfopdr_volgnr"/-->
<xsl:value-of select="melding/key"/>/<xsl:value-of select=" bedrijfopdr_volgnr"/>
</MessageId>
<MessageType>HardServiceMelding</MessageType>
<MessageFormat>xml</MessageFormat>
<MessageVersion>1.0.0.0</MessageVersion>
<SenderId>Facilitor</SenderId>
<ReceiverId>Archibus</ReceiverId>
<Destination>Archibus</Destination>
<xsl:element name="Created">
<xsl:for-each select="tracking/track">
<xsl:sort select="datum/timestamp" order="ascending"/>
<xsl:if test="position()=1">
<xsl:value-of select="datum/jaar"/>-<xsl:value-of select="datum/maand"/>-<xsl:value-of select="datum/dag"/>T<xsl:value-of select="datum/tijd"/>:00<xsl:value-of select="/facilitor/header/servertimezone"/>
</xsl:if>
</xsl:for-each>
</xsl:element>
</xsl:element>
<xsl:element name="Body">
<xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
<ticketRequest>
<!--facilitorId><xsl:value-of select="concat(melding/discipline/srtdiscipline/prefix, melding/key)"/>/<xsl:value-of select=" bedrijfopdr_volgnr"/></facilitorId-->
<facilitorId><xsl:value-of select="melding/key"/>/<xsl:value-of select=" bedrijfopdr_volgnr"/></facilitorId-->
<siteId><xsl:value-of select="melding/plaats/regio/district/locatie/code"/></siteId>
<buildingId><xsl:value-of select="melding/plaats/regio/district/locatie/gebouw/code"/></buildingId>
<floorId><xsl:value-of select="melding/plaats/regio/district/locatie/gebouw/verdieping/code"/></floorId>
<roomId><xsl:value-of select="melding/plaats/regio/district/locatie/gebouw/verdieping/ruimte/nr"/></roomId>
<description><xsl:value-of select="melding/onderwerp"/></description>
<remarks>
Melder: <xsl:value-of select="melding/voor/naam_full"/>
Opmerking:
<xsl:value-of select="omschrijving"/>
</remarks>
<phone></phone>
<probType>TECHNISCH VW</probType>
<requestor>SERVICEDESK HGH</requestor>
<activityType>SERVICE DESK - MAINTENANCE</activityType>
<escalationTS>
<xsl:value-of select="melding/datum_gepland/jaar"/>-<xsl:value-of select="melding/datum_gepland/maand"/>-<xsl:value-of select="melding/datum_gepland/dag"/>T<xsl:value-of select="melding/datum_gepland/tijd"/>:00<xsl:value-of select="/facilitor/header/servertimezone"/>
</escalationTS>
</ticketRequest>
<xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
</xsl:element>
</xsl:element>
</xsl:template>
<!-- Maken 'bon' (XML) -->
<xsl:template match="facilitor">
<xsl:apply-templates select="opdracht"/>
</xsl:template>
<!-- Decoderen XML response -->
<xsl:template match="ServiceRequestStatus">
<Result>
<xsl:value-of select="ErrorLog/TypeID"/>
</Result>
</xsl:template>
<!-- Root -->
<xsl:template match="/">
<xsl:choose>
<xsl:when test="$mode='getExtension'">
<xsl:element name="format">
<xsl:element name="extension">xml</xsl:element>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="facilitor"/>
<xsl:apply-templates select="ServiceRequestStatus"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt" version="1.0">
<xsl:output method="xml" indent="yes" encoding="utf-8"/>
<xsl:variable name="Rev">
<xsl:value-of select="substring(translate('$Revision$', '$ ', ''), 10)"/>
</xsl:variable>
<xsl:decimal-format name="european" decimal-separator="," grouping-separator="."/>
<xsl:template match="FacilitorMelding">
<facilitor>
<xsl:element name="opdracht">
<xsl:attribute name="key">
<!--xsl:value-of select="substring(facilitorId,2,100)"/-->
<xsl:value-of select="facilitorId"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="status='COMPLETED'">
<xsl:attribute name="type">update</xsl:attribute>
<mut_datum>
<xsl:value-of select="substring-before(dateTimeStatusChange, '+')"/>
</mut_datum>
<xsl:if test="remarks!=''">
<opmerking>
<xsl:value-of select="remarks"/>
</opmerking>
</xsl:if>
<status>ORDAFM</status>
<kenmerk naam="Afgemeld">1</kenmerk>
</xsl:when>
<xsl:when test="status='REJECTED'">
<xsl:attribute name="type">update</xsl:attribute>
<mut_datum>
<xsl:value-of select="substring-before(dateTimeStatusChange, '+')"/>
</mut_datum>
<xsl:if test="remarks!=''">
<opmerking>
<xsl:value-of select="remarks"/>
</opmerking>
</xsl:if>
<status>ORDREJ</status>
</xsl:when>
<xsl:when test="status='APPROVED'">
<xsl:attribute name="type">update</xsl:attribute>
<mut_datum>
<xsl:value-of select="substring-before(dateTimeStatusChange, '+')"/>
</mut_datum>
<xsl:if test="remarks!=''">
<opmerking>
<xsl:value-of select="remarks"/>
</opmerking>
</xsl:if>
<status>ORDACP</status>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="type">note</xsl:attribute>
<opmerking>
<xsl:value-of select="status"/>
<xsl:text>
</xsl:text>
<xsl:value-of select="remarks"/>
</opmerking>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</facilitor>
</xsl:template>
<xsl:template match="facilitor">
<xsl:apply-templates select="FacilitorMelding"/>
</xsl:template>
<!-- Root -->
<xsl:template match="/">
<xsl:apply-templates select="FacilitorMelding"/>
</xsl:template>
<xsl:template match="melder">
</xsl:template>
</xsl:stylesheet>