addWebservice.xts 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: AGS
  5. (C) Copyright IBM Corp. 2005, 2014
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/AGS.xml,messages/portal.xml, messages/portalRL.xml" resolverBase="prompting" includeConfig="true" requiredCapability="canUseEventStudio">
  9. <!--
  10. ===============================================================================================
  11. formlogic_init - standard form logic initialization
  12. ===============================================================================================
  13. -->
  14. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt"/>
  15. <!--
  16. ===============================================================================================
  17. deletePrevSelOprData - As the page is resubmitted when changing operation for a WSDL it requires
  18. to delete any operation arguments from the env upon resubmission.
  19. ===============================================================================================
  20. -->
  21. <xts:block id="deletePrevSelOprData" dependency="formlogic_init" mode="interpret" condition=".[/root/env/param[@name='url_newoperation']='true']" mandatory="false" processor="XSLT" type="exec">
  22. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  23. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  24. <xsl:template match="/root">
  25. <xts:sequence>
  26. <xts:delete select="/root/env/param[starts-with(@name, 'pv_')]" mandatory="false"/>
  27. <xts:delete select="/root/env/param[@name='taskParameters']"/>
  28. <xts:delete select="/root/env/param[@name='url_newoperation']"/>
  29. </xts:sequence>
  30. </xsl:template>
  31. </xsl:stylesheet>
  32. </xts:block>
  33. <!--
  34. ================================================================================
  35. whip out the parameters that were saved off previously
  36. ===============================================================================================
  37. -->
  38. <xts:block id="decodeExistingParameters" path="/ags/parameters/decodeExistingParameters.xslt" dependency="deletePrevSelOprData" processor="XSLT" type="exec" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup' or /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'finished' ]" mandatory="false">
  39. <xts:logicsheet path="logicsheets/portal.xsl"/>
  40. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  41. </xts:block>
  42. <!--
  43. ================================================================================
  44. If we have been through this dialog before we will have saved or unsaved parameter values to display, so whip them out
  45. from the parameter named taskParameters. this contains the previously saved param values retrieved in loadAgent and any unsaved updates
  46. from previous passes through this dialog
  47. ===============================================================================================
  48. -->
  49. <xts:block id="checkExistingParameters" path="/ags/parameters/checkExistingParameters.xslt" dependency="decodeExistingParameters" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup']" processor="XSLT" type="exec" mandatory="false">
  50. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  51. </xts:block>
  52. <!--
  53. ================================================================================
  54. We also may have just come back from a jauort server, so update this info with any new parameter values
  55. ===============================================================================================
  56. -->
  57. <xts:block id="mergeLiteralParameters" path="/ags/parameters/mergeLiteralParameters.xslt" dependency="checkExistingParameters" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup' or /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'finished']" processor="XSLT" type="exec" mandatory="false">
  58. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  59. </xts:block>
  60. <!--
  61. ===============================================================================================
  62. readAgsConfigProp - check if show trigger is enabled
  63. ===============================================================================================
  64. -->
  65. <xts:block id="readAgsConfigProp" mode="interpret" dependency="mergeLiteralParameters" mandatory="false" processor="XSLT" type="exec">
  66. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  67. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  68. <xsl:template match="/root">
  69. <xts:sequence>
  70. <xts:append>
  71. <evts>
  72. <xts:function name="getConfiguration" xmlns:xts="http://developer.cognos.com/schemas/xts/">
  73. <xts:param name="webservice.showTrigger"/>
  74. </xts:function>
  75. </evts>
  76. </xts:append>
  77. </xts:sequence>
  78. </xsl:template>
  79. </xsl:stylesheet>
  80. </xts:block>
  81. <!--
  82. ===============================================================================================
  83. readWSDLdata - operation parameters etc.
  84. cq 265497: deployed web task looses operation
  85. ===============================================================================================
  86. -->
  87. <xts:block id="readWSDLdata" mode="interpret" dependency="readAgsConfigProp" condition=".[not(/root/env/param[@name='isTriggerUsed']) and /root/env/param[@name='url_wsdl'] and /root/env/param[@name='url_wsdl']!='' and /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup']" mandatory="false" processor="XSLT" type="exec">
  88. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  89. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  90. <xsl:template match="/root">
  91. <xts:sequence>
  92. <xts:delete select="/root/WSDL" mandatory="false"/>
  93. <xts:append>
  94. <xts:request protocol="WSDL" cache="false" mimeType="text/xml" href="{/root/env/param[@name='url_wsdl']}" faultBlock="faultHandler"/>
  95. </xts:append>
  96. <xsl:if test="contains(/root/env/param[@name='url_operation'], '_[opr]_')">
  97. <xts:update select="/root/env/param[@name='url_operation']">
  98. <param name="url_operation">
  99. <xsl:value-of select="concat(substring-before(/root/env/param[@name='url_operation'], '_[opr]_'),'_[opr]_')"/>
  100. </param>
  101. </xts:update>
  102. </xsl:if>
  103. </xts:sequence>
  104. </xsl:template>
  105. </xsl:stylesheet>
  106. </xts:block>
  107. <!--
  108. ===============================================================================================
  109. putCognosWSDLdata - Trigger operation parameters etc.
  110. ===============================================================================================
  111. -->
  112. <xts:block id="putCognosWSDLdata" mode="interpret" dependency="readWSDLdata" condition=".[/root/env/param[@name='isTriggerUsed'] and /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup']" mandatory="false" processor="XSLT" type="exec">
  113. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  114. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  115. <xsl:template match="/root">
  116. <xts:sequence>
  117. <xts:delete select="/root/WSDL" mandatory="false"/>
  118. <xts:append>
  119. <WSDL>
  120. <Service name="CognosReportNetService">
  121. <PortType name="CognosReportNetPort" type="CognosReportNetPortType" Binding="SOAPBindingImpl">
  122. <Operation name="trigger">
  123. <Parameter Name="triggerName" Type="string" SimpleJavaType="true"/>
  124. </Operation>
  125. </PortType>
  126. </Service>
  127. </WSDL>
  128. </xts:append>
  129. <xts:append select="/root/env">
  130. <param name="url_wsdl">
  131. <xsl:value-of select="concat(/root/configProps/param/property[@name='internalDispatcher'], '?b_action=wsdl')"/>
  132. </param>
  133. </xts:append>
  134. </xts:sequence>
  135. </xsl:template>
  136. </xsl:stylesheet>
  137. </xts:block>
  138. <!--
  139. ===============================================================================================
  140. ProcessResponse - Process the response of the call and transform it into a standard xml structure
  141. ===============================================================================================
  142. -->
  143. <xts:block id="processResponse" mode="interpret" dependency="putCognosWSDLdata" condition=".[ not(/root/soapFault) and (/root/env/param[@name='url_wsdl'] and /root/env/param[@name='url_wsdl']!='' and /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup')]" mandatory="false" processor="XSLT" type="exec">
  144. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  145. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  146. <xsl:template match="/root">
  147. <xsl:variable name="WSDLOpr">
  148. <xsl:choose>
  149. <xsl:when test="/root/env/param[@name='url_operation'] != ''">
  150. <xsl:value-of select="/root/env/param[@name='url_operation']"/>
  151. </xsl:when>
  152. <xsl:otherwise>
  153. <xsl:if test="count(/root/WSDL/Service/PortType[@Binding='SOAPBindingImpl']/Operation)>0">
  154. <xsl:value-of select="/root/WSDL/Service/PortType[@Binding='SOAPBindingImpl']/Operation[1]/@uname"/>
  155. </xsl:if>
  156. </xsl:otherwise>
  157. </xsl:choose>
  158. </xsl:variable>
  159. <xsl:variable name="WSDLSvc">
  160. <xsl:choose>
  161. <xsl:when test="/root/env/param[@name='url_serviceName'] != ''">
  162. <xsl:value-of select="/root/env/param[@name='url_serviceName']"/>
  163. </xsl:when>
  164. <xsl:otherwise>
  165. <xsl:if test="count(/root/WSDL/Service)>0">
  166. <xsl:value-of select="/root/WSDL/Service[1]/@name"/>
  167. </xsl:if>
  168. </xsl:otherwise>
  169. </xsl:choose>
  170. </xsl:variable>
  171. <xsl:variable name="WSDLSvcPort">
  172. <xsl:choose>
  173. <xsl:when test="/root/env/param[@name='url_port'] != ''">
  174. <xsl:value-of select="/root/env/param[@name='url_port']"/>
  175. </xsl:when>
  176. <xsl:otherwise>
  177. <xsl:if test="count(/root/WSDL/Service)>0">
  178. <xsl:value-of select="/root/WSDL/Service/PortType[@Binding='SOAPBindingImpl']/@name"/>
  179. </xsl:if>
  180. </xsl:otherwise>
  181. </xsl:choose>
  182. </xsl:variable>
  183. <xts:sequence>
  184. <!--xts:delete select="/root/WSDL" mandatory="false"/-->
  185. <xts:append>
  186. <parametersResponse>
  187. <parameter>
  188. <!--xsl:for-each select="/root/WSDL/Service[@name=$WSDLSvc]/PortType[@Binding='SOAPBindingImpl']/Operation[@name=$WSDLOpr]/Parameter"-->
  189. <xsl:apply-templates select="/root/WSDL/Service[@name=$WSDLSvc]/PortType[@Binding='SOAPBindingImpl']/*"/>
  190. </parameter>
  191. </parametersResponse>
  192. </xts:append>
  193. <xts:delete select="/root/env/param[@name='url_methods']"/>
  194. <xts:append select="/root/env">
  195. <param name="url_methods">
  196. <xsl:value-of select="concat($WSDLSvc,'?',$WSDLOpr, '?', $WSDLSvcPort)"/>
  197. </param>
  198. </xts:append>
  199. </xts:sequence>
  200. </xsl:template>
  201. <xsl:template match="Operation">
  202. <xsl:variable name="WSDLOpr1">
  203. <xsl:choose>
  204. <xsl:when test="/root/env/param[@name='url_operation'] != ''">
  205. <xsl:value-of select="/root/env/param[@name='url_operation']"/>
  206. </xsl:when>
  207. <xsl:otherwise>
  208. <xsl:if test="count(/root/WSDL/Service/PortType[@Binding='SOAPBindingImpl']/Operation)>0">
  209. <xsl:value-of select="/root/WSDL/Service/PortType[@Binding='SOAPBindingImpl']/Operation[1]/@uname"/>
  210. </xsl:if>
  211. </xsl:otherwise>
  212. </xsl:choose>
  213. </xsl:variable>
  214. <xsl:choose>
  215. <xsl:when test="@uname=$WSDLOpr1">
  216. <xsl:apply-templates select="./*"/>
  217. </xsl:when>
  218. <xsl:otherwise>
  219. <!-- manage old build stored agent data -->
  220. <xsl:if test="@name=$WSDLOpr1">
  221. <xsl:apply-templates select="./*"/>
  222. </xsl:if>
  223. </xsl:otherwise>
  224. </xsl:choose>
  225. </xsl:template>
  226. <xsl:template match="Parameter">
  227. <item>
  228. <xsl:apply-templates select="@*"/>
  229. <value>
  230. <xsl:value-of select="@name"/>
  231. </value>
  232. <xsl:apply-templates select="./*"/>
  233. </item>
  234. </xsl:template>
  235. <xsl:template match="Datatype">
  236. <!-- now copy each sub element 1 level ??-->
  237. <item>
  238. <xsl:apply-templates select="./*"/>
  239. <xsl:apply-templates select="@*"/>
  240. </item>
  241. </xsl:template>
  242. <xsl:template match="@*">
  243. <xsl:variable name="name">
  244. <xsl:value-of select="translate(local-name(),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
  245. </xsl:variable>
  246. <xsl:element name="{$name}">
  247. <xsl:value-of select="."/>
  248. </xsl:element>
  249. </xsl:template>
  250. </xsl:stylesheet>
  251. </xts:block>
  252. <!--
  253. ================================================================================
  254. check that we have all the parameters, even those without saved values
  255. and produce a block of xml to be used by the display that contains all the parameters and any parameter values that may have been
  256. saved or recently generated by this page via the rs or the model insert button
  257. remove any saved params that are no longer valid
  258. ===============================================================================================
  259. -->
  260. <xts:block id="mergeParameters" path="/ags/parameters/mergeParameters.xslt" dependency="processResponse" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup'] " processor="XSLT" type="exec" mandatory="false">
  261. </xts:block>
  262. <!--
  263. ================================================================================
  264. decode the the model item parameters from the form fields and update the parameters block
  265. ===============================================================================================
  266. -->
  267. <xts:block id="mergeModelParameters" path="/ags/parameters/mergeModelParameters.xslt" processor="XSLT" type="exec" mode="interpret" dependency="mergeParameters" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup' or /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'finished'] " mandatory="false"/>
  268. <!--
  269. ================================================================================
  270. if We have just come back from a jaunt round the report server, update the agent task blob
  271. ===============================================================================================
  272. -->
  273. <xts:block id="createParametersBlob" path="/ags/parameters/createParametersBlob.xslt" dependency="mergeModelParameters" processor="XSLT" type="exec" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup' or /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'finished'] " mandatory="false">
  274. <xts:logicsheet path="logicsheets/portal.xsl"/>
  275. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  276. </xts:block>
  277. <!--
  278. ===============================================================================================
  279. returnResult - We're done with the webservice morphlet, so return the appropriate response
  280. ===============================================================================================
  281. -->
  282. <xts:block id="returnResult" path="/ags/tabResultTemplate.xslt" dependency="createParametersBlob" type="exec" processor="XSLT" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'finished']" mandatory="false">
  283. <xts:logicsheet path="logicsheets/portal.xsl"/>
  284. </xts:block>
  285. <!--
  286. ================================================================================
  287. Append the report path to the agent path.
  288. ===============================================================================================
  289. -->
  290. <xts:block id="appendDisplayedPageType" dependency="returnResult" processor="XSLT" type="exec" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup']" mandatory="false">
  291. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xts xsl">
  292. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  293. <xsl:template match="/">
  294. <xts:sequence>
  295. <xts:append select="/root">
  296. <displayedPage quote-string="">web</displayedPage>
  297. </xts:append>
  298. </xts:sequence>
  299. </xsl:template>
  300. </xsl:stylesheet>
  301. </xts:block>
  302. <!--
  303. ================================================================================
  304. create a data structure for the display to work on....
  305. take the report server parameters as the basis and include the default literal summary and model values
  306. format:
  307. <parametersDisplay>
  308. <parameter name="... identifier" caption="localised dislpay name" multivalued="true/false" required="true/false" type="" literalValue="" modelValue=""/>
  309. </parametersDisplay>
  310. This logic sheet is superset of all needed display parameters. Not all will be needed or used.
  311. ===============================================================================================
  312. -->
  313. <xts:block id="createDisplayData" path="/ags/parameters/createDisplayData.xslt" dependency="appendDisplayedPageType" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup']" processor="XSLT" type="exec" mandatory="false">
  314. <xts:logicsheet path="logicsheets/portal.xsl"/>
  315. <xts:logicsheet path="ags/logicsheets/dialogs.xsl"/>
  316. </xts:block>
  317. <!--
  318. ===============================================================================================
  319. genMarkup -
  320. ===============================================================================================
  321. -->
  322. <xts:block id="genMarkup" type="exec" processor="XSLT" dependency="createDisplayData" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup']" mandatory="false">
  323. <!-- logicsheets -->
  324. <xts:logicsheet path="ags/logicsheets/agentDefinition.xsl"/>
  325. <!-- portal specific information -->
  326. <xts:logicsheet path="logicsheets/portal.xsl"/>
  327. <!-- agent studio logicsheets -->
  328. <xts:logicsheet path="ags/logicsheets/arguments.xslt"/>
  329. <xts:logicsheet path="ags/logicsheets/dialogs.xsl"/>
  330. <!-- Dialog specific logicsheets -->
  331. <xts:logicsheet path="logicsheets/presentation/dialog/ui-templates.xsl"/>
  332. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  333. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  334. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  335. <!-- Generic logicsheets -->
  336. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  337. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  338. <!-- apply the form logic -->
  339. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  340. <!-- Prevent the href from appearing in the status bar. -->
  341. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  342. <xsl:stylesheet version="1.0" xmlns:agsarg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/arguments/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:agsad="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/agentDefinition/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:bmt="http://www.developer.cognos.com/schemas/bmt/51/0" xmlns:out="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/" xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/" xmlns:req-params="http://developer.cognos.com/schemas/request/params" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" xmlns:agsdlg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/dialog/" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="agsarg xts cm pf xtsext lyt dp df cf cp xos utml agsdlg bmt">
  343. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  344. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  345. <pf:variables/>
  346. <xsl:variable name="ags_image_root">../ags/images/summary/</xsl:variable>
  347. <xsl:variable name="mname" select="'dialogAdapter.xts'"/>
  348. <xsl:variable name="spacer">
  349. <img height="10" width="10">
  350. <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute>
  351. </img>
  352. </xsl:variable>
  353. <!-- SEC_INFO hasTask is not javascript encoded, it is always a boolean value true|false-->
  354. <xsl:variable name="hasTask">
  355. <xsl:choose>
  356. <xsl:when test="key('env-param','url_wsdl') != ''">
  357. <xsl:text>true</xsl:text>
  358. </xsl:when>
  359. <xsl:otherwise>
  360. <xsl:text>false</xsl:text>
  361. </xsl:otherwise>
  362. </xsl:choose>
  363. </xsl:variable>
  364. <xsl:variable name="isUsingTrigger">
  365. <xsl:choose>
  366. <xsl:when test="key('env-param','isTriggerUsed') != ''">
  367. <xsl:text>true</xsl:text>
  368. </xsl:when>
  369. <xsl:otherwise>
  370. <xsl:text>false</xsl:text>
  371. </xsl:otherwise>
  372. </xsl:choose>
  373. </xsl:variable>
  374. <xsl:template match="/">
  375. <xts:sequence>
  376. <xts:append select="/root/output">
  377. <xos:part>
  378. <xos:entityHeader>
  379. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  380. </xos:entityHeader>
  381. <xos:entityBody>
  382. <xsl:element name="{key('request-param','resultNode')}" namespace="">
  383. <markup>
  384. <xts:transform name="XMLEncode">
  385. <utml:form name="pform">
  386. <!-- we're maintaining our own parameter values -->
  387. <utml:exclude-prefix>pv_</utml:exclude-prefix>
  388. <!-- this defines the form command operation to be performed when all the collected properties are submitted... -->
  389. <!-- ================================================================ -->
  390. <!-- H E A D E R -->
  391. <!-- ================================================================ -->
  392. <agsdlg:header>
  393. <dp:image>
  394. <img alt="" border="0">
  395. <xsl:attribute name="src"><xsl:value-of select="$ags_image_root"/>icon_Web_service_24.gif</xsl:attribute>
  396. </img>
  397. </dp:image>
  398. <dp:title>
  399. <xts:string id="DIALOG_WS_TITLE"/>
  400. </dp:title>
  401. <dp:description>
  402. <xts:string id="DIALOG_WS_DESCRIPTION"/>
  403. </dp:description>
  404. </agsdlg:header>
  405. <!-- need this to be included by default -->
  406. <script type="text/javascript" src="../ags/dragDropHandler.js"/>
  407. <utml:input type="hidden" id="taskName" name="taskName" utml:update="false">
  408. <utml:value>
  409. <xsl:choose>
  410. <xsl:when test="key('env-param', 'selected_path') and key('env-param', 'pageitem')">
  411. <xsl:value-of select="/root/cm:queryResponse/cm:webServiceTask/cm:defaultName"/>
  412. </xsl:when>
  413. <xsl:when test="key('env-param', 'taskName') and string-length(string(key('env-param', 'taskName'))) > 0">
  414. <xsl:value-of select="key('env-param', 'taskName')"/>
  415. </xsl:when>
  416. </xsl:choose>
  417. </utml:value>
  418. </utml:input>
  419. <!-- ================================================================ -->
  420. <!-- B O D Y -->
  421. <!-- ================================================================ -->
  422. <!-- Define a new layout This consists of two identical sections-->
  423. <lyt:layout width="100%" style="2">
  424. <lyt:section>
  425. <dp:list width="80%">
  426. <dp:section>
  427. <dp:label>
  428. <xts:string id="DIALOG_WS_URL"/>
  429. </dp:label>
  430. </dp:section>
  431. <dp:section>
  432. <utml:input type="text" name="url_wsdl" id="url_wsdl" utml:update="false" style="width:100%" AUTOCOMPLETE="off">
  433. <utml:value>
  434. <xsl:choose>
  435. <xsl:when test="key('env-param', 'url_wsdl') and string-length(string(key('env-param', 'url_wsdl'))) > 0">
  436. <xsl:value-of select="key('env-param', 'url_wsdl')"/>
  437. </xsl:when>
  438. </xsl:choose>
  439. </utml:value>
  440. </utml:input>
  441. </dp:section>
  442. <dp:section>
  443. <img height="10" width="1" src="../ps/images/space.gif"/>
  444. </dp:section>
  445. <dp:section align="center">
  446. <dp:buttonGroup align="center">
  447. <dp:button>
  448. <a href="#" onclick="doRetrieveWS();">
  449. <dp:buttonText>
  450. <xts:string id="DIALOG_WS_RETRIEVE"/>
  451. </dp:buttonText>
  452. <dp:buttonImage dp:tooltip="DIALOG_WS_RETRIEVE">../ags/images/arrow_down.gif</dp:buttonImage>
  453. </a>
  454. </dp:button>
  455. </dp:buttonGroup>
  456. </dp:section>
  457. </dp:list>
  458. </lyt:section>
  459. <lyt:section>
  460. <xsl:variable name="display">
  461. <xsl:if test="not(key('request-param','eventList')) or key('request-param','eventList') = ''">none</xsl:if>
  462. </xsl:variable>
  463. <xsl:value-of select="key('request-param','suppressionDetails')" disable-output-escaping="yes"/>
  464. <xsl:if test="/root/evts/configuration/property[@name='webservice.showTrigger']='true'">
  465. <dp:list>
  466. <dp:section>
  467. <dp:section1>
  468. <utml:input type="checkbox" name="isTriggerUsed" id="isTriggerUsed" utml:update="true" onclick="getTriggerCall('test');">
  469. <xts:string id="CLICK_WS_TRIGGER"/>
  470. </utml:input>
  471. </dp:section1>
  472. </dp:section>
  473. </dp:list>
  474. </xsl:if>
  475. </lyt:section>
  476. </lyt:layout>
  477. <xsl:choose>
  478. <!--xsl:when test="/root/soapFault/fault/xts:exception/xts:exceptionCode != '' ">
  479. <dp:section1>
  480. <xsl:value-of select="/root/soapFault/fault/xts:exception/xts:exceptionCode"/>
  481. </dp:section1>
  482. </xsl:when-->
  483. <xsl:when test="$hasTask = 'true'">
  484. <lyt:layout style="1">
  485. <lyt:section>
  486. <dp:textarea>
  487. <dp:section1>
  488. <xts:string id="DIALOG_WS_OPERATION"/>
  489. </dp:section1>
  490. <dp:section2>
  491. <xsl:choose>
  492. <xsl:when test="/root/WSDL//Operation">
  493. <utml:input id="url_serviceName" name="url_serviceName" type="hidden" utml:update="true"/>
  494. <utml:input id="url_newoperation" name="url_newoperation" type="hidden" utml:update="true"/>
  495. <utml:input id="url_operation" name="url_operation" type="hidden" utml:update="true"/>
  496. <utml:input id="url_port" name="url_port" type="hidden">
  497. <utml:value>
  498. <xsl:value-of select="/root/WSDL/Service/PortType[@Binding='SOAPBindingImpl']/@name"/>
  499. </utml:value>
  500. </utml:input>
  501. <utml:select id="url_methods" name="url_methods" onchange="loadMethod(this)">
  502. <xsl:for-each select="/root/WSDL/Service/PortType[@Binding='SOAPBindingImpl']/Operation">
  503. <utml:option>
  504. <utml:value>
  505. <xsl:value-of select="xtsext:javascriptencode(string(concat( ../../@name , '?' , ./@uname, '?', ../@name )))"/>
  506. </utml:value>
  507. <xsl:value-of select="xtsext:javascriptencode(string(concat( ./@name , ' (' , ../../@name , ')' )))"/>
  508. </utml:option>
  509. </xsl:for-each>
  510. </utml:select>
  511. </xsl:when>
  512. <xsl:when test="/root/soapFault">
  513. <xsl:text>
  514. <xts:string id="DIALOG_MESSAGE_NOT_AVAILABLE"/>
  515. </xsl:text>
  516. </xsl:when>
  517. <xsl:otherwise>
  518. <xsl:text>
  519. <xts:string id="DIALOG_MESSAGE_NONE"/>
  520. </xsl:text>
  521. </xsl:otherwise>
  522. </xsl:choose>
  523. </dp:section2>
  524. </dp:textarea>
  525. </lyt:section>
  526. </lyt:layout>
  527. <xsl:if test="not(/root/soapFault)">
  528. <lyt:layout style="1">
  529. <lyt:section width="100%">
  530. <dp:section>
  531. <xsl:variable name="WSDLOpr">
  532. <xsl:choose>
  533. <xsl:when test="/root/env/param[@name='url_operation'] != ''">
  534. <xsl:value-of select="/root/env/param[@name='url_operation']"/>
  535. </xsl:when>
  536. <xsl:otherwise>
  537. <xsl:if test="count(/root/WSDL/Service/PortType[@Binding='SOAPBindingImpl']/Operation)>0">
  538. <xsl:value-of select="/root/WSDL/Service/PortType[@Binding='SOAPBindingImpl']/Operation[1]/@name"/>
  539. </xsl:if>
  540. </xsl:otherwise>
  541. </xsl:choose>
  542. </xsl:variable>
  543. <agsarg:arguments>
  544. <displayedPage>web</displayedPage>
  545. </agsarg:arguments>
  546. <agsarg:argumentsScript/>
  547. </dp:section>
  548. </lyt:section>
  549. </lyt:layout>
  550. </xsl:if>
  551. </xsl:when>
  552. </xsl:choose>
  553. <dp:emptyFooter/>
  554. <script type="text/javascript">
  555. // function to initialize the script for the contents of the screen
  556. var operations = new Object();
  557. function init() {
  558. var cf=parent.getConfigFrame?parent.getConfigFrame():null;
  559. var fault = '<xsl:value-of select="xtsext:javascriptencode(xtsext:xmlencode(string(/root/soapFault/fault/*[local-name()='exception']/*[local-name()='exceptionMsg'])))"/>' ;
  560. <xsl:for-each select="/root/soapFault/fault/*[local-name()='exception']/*[local-name()='exceptionMsg']">
  561. cf.pageErrors[<xsl:value-of select="position()"/>-1] = "<xsl:value-of select="xtsext:javascriptencode(string(.))"/>" ;
  562. </xsl:for-each>
  563. if(fault != ''){
  564. parent.showErrorPage(80);
  565. return;
  566. }
  567. var hasTask = <xsl:value-of select="string($hasTask)"/>;
  568. var url_method_val = '<xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='url_methods']))"/>';
  569. var matchedOldMethod ='old method';
  570. var isOldIB = false;
  571. if(url_method_val.indexOf('_[opr]_')&lt;2){
  572. matchedOldMethod = url_method_val.substring(0, url_method_val.lastIndexOf('?'));
  573. isOldIB = true;
  574. }
  575. <xsl:for-each select="/root/WSDL/Service/PortType[@Binding='SOAPBindingImpl']/Operation">
  576. var key = "<xsl:value-of select="xtsext:javascriptencode(string(concat( ../../@name , '?' , ./@uname, '?', ../@name )))"/>";
  577. var obj = new Object();
  578. obj.url_serviceName = "<xsl:value-of select="xtsext:javascriptencode(string(../../@name))"/>";
  579. obj.url_operation = "<xsl:value-of select="xtsext:javascriptencode(string(./@uname))"/>";
  580. if(isOldIB &amp;&amp; key.indexOf(matchedOldMethod)>-1){
  581. //matchedOldMethod = key;
  582. var index = <xsl:value-of select="position()"/>-1 ;
  583. index = (index &lt; 0) ? 0 : index;
  584. document.getElementById("url_methods").selectedIndex = index;
  585. }
  586. obj.url_port = "<xsl:value-of select="xtsext:javascriptencode(string(../@name))"/>";
  587. operations[key] = obj;
  588. </xsl:for-each>
  589. if(window.initPromptPage &amp;&amp; hasTask) {
  590. initPromptPage();
  591. }
  592. if(<xsl:value-of select="xtsext:javascriptencode(string($isUsingTrigger))"/>){
  593. //document.getElementById("url_wsdl").value = '';
  594. document.getElementById("url_wsdl").disabled = true;
  595. document.getElementById("isTriggerUsed").checked = true;
  596. }
  597. }
  598. function trimString (str) {
  599. str = this != window? this : str;
  600. return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
  601. }
  602. String.prototype.trim = trimString;
  603. function doRetrieveWS()
  604. {
  605. var url = document.getElementById("url_wsdl") ;
  606. <xsl:variable name="NO_URL_MSG">
  607. <xts:string id="DIALOG_WS_NO_WSDL"/>
  608. </xsl:variable>
  609. if(null!= url){
  610. var urlVal = url.value;
  611. urlVal = urlVal.trim();
  612. if(urlVal.length &lt; 1) {
  613. var msgWarn = "<xsl:value-of select="xtsext:javascriptencode(string($NO_URL_MSG))"/>";
  614. // need to trim the message - remove extra spaces
  615. alert(msgWarn.trim());
  616. return ;
  617. }
  618. }
  619. if(!<xsl:value-of select="xtsext:javascriptencode(string($isUsingTrigger))"/>){
  620. //We clicked retrieve so Reset the operation name.
  621. if (document.getElementById("url_operation")) {
  622. document.getElementById("url_operation").value="";
  623. document.getElementById("url_serviceName").value="";
  624. }
  625. parent.getConfigFrame().loadPage('ags/dialogAdapter.xts', 'maintain');
  626. }
  627. loadMethod("url_methods") ;
  628. }
  629. function setURLValues()
  630. {
  631. var methodInput = document.getElementById("url_methods");
  632. if(methodInput){
  633. // Selected a new method.
  634. var s = methodInput.value;
  635. // get the values from the operation array
  636. var url_serviceName = operations[s].url_serviceName;
  637. var url_operation = operations[s].url_operation;
  638. var url_port = operations[s].url_port;
  639. var oprName = url_operation;
  640. //WebServiceTaskRunnable.AGS_WS_OPRN_CONST => _[opr]_ for bug 571678.0
  641. var n = url_operation.indexOf('_[opr]_');
  642. if(n>0) {
  643. oprName = url_operation.substring(0, n);
  644. }
  645. document.getElementById("url_serviceName").value = url_serviceName;
  646. document.getElementById("url_operation").value = url_operation;
  647. document.getElementById("url_port").value = url_port;
  648. document.getElementById("taskName").value = oprName;
  649. }
  650. }
  651. function loadMethod(obj)
  652. {
  653. setURLValues();
  654. document.getElementById("url_newoperation").value = 'true';
  655. parent.getConfigFrame().loadPage('ags/dialogAdapter.xts', 'maintain');
  656. }
  657. // submit the operation and service name
  658. function leavingDialog(){
  659. if(window.argumentsLeavingDialog){
  660. argumentsLeavingDialog();
  661. }
  662. setURLValues();
  663. }
  664. function getTriggerCall(abc){
  665. var isTrig = document.getElementById("isTriggerUsed") ;
  666. if(isTrig){
  667. isTrig.value = true;
  668. document.getElementById("url_wsdl").value = '';
  669. document.getElementById("url_wsdl").disabled = true;
  670. parent.getConfigFrame().loadPage('ags/dialogAdapter.xts', 'maintain');
  671. }
  672. }
  673. </script>
  674. </utml:form>
  675. </xts:transform>
  676. </markup>
  677. </xsl:element>
  678. </xos:entityBody>
  679. </xos:part>
  680. </xts:append>
  681. </xts:sequence>
  682. <xts:delete select="/root/WSDL" mandatory="false"/>
  683. </xsl:template>
  684. </xsl:stylesheet>
  685. </xts:block>
  686. <!--
  687. ===============================================================================================
  688. debug - special debug block for nested requests
  689. ===============================================================================================
  690. -->
  691. <xts:block id="debug" type="exec" processor="XSLT" mimeType="text/html" dependency="genMarkup" condition=".[/root/session/param[@name='debug']='1']" mandatory="false">
  692. <!-- Get the debug logic sheet -->
  693. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  694. <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/" exclude-result-prefixes="dbg">
  695. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  696. <xsl:template match="/">
  697. <dbg:dumpxml select="/root"/>
  698. </xsl:template>
  699. </xsl:stylesheet>
  700. </xts:block>
  701. <xts:block id="faultHandler" type="fault" processor="XSLT">
  702. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" exclude-result-prefixes="xsl">
  703. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  704. <xsl:template match="/">
  705. <xsl:choose>
  706. <xsl:when test="contains(//*, 'CAM-AAA-0055')">
  707. <fault>
  708. <passport>timeout</passport>
  709. </fault>
  710. </xsl:when>
  711. <xsl:when test="./*[local-name() = 'exception']/*[local-name() = 'exceptionDetail']/*[local-name() = 'exception']/errorCode = 'cmArchiveEncrypted' or ./*[local-name() = 'exception']/*[local-name() = 'exceptionDetail']/*[local-name() = 'exception']/errorCode = 'cmImportCryptoFailed'">
  712. <copyFault>
  713. <xsl:copy-of select="."/>
  714. </copyFault>
  715. </xsl:when>
  716. <xsl:otherwise>
  717. <soapFault>
  718. <xsl:copy>
  719. <xsl:copy-of select="/root/fault"/>
  720. </xsl:copy>
  721. </soapFault>
  722. </xsl:otherwise>
  723. </xsl:choose>
  724. </xsl:template>
  725. <xsl:template match="text()"/>
  726. </xsl:stylesheet>
  727. </xts:block>
  728. </xts:morphlet>