123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cpscrn
- (C) Copyright IBM Corp. 2005, 2011
- 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: //cps/main/src/cps/templates/cps2/gethandler.xts#4 $ -->
- <!-- $DateTime: 2003/12/10 15:46:32 $ -->
- <!-- $Change: 7283 $ -->
- <xts:morphlet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/">
- <xts:documentation>
- Web Service Discovery GET Handler
-
- modes:
- default - render list of services with urls to discover endpoints
- wsdl or WSDL - return wsdl xml document for referenced service
-
- notes:
- - because of restrictions on where the gethandler can be declared, this
- version will need to be aware of the implementation
- - if location is /cps2/producer, then we are handling the wsrp producer discovery
- - others should be handled as simple services.
-
- </xts:documentation>
- <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"
- xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/"
- xmlns:cws="http://developer.cognos.com/schemas/xts/logicsheets/xslt/cws/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <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>
- </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="/">
- <xsl:copy-of select="/error/*"/>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- info
-
- if url is an interface endpoint
- if url is a wsrp endpoint
- if url is not a web service endpoint
-
- if there are multiple endpoints at one address
- render section for each web service
-
- render
-
- -->
- <xts:block id="info" dependency="get_interfaces" condition=".[not(/root/env/param[@name = 'wsdl'])]" mandatory="false" type="exec" processor="XSLT" mode="output" mimeType="text/html">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xts">
- <xsl:output method="html" omit-xml-declaration="yes" media-type="text/html" encoding="UTF-8"/>
- <xsl:template match="/">
- <html>
- <head>
- <title>Test Morphlet</title>
- <meta http-equiv="pragma" content="no-cache"/>
- <meta http-equiv="cache" content="0"/>
- </head>
- <body bgcolor="#ffffff">
- <h2>CPS Assembler</h2>
-
- <xsl:for-each select="/root/interface">
- <table cellpadding="2" cellspacing="0" border="1" width="50%">
- <tbody>
- <tr>
- <th>Param</th>
- <th>Value</th>
- </tr>
- <xsl:for-each select="operation">
- <tr>
- <td>
- <xsl:value-of select="@name"/>
- </td>
- <td>
- <xsl:value-of select="morphlet/@path"/>
- </td>
- </tr>
- </xsl:for-each>
- </tbody>
- </table>
- <br/>
- </xsl:for-each>
- <table cellpadding="2" cellspacing="0" border="1" width="50%">
- <tbody>
- <tr>
- <th>Param</th>
- <th>Value</th>
- </tr>
- <xsl:for-each select="/root/interfaces/interfaceInfo/param">
- <tr>
- <td>
- <xsl:value-of select="@name"/>
- </td>
- <td>
- <xsl:value-of select="."/>
- </td>
- </tr>
- </xsl:for-each>
- </tbody>
- </table>
- <br/>
- <xsl:call-template name="render-debug-links"/>
- </body>
- </html>
- </xsl:template>
- <xsl:template name="render-debug-links">
- <xsl:param name="trace" select="/root/debug/traceRequestPath"/>
- <xsl:param name="title"/>
- <xsl:if test="$trace">
- <xsl:variable name="server" select="/root/http/param[@name = 'HOST']"/>
- <xsl:variable name="traceurl" select="concat('http://', $server, '/cps/transerv?m=/debug/traceview.xts&request=')"/>
- <xsl:variable name="sourceurl" select="concat($server, '?m=/debug/morphview.xts&view=')"/>
- <xsl:variable name="source" select="substring-before($trace, '/execution-')"/>
- <xsl:variable name="instanceId" select="substring-after($trace, 'execution-')"/>
- <xsl:if test="$instanceId">
- <table cellspacing="0" cellpadding="0" border="0" width="100%" height="20">
- <tr>
- <td nowrap="nowrap" class="dialogHeaderLink" valign="top" align="right" width="100%">
- <a href="{ $sourceurl }{ $source }" target="morphsource_{ translate($source, '/.', '__') }">
- <xsl:value-of select="$source"/>
- </a>
- </td>
- <td valign="middle" width="5" height="20">
- <img width="5" height="20" src="/cps/debug/images/space.gif" alt=""/>
- </td>
- <td nowrap="nowrap" class="dialogHeaderLink" valign="top" align="right">
- <a href="{ $traceurl }{ $trace }" target="morphtrace_{ $instanceId }">trace</a>
- </td>
- </tr>
- </table>
- </xsl:if>
- </xsl:if>
- </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" dependency="info" condition="/root/env/param[@name = 'wsdl']" mandatory="false" type="exec" processor="XSLT" mode="interpret">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
- exclude-result-prefixes="xts">
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root">
- <schemas>
- <xsl:for-each select="/root/interface[1]/types/schema">
- <xts:request protocol="FILEREAD" target="{ @src }"/>
- </xsl:for-each>
- </schemas>
- </xts:append>
- <xts:append select="/root/output">
- <xts:transform processor="XSLT" src="/cps4/nav/wsdl/wsdl.xslt" option="part" mimeType="text/xml">
- <root>
- <xts:queryNode select="/root/interface[1] | /root/schemas | /root/http"/>
- </root>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|