resequence.xts 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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, 2014
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. -->
  12. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml" includeConfig="true">
  13. <!-- Navigation control -->
  14. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  15. <!-- Content request to get basic preferences -->
  16. <xts:block id="getContent" processor="XSLT" type="exec" dependency="formlogic_init" mandatory="true" >
  17. <xts:logicsheet path="portal/preferences/common/request/request.xslt"/>
  18. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  19. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  20. <xsl:stylesheet version="1.0"
  21. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  22. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  23. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  24. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  25. xmlns:rdr="http://developer.cognos.com/schemas/xts/rdr/"
  26. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  27. xmlns:xts="http://developer.cognos.com/schemas/xts/">
  28. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  29. <xsl:template match="/root">
  30. <xsl:choose>
  31. <xsl:when test="/root/env/param[@name='m_pp_shared_pages']">
  32. <!-- the list was passed in so lets unpack it -->
  33. <!-- need to place it in the same place it would be in as if we did the request -->
  34. <xts:sequence>
  35. <xts:append>
  36. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(/root/env/param[@name='m_pp_shared_pages'])),true())" disable-output-escaping="yes"/>
  37. </xts:append>
  38. </xts:sequence>
  39. </xsl:when>
  40. <xsl:otherwise>
  41. <rdr:Requests>
  42. <rdr:Request type="preferences" mode="preferences">
  43. <rdr:searchPath>~</rdr:searchPath>
  44. </rdr:Request>
  45. </rdr:Requests>
  46. </xsl:otherwise>
  47. </xsl:choose>
  48. </xsl:template>
  49. </xsl:stylesheet>
  50. </xts:block>
  51. <!-- if we had to retrieve the shared pages from cm...we must create the portalPages list -->
  52. <xts:block id="createSharedPagesList" processor="XSLT" type="exec" dependency="getContent" condition=".[not(/root/env/param[@name = 'm_pp_shared_pages'])]" mandatory="false" >
  53. <xts:logicsheet path="portal/preferences/common/request/request.xslt"/>
  54. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  55. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  56. <xsl:stylesheet version="1.0"
  57. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  58. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  59. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  60. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  61. xmlns:rdr="http://developer.cognos.com/schemas/xts/rdr/"
  62. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  63. xmlns:xts="http://developer.cognos.com/schemas/xts/">
  64. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  65. <xsl:template match="/root">
  66. <xts:sequence>
  67. <xts:append>
  68. <!-- the list was not passed in so we must look at cm for the portalPages list -->
  69. <sharedPagesListForDisplay>
  70. <xsl:for-each select="/root/cm:queryResponse/cm:queryReply[1]/cm:account/cm:portalPages/*">
  71. <pagelet>
  72. <xsl:copy-of select="@*|*"/>
  73. </pagelet>
  74. </xsl:for-each>
  75. </sharedPagesListForDisplay>
  76. </xts:append>
  77. </xts:sequence>
  78. </xsl:template>
  79. </xsl:stylesheet>
  80. </xts:block>
  81. <!-- Response -->
  82. <xts:block id="resequencePage" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="formlogic_init getContent createSharedPagesList" mandatory="true">
  83. <xts:logicsheet path="portal/preferences/common/response/preferences.xslt"/>
  84. <xts:logicsheet path="logicsheets/portal.xsl"/>
  85. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  86. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  87. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  88. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  89. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  90. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  91. <xts:logicsheet path="logicsheets/formlogic_lite.xslt"/>
  92. <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  93. <xsl:stylesheet version="1.0"
  94. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  95. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  96. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  97. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  98. xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
  99. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  100. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  101. xmlns:dc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/confirm/1/"
  102. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  103. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  104. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  105. xmlns:out="http://www.w3.org/1999/XSL/Transform"
  106. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  107. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  108. xmlns:x="x"
  109. xmlns:rdb="http://developer.cognos.com/schemas/xts/rdb"
  110. exclude-result-prefixes="rdb xsl out cm lyt pf df dp dt cp dc cf utml x xts xtsext">
  111. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  112. <!-- morphlet -->
  113. <xsl:variable name="mname" select="'preferences/resequence.xts'"/>
  114. <!-- start the output -->
  115. <xsl:template match="/root">
  116. <xsl:variable name="browserTitle"><xts:string id="IDS_RESEQUENCE_TITLE"/></xsl:variable>
  117. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  118. <dp:meta>
  119. <pf:meta/>
  120. </dp:meta>
  121. <dp:script>
  122. <pf:help context=""/>
  123. <script language="javascript">
  124. <xsl:variable name="sharedPagesCount" select="count(/root/sharedPagesListForDisplay/pagelet)"/>
  125. var sharedPagesList = new Array();
  126. <xsl:for-each select="/root/sharedPagesListForDisplay/*">
  127. <xsl:variable name="name">
  128. <xsl:choose>
  129. <xsl:when test="string(cm:defaultName) != ''">
  130. <xsl:value-of select="cm:defaultName"/>
  131. </xsl:when>
  132. <xsl:otherwise>
  133. <xsl:text/>&lt;<xts:string id="IDS_PAGE_UNAVAILABLE"/><xsl:text/>&gt;<xsl:text/>
  134. </xsl:otherwise>
  135. </xsl:choose>
  136. </xsl:variable>
  137. sharedPagesList[<xsl:value-of select="(position() - 1)"/>] = new Array("<xsl:value-of select="$sharedPagesCount - (position() - 1)"/>","<xsl:value-of select="xtsext:javascriptencode(string($name))"/>", "<xsl:value-of select="cm:storeID"/>","");
  138. </xsl:for-each>
  139. //this will set the values for steps selectbox
  140. function setValues()
  141. {
  142. var selectList = document.pform.sharedPageSequence;
  143. var sortArray = sharedPagesList;
  144. if (selectList)
  145. {
  146. for (var i=0; i &lt; selectList.options.length; i++)
  147. {
  148. positionInArray = selectList[i].value;
  149. dispSeq = i+1;
  150. selectList[i].value = dispSeq + ',' + sortArray[positionInArray][2];
  151. selectList[i].selected = true;
  152. }
  153. }
  154. }
  155. </script>
  156. </dp:script>
  157. <utml:form name="pform" method="post" action="{$gateway}">
  158. <dp:header>
  159. <dp:title><xsl:value-of select="$browserTitle"/></dp:title>
  160. </dp:header>
  161. <!-- Intro text -->
  162. <dp:description><xts:string id="IDS_RESEQUENCE_DESCRIPTION"/></dp:description>
  163. <utml:input type="hidden" name="ifrmcmd" value="save" utml:update="false"/>
  164. <utml:input type="hidden" name="m_return" value="" utml:update="false"/>
  165. <utml:input type="hidden" name="sharedPagesChanged" value="resequence" utml:update="false"/>
  166. <utml:input name="m_pp_shared_pages" type="hidden" update="false">
  167. <xsl:attribute name="value">
  168. <xsl:variable name="markup"><xsl:apply-templates select="/root/sharedPagesListForDisplay" mode="markup"/></xsl:variable>
  169. <xsl:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string($markup),true()))"/>
  170. </xsl:attribute>
  171. </utml:input>
  172. <lyt:layout style="1" border="no" title="IDS_MP_RESEQUENCE" id="IDS_MP_RESEQUENCE">
  173. <lyt:section>
  174. <dp:list>
  175. <dp:section>
  176. <cf:sortList name="sharedPageSequence" form="pform" array="sharedPagesList" size="15" class="resequence" tLabel="IDS_MP_RESEQUENCE" aria-labelledby="IDS_MP_RESEQUENCE" >
  177. <cf:initContent>
  178. <xsl:for-each select="/root/sharedPagesListForDisplay/pagelet">
  179. <utml:option>
  180. <xsl:attribute name="value"><xsl:value-of select="(position() - 1)"/></xsl:attribute>
  181. <xsl:choose>
  182. <xsl:when test="string(cm:defaultName) != ''">
  183. <xsl:value-of select="xtsext:enforceBTD(cm:defaultName, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
  184. </xsl:when>
  185. <xsl:otherwise>
  186. <xsl:text/>&lt;<xts:string id="IDS_PAGE_UNAVAILABLE"/><xsl:text/>&gt;<xsl:text/>
  187. </xsl:otherwise>
  188. </xsl:choose>
  189. </utml:option>
  190. </xsl:for-each>
  191. </cf:initContent>
  192. </cf:sortList>
  193. </dp:section>
  194. </dp:list>
  195. </lyt:section>
  196. </lyt:layout>
  197. <!-- Footer -->
  198. <dp:footer>
  199. <xsl:choose>
  200. <xsl:when test="/root/env/param[@name= 'ps_nav_stack'] and (/root/env/param[@name= 'ps_nav_stack'] != '') ">
  201. <df:button df:id="IDS_OK" utml:validate="true" df:style="stack-down-save" onclick="javascript:setValues()"/>
  202. <df:button df:id="IDS_CANCEL" df:style="stack-down"/>
  203. </xsl:when>
  204. <xsl:otherwise>
  205. <df:button df:id="IDS_OK" utml:validate="true" df:style="submit" onclick="javascript:setValues()">
  206. <df:target>portal/submit.xts</df:target>
  207. </df:button>
  208. <df:button df:id="IDS_CANCEL" df:style="back-url"/>
  209. </xsl:otherwise>
  210. </xsl:choose>
  211. </dp:footer>
  212. </utml:form>
  213. </dp:page>
  214. </xsl:template>
  215. <!-- Generic templates -->
  216. <pf:variables/>
  217. <pf:serialize-xml/>
  218. <pf:gen-icon/>
  219. </xsl:stylesheet>
  220. </xts:block>
  221. <!-- debug -->
  222. <xts:block id="debug" dependency="resequencePage getContent" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  223. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  224. <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">
  225. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  226. <xsl:template match="/">
  227. <dbg:dumpxml select="/root"/>
  228. </xsl:template>
  229. </xsl:stylesheet>
  230. </xts:block>
  231. </xts:morphlet>