123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cogadmin
- (C) Copyright IBM Corp. 2005, 2010
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
- Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
- -->
- <!-- $Header: //cogadmin/main/prod/adminServer/templates/ps/cogadminWebService/impl_wsrf/gethandler.xts#3 $ -->
- <!-- $DateTime: 2010/03/31 17:10:53 $ -->
- <!-- $Change: 15977 $ -->
- <xts:morphlet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/">
- <xts:block id="get_interfaces" type="exec" processor="XSLT" mode="interpret">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:template match="/">
- <xsl:for-each select="/root/interfaces/interfaceInfo[param[@name = 'virtualPath'] != '']">
- <xts:sequence>
- <xts:append>
- <xts:request protocol="FILEREAD" target="{ param[@name = 'location'] }/interface.xml" faultBlock="readfault"/>
- </xts:append>
- </xts:sequence>
- </xsl:for-each>
-
- <!-- get gateway to determine protocol scheme (ie. https) -->
- <xts:sequence>
- <xts:append>
- <xts:function name="getConfiguration">
- <xts:param name="gateway"/>
- </xts:function>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="readfault" type="fault" processor="XSLT">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:template match="/">
- <error>
- <xsl:copy-of select="/root/fault/*"/>
- </error>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- request is for a wsrp producer endpoint
- load interface and handle wsrp namespace
-
- for first loaded interface
- load package info
-
- generate wsdl with only supported interfaces
- -->
- <xts:block id="wsdl_service" dependency="get_interfaces" type="exec" processor="XSLT" mode="interpret">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xts">
- <xsl:variable name="env-param" select="/root/env/param"/>
- <xsl:variable name="http-param" select="/root/http/param"/>
- <xsl:variable name="config-property" select="/root/configuration/property"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root/output">
- <xsl:choose>
- <xsl:when test="/root/error">
- <xos:statusCode xmlns:xos="http://developer.cognos.com/schemas/xts/output/">404</xos:statusCode>
- </xsl:when>
- <xsl:otherwise>
- <!--
- NOTE: The CGI 1.1 interface does not describe the protocol scheme (ie. https) so the
- configuration gateway parameter's protocol scheme is used.
- Since multiple gateways may be used, the rest of the configuration gateway parameter
- is discarded and the URI is reconstructed from the incomming http parameters.
- -->
- <xsl:variable name="gateway" select="$config-property[@name = 'gateway']"/>
- <xsl:variable name="gateway-scheme">
- <xsl:if test="contains($gateway, '://')">
- <xsl:value-of select="substring-before($gateway, '://')"/>
- </xsl:if>
- </xsl:variable>
- <xsl:variable name="protocol">
- <xsl:choose>
- <xsl:when test="$gateway-scheme != ''">
- <xsl:value-of select="$gateway-scheme"/>
- </xsl:when>
- <xsl:otherwise>http</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="request-uri">
- <xsl:value-of select="concat($protocol, '://')"/>
- <xsl:value-of select="$http-param[@name = 'SERVER_NAME']"/>
- <xsl:if test="$http-param[@name = 'SERVER_PORT'] != '' and $http-param[@name = 'SERVER_PORT'] != '80'">
- <xsl:text>:</xsl:text>
- <xsl:value-of select="$http-param[@name = 'SERVER_PORT']"/>
- </xsl:if>
- <xsl:value-of select="$http-param[@name = 'SCRIPT_NAME']"/>
- <xsl:value-of select="$http-param[@name = 'PATH_INFO']"/>
- </xsl:variable>
- <xsl:variable name="resource" select="$env-param[@name = 'resourceType']"/>
- <xos:part xmlns:xos="http://developer.cognos.com/schemas/xts/output/">
- <xos:entityHeader>
- <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
- </xos:entityHeader>
- <xos:entityBody>
- <xts:getResourceWSDL>
- <xts:param name="resourceType"><xsl:value-of select="$resource"/></xts:param>
- <xts:param name="servletURI"><xsl:value-of select="$request-uri"/></xts:param>
- <xts:param name="targetNamespace"><xsl:value-of select="concat('http://developer.cognos.com/nemo/', $resource)"/></xts:param>
- </xts:getResourceWSDL>
- </xos:entityBody>
- </xos:part>
- </xsl:otherwise>
- </xsl:choose>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|