<?xml version='1.0' encoding='UTF-8'?>

<Properties version="4.1">
	<Property name="xslt.base64Zipped">true</Property>
	<Property name="xslt.ignoreInput">false</Property>
	<Property name="xslt.params" type="List">
		<Property name="var.session">var.session</Property>
	</Property>
	<Property name="xslt.saveAtServer">true</Property>
	<Property name="xslt.setAllVariablesAsTransformerParams">true</Property>
	<Property name="xslt.source">&lt;?xml version="1.0" encoding="UTF-8"?>
&lt;body>&lt;download>&lt;fileName>Stammdaten_GRTD_2017_02_10.xlsx&lt;/fileName>&lt;contentType>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet&lt;/contentType>&lt;data>[encoded data, 19136 characters]&lt;/data>&lt;/download>&lt;/body></Property>
	<Property name="xslt.sourceVariables" type="Map">
		<Property name="ISWorkflowName">VAM_api_download_store</Property>
		<Property name="ISServerName">dev03.virtimo.net</Property>
		<Property name="ISInvokingWorkflow">VAM_api_main_processRequests</Property>
		<Property name="var.log" type="XmlDocument">&lt;?xml version="1.0" encoding="UTF-8"?>
&lt;log>&lt;entries/>&lt;/log></Property>
		<Property name="ISModuleId">1366</Property>
		<Property name="ISGlobalProcessId">1660499</Property>
		<Property name="ISUserName">VAM</Property>
		<Property name="ISInvokingModule">VAM_api_main_WFC_saveDownload</Property>
		<Property name="ISCurrentTime">1486729391457</Property>
		<Property name="ISProcessId">1660499</Property>
		<Property name="var.session" type="XmlDocument">&lt;?xml version="1.0" encoding="UTF-8"?>
&lt;session>&lt;configuration>&lt;api> 
    &lt;database>&lt;type>oracle&lt;/type> 
        
        
      &lt;default> 
        &lt;alertTimeout>20&lt;/alertTimeout>  
        &lt;queryTimeout>60&lt;/queryTimeout> 
      &lt;/default> 
    &lt;/database>  
    &lt;entity> 
      &lt;validate>false&lt;/validate> 
    &lt;/entity>  
    &lt;response> 
      &lt;debuggingInformation>false&lt;/debuggingInformation>  
      &lt;format>false&lt;/format>  
      &lt;validate>true&lt;/validate> 
    &lt;/response>  
    &lt;user> 
      &lt;maxAge>P0DT2H0M5S&lt;/maxAge>  
    &lt;/user>&lt;technicalUser> 
      &lt;loginName>sys&lt;/loginName> 
    &lt;/technicalUser>&lt;alerting> 
      &lt;recipient> 
        &lt;eMailAddress>kaufhold@virtimo.de &lt;/eMailAddress> 
      &lt;/recipient>&lt;mail> 
      &lt;host>smtp.googlemail.com&lt;/host>  
      &lt;sender> 
        &lt;eMailAddress>jochen@virtimo.net &lt;/eMailAddress> 
      &lt;/sender>  
      &lt;debuggingInformation>true&lt;/debuggingInformation> 
    &lt;/mail> 
    &lt;/alerting>&lt;backend>&lt;imnot>&lt;url>https://localhost:7080/im/1/rest/&lt;/url>&lt;/imnot>&lt;bpc>&lt;url>http://localhost:8181/cxf/bpc-core/authentication&lt;/url>&lt;/bpc>&lt;/backend> 
  &lt;/api>&lt;am>&lt;database>&lt;type>mssql&lt;/type> 
        
        
      &lt;default> 
        &lt;alertTimeout>20&lt;/alertTimeout>  
        &lt;queryTimeout>60&lt;/queryTimeout> 
      &lt;/default> 
    &lt;/database> 
      
      
    &lt;entity> 
      &lt;validate>false&lt;/validate> 
    &lt;/entity>  
      
      
    &lt;technicalUser> 
      &lt;loginName>sys&lt;/loginName> 
    &lt;/technicalUser>
      
      
     
  &lt;/am>&lt;userGroupName>VAM&lt;/userGroupName>&lt;/configuration>&lt;user>&lt;id>bpcadmin&lt;/id>&lt;displayName>bpcadmin&lt;/displayName>&lt;loginName>bpcadmin&lt;/loginName>&lt;name>bpcadmin&lt;/name>&lt;eMailAddress/>&lt;active>true&lt;/active>&lt;locale>de_DE&lt;/locale>&lt;language>de&lt;/language>&lt;country>DE&lt;/country>&lt;roles>&lt;role>10XCH-SWISSGRID2&lt;/role>&lt;role>bpcadmin&lt;/role>&lt;role>bpcUser&lt;/role>&lt;role>EAI Developer&lt;/role>&lt;role>VAM_organization_16103&lt;/role>&lt;role>VAM_organization_ebix&lt;/role>&lt;role>VAM_organization_PF&lt;/role>&lt;role>VAM_organization_showcase&lt;/role>&lt;role>VAM-administrator&lt;/role>&lt;/roles>&lt;permissions>&lt;permission>&lt;module>am&lt;/module>&lt;context>asset&lt;/context>&lt;method>create&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>asset&lt;/context>&lt;method>delete&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>asset&lt;/context>&lt;method>executeAction&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>asset&lt;/context>&lt;method>get&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>asset&lt;/context>&lt;method>getActionAttributes&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>asset&lt;/context>&lt;method>query&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>asset&lt;/context>&lt;method>update&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>person&lt;/context>&lt;method>create&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>person&lt;/context>&lt;method>delete&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>person&lt;/context>&lt;method>get&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>person&lt;/context>&lt;method>query&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>person&lt;/context>&lt;method>update&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>query&lt;/context>&lt;method>create&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>query&lt;/context>&lt;method>delete&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>query&lt;/context>&lt;method>get&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>query&lt;/context>&lt;method>query&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>query&lt;/context>&lt;method>update&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>template&lt;/context>&lt;method>create&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>template&lt;/context>&lt;method>delete&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>template&lt;/context>&lt;method>executeAction&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>template&lt;/context>&lt;method>get&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>template&lt;/context>&lt;method>getActionAttributes&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>template&lt;/context>&lt;method>getImage&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>template&lt;/context>&lt;method>query&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>template&lt;/context>&lt;method>setImage&lt;/method>&lt;/permission>&lt;permission>&lt;module>am&lt;/module>&lt;context>template&lt;/context>&lt;method>update&lt;/method>&lt;/permission>&lt;permission>&lt;module>api&lt;/module>&lt;context>organization&lt;/context>&lt;method>getConfiguration&lt;/method>&lt;/permission>&lt;permission>&lt;module>api&lt;/module>&lt;context>organization&lt;/context>&lt;method>setConfiguration&lt;/method>&lt;/permission>&lt;permission>&lt;module>api&lt;/module>&lt;context>organization&lt;/context>&lt;method>setName&lt;/method>&lt;/permission>&lt;/permissions>&lt;organizations>&lt;organization>&lt;id>PF&lt;/id>&lt;displayName>PF&lt;/displayName>&lt;name/>&lt;configuration/>&lt;active>true&lt;/active>&lt;/organization>&lt;/organizations>&lt;/user>&lt;startTimestamp>1486729387735&lt;/startTimestamp>&lt;/session></Property>
		<Property name="ISModuleName">VAM_api_empty</Property>
	</Property>
	<Property name="xslt.stylesheet" type="XmlDocument">&lt;?xml version="1.0" encoding="UTF-8"?>
&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:isxp="java:com.inubit.ibis.xsltext.ISFunctions" xmlns:am="http://www.bosch-si.com/2013/AM" exclude-result-prefixes="#all" version="2.0">&lt;xsl:import href="inubitmodule://VAM_api_XSLT_Tools"/>
  &lt;xsl:output method="xml" encoding="UTF-8"/>&lt;xsl:param name="var.session" as="element()"/>
  &lt;xsl:template match="/*">&lt;xsl:variable name="var.fileName" select="if (download/fileName != '') then download/fileName else 'download.bin'"/>&lt;xsl:variable name="var.contentType" select="if (download/contentType != '') then download/contentType else 'application/octet-stream'"/>&lt;queries>&lt;xsl:choose>&lt;xsl:when test="$databaseType = 'mssql'">&lt;query properties="force">&lt;value>&lt;xsl:text>DECLARE @NextID int ;
SET @NextID = NEXT VALUE FOR downloads_seq; 

INSERT INTO DOWNLOADS (
     ID,
     FILENAME,
     CONTENTTYPE,
     ORGANIZATIONID,
     USERID,
     DATA,
     CREATEDON)
VALUES (
     @NextID,
     &lt;/xsl:text>&lt;xsl:value-of select="am:stringToDB($var.fileName), am:comma()"/>&lt;xsl:value-of select="am:stringToDB($var.contentType), am:comma()"/>&lt;xsl:value-of select="am:stringToDB($var.session/user/organizations/organization/id), am:comma()"/>&lt;xsl:value-of select="am:stringToDB($var.session/user/id), am:comma()"/>&lt;xsl:text>cast(
     &lt;/xsl:text>&lt;!--TODO das sieht sehr unständlich aus - warum nicht das base64 direkt verwenden?-->&lt;xsl:value-of select="am:stringToDB(isxp:serialize(download/data))"/>&lt;xsl:text> as xml).value('/data[1]', 'varbinary(max)'),  '&lt;/xsl:text>&lt;xsl:value-of select="format-dateTime(adjust-dateTime-to-timezone(current-dateTime(), xs:dayTimeDuration('PT0H')), '[Y0001]-[M01]-[D01] [H01]:[m01]:[s01]')"/>&lt;xsl:text>'
)&lt;/xsl:text>&lt;/value>&lt;/query>&lt;/xsl:when>&lt;xsl:otherwise>&lt;query type="insert">&lt;tables>&lt;table>&lt;tableNames>&lt;tableName>DOWNLOADS&lt;/tableName>&lt;/tableNames>&lt;fields>&lt;field>&lt;fieldName>ID&lt;/fieldName>&lt;fieldValue type="force">&lt;xsl:value-of select="am:nextID('downloads_seq')"/>&lt;/fieldValue>&lt;/field>&lt;field>&lt;fieldName>FILENAME&lt;/fieldName>&lt;fieldValue>&lt;xsl:value-of select="$var.fileName"/>&lt;/fieldValue>&lt;/field>&lt;field>&lt;fieldName>CONTENTTYPE&lt;/fieldName>&lt;fieldValue>&lt;xsl:value-of select="$var.contentType"/> &lt;/fieldValue>&lt;/field>&lt;field>&lt;fieldName>ORGANIZATIONID&lt;/fieldName>&lt;fieldValue>&lt;xsl:value-of select="$var.session/user/organizations/organization/id"/> &lt;/fieldValue>&lt;/field>&lt;field>&lt;fieldName>USERID&lt;/fieldName>&lt;fieldValue>&lt;xsl:value-of select="$var.session/user/id"/> &lt;/fieldValue>&lt;/field>&lt;field>&lt;fieldName>DATA&lt;/fieldName>&lt;fieldValue>&lt;xsl:value-of select="download/data"/> &lt;/fieldValue>&lt;/field>&lt;field>&lt;fieldName>CREATEDON&lt;/fieldName>&lt;fieldValue>&lt;xsl:value-of select="format-dateTime(adjust-dateTime-to-timezone(current-dateTime(), xs:dayTimeDuration('PT0H')), '[Y0001]-[M01]-[D01] [H01]:[m01]:[s01]')"/> &lt;/fieldValue>&lt;/field>&lt;/fields>&lt;/table>&lt;/tables>
          
        &lt;/query>&lt;/xsl:otherwise>&lt;/xsl:choose>&lt;query properties="force">&lt;value>&lt;xsl:value-of select="am:selectNewID('downloads_seq')"/>&lt;/value>
          
        &lt;/query>&lt;/queries>
  &lt;/xsl:template>
&lt;/xsl:stylesheet></Property>
	<Property name="xslt.target"></Property>
	<Property name="xslt.transformer">net.sf.saxon.TransformerFactoryImpl</Property>
</Properties>