modify_sequence.xts 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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, 2013
  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">
  13. <!--
  14. ===============================================================================================
  15. formlogic_init - standard form logic initialization
  16. ===============================================================================================
  17. -->
  18. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  19. <!-- Content Request =========================================================== -->
  20. <xts:block id="getContent" processor="XSLT" type="exec">
  21. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  22. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  23. <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="no"/>
  24. <xsl:variable name="query-values" select="/root/env/param"/>
  25. <xsl:template match="/">
  26. <!-- Either unpack the list or retrieve the jobSteps -->
  27. <xts:sequence>
  28. <xts:append>
  29. <xsl:choose>
  30. <xsl:when test="$query-values[@name = 'jobSteps']">
  31. <xsl:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap',string( $query-values[@name = 'jobSteps'] )), true() )" disable-output-escaping="yes"/>
  32. </xsl:when>
  33. <!-- not steps defined yet. -->
  34. <xsl:otherwise>
  35. <steps>
  36. <queryResponse xmlns="http://developer.cognos.com/schemas/xts-cm/1/"/>
  37. </steps>
  38. </xsl:otherwise>
  39. </xsl:choose>
  40. </xts:append>
  41. </xts:sequence>
  42. </xsl:template>
  43. </xsl:stylesheet>
  44. </xts:block>
  45. <xts:block id="format" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="formlogic_init getContent">
  46. <!-- get the ContentManager logic sheet -->
  47. <!-- portal specific information -->
  48. <xts:logicsheet path="logicsheets/portal.xsl"/>
  49. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  50. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  51. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  52. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  53. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  54. <!-- apply the form logic -->
  55. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  56. <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  57. <xsl:stylesheet version="1.0"
  58. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  59. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  60. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  61. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  62. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  63. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  64. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  65. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  66. xmlns:st="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/specializetabs/"
  67. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  68. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  69. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  70. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  71. xmlns:x="x"
  72. exclude-result-prefixes="xsl cm cml df dp pf bus utml xtsext">
  73. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  74. <!-- current file name -->
  75. <xsl:variable name="mname" select="'modify_sequence.xts'"/>
  76. <!-- add any theme variables -->
  77. <pf:variables/>
  78. <xsl:variable name="stepsCount" select="count(/root/steps/cm:queryResponse/cm:jobStepDefinition[not(x:deleted)])"/>
  79. <xsl:variable name="inWizard" select="key('env-param', 'm_new_class') != ''"/>
  80. <!-- start the output -->
  81. <xsl:template match="/root">
  82. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$product_name">
  83. <dp:meta>
  84. <pf:meta/>
  85. <!-- Standard meta tags -->
  86. </dp:meta>
  87. <dp:script>
  88. <pf:help context="HID_SCHEDULE_MULTIPLE"/>
  89. <!-- Help system -->
  90. <script language="javascript">
  91. var stepsOptionList = new Array();
  92. <xsl:for-each select="steps/cm:queryResponse/cm:jobStepDefinition[not(x:deleted)]/cm:stepObject/*">
  93. <xsl:variable name="pathStr">
  94. <cf:do-the-path-link>
  95. <cf:param name="familytree">cm:ancestors</cf:param>
  96. <cf:param name="familymember">cm:defaultName</cf:param>
  97. <cf:param name="onlyAncestors">true</cf:param>
  98. </cf:do-the-path-link>
  99. </xsl:variable>
  100. <xsl:variable name="displayStr">
  101. <xts:string id="IDS_MODIFY_STEPS_SEQUENCE_OPTIONS">
  102. <xts:param name="obj_name">
  103. <xsl:value-of select="cm:defaultName"/>
  104. </xts:param>
  105. <xts:param name="obj_path">
  106. <xsl:value-of select="normalize-space($pathStr)"/>
  107. </xts:param>
  108. </xts:string>
  109. </xsl:variable>
  110. stepsOptionList[<xsl:value-of select="(position() - 1)"/>] = new Array("<xsl:value-of select="$stepsCount - (position() - 1)"/>", "<xsl:value-of select="xtsext:javascriptencode(normalize-space(string($displayStr)))"/>", "<xsl:value-of select="xtsext:javascriptencode(string(parent::*/parent::*/x:guid))"/>", "", "<xsl:value-of select="xtsext:javascriptencode(string(cm:defaultName))"/>", "");
  111. </xsl:for-each>
  112. //set all the values to zero
  113. function resetToZero(what, sortArray)
  114. {
  115. sortList(what, sortArray, 'a4');
  116. for (var i=0; i &lt; what.options.length; i++)
  117. {
  118. sortArray[what[i].value][0] = 0;
  119. what[i].selected = false;
  120. }
  121. }
  122. //this will set the values for steps selectbox
  123. function setValues()
  124. {
  125. var selectList = document.pform.entriesSortOrder;
  126. var sortArray = stepsOptionList;
  127. if (selectList)
  128. {
  129. for (var i=0; i &lt; selectList.options.length; i++)
  130. {
  131. positionInArray = selectList[i].value;
  132. dispSeq = i+1;
  133. selectList[i].value = dispSeq + ',' + sortArray[positionInArray][2];
  134. selectList[i].selected = true;
  135. }
  136. }
  137. }
  138. </script>
  139. </dp:script>
  140. <utml:form name="pform" method="post" action="{$gateway}">
  141. <utml:input type="hidden" name="ps_nav_op" value="" utml:update="false"/>
  142. <utml:input type="hidden" name="ifrmcmd" value="save" utml:update="false"/>
  143. <utml:input name="modifySequence" type="hidden" value="true"/>
  144. <!-- dialog header -->
  145. <dp:header>
  146. <!-- header titles-->
  147. <dp:title>
  148. <xsl:variable name="object-name">
  149. <xsl:choose>
  150. <xsl:when test="$inWizard">
  151. <xts:string id="IDS_ADDENTRIES_TITLE_NEW_JOB"/>
  152. </xsl:when>
  153. <xsl:otherwise>
  154. <xsl:value-of select="key('env-param', 'm_name')"/>
  155. </xsl:otherwise>
  156. </xsl:choose>
  157. </xsl:variable>
  158. <xts:string id="IDS_MODIFY_STEPS_SEQUENCE_TITLE">
  159. <xts:param name="obj_name">
  160. <span>
  161. <xsl:if test="not($inWizard)">
  162. <xsl:attribute name="lang"><xsl:value-of select="$contentLocale"/></xsl:attribute>
  163. </xsl:if>
  164. <xsl:value-of select="xtsext:enforceBTD($object-name, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
  165. </span>
  166. </xts:param>
  167. </xts:string>
  168. </dp:title>
  169. </dp:header>
  170. <lyt:layout style="1" border="no">
  171. <lyt:section>
  172. <xsl:if test="steps/cm:queryResponse/cm:jobStepDefinition[not(x:deleted)]">
  173. <dp:list title="IDS_PROP_JOB_STEPS_LABEL" for="ctrl_entriesSortOrder">
  174. <dp:text width="100%">
  175. <cf:sortList name="entriesSortOrder" form="pform" array="stepsOptionList" size="15" id="ctrl_entriesSortOrder">
  176. <cf:initContent>
  177. <xsl:for-each select="steps/cm:queryResponse/cm:jobStepDefinition[not(x:deleted)]/cm:stepObject/*">
  178. <xsl:variable name="pathStr">
  179. <cf:do-the-path-link>
  180. <cf:param name="familytree">cm:ancestors</cf:param>
  181. <cf:param name="familymember">cm:defaultName</cf:param>
  182. <cf:param name="onlyAncestors">true</cf:param>
  183. </cf:do-the-path-link>
  184. </xsl:variable>
  185. <utml:option>
  186. <xsl:attribute name="value"><xsl:value-of select="(position() - 1)"/></xsl:attribute>
  187. <xsl:attribute name="lang"><xsl:value-of select="$contentLocale"/></xsl:attribute>
  188. <xts:string id="IDS_MODIFY_STEPS_SEQUENCE_OPTIONS">
  189. <xts:param name="obj_name">
  190. <xsl:value-of select="xtsext:enforceBTD(cm:defaultName, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
  191. </xts:param>
  192. <xts:param name="obj_path">
  193. <xsl:value-of select="normalize-space($pathStr)"/>
  194. </xts:param>
  195. </xts:string>
  196. <xsl:text/>
  197. </utml:option>
  198. </xsl:for-each>
  199. </cf:initContent>
  200. </cf:sortList>
  201. </dp:text>
  202. </dp:list>
  203. </xsl:if>
  204. </lyt:section>
  205. </lyt:layout>
  206. <dp:footer>
  207. <df:button df:id="IDS_OK" utml:validate="false" df:style="stack-down-save" onclick="javascript:setValues()"/>
  208. <df:button df:id="IDS_CANCEL" df:style="stack-down"/>
  209. </dp:footer>
  210. </utml:form>
  211. </dp:page>
  212. </xsl:template>
  213. </xsl:stylesheet>
  214. </xts:block>
  215. <!--
  216. ===============================================================================================
  217. debug - display debug information
  218. ===============================================================================================
  219. -->
  220. <xts:block id="debug" dependency="format" condition=".[/root/session/param[@name='debug'] = '1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  221. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  222. <!-- debug logic sheet -->
  223. <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">
  224. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  225. <dbg:templates/>
  226. <!-- add any debug templates -->
  227. <xsl:template match="/">
  228. <dbg:dumpxml select="/root"/>
  229. </xsl:template>
  230. </xsl:stylesheet>
  231. </xts:block>
  232. </xts:morphlet>