submit.xts 81 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ps
  5. (C) Copyright IBM Corp. 2005, 2019
  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/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" messageBase="messages/portal.xml, messages/portalRL.xml">
  9. <!-- if the sharedpages list was not passed in, then we may need to read it in -->
  10. <xts:block processor="XSLT" type="exec" mandatory="false"
  11. id="readPageletList"
  12. condition=".[not(/root/env/param[@name='m_pp_shared_pages']) and /root/env/param[@name='sharedPagesChanged'] and /root/env/param[@name='sharedPagesChanged'] != '']">
  13. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  14. <xsl:stylesheet version="1.0"
  15. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  16. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  17. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  18. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  19. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  20. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  21. <xsl:template match="root">
  22. <xts:sequence>
  23. <xts:append>
  24. <portalPages>
  25. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  26. <send:request provider="cm">
  27. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  28. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  29. <cm:search>~</cm:search>
  30. <cm:properties>
  31. <cm:property name="portalPages"/>
  32. </cm:properties>
  33. <cm:options schemaInfo="true">
  34. <cm:refProps>
  35. <cm:refProp refPropName="portalPages">
  36. <cm:properties>
  37. <cm:property name="defaultName"/>
  38. <cm:property name="permissions"/>
  39. <cm:property name="searchPath"/>
  40. <cm:property name="disabled"/>
  41. <cm:property name="storeID"/>
  42. </cm:properties>
  43. </cm:refProp>
  44. </cm:refProps>
  45. </cm:options>
  46. </cm:query>
  47. </xts:transform>
  48. </send:request>
  49. </xts:transform>
  50. </portalPages>
  51. </xts:append>
  52. </xts:sequence>
  53. </xsl:template>
  54. </xsl:stylesheet>
  55. </xts:block>
  56. <!-- need to get the pagelet list to display in the mypges tab. -->
  57. <!-- public folder page, private folder page, and all custom pages -->
  58. <!-- Content request to get basic preferences -->
  59. <xts:block processor="XSLT" type="exec" mandatory="false"
  60. id="createPageletList"
  61. dependency="readPageletList"
  62. condition=".[/root/portalPages or /root/env/param[@name='m_pp_shared_pages']]">
  63. <xsl:stylesheet version="1.0"
  64. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  65. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  66. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  67. xmlns:xts="http://developer.cognos.com/schemas/xts/">
  68. <xsl:key name="system-param" match="/root/system/param" use="@name"/>
  69. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  70. <xsl:template match="/">
  71. <xts:sequence>
  72. <xsl:choose>
  73. <xsl:when test="/root/env/param[@name='m_pp_shared_pages']">
  74. <xts:append>
  75. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='m_pp_shared_pages'])),true())" disable-output-escaping="yes"/>
  76. </xts:append>
  77. </xsl:when>
  78. <xsl:otherwise>
  79. <xts:append>
  80. <sharedPagesListForDisplay>
  81. <xsl:for-each select="/root/portalPages/cm:queryResponse/cm:account/cm:portalPages/*">
  82. <pagelet><xsl:copy-of select="@*|*"/></pagelet>
  83. </xsl:for-each>
  84. </sharedPagesListForDisplay>
  85. </xts:append>
  86. </xsl:otherwise>
  87. </xsl:choose>
  88. </xts:sequence>
  89. </xsl:template>
  90. </xsl:stylesheet>
  91. </xts:block>
  92. <xts:block processor="XSLT" type="exec" mandatory="false"
  93. id="presaveOptions-readAccountOptions"
  94. condition=".[/root/env/param[@name='m_class'] = 'account' and count(/root/env/param[starts-with(@name,'m_po_')]) > 0]">
  95. <xts:logicsheet path="logicsheets/portal.xsl"/>
  96. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  97. <xsl:stylesheet version="1.0"
  98. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  99. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  100. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  101. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  102. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  103. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  104. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  105. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  106. <pf:variables/>
  107. <xsl:template match="/">
  108. <xts:sequence>
  109. <xts:append>
  110. <accountOptions>
  111. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  112. <send:request provider="cm">
  113. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  114. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  115. <cm:requests>
  116. <cm:query>
  117. <cm:search><xsl:value-of select="/root/env/param[@name='m_obj']"/></cm:search>
  118. <cm:properties>
  119. <cm:property name="options"/>
  120. <cm:property name="searchPath"/>
  121. <cm:property name="permissions"/>
  122. </cm:properties>
  123. </cm:query>
  124. <!-- when we are editing the anonymous account, we may be in the situation where we were do not have the skin. In this case, we could have only the skin name. So we need to look it up in the list of skins -->
  125. <xsl:if test="$is-named = '0'">
  126. <cm:query>
  127. <cm:search>/portal/*[@objectClass='portalSkinFolder']/*[@objectClass='portalSkin' and permission('execute')]</cm:search>
  128. <cm:properties>
  129. <cm:property name="searchPath"/>
  130. <cm:property name="defaultName"/>
  131. <cm:property name="resourceLocation"/>
  132. <cm:property name="storeID"/>
  133. </cm:properties>
  134. <cm:sortBy>
  135. <cm:sort name="defaultName" order="ascending"/>
  136. </cm:sortBy>
  137. </cm:query>
  138. </xsl:if>
  139. </cm:requests>
  140. </cm:query>
  141. </xts:transform>
  142. </send:request>
  143. </xts:transform>
  144. </accountOptions>
  145. </xts:append>
  146. </xts:sequence>
  147. </xsl:template>
  148. </xsl:stylesheet>
  149. </xts:block>
  150. <!-- CM does not support updating values individually in the account options property -->
  151. <!-- This block queries the account options and fill them in to the update request such that they are not wiped out -->
  152. <xts:block processor="XSLT" type="exec" mandatory="false"
  153. id="presaveOptions"
  154. dependency="presaveOptions-readAccountOptions"
  155. condition=".[/root/env/param[@name='m_class'] = 'account' and count(/root/env/param[starts-with(@name,'m_po_')]) > 0]">
  156. <xts:logicsheet path="logicsheets/portal.xsl"/>
  157. <xsl:stylesheet version="1.0"
  158. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  159. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  160. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  161. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  162. xmlns:xts="http://developer.cognos.com/schemas/xts/">
  163. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  164. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  165. <pf:variables/>
  166. <xsl:template match="/">
  167. <xsl:variable name="canWrite" select="contains(/root/accountOptions/cm:queryResponse/cm:queryReply[1]/cm:account/cm:permissions, 'write')"/>
  168. <xts:sequence>
  169. <xts:append select="/root/env">
  170. <xsl:choose>
  171. <xsl:when test="$canWrite">
  172. <xsl:for-each select="/root/accountOptions/cm:queryResponse/cm:queryReply[1]/cm:account/options/value/item">
  173. <xsl:variable name="name" select="concat('m_po_', ./name)"/>
  174. <xsl:if test="not(key('env-param', $name))">
  175. <!--
  176. == RTC Task 31609 - Accessible Report Output Preference; this option is exceptional in that
  177. == it is a preference that is exposed on the preferences page but is not a "portal option". Rather
  178. == it's a generic (system level) option and as such it's environment name is preceded with m_go_.
  179. -->
  180. <xsl:choose>
  181. <xsl:when test="$name='m_po_http://developer.cognos.com/ceba/constants/systemOptionEnum#accessibilityFeatures'">
  182. <param name="m_go_accessibilityFeatures"><xsl:value-of select="./value"/></param>
  183. </xsl:when>
  184. <xsl:when test="$name='m_po_http://developer.cognos.com/ceba/constants/biDirectionalOptionEnum#biDirectionalFeaturesEnabled'">
  185. <param name="m_bidi_biDirectionalFeaturesEnabled"><xsl:value-of select="./value"/></param>
  186. </xsl:when>
  187. <xsl:when test="$name='m_po_http://developer.cognos.com/ceba/constants/biDirectionalOptionEnum#baseTextDirection'">
  188. <param name="m_bidi_baseTextDirectionOptionEnum"><xsl:value-of select="./value"/></param>
  189. </xsl:when>
  190. <xsl:otherwise>
  191. <param name="{$name}"><xsl:value-of select="./value"/></param>
  192. </xsl:otherwise>
  193. </xsl:choose>
  194. </xsl:if>
  195. </xsl:for-each>
  196. </xsl:when>
  197. <xsl:otherwise>
  198. <!-- read-only anonymous users editing their own preferences in the preferences page get the values from the cookie -->
  199. <xsl:if test="$is-named = '0'">
  200. <xsl:for-each select="/root/user/param[@name != 'timeZoneID' and @name != 'format' and @name != 'productLocale' and @name != 'contentLocale']">
  201. <xsl:variable name="name" select="concat('m_po_', ./@name)"/>
  202. <xsl:if test="not(key('env-param', $name))">
  203. <xsl:choose>
  204. <!-- in the anonymous case if we are not passed in the skin, we have to look it up in the cookie...since the cookie only stores the resouccelocation, we have to look up the storeID from the list of skins(for more information please consult bug#479742) -->
  205. <xsl:when test="$name = 'm_po_skin'">
  206. <xsl:variable name="skinLocator"><xsl:value-of select="/root/user/param[@name='skin']"/></xsl:variable>
  207. <param name="{$name}">storeID("<xsl:value-of select="/root/accountOptions/cm:queryResponse/cm:queryReply[2]/cm:portalSkin/cm:storeID[../cm:resourceLocation = $skinLocator]"/>")</param>
  208. </xsl:when>
  209. <xsl:otherwise>
  210. <param name="{$name}"><xsl:value-of select="."/></param>
  211. </xsl:otherwise>
  212. </xsl:choose>
  213. </xsl:if>
  214. </xsl:for-each>
  215. </xsl:if>
  216. </xsl:otherwise>
  217. </xsl:choose>
  218. </xts:append>
  219. </xts:sequence>
  220. </xsl:template>
  221. </xsl:stylesheet>
  222. </xts:block>
  223. <!-- sharedpages request processeing -->
  224. <!-- process addPage, set as home, remove page and modify sequence requests -->
  225. <xts:block type="exec" mode="interpret" processor="XSLT" mandatory="false"
  226. id="processSharedPagesCommands"
  227. dependency="createPageletList"
  228. path="/portal/preferences/common/processing/updateSharedPagesList.xslt"
  229. condition=".[/root/sharedPagesListForDisplay]">
  230. </xts:block>
  231. <xts:block type="exec" mode="interpret" processor="XSLT" mandatory="false"
  232. id="updateSharedPages"
  233. dependency="processSharedPagesCommands"
  234. condition=".[/root/sharedPagesListForDisplay]">
  235. <xts:logicsheet path="logicsheets/portal.xsl"/>
  236. <xsl:stylesheet version="1.0"
  237. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  238. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  239. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  240. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  241. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  242. xmlns:xts="http://developer.cognos.com/schemas/xts/">
  243. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  244. <pf:serialize-xml/>
  245. <xsl:template match="/root">
  246. <xsl:variable name="passport" select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
  247. <xts:sequence>
  248. <xts:delete select="/root/env/param[@name = 'm_pp_shared_pages']"/>
  249. <xts:append select="/root/env">
  250. <xsl:variable name="markup">
  251. <xsl:apply-templates select="/root/sharedPagesListForDisplay" mode="markup"/>
  252. </xsl:variable>
  253. <xsl:variable name="encodedSharedPages"><xsl:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($markup),true()))"/></xsl:variable>
  254. <!-- now we need to store the updated shared pages list -->
  255. <!-- lets try updating the environment...you never know that might work -->
  256. <param name="m_pp_shared_pages">
  257. <xsl:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($markup),true()))"/>
  258. </param>
  259. </xts:append>
  260. </xts:sequence>
  261. </xsl:template>
  262. </xsl:stylesheet>
  263. </xts:block>
  264. <xts:block id="presave-launchableProperties" type="exec" mode="interpret" processor="XSLT" mandatory="false"
  265. condition=".[ /root/env/param[@name = 'm_p_launchableType'] and not(/root/env/param[@name = 'm_p_specification']) ]">
  266. <xts:logicsheet path="logicsheets/portal.xsl"/>
  267. <xts:logicsheet path="portal/mvc/config/configuration.xslt"/>
  268. <xsl:stylesheet version="1.0"
  269. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  270. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  271. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  272. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  273. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  274. xmlns:mvc="http://developer.cognos.com/schemas/xts/mvc"
  275. xmlns:xts="http://developer.cognos.com/schemas/xts/">
  276. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  277. <xsl:template match="/root">
  278. <xts:sequence>
  279. <xsl:choose>
  280. <!-- MVC - Content Reference -->
  281. <xsl:when test="/root/env/param[@name = 'm_p_launchableType'] = 'application/vnd.ibm.cognos.instance'">
  282. <xts:append select="/root/env">
  283. <xsl:variable name="specification">
  284. <xsl:call-template name="build-specification-xml">
  285. <xsl:with-param name="startingFolder" select="/root/env/param[@name='m_p_RCRstartingFolder']"/>
  286. </xsl:call-template>
  287. </xsl:variable>
  288. <param name="m_p_specification"><xsl:value-of select="string($specification)"/></param>
  289. </xts:append>
  290. <xts:delete select="/root/env/param[@name = 'm_p_RCRstartingFolder']"/>
  291. </xsl:when>
  292. <!-- other launchables -->
  293. </xsl:choose>
  294. </xts:sequence>
  295. </xsl:template>
  296. <pf:serialize-xml/>
  297. <mvc:build-specification-xml/>
  298. </xsl:stylesheet>
  299. </xts:block>
  300. <!-- If we are processing a group copy/cut then we need to read the items stored in CM clipboard -->
  301. <xts:block id="getRunTimeState" processor="XSLT" type="exec" mandatory="false" condition=".[/root/env/param[@name='editentries'] and ( (/root/env/param[@name='ifrmcmd'] = 'move') or (/root/env/param[@name='ifrmcmd'] = 'copy') ) ]">
  302. <xts:logicsheet path="logicsheets/portal.xsl"/>
  303. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  304. <xsl:stylesheet version="1.0"
  305. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  306. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  307. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  308. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  309. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" >
  310. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  311. <pf:sessionpassport/>
  312. <xsl:template match="/root">
  313. <xts:sequence>
  314. <xts:append>
  315. <TDS-ccClipboard>
  316. <xts:function name="TDSRequest">
  317. <xts:param name="action">get</xts:param>
  318. <xts:param name="session-id"><xsl:value-of select="$passport"/></xts:param>
  319. <xts:param name="name"><xsl:value-of select="'ccClipboard'"/></xts:param>
  320. </xts:function>
  321. </TDS-ccClipboard>
  322. </xts:append>
  323. </xts:sequence>
  324. </xsl:template>
  325. </xsl:stylesheet>
  326. </xts:block>
  327. <xts:block id="deleteRunTimeState" processor="XSLT" type="exec" mandatory="false"
  328. condition=".[string(/root/env/param[@name='m_obj'])='~' and string(/root/env/param[@name='ifrmcmd'])='save']">
  329. <xts:logicsheet path="logicsheets/portal.xsl"/>
  330. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  331. <xsl:stylesheet version="1.0"
  332. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  333. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  334. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  335. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  336. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" >
  337. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  338. <pf:sessionpassport/>
  339. <xsl:template match="/root">
  340. <xts:sequence>
  341. <xts:append>
  342. <deletedccpages>
  343. <xts:function name="TDSRequest">
  344. <xts:param name="action">delete</xts:param>
  345. <xts:param name="session-id"><xsl:value-of select="$passport"/></xts:param>
  346. <xts:param name="name"><xsl:value-of select="'ccPages'"/></xts:param>
  347. </xts:function>
  348. </deletedccpages>
  349. </xts:append>
  350. </xts:sequence>
  351. </xsl:template>
  352. </xsl:stylesheet>
  353. </xts:block>
  354. <!--
  355. ===============================================================================================
  356. doFrmCommand - submit the form command (create, save, move, copy, delete)
  357. ===============================================================================================
  358. -->
  359. <xts:block id="doFrmCommand" processor="XSLT" type="exec" mandatory="false" dependency="getRunTimeState createPageletList updateSharedPages presave-launchableProperties processSharedPagesCommands presaveOptions deleteRunTimeState">
  360. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  361. <xts:logicsheet path="logicsheets/presentation/dialog/connections.xslt"/>
  362. <xsl:stylesheet
  363. xmlns:dcx="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/connections/1/"
  364. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  365. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  366. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  367. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  368. xmlns:cps="http://developer.cognos.com/schemas/cps/asm/objects/1/"
  369. version="1.0">
  370. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  371. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  372. <xsl:template match="/root">
  373. <xts:sequence>
  374. <xts:append>
  375. <xsl:choose>
  376. <!-- if we are creating or editing a url object, then make sure it is a valid url in the url object -->
  377. <xsl:when test="(key('env-param', 'm_class') = 'URL' or key('env-param', 'm_new_class') = 'URL') and (xtsext:cafaction('issafeurl_null', normalize-space(key('env-param', 'm_p_uri'))) = 'false') and (string(/root/system/param[@name='validateURI']) = 'true')">
  378. <URLError><xsl:value-of select="/root/env/param[@name='m_p_uri']"/></URLError>
  379. </xsl:when>
  380. <xsl:otherwise>
  381. <frmResult>
  382. <xsl:choose>
  383. <xsl:when test=" (key('env-param', 'ifrmcmd') = 'create') and (contains(' folder printer namespaceFolder configurationFolder adminFolder portletFolder tenant ', concat(' ', key('env-param', 'x_new_class'), ' ')))">
  384. <send:request provider="xts">
  385. <create xmlns="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/">
  386. <env>
  387. <param name="m_new_class">
  388. <xsl:value-of select="key('env-param', 'x_new_class')"/>
  389. </param>
  390. <param name="m_p_defaultName">
  391. <xsl:value-of select="key('env-param', 'x_p_defaultName')"/>
  392. </param>
  393. <param name="m_p_path">
  394. <xsl:value-of select="key('env-param', 'x_path')"/>
  395. </param>
  396. <xsl:if test="key('env-param', 'x_p_defaultDescription') != ''">
  397. <param name="m_p_defaultDescription">
  398. <xsl:value-of select="key('env-param', 'x_p_defaultDescription')"/>
  399. </param>
  400. </xsl:if>
  401. <xsl:if test="key('env-param', 'x_p_defaultScreenTip') != ''">
  402. <param name="m_p_defaultScreenTip">
  403. <xsl:value-of select="key('env-param', 'x_p_defaultScreenTip')"/>
  404. </param>
  405. </xsl:if>
  406. <xsl:if test="key('env-param', 'x_new_class') = 'printer'">
  407. <param name="m_p_printerAddress">
  408. <xsl:value-of select="key('env-param', 'x_p_printerAddress')"/>
  409. </param>
  410. <param name="m_p_modelName">
  411. <xsl:value-of select="key('env-param', 'x_modelName')"/>
  412. </param>
  413. <param name="m_p_location">
  414. <xsl:value-of select="key('env-param', 'x_p_location')"/>
  415. </param>
  416. </xsl:if>
  417. <xsl:if test="key('env-param', 'overwriteExistingItems') != ''">
  418. <param name="overwriteExistingItems">
  419. <xsl:value-of select="key('env-param', 'overwriteExistingItems')"/>
  420. </param>
  421. </xsl:if>
  422. </env>
  423. </create>
  424. </send:request>
  425. </xsl:when>
  426. <!-- *** DO NOT DELETE ***
  427. xsl:when test="key('env-param', 'ifrmcmd') = 'update' and key('env-param', 'm_class') != 'folder'">
  428. <send:request provider="xts">
  429. <xsl:element name="save" namespace="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/">
  430. <env>
  431. <xsl:copy-of select="/root/env/*"/>
  432. </env>
  433. </xsl:element>
  434. </send:request>
  435. </xsl:when-->
  436. <xsl:when test="(key('env-param', 'ifrmcmd')='create') and (key('env-param', 'm_new_class')='dataSource')">
  437. <send:request provider="xts">
  438. <xsl:element name="create" namespace="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/">
  439. <env xmlns="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/">
  440. <param name="m_new_class">dataSource</param>
  441. <xsl:if test="key('env-param', 'm_p_defaultDescription') != ''">
  442. <param name="m_p_defaultDescription">
  443. <xsl:value-of select="key('env-param', 'm_p_defaultDescription')"/>
  444. </param>
  445. </xsl:if>
  446. <xsl:if test="key('env-param', 'm_p_defaultScreenTip') != ''">
  447. <param name="m_p_defaultScreenTip">
  448. <xsl:value-of select="key('env-param', 'm_p_defaultScreenTip')"/>
  449. </param>
  450. </xsl:if>
  451. <param name="m_p_defaultName">
  452. <xsl:value-of select="key('env-param', 'm_p_defaultName')"/>
  453. </param>
  454. <param name="m_p_path">
  455. <xsl:value-of select="key('env-param', 'm_path')"/>
  456. </param>
  457. <xsl:for-each select="/root/env/param[starts-with(@name,'m_cbp_')]">
  458. <param name="{@name}">
  459. <xsl:value-of select="."/>
  460. </param>
  461. </xsl:for-each>
  462. <xsl:if test="key('env-param', 'overwriteExistingItems') != ''">
  463. <param name="overwriteExistingItems">
  464. <xsl:value-of select="key('env-param', 'overwriteExistingItems')"/>
  465. </param>
  466. </xsl:if>
  467. <xsl:if test="key('env-param', 'm_p_tenantID')">
  468. <param name="m_p_tenantID">
  469. <xsl:value-of select="key('env-param', 'm_p_tenantID')"/>
  470. </param>
  471. </xsl:if>
  472. <xsl:if test="key('env-param', 'changed_m_p_tenantID')">
  473. <param name="changed_m_p_tenantID">
  474. <xsl:value-of select="key('env-param', 'changed_m_p_tenantID')"/>
  475. </param>
  476. </xsl:if>
  477. </env>
  478. </xsl:element>
  479. </send:request>
  480. </xsl:when>
  481. <xsl:when test="(key('env-param', 'ifrmcmd')='create') and (key('env-param', 'm_new_class')='dataSourceConnection')">
  482. <send:request provider="xts">
  483. <xsl:element name="create" namespace="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/">
  484. <env xmlns="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/">
  485. <xsl:if test="key('env-param', 'm_connection_default_signon') or key('env-param', 'm_connection_type') = 'json'">
  486. <dcx:savePasswordVars/>
  487. <param name="m_default_signon">
  488. <xsl:call-template name="dcx:genCredentials">
  489. <xsl:with-param name="username" select="key('env-param', 'm_connection_userid')"/>
  490. <xsl:with-param name="password" select="$password"/>
  491. <xsl:with-param name="passwordEncrypted" select="$passwordEncrypted"/>
  492. <xsl:with-param name="cubePassword" select="$cubePassword"/>
  493. <xsl:with-param name="cubePasswordEncrypted" select="$cubePasswordEncrypted"/>
  494. </xsl:call-template>
  495. </param>
  496. </xsl:if>
  497. <param name="m_p_path">
  498. <xsl:value-of select="key('env-param', 'm_path')"/>
  499. </param>
  500. <xsl:for-each select="/root/env/param[not(@name='m_path' or @name='m_class' or @name='m_connection_password' or @name='m_connection_confirm_password')]">
  501. <param name="{@name}">
  502. <xsl:value-of select="."/>
  503. </param>
  504. </xsl:for-each>
  505. </env>
  506. </xsl:element>
  507. </send:request>
  508. </xsl:when>
  509. <xsl:when test=" (key('env-param', 'ifrmcmd') = 'save') and (key('env-param', 'm_class') = 'dataSource') ">
  510. <!-- Take a count of all m_t_default parameters -->
  511. <xsl:variable name="mtcnt"><xsl:value-of select="count(/root/env/param[starts-with(@name,'m_t_default_')])"/></xsl:variable>
  512. <send:request provider="xts">
  513. <xsl:element name="save" namespace="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/">
  514. <env xmlns="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/">
  515. <!-- handle inputs from the multilingual property page -->
  516. <xsl:if test="$mtcnt > 0">
  517. <!--
  518. Determine if there is NOT a description that has a value.
  519. If there are none, then create an empty description so CM will clear all locale entries.
  520. Note: The opposite test condition would not be correct here - to see if there is
  521. a screenTip that has a blank value.
  522. -->
  523. <xsl:if test="not(/root/env/param[starts-with(@name, 'm_t_default_description')] != '') and not(key('env-param', 'pty_desc') != '')">
  524. <param>
  525. <xsl:attribute name="name">
  526. <xsl:value-of select="'m_p_description'"/>
  527. </xsl:attribute>
  528. </param>
  529. </xsl:if>
  530. <!--
  531. Determine if there is NOT a screenTip that has a value.
  532. If there are none, then create an empty screenTip so CM will clear all locale entries.
  533. Note: The opposite test condition would not be correct here - to see if there is
  534. a screenTip that has a blank value.
  535. -->
  536. <xsl:if test="not(/root/env/param[starts-with(@name, 'm_t_default_screenTip')] != '') and not(key('env-param', 'pty_scrt') != '')">
  537. <param>
  538. <xsl:attribute name="name">
  539. <xsl:value-of select="'m_p_screenTip'"/>
  540. </xsl:attribute>
  541. </param>
  542. </xsl:if>
  543. </xsl:if>
  544. <xsl:variable name="ptyn"><xsl:value-of select="key('env-param', 'pty_name')"/></xsl:variable>
  545. <xsl:variable name="ptyd"><xsl:value-of select="key('env-param', 'pty_desc')"/></xsl:variable>
  546. <xsl:variable name="ptys"><xsl:value-of select="key('env-param', 'pty_scrt')"/></xsl:variable>
  547. <xsl:for-each select="/root/env/param">
  548. <xsl:if test="starts-with(@name, 'm_t_default_')">
  549. <xsl:variable name="localeVal"><xsl:value-of select="xtsext:substringAfterLast(string(@name), '_')"/></xsl:variable>
  550. <xsl:choose>
  551. <xsl:when test="$localeVal != string(key('env-param', 'pty_activeLang'))">
  552. <!--
  553. Handle the case where the user has just cleared all the fields, so don't pass it along for update.
  554. -->
  555. <xsl:if test="string(key('env-param', concat('m_t_default_name_',$localeVal))) != '' or string(key('env-param', concat('m_t_default_description_',$localeVal))) != '' or string(key('env-param', concat('m_t_default_screenTip_',$localeVal))) != ''">
  556. <xsl:if test="string(.) != ''">
  557. <param>
  558. <xsl:attribute name="name">
  559. <xsl:value-of select="concat('m_p_', xtsext:substringBeforeLast(substring-after(string(@name), 'm_t_default_'), '_'))"/>
  560. </xsl:attribute>
  561. <xsl:attribute name="locale">
  562. <xsl:value-of select="$localeVal"/>
  563. </xsl:attribute>
  564. <xsl:value-of select="."/>
  565. </param>
  566. </xsl:if>
  567. </xsl:if>
  568. </xsl:when>
  569. <xsl:otherwise>
  570. <!--
  571. Special processing required for the property page information - in case the user has pressed ok
  572. when a new language is in presentation.
  573. -->
  574. <xsl:variable name="theName"><xsl:value-of select="xtsext:substringBeforeLast(substring-after(string(@name), 'm_t_default_'),'_')"/></xsl:variable>
  575. <xsl:variable name="theValue">
  576. <xsl:choose>
  577. <xsl:when test="$theName='name'">
  578. <xsl:if test="$ptyn != ''">
  579. <xsl:value-of select="$ptyn"/>
  580. </xsl:if>
  581. </xsl:when>
  582. <xsl:when test="$theName='description'">
  583. <xsl:if test="$ptyd != ''">
  584. <xsl:value-of select="$ptyd"/>
  585. </xsl:if>
  586. </xsl:when>
  587. <xsl:otherwise>
  588. <xsl:if test="$ptys != ''">
  589. <xsl:value-of select="$ptys"/>
  590. </xsl:if>
  591. </xsl:otherwise>
  592. </xsl:choose>
  593. </xsl:variable>
  594. <!--
  595. Only create the parameter when all the values are available - otherwise they will be removed.
  596. -->
  597. <xsl:if test="$ptyn != '' or $ptyd != '' or $ptys != ''">
  598. <xsl:if test="$theValue != ''">
  599. <param>
  600. <xsl:attribute name="name">
  601. <xsl:value-of select="concat('m_p_',$theName)"/>
  602. </xsl:attribute>
  603. <xsl:attribute name="locale">
  604. <xsl:value-of select="$localeVal"/>
  605. </xsl:attribute>
  606. <xsl:value-of select="$theValue"/>
  607. </param>
  608. </xsl:if>
  609. </xsl:if>
  610. </xsl:otherwise>
  611. </xsl:choose>
  612. </xsl:if>
  613. <xsl:if test="@name != 'm_path' and @name != 'm_p_searchPath' and @name != 'm_new_class'">
  614. <xsl:if test="$mtcnt=0 or ($mtcnt != 0 and @name !='m_p_defaultName' and @name != 'm_p_defaultDescription' and @name != 'm_p_defaultScreenTip' and not(starts-with(@name,'m_t_default_')))">
  615. <param name="{@name}">
  616. <xsl:value-of select="."/>
  617. </param>
  618. </xsl:if>
  619. </xsl:if>
  620. </xsl:for-each>
  621. </env>
  622. </xsl:element>
  623. </send:request>
  624. </xsl:when>
  625. <!-- <xsl:when test="((/root/env/param[@name='ifrmcmd'] = 'move') or (/root/env/param[@name='ifrmcmd'] = 'copy')) and (not(key('env-param', 'm_obj')) or (key('env-param', 'm_obj') = '')) and not(/root/cm:queryResponse/cm:runTimeState/cm:state/*)"> -->
  626. <xsl:when test="((/root/env/param[@name='ifrmcmd'] = 'move') or (/root/env/param[@name='ifrmcmd'] = 'copy')) and (not(key('env-param', 'm_obj')) or (key('env-param', 'm_obj') = '')) and not(/root/TDS-ccClipboard/*)">
  627. <!-- Do not perform a copy or move if no objects are specified -->
  628. <xsl:element name="Noop"/>
  629. </xsl:when>
  630. <xsl:otherwise>
  631. <xsl:variable name="credentialPath" select="/root/header/*[local-name()='biBusHeader']/*[local-name()='CAM']/*[local-name() = 'CAMCredentialPath']"/>
  632. <send:request provider="xts">
  633. <xsl:element name="{key('env-param', 'ifrmcmd')}" namespace="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/">
  634. <env xmlns="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/">
  635. <!-- copy anything in env -->
  636. <xsl:choose>
  637. <!--
  638. "Enhancement" 543922.1:
  639. When creating reportView, shortcut or agentDefinitionView convert "default" values for name/description/screentip to multilingual params.
  640. -->
  641. <xsl:when test="/root/env/param[starts-with(@name,'m_ml_')]">
  642. <xsl:variable name="contentLocale" select="/root/user/param[@name='contentLocale']"/>
  643. <xsl:for-each select="/root/env/param">
  644. <xsl:choose>
  645. <xsl:when test="@name='m_p_defaultName'">
  646. <param>
  647. <xsl:attribute name="name"><xsl:value-of select="concat('m_ml_name_',string($contentLocale))"/></xsl:attribute>
  648. <xsl:value-of select="."/>
  649. </param>
  650. </xsl:when>
  651. <xsl:when test="@name='m_p_defaultDescription'">
  652. <param>
  653. <xsl:attribute name="name"><xsl:value-of select="concat('m_ml_description_',string($contentLocale))"/></xsl:attribute>
  654. <xsl:value-of select="."/>
  655. </param>
  656. </xsl:when>
  657. <xsl:when test="@name='m_p_defaultScreenTip'">
  658. <param>
  659. <xsl:attribute name="name"><xsl:value-of select="concat('m_ml_screenTip_',string($contentLocale))"/></xsl:attribute>
  660. <xsl:value-of select="."/>
  661. </param>
  662. </xsl:when>
  663. <xsl:otherwise>
  664. <param name="{@name}">
  665. <xsl:value-of select="."/>
  666. </param>
  667. </xsl:otherwise>
  668. </xsl:choose>
  669. </xsl:for-each>
  670. </xsl:when>
  671. <xsl:when test="/root/env/param[starts-with(@name,'m_t_default_')]">
  672. <xsl:for-each select="/root/env/param">
  673. <xsl:if test="not(@name='m_p_defaultName') and not(@name='m_p_defaultDescription') and not(@name='m_p_defaultScreenTip') and not(@name='m_p_defaultTriggerDescription')">
  674. <param name="{@name}">
  675. <xsl:choose>
  676. <!-- decode certain xml-encoded params -->
  677. <xsl:when test="@name='pagexml'">
  678. <xsl:value-of select="." disable-output-escaping="yes"/>
  679. </xsl:when>
  680. <xsl:otherwise>
  681. <xsl:value-of select="."/>
  682. </xsl:otherwise>
  683. </xsl:choose>
  684. </param>
  685. </xsl:if>
  686. </xsl:for-each>
  687. </xsl:when>
  688. <xsl:otherwise>
  689. <xsl:for-each select="/root/env/param">
  690. <xsl:if test="not(starts-with(@name, 'checkbox_'))">
  691. <xsl:choose>
  692. <xsl:when test="not(starts-with(@name,'m_p_defaultDescription') or starts-with(@name,'m_p_defaultScreenTip') or starts-with(@name,'m_p_defaultTriggerDescription') )">
  693. <param name="{@name}">
  694. <xsl:choose>
  695. <!-- decode certain xml-encoded params -->
  696. <xsl:when test="@name='pagexml'">
  697. <xsl:value-of select="." disable-output-escaping="yes"/>
  698. </xsl:when>
  699. <xsl:otherwise>
  700. <xsl:value-of select="."/>
  701. </xsl:otherwise>
  702. </xsl:choose>
  703. </param>
  704. </xsl:when>
  705. <xsl:otherwise>
  706. <xsl:if test="key('env-param', 'ifrmcmd')!='create' or (key('env-param', 'ifrmcmd')='create' and child::node() != '')">
  707. <param name="{@name}">
  708. <xsl:choose>
  709. <!-- decode certain xml-encoded params -->
  710. <xsl:when test="@name='pagexml'">
  711. <xsl:value-of select="." disable-output-escaping="yes"/>
  712. </xsl:when>
  713. <xsl:otherwise>
  714. <xsl:value-of select="."/>
  715. </xsl:otherwise>
  716. </xsl:choose>
  717. </param>
  718. </xsl:if>
  719. </xsl:otherwise>
  720. </xsl:choose>
  721. </xsl:if>
  722. </xsl:for-each>
  723. </xsl:otherwise>
  724. </xsl:choose>
  725. <xsl:choose>
  726. <!-- If this is the case where we have a copy or a move command -->
  727. <xsl:when test="key('env-param', 'editentries') and (key('env-param', 'ifrmcmd') = 'copy' or key('env-param', 'ifrmcmd') = 'move')">
  728. <clipboard>
  729. <xsl:copy-of select="/root/TDS-ccClipboard/*"/>
  730. </clipboard>
  731. </xsl:when>
  732. <!-- This is the case where we have a group delete command -->
  733. <xsl:otherwise>
  734. <xsl:for-each select="/root/env/*[starts-with(@name, 'checkbox_')]">
  735. <param name="{@name}">
  736. <xsl:value-of select="."/>
  737. </param>
  738. </xsl:for-each>
  739. </xsl:otherwise>
  740. </xsl:choose>
  741. <!-- if we have a group of object from the sort to save-->
  742. <!--
  743. Fix Bug #468845 - XTS/CM error in My folders when using Sort Order on LDAP configuration.
  744. m_obj now extracts the object name based on the last string sequence "]," instead of just the "," since the searchPath can contain a comma.
  745. -->
  746. <xsl:for-each select="/root/env/param[@name='containerSortOrder' or @name='entriesSortOrder' or @name='containerDefaultOrder' or @name='entriesDefaultOrder']">
  747. <objs>
  748. <param name="m_obj"><xsl:value-of select="concat(string(xtsext:substringBeforeLast(string(substring-after(string(.),',')),'],')),']')"/></param>
  749. <param name="m_class"><xsl:value-of select="xtsext:substringAfterLast(string(.),',')"/></param>
  750. <param name="m_p_displaySequence"><xsl:value-of select="substring-before(string(.),',')"/></param>
  751. </objs>
  752. </xsl:for-each>
  753. <!-- handle inputs from the multilingual property page -->
  754. <xsl:if test="/root/env/param[starts-with(@name, 'm_t_default_')]">
  755. <!--
  756. Determine if there is NOT a description that has a value.
  757. If there are none, then create an empty description so CM will clear all locale entries.
  758. Note: The opposite test condition would not be correct here - to see if there is
  759. a screenTip that has a blank value.
  760. -->
  761. <xsl:if test="not(/root/env/param[starts-with(@name, 'm_t_default_description')] != '') and not(key('env-param', 'pty_desc') != '')">
  762. <param>
  763. <xsl:attribute name="name">
  764. <xsl:value-of select="'m_p_description'"/>
  765. </xsl:attribute>
  766. </param>
  767. </xsl:if>
  768. <!--
  769. Determine if there is NOT a screenTip that has a value.
  770. If there are none, then create an empty screenTip so CM will clear all locale entries.
  771. Note: The opposite test condition would not be correct here - to see if there is
  772. a screenTip that has a blank value.
  773. -->
  774. <xsl:if test="not(/root/env/param[starts-with(@name, 'm_t_default_screenTip')] != '') and not(key('env-param', 'pty_scrt') != '')">
  775. <param>
  776. <xsl:attribute name="name">
  777. <xsl:value-of select="'m_p_screenTip'"/>
  778. </xsl:attribute>
  779. </param>
  780. </xsl:if>
  781. </xsl:if>
  782. <xsl:variable name="ptyn"><xsl:value-of select="key('env-param', 'pty_name')"/></xsl:variable>
  783. <xsl:variable name="ptyd"><xsl:value-of select="key('env-param', 'pty_desc')"/></xsl:variable>
  784. <xsl:variable name="ptys"><xsl:value-of select="key('env-param', 'pty_scrt')"/></xsl:variable>
  785. <xsl:variable name="ptytd"><xsl:value-of select="key('env-param', 'pty_trigger_desc')"/></xsl:variable>
  786. <xsl:for-each select="/root/env/param[starts-with(@name, 'm_t_default_')]">
  787. <xsl:variable name="localeVal"><xsl:value-of select="xtsext:substringAfterLast(string(@name), '_')"/></xsl:variable>
  788. <xsl:choose>
  789. <xsl:when test="starts-with(@name,'m_t_default_triggerDescription_')">
  790. <xsl:if test=". != ''">
  791. <xsl:variable name="theName"><xsl:value-of select="xtsext:substringBeforeLast(substring-after(string(@name), 'm_t_default_'),'_')"/></xsl:variable>
  792. <param>
  793. <xsl:attribute name="name">
  794. <xsl:value-of select="concat('m_p_',$theName)"/>
  795. </xsl:attribute>
  796. <xsl:attribute name="locale">
  797. <xsl:value-of select="$localeVal"/>
  798. </xsl:attribute>
  799. <xsl:value-of select="."/>
  800. </param>
  801. </xsl:if>
  802. </xsl:when>
  803. <xsl:when test="$localeVal != string(key('env-param', 'pty_activeLang'))">
  804. <!--
  805. Handle the case where the user has just cleared all the fields, so don't pass it along for update.
  806. -->
  807. <xsl:if test="string(key('env-param', concat('m_t_default_name_',$localeVal))) != '' or string(key('env-param', concat('m_t_default_description_',$localeVal))) != '' or string(key('env-param', concat('m_t_default_screenTip_',$localeVal))) != ''">
  808. <xsl:if test="string(.) != ''">
  809. <param>
  810. <xsl:attribute name="name">
  811. <xsl:value-of select="concat('m_p_', xtsext:substringBeforeLast(substring-after(string(@name), 'm_t_default_'), '_'))"/>
  812. </xsl:attribute>
  813. <xsl:attribute name="locale">
  814. <xsl:value-of select="$localeVal"/>
  815. </xsl:attribute>
  816. <xsl:value-of select="."/>
  817. </param>
  818. </xsl:if>
  819. </xsl:if>
  820. </xsl:when>
  821. <xsl:otherwise>
  822. <!--
  823. Special processing required for the property page information - in case the user has pressed ok
  824. when a new language is in presentation.
  825. -->
  826. <xsl:variable name="theName"><xsl:value-of select="xtsext:substringBeforeLast(substring-after(string(@name), 'm_t_default_'),'_')"/></xsl:variable>
  827. <xsl:variable name="theValue">
  828. <xsl:choose>
  829. <xsl:when test="$theName='name'">
  830. <xsl:if test="$ptyn != ''">
  831. <xsl:value-of select="$ptyn"/>
  832. </xsl:if>
  833. </xsl:when>
  834. <xsl:when test="$theName='description'">
  835. <xsl:if test="$ptyd != ''">
  836. <xsl:value-of select="$ptyd"/>
  837. </xsl:if>
  838. </xsl:when>
  839. <xsl:otherwise>
  840. <xsl:if test="$ptys != ''">
  841. <xsl:value-of select="$ptys"/>
  842. </xsl:if>
  843. </xsl:otherwise>
  844. </xsl:choose>
  845. </xsl:variable>
  846. <!--
  847. Only create the parameter when all the values are available - otherwise they will be removed.
  848. -->
  849. <xsl:if test="$ptyn != '' or $ptyd != '' or $ptys != ''">
  850. <xsl:if test="$theValue != ''">
  851. <param>
  852. <xsl:attribute name="name">
  853. <xsl:value-of select="concat('m_p_',$theName)"/>
  854. </xsl:attribute>
  855. <xsl:attribute name="locale">
  856. <xsl:value-of select="$localeVal"/>
  857. </xsl:attribute>
  858. <xsl:value-of select="$theValue"/>
  859. </param>
  860. </xsl:if>
  861. </xsl:if>
  862. </xsl:otherwise>
  863. </xsl:choose>
  864. </xsl:for-each>
  865. <!-- if we dont have m_p_path and we have m_path create m_p_path to always be consistent -->
  866. <xsl:if test="not(key('env-param', 'm_p_path')) and (key('env-param', 'm_path'))">
  867. <param name="m_p_path"><xsl:value-of select="key('env-param', 'm_path')"/></param>
  868. </xsl:if>
  869. </env>
  870. <xsl:if test="$credentialPath != ''">
  871. <credentialPath>
  872. <xsl:value-of select="$credentialPath"/>
  873. </credentialPath>
  874. </xsl:if>
  875. </xsl:element>
  876. </send:request>
  877. </xsl:otherwise>
  878. </xsl:choose>
  879. </frmResult>
  880. </xsl:otherwise>
  881. </xsl:choose>
  882. </xts:append>
  883. <!--xts:delete select="/root/env/param[starts-with( @name, 'stack_') and @name != 'stack_0']"/>
  884. < xts:replace select="/root/env/param[@name = 'ps_nav_op']">
  885. <param name="ps_nav_op">stack-down</param>
  886. </xts:replace -->
  887. </xts:sequence>
  888. </xsl:template>
  889. <dcx:genCredentialTemplate/>
  890. </xsl:stylesheet>
  891. </xts:block>
  892. <!--
  893. ===============================================================================================
  894. doFrmCommandCleanup - Cleanup after form parameters after executing the form command
  895. ===============================================================================================
  896. -->
  897. <xts:block id="doFrmCommandCleanup" processor="XSLT" type="exec" mandatory="false" dependency="doFrmCommand">
  898. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cmd="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/" version="1.0">
  899. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  900. <xsl:template match="/root">
  901. <xts:sequence>
  902. <xsl:if test="not(/root/frmResult/cmd:response/cmd:error)">
  903. <xts:delete select="/root/env/param[starts-with( @name, 'm_t_default_')]"/>
  904. </xsl:if>
  905. </xts:sequence>
  906. </xsl:template>
  907. </xsl:stylesheet>
  908. </xts:block>
  909. <!--
  910. ===============================================================================================
  911. postDataSourceCreation - Creates the connection child of the datasource and the proxy credential
  912. child (optionally), but only if the datasource creation was successful.
  913. ===============================================================================================
  914. -->
  915. <xts:block id="postDataSourceCreation" processor="XSLT" type="exec" dependency="doFrmCommandCleanup" condition=".[(/root/env/param[@name='ifrmcmd']='create') and (/root/env/param[@name='m_new_class']='dataSource') and not(/root/*[local-name() = 'frmResult']/*[local-name() = 'response']/*[local-name() = 'error'])]" mandatory="false">
  916. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  917. <xts:logicsheet path="logicsheets/presentation/dialog/connections.xslt"/>
  918. <xsl:stylesheet version="1.0"
  919. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  920. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  921. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  922. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  923. xmlns:dcx="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/connections/1/">
  924. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  925. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  926. <xsl:template match="/root">
  927. <xts:sequence>
  928. <!-- set the defaultName to the one returned from the original cm:add request since the CM may have normalized the name -->
  929. <xts:replace select="/root/env/param[@name = 'm_p_defaultName']">
  930. <param name="m_p_defaultName"><xsl:value-of select="/root/*[local-name() = 'frmResult']/*[local-name() = 'response']/*[local-name() = 'dataSource']/*[local-name()='defaultName']"/></param>
  931. </xts:replace>
  932. <xts:append select="/root/env">
  933. <param name="newDataSourceID"><xsl:value-of select="/root/*[local-name() = 'frmResult']/*[local-name() = 'response']/*[local-name() = 'dataSource']/*[local-name()='storeID']"/></param>
  934. <param name="newDataSourcePath"><xsl:value-of select="/root/*[local-name() = 'frmResult']/*[local-name() = 'response']/*[local-name() = 'dataSource']/*[local-name()='searchPath']"/></param>
  935. </xts:append>
  936. <xts:append>
  937. <send:request provider="xts">
  938. <xsl:element name="create" namespace="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/">
  939. <env xmlns="http://developer.cognos.com/schemas/xts/portal/iFrmCmd/1/">
  940. <!-- use the searchPath returned from the original cm:add request since the CM may have normalized the name -->
  941. <param name="m_p_path"><xsl:value-of select="/root/*[local-name() = 'frmResult']/*[local-name() = 'response']/*[local-name() = 'dataSource']/*[local-name()='searchPath']"/></param>
  942. <param name="m_new_class">dataSourceConnection</param>
  943. <dcx:savePasswordVars/>
  944. <xsl:if test="key('env-param', 'm_connection_default_signon') or key('env-param', 'm_connection_type') = 'json'">
  945. <param name="m_default_signon">
  946. <xsl:call-template name="dcx:genCredentials">
  947. <xsl:with-param name="username" select="key('env-param', 'm_connection_userid')"/>
  948. <xsl:with-param name="password" select="$password"/>
  949. <xsl:with-param name="passwordEncrypted" select="$passwordEncrypted"/>
  950. <xsl:with-param name="cubePassword" select="$cubePassword"/>
  951. <xsl:with-param name="cubePasswordEncrypted" select="$cubePasswordEncrypted"/>
  952. </xsl:call-template>
  953. </param>
  954. </xsl:if>
  955. <xsl:if test="key('env-param', 'm_connection_proxy_enabled')='true'">
  956. <xsl:variable name="proxyPassword">
  957. <xsl:choose>
  958. <xsl:when test="key('env-param', 'proxyPasswordEncrypted') != ''">
  959. <xsl:value-of select="key('env-param', 'proxyPasswordEncrypted')"/>
  960. </xsl:when>
  961. <xsl:otherwise>
  962. <xsl:value-of select="key('env-param', 'm_connection_proxy_password')"/>
  963. </xsl:otherwise>
  964. </xsl:choose>
  965. </xsl:variable>
  966. <param name="m_proxy_signon">
  967. <xsl:call-template name="dcx:genCredentials">
  968. <xsl:with-param name="username" select="key('env-param', 'm_connection_proxy_user')"/>
  969. <xsl:with-param name="password" select="$proxyPassword"/>
  970. <xsl:with-param name="passwordEncrypted" select="true()"/>
  971. <xsl:with-param name="cubePassword" select="$cubePassword"/>
  972. <xsl:with-param name="cubePasswordEncrypted" select="$cubePasswordEncrypted"/>
  973. </xsl:call-template>
  974. </param>
  975. </xsl:if>
  976. <xsl:for-each select="/root/env/param">
  977. <xsl:if test="not(starts-with(./@name,'m_cbp')) and ./@name != 'm_path' and ./@name != 'm_p_path' and ./@name != 'm_new_class' and ./@name != 'm_class' and ./@name != 'm_connection_password' and ./@name != 'm_connection_confirm_password'">
  978. <param name="{./@name}">
  979. <xsl:value-of select="."/>
  980. </param>
  981. </xsl:if>
  982. </xsl:for-each>
  983. </env>
  984. </xsl:element>
  985. </send:request>
  986. </xts:append>
  987. </xts:sequence>
  988. </xsl:template>
  989. <dcx:genCredentialTemplate/>
  990. </xsl:stylesheet>
  991. </xts:block>
  992. <!--
  993. ===============================================================================================
  994. postSaveFrmCommand - Additional operations to be performed after the save
  995. - deletion of data source credentials
  996. ===============================================================================================
  997. -->
  998. <xts:block id="postSaveAccount" processor="XSLT" type="exec" dependency="doFrmCommandCleanup" condition=".[(/root/env/param[@name='ifrmcmd']='save') and (/root/env/param[@name='m_class']='account') and not(/root/*[local-name() = 'frmResult']/*[local-name() = 'response']/*[local-name() = 'error'])]" mandatory="false">
  999. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  1000. <xsl:stylesheet version="1.0"
  1001. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  1002. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  1003. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  1004. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  1005. <xsl:template match="/root">
  1006. <xsl:variable name="storeIds" select="/root/env/param[@name='m_dataSourceCredentialsToDelete']"/>
  1007. <xsl:if test="$storeIds != ''">
  1008. <xts:sequence>
  1009. <xts:append>
  1010. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  1011. <send:request provider="cm">
  1012. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  1013. <xts:transform src="transforms/CM/generate-delete-datasourcecredentials.xslt" processor="XSLT">
  1014. <xts:function name="ConvertStoreIdsFromJsonToXml">
  1015. <xts:param name="storeIds"><xsl:value-of select="$storeIds"/></xts:param>
  1016. </xts:function>
  1017. </xts:transform>
  1018. </xts:transform>
  1019. </send:request>
  1020. </xts:transform>
  1021. </xts:append>
  1022. </xts:sequence>
  1023. </xsl:if>
  1024. </xsl:template>
  1025. </xsl:stylesheet>
  1026. </xts:block>
  1027. <!--
  1028. ===============================================================================================
  1029. formlogic_init - standard form logic initialization
  1030. ===============================================================================================
  1031. -->
  1032. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http" dependency="doFrmCommand"/>
  1033. <!--
  1034. ===============================================================================================
  1035. reload - reload the user preferences
  1036. ===============================================================================================
  1037. -->
  1038. <xts:block id="reload" condition=".[/root/env/param[@name='m_class'] = 'account' or /root/env/param[@name='ifrmcmd'] = 'move']" mandatory="false" processor="XSLT" type="exec" dependency="formlogic_init">
  1039. <xsl:stylesheet version="1.0"
  1040. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  1041. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  1042. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  1043. <xsl:template match="/">
  1044. <xts:sequence>
  1045. <xts:append select="/root/env">
  1046. <xsl:choose>
  1047. <xsl:when test="/root/env/param[@name='m_class'] = 'account'">
  1048. <param name="m_reload">userPreference</param>
  1049. </xsl:when>
  1050. <xsl:when test="/root/env/param[@name='ifrmcmd'] = 'move'">
  1051. <!-- Force a session rebuild. Due to over/optimization in CM where a move operation for an object (especially container object) can result in stale
  1052. page being rendered when that object is accessed in its new location -->
  1053. <param name="m_reload"/>
  1054. </xsl:when>
  1055. </xsl:choose>
  1056. </xts:append>
  1057. </xts:sequence>
  1058. </xsl:template>
  1059. </xsl:stylesheet>
  1060. </xts:block>
  1061. <!-- Deal with cases where options to "add to the portal view" or "view the page" are selected at the end of the pagelet creation wizard -->
  1062. <xts:block id="postPageletCreation" processor="XSLT" type="exec"
  1063. dependency="formlogic_init"
  1064. condition=".[/root/*[local-name() = 'frmResult']/*[local-name() = 'response']/*[local-name() ='pagelet'] and (/root/env/param[@name='mp_addToPortal'] or /root/env/param[@name='mp_viewPage'])]" mandatory="false">
  1065. <xsl:stylesheet version="1.0"
  1066. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  1067. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  1068. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  1069. <xsl:key name="system-param" match="/root/system/param" use="@name"/>
  1070. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  1071. <xsl:key name="session-param" match="/root/session/param" use="@name"/>
  1072. <xsl:template match="root">
  1073. <xsl:variable name="newPageID" select="string(/root/*[local-name() = 'frmResult']/*[local-name() = 'response']/cm:pagelet/cm:storeID)"/>
  1074. <!-- Check to see if we need to update the back URL -->
  1075. <xsl:variable name="backURL">
  1076. <xsl:choose>
  1077. <!-- View Page only -->
  1078. <xsl:when test="key('env-param', 'mp_viewPage') and not(key('env-param', 'mp_addToPortal'))">
  1079. <xsl:value-of select="concat(/root/http/param[@name='SCRIPT_NAME'], '?b_action=dashboard&amp;pathinfo=/cm&amp;path=storeID(%22', $newPageID, '%22)')"/>&amp;backURL=<xsl:value-of select="xtsext:protect(xtsext:urlencode(key(&quot;env-param&quot;, &quot;backURL&quot;)),'url','url','getdata')"/>
  1080. <xsl:if test="not(/root/system/param[@name='ui_hide']/CRN_HEADER_TITLE)">
  1081. <xsl:text>&amp;frag-header=true</xsl:text>
  1082. </xsl:if>
  1083. </xsl:when>
  1084. <!-- View Page and Add to portal tabs -->
  1085. <xsl:when test="key('env-param', 'mp_viewPage') and key('env-param', 'mp_addToPortal')">
  1086. <xsl:value-of select="concat(key('env-param', 'backURL'), '&amp;m_tab_override=', $newPageID)"/>
  1087. </xsl:when>
  1088. <xsl:otherwise>
  1089. <xsl:value-of select="key('env-param', 'backURL')"/>
  1090. </xsl:otherwise>
  1091. </xsl:choose>
  1092. </xsl:variable>
  1093. <xts:sequence>
  1094. <!-- View Page option - Update the back url -->
  1095. <xsl:if test="key('env-param', 'mp_viewPage')">
  1096. <xts:replace select="/root/env/param[@name='backURL']">
  1097. <param name="backURL"><xsl:value-of select="$backURL"/></param>
  1098. </xts:replace>
  1099. </xsl:if>
  1100. <!-- Add to portal pages option - build a new request context -->
  1101. <xsl:if test="key('env-param', 'mp_addToPortal')">
  1102. <!--
  1103. Recycle the cafcontectId in the original request for the purpose of this request.
  1104. Do not create a new one as that defeats the security intention of this token.
  1105. If no valid token passed in the original request then this request should fail!
  1106. -->
  1107. <xsl:variable name="cafContextID" select="key('env-param', 'ui.cafcontextid')"/>
  1108. <!-- Clear the context of the previous request -->
  1109. <xts:delete select="/root/env/param"/>
  1110. <!-- Build the new context -->
  1111. <xts:append select="/root/env">
  1112. <xsl:if test="$cafContextID != ''">
  1113. <param name="ui.cafcontextid"><xsl:value-of select="$cafContextID"/></param>
  1114. </xsl:if>
  1115. <param name="ifrmcmd">save</param>
  1116. <param name="m_obj">~</param>
  1117. <param name="sharedPagesChanged">add</param>
  1118. <param name="m_class">account</param>
  1119. <param name="m_return"><xsl:value-of select="key('system-param', 'app')"/>/submit.xts</param>
  1120. <param name="m_selectedPage"><xsl:value-of select="$newPageID"/></param>
  1121. <param name="backURL"><xsl:value-of select="$backURL"/></param>
  1122. </xts:append>
  1123. </xsl:if>
  1124. </xts:sequence>
  1125. </xsl:template>
  1126. </xsl:stylesheet>
  1127. </xts:block>
  1128. <!--
  1129. ===============================================================================================
  1130. redirect - redirect the browser
  1131. ===============================================================================================
  1132. -->
  1133. <xts:block id="redirect" dependency="reload postPageletCreation postSaveAccount" mode="output" processor="XSLT" type="exec" mimeType="text/html">
  1134. <xts:logicsheet path="logicsheets/portal.xsl"/>
  1135. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  1136. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  1137. <xsl:stylesheet version="1.0"
  1138. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  1139. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  1140. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  1141. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  1142. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  1143. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  1144. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  1145. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  1146. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  1147. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  1148. xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
  1149. exclude-result-prefixes="xsl pf dp utml xtsext cp bus cm cml xts">
  1150. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  1151. <pf:variables/>
  1152. <xsl:template match="/">
  1153. <xsl:choose>
  1154. <xsl:when test="(/root/*[local-name() = 'frmResult']/*[local-name() = 'response']/*[local-name() = 'error']/*[local-name() = 'errorCode'] = 'cmNameConflict' or /root/*[local-name() = 'frmResult']/*[local-name() = 'response']/*[local-name() = 'error']/*[local-name() = 'errorCode'] = 'cmDuplicateName' or /root/frmResult/error/errorCode = 'cmNameConflict' or /root/frmResult/error/errorCode = 'cmDuplicateName' or /root/*[local-name() = 'frmResult']/*[local-name() = 'response']/*[local-name() = 'error']/*[local-name() = 'errorCode'] = 'cmUpdateFailed1') or (string(/root/URLError) != '')">
  1155. <!-- We have a duplicate name error condition. -->
  1156. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$product_name">
  1157. <dp:meta>
  1158. <pf:meta/> <!-- Add standard meta tags -->
  1159. </dp:meta>
  1160. <form name="pform" method="post" action="{$gateway}">
  1161. <xsl:choose>
  1162. <xsl:when test="string(/root/URLError) != ''">
  1163. <!-- we are editing attempting to create or save a url with an invalid url. The url must be corrected or the operation canceled -->
  1164. <input name="m" type="hidden" value="portal/error.xts"/>
  1165. <input name="cmdErrorResubmit" type="hidden" value="portal/submit.xts"/>
  1166. <input name="cmdErrorMessage" type="hidden" value=""/>
  1167. <input name="cmdErrorNameField" type="hidden" value="m_p_uri"/>
  1168. <input name="cmdErrorCode" type="hidden" value=""/>
  1169. <input name="cmdErrorAction" type="hidden" value="overwriteURL"/>
  1170. </xsl:when>
  1171. <xsl:when test="key('env-param', 'ifrmcmd') = 'copy' or key('env-param', 'ifrmcmd') = 'move'">
  1172. <!-- We ran into a duplicate name error during the copy or move -->
  1173. <input name="m" type="hidden" value="portal/error.xts"/>
  1174. <input name="cmdErrorResubmit" type="hidden" value="portal/submit.xts"/>
  1175. <input name="cmdErrorMessage" type="hidden" value="{/root/frmResult/error/errorMessage}"/>
  1176. <input name="cmdErrorCode" type="hidden" value="{/root/frmResult/error/errorCode}"/>
  1177. <input name="cmdErrorCodeDetails" type="hidden" value="{/root/frmResult/error/errorCodeDetails}"/>
  1178. <input name="cmdErrorAction" type="hidden" value="overwrite"/>
  1179. </xsl:when>
  1180. <xsl:when test="key('env-param', 'ifrmcmd') = 'create'">
  1181. <!-- We ran into a duplicate name error during the copy or move -->
  1182. <input name="m" type="hidden" value="portal/error.xts"/>
  1183. <input name="cmdErrorResubmit" type="hidden" value="portal/submit.xts"/>
  1184. <input name="cmdErrorMessage" type="hidden" value="{/root/*[local-name() = 'frmResult']/*[local-name() = 'response']/*[local-name() = 'error']/*[local-name() = 'errorMessage']}"/>
  1185. <input name="cmdErrorCode" type="hidden" value="{/root/*[local-name() = 'frmResult']/*[local-name() = 'response']/*[local-name() = 'error']/*[local-name() = 'errorCode']}"/>
  1186. <xsl:choose>
  1187. <xsl:when test="key('env-param', 'm_new_class') = 'folder'"><input name="cmdErrorAction" type="hidden" value="rename"/></xsl:when>
  1188. <xsl:otherwise><input name="cmdErrorAction" type="hidden" value="overwrite,rename"/></xsl:otherwise>
  1189. </xsl:choose>
  1190. <xsl:choose>
  1191. <xsl:when test="key('env-param', 'x_p_defaultName') != ''">
  1192. <input name="cmdErrorNameField" type="hidden" value="x_p_defaultName"/>
  1193. </xsl:when>
  1194. <xsl:otherwise>
  1195. <input name="cmdErrorNameField" type="hidden" value="m_p_defaultName"/>
  1196. </xsl:otherwise>
  1197. </xsl:choose>
  1198. <xsl:choose>
  1199. <xsl:when test="key('env-param', 'x_path') != ''">
  1200. <input name="cmdErrorPath" type="hidden" value="x_path"/>
  1201. </xsl:when>
  1202. <xsl:otherwise>
  1203. <input name="cmdErrorPath" type="hidden" value="m_path"/>
  1204. </xsl:otherwise>
  1205. </xsl:choose>
  1206. <xsl:choose>
  1207. <xsl:when test="key('env-param', 'x_new_class') != ''">
  1208. <input name="cmdErrorClass" type="hidden" value="x_new_class"/>
  1209. </xsl:when>
  1210. <xsl:otherwise>
  1211. <input name="cmdErrorClass" type="hidden" value="m_new_class"/>
  1212. </xsl:otherwise>
  1213. </xsl:choose>
  1214. </xsl:when>
  1215. <xsl:when test="key('env-param', 'ifrmcmd') = 'save'">
  1216. <!-- We ran into a duplicate name error during the save -->
  1217. <xsl:variable name="errorMessage" select="string(/root/*[local-name() = 'frmResult']/*[local-name() = 'response']/*[local-name() = 'error']/*[local-name() = 'errorMessage'])"/>
  1218. <input name="m" type="hidden" value="portal/properties_general.xts"/>
  1219. <input name="cmdErrorMessage" type="hidden" value="{$errorMessage}"/>
  1220. </xsl:when>
  1221. </xsl:choose>
  1222. <!-- if we have the connection password and it's already encrypted, don't use a field name that
  1223. ends with _password since the password will get encrypted twice -->
  1224. <xsl:choose>
  1225. <xsl:when test="key('env-param', 'm_connection_password')[@format='encrypted']">
  1226. <xsl:if test="not(key('env-param','passwordEncrypted'))">
  1227. <input name="passwordEncrypted" type="hidden" value="{key('env-param', 'm_connection_password')}"/>
  1228. </xsl:if>
  1229. </xsl:when>
  1230. <xsl:when test="key('env-param', 'm_connection_password')">
  1231. <input name="m_connection_password" type="hidden" value="{key('env-param', 'm_connection_password')}"/>
  1232. </xsl:when>
  1233. </xsl:choose>
  1234. <xsl:for-each select="/root/env/param[@name != 'm_connection_password' and @name != 'm' and @name != 'cmdErrorMessage' and @name != 'cmdErrorCode' and @name != 'cmdErrorResubmit' and @name != 'cmdErrorNameField' and @name != 'cmdErrorAction' and @name != 'cmdErrorPath' and @name != 'cmdErrorClass']">
  1235. <input name="{@name}" type="hidden" value="{.}"/>
  1236. </xsl:for-each>
  1237. </form>
  1238. <script language="javascript">document.pform.submit();</script>
  1239. </dp:page>
  1240. </xsl:when>
  1241. <!-- redirect the user to the view run history details page after submitting a run request from the run with options or run once page -->
  1242. <xsl:when test="key('env-param', 'viewHistoryCheckBox') and key('env-param', 'm_obj') != '' and /root/*[local-name()='frmResult']/*[local-name()='response']/*[local-name()='runResponse']/*[local-name()='result']/*[local-name()='details']/*/*[local-name()='eventID'] != ''">
  1243. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$product_name">
  1244. <dp:meta>
  1245. <pf:meta/> <!-- Add standard meta tags -->
  1246. </dp:meta>
  1247. <form name="pform" method="post" action="{$gateway}">
  1248. <input name="eventID" type="hidden" value="{/root/*[local-name()='frmResult']/*[local-name()='response']/*[local-name()='runResponse']/*[local-name()='result']/*[local-name()='details']/*/*[local-name()='eventID']}"/>
  1249. <input name="m" type="hidden" value="{$app}/history/view_executing_details.xts"/>
  1250. <input name="frmcmd" type="hidden" value="success"/>
  1251. <input name="visited" type="hidden" value="false"/>
  1252. <xsl:for-each select="/root/env/param[@name != 'm_obj' and @name != 'm' and @name != 'overwriteExistingItems']">
  1253. <input name="{@name}" type="hidden" value="{.}"/>
  1254. </xsl:for-each>
  1255. </form>
  1256. <script language="javascript">
  1257. function init()
  1258. {
  1259. if (document.pform.visited.value=="true")
  1260. {
  1261. history.go(-1);
  1262. }
  1263. else
  1264. {
  1265. document.pform.visited.value="true";
  1266. document.pform.submit();
  1267. }
  1268. }
  1269. </script>
  1270. </dp:page>
  1271. </xsl:when>
  1272. <xsl:when test="not(string(key('env-param','m_return')) = '') or not(string(key('env-param','redirect.m'))='')">
  1273. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$product_name">
  1274. <dp:meta>
  1275. <pf:meta/> <!-- Add standard meta tags -->
  1276. </dp:meta>
  1277. <xsl:if test="/root/frmResult/Noop">
  1278. <script language="javascript" src="{$webcontent}/{$app}/js/cookie_jar.js"/>
  1279. <script language="javascript">
  1280. var sParamDelimiter = "<xsl:value-of select="xtsext:javascriptencode(string(key('system-param', 'delimiters')/@d1))"/>";
  1281. var sNameValueDelimiter = "<xsl:value-of select="xtsext:javascriptencode(string(key('system-param', 'delimiters')/@d2))"/>";
  1282. var sCookiePath = "<xsl:value-of select="xtsext:javascriptencode(string($cookie_path))"/>";
  1283. var sCookieDomain = "<xsl:value-of select="xtsext:javascriptencode(string($cookie_domain))"/>";
  1284. var sCookieSecure = "<xsl:value-of select="xtsext:javascriptencode(string($cookie_secure))"/>";
  1285. resetStateParam('edit');
  1286. </script>
  1287. </xsl:if>
  1288. <form name="pform" method="post" action="{$gateway}">
  1289. <input name="m" type="hidden">
  1290. <xsl:attribute name="value">
  1291. <xsl:choose>
  1292. <xsl:when test="not(string(key('env-param','m_return')) = '')"><xsl:value-of select="key('env-param','m_return')"/></xsl:when>
  1293. <xsl:otherwise><xsl:value-of select="key('env-param','redirect.m')"/></xsl:otherwise>
  1294. </xsl:choose>
  1295. </xsl:attribute>
  1296. </input>
  1297. <input name="visited" type="hidden" value="false"/>
  1298. <input name="revisiting" type="hidden" value=""/>
  1299. <xsl:choose>
  1300. <!-- navigating to the schedule or run with options dialog from the wizard -->
  1301. <!-- pass only a controlled set of params to the run with options and schedule dialog -->
  1302. <xsl:when test="(key('env-param','m_selectaction') = 'run' or key('env-param','m_selectaction') = 'schedule') and key('env-param','ifrmcmd') = 'create' and key('env-param','submitFromWizard') = 'true'">
  1303. <xsl:for-each select="/root/env/param[contains(' m_class b_action m_p_tenantID changed_m_p_tenantID encoding m_path backURL cto_consistency_check cto_externalnamespace contentTaskType selectedTenants selectedTenantNames selectPublicTenant cto_granularity cto_filePerTenant ', concat(' ',@name,' '))]">
  1304. <input name="{@name}" type="hidden" value="{.}"/>
  1305. </xsl:for-each>
  1306. <input name="m_obj" type="hidden" value="{/root/*[local-name()='frmResult']/*[local-name()='response']/*/*[local-name()='searchPath']}"/>
  1307. <xsl:choose>
  1308. <xsl:when test="not(string(key('env-param','err_rename'))='')">
  1309. <input name="m_name" type="hidden" value="{key('env-param','err_rename')}"/>
  1310. </xsl:when>
  1311. <xsl:otherwise>
  1312. <input name="m_name" type="hidden" value="{key('env-param','m_name')}"/>
  1313. </xsl:otherwise>
  1314. </xsl:choose>
  1315. <input name="ifrmcmd" type="hidden" value=""/>
  1316. </xsl:when>
  1317. <xsl:when test="/root/env/param[starts-with(string(@name),'redirect.')]">
  1318. <xsl:for-each select="/root/env/param[starts-with(string(@name),'redirect.') and not(@name='redirect.m')]">
  1319. <input name="{substring-after(@name,'redirect.')}" type="hidden" value="{.}"/>
  1320. </xsl:for-each>
  1321. <!-- initialize ifrmcmd -->
  1322. <input name="ifrmcmd" type="hidden" value=""/>
  1323. </xsl:when>
  1324. <xsl:otherwise>
  1325. <xsl:for-each select="/root/env/param[@name != 'm_return' and @name != 'm' and @name != 'overwriteExistingItems']">
  1326. <input name="{@name}" type="hidden" value="{.}"/>
  1327. </xsl:for-each>
  1328. </xsl:otherwise>
  1329. </xsl:choose>
  1330. <input name="frmcmd" type="hidden" value="success"/>
  1331. </form>
  1332. <script language="javascript">
  1333. function init()
  1334. {
  1335. if (document.pform.visited.value=="true")
  1336. {
  1337. history.go(-1);
  1338. }
  1339. else
  1340. {
  1341. document.pform.visited.value="true";
  1342. document.pform.submit();
  1343. }
  1344. }
  1345. </script>
  1346. </dp:page>
  1347. </xsl:when>
  1348. <!-- if comgin from dataSource wizard and going back to the caller (CMM) -->
  1349. <xsl:when test="key('env-param','fromCMM') and key('env-param','m_new_class')='dataSource'">
  1350. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$product_name">
  1351. <dp:meta>
  1352. <pf:meta/> <!-- Add standard meta tags -->
  1353. </dp:meta>
  1354. <dt:cmmPostBackForm/>
  1355. <script language="javascript">
  1356. document.cmmform.submit();
  1357. </script>
  1358. </dp:page>
  1359. </xsl:when>
  1360. <xsl:otherwise>
  1361. <!--
  1362. If no back url is passed in then provide a default url to go to
  1363. so we don't end up redirecting to an empty url - Causes endless redirection loop.
  1364. -->
  1365. <xsl:variable name="back-url">
  1366. <xsl:choose>
  1367. <xsl:when test="string(key('env-param','backURL')) = ''">
  1368. <xsl:value-of select="concat(string(/root/http/param[@name='SCRIPT_NAME']),'?', key('system-param', 'COGNOSHome'))"/>
  1369. </xsl:when>
  1370. <xsl:otherwise>
  1371. <xsl:value-of select="key('env-param','backURL')"/>
  1372. </xsl:otherwise>
  1373. </xsl:choose>
  1374. </xsl:variable>
  1375. <!-- FYI for PP8 xss checking is na so no protect function required whereas it is needed for PP7-->
  1376. <!-- go to the back-url if we don't have an m_return -->
  1377. <xsl:variable name="redirect-url-fragment">
  1378. <xsl:choose>
  1379. <xsl:when test="string(key('env-param','m_new_class')) = 'powerPlayReport' or string(key('env-param','m_new_class')) = 'powerPlayCube'">
  1380. <!-- Handle series 7 powerPlay object -->
  1381. <xsl:choose>
  1382. <xsl:when test="string(key('env-param','ifrmcmd'))!='create'">
  1383. <xsl:value-of select="$back-url"/>
  1384. </xsl:when>
  1385. <xsl:otherwise>
  1386. <xsl:variable name="ppURL">
  1387. <xsl:value-of select="concat(string(/root/env/param[@name='successURL']),'&amp;crnobj=',xtsext:urlencode(string(/root/*[local-name()='frmResult']/*[local-name()='response']/*/cm:searchPath)))"/>
  1388. </xsl:variable>
  1389. <xsl:value-of select="xtsext:protect(string($ppURL),'none','s7url','s7url')"/>
  1390. </xsl:otherwise>
  1391. </xsl:choose>
  1392. </xsl:when>
  1393. <!-- PP8 studio and client will fall in here -->
  1394. <xsl:when test="string(key('env-param','successURL'))!=''">
  1395. <xsl:value-of select="concat(string(/root/env/param[@name='successURL']),'&amp;crnobj=',xtsext:urlencode(string(/root/*[local-name()='frmResult']/*[local-name()='response']/*/cm:searchPath)))"/>
  1396. </xsl:when>
  1397. <!-- For all other objects -->
  1398. <xsl:otherwise>
  1399. <xsl:value-of select="$back-url"/>
  1400. </xsl:otherwise>
  1401. </xsl:choose>
  1402. </xsl:variable>
  1403. <xsl:variable name="param-char">
  1404. <xsl:choose>
  1405. <xsl:when test="contains(string($redirect-url-fragment),'?')">
  1406. <xsl:text>&amp;</xsl:text>
  1407. </xsl:when>
  1408. <xsl:otherwise>
  1409. <xsl:text>?</xsl:text>
  1410. </xsl:otherwise>
  1411. </xsl:choose>
  1412. </xsl:variable>
  1413. <xsl:variable name="redirect-url">
  1414. <xsl:value-of select="$redirect-url-fragment"/>
  1415. <xsl:if test="key('env-param','m_reload') and not(starts-with($redirect-url-fragment, 'javascript:'))">
  1416. <xsl:value-of select="$param-char"/>
  1417. <xsl:text/>m_reload=<xsl:value-of select="key('env-param','m_reload')"/>
  1418. </xsl:if>
  1419. <xsl:if test="key('env-param','md.callBack') and not(starts-with($redirect-url-fragment, 'javascript:'))">
  1420. <xsl:value-of select="$param-char"/>
  1421. <xsl:text/>m_success=<xsl:text/>
  1422. </xsl:if>
  1423. </xsl:variable>
  1424. <xsl:variable name="isPP8Obj" select="string(key('env-param','m_new_class')) = 'powerPlay8Report' or string(key('env-param','m_new_class')) = 'powerPlay8ReportView'"/>
  1425. <xsl:variable name="urlTooLong" select="string-length(string($redirect-url)) &gt; 2048"/>
  1426. <!-- Note: always post for PP8 because when GET if something is encoded it doesn't always get decoded so they cannot handle it -->
  1427. <xsl:variable name="doPost" select="$urlTooLong or $isPP8Obj"/>
  1428. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$product_name">
  1429. <!-- this is the redirect portion of the code -->
  1430. <dp:meta>
  1431. <!-- Add standard meta tags -->
  1432. <pf:meta/>
  1433. <xsl:if test="not(starts-with($redirect-url,'javascript:')) and not($doPost)">
  1434. <meta http-equiv="refresh">
  1435. <xsl:attribute name="content">0; URL=<xsl:value-of select="$redirect-url"/></xsl:attribute>
  1436. </meta>
  1437. </xsl:if>
  1438. </dp:meta>
  1439. <xsl:if test="starts-with($redirect-url,'javascript:')">
  1440. <script language="javascript">
  1441. window.location.href = "<xsl:value-of select="xtsext:javascriptencode(string($redirect-url))"/>";
  1442. </script>
  1443. </xsl:if>
  1444. <xsl:if test="$doPost">
  1445. <form name="pform" method="post" action="{$gateway}">
  1446. <input name="doPostURL" value="backURL" type="hidden"/>
  1447. <input name="m" type="hidden" value="portal/postURL.xts"/>
  1448. <input name="backURL" type="hidden">
  1449. <xsl:attribute name="value"><xsl:value-of select="$redirect-url"/></xsl:attribute>
  1450. </input>
  1451. </form>
  1452. <script language="javascript">document.pform.submit();</script>
  1453. </xsl:if>
  1454. <xsl:if test="/root/frmResult/Noop">
  1455. <script language="javascript" src="{$webcontent}/{$app}/js/cookie_jar.js"/>
  1456. <script language="javascript">
  1457. var sParamDelimiter = "<xsl:value-of select="xtsext:javascriptencode(string(key('system-param', 'delimiters')/@d1))"/>";
  1458. var sNameValueDelimiter = "<xsl:value-of select="xtsext:javascriptencode(string(key('system-param', 'delimiters')/@d2))"/>";
  1459. var sCookiePath = "<xsl:value-of select="xtsext:javascriptencode(string($cookie_path))"/>";
  1460. var sCookieDomain = "<xsl:value-of select="xtsext:javascriptencode(string($cookie_domain))"/>";
  1461. var sCookieSecure = "<xsl:value-of select="xtsext:javascriptencode(string($cookie_secure))"/>";
  1462. resetStateParam('edit');
  1463. </script>
  1464. </xsl:if>
  1465. </dp:page>
  1466. </xsl:otherwise>
  1467. </xsl:choose>
  1468. </xsl:template>
  1469. </xsl:stylesheet>
  1470. </xts:block>
  1471. <!--
  1472. ===============================================================================================
  1473. debug - display debug information
  1474. ===============================================================================================
  1475. -->
  1476. <xts:block id="debug" dependency="redirect" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  1477. <!-- get the debug logic sheet -->
  1478. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  1479. <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">
  1480. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  1481. <xsl:template match="/">
  1482. <dbg:dumpxml select="/root"/>
  1483. </xsl:template>
  1484. </xsl:stylesheet>
  1485. </xts:block>
  1486. </xts:morphlet>