properties_powerplay_run_options.xts 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  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" includeConfig="true">
  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. <!-- Load object-specific property tabs map ============================================================== -->
  20. <xts:block id="getTabs" type="exec" mode="interpret" processor="XML" path="/portal/uiobjects_tabs.xml"/>
  21. <!--
  22. ===============================================================================================
  23. getObjects - get object class names
  24. ===============================================================================================
  25. -->
  26. <xts:block id="classNames" type="exec" mode="input" processor="XML" path="/portal/uiExtensions.xml">
  27. <xts:logicsheet path="/logicsheets/uiobjects/uiobjects_names.xslt"/>
  28. </xts:block>
  29. <!--
  30. ===============================================================================================
  31. getContent - get our data from Content Manager
  32. ===============================================================================================
  33. -->
  34. <xts:block id="getContent" processor="XSLT" type="exec" dependency="formlogic_init">
  35. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  36. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  37. <xsl:stylesheet version="1.0"
  38. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  39. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  40. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/">
  41. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  42. <xsl:template match="/">
  43. <xts:sequence>
  44. <xts:append>
  45. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  46. <send:request provider="cm">
  47. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  48. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  49. <cm:search>
  50. <xsl:value-of select="/root/env/param[@name='m_obj']"/>
  51. </cm:search>
  52. <cm:properties>
  53. <cm:property name="defaultName"/>
  54. <cm:property name="permissions"/>
  55. <cm:property name="hasPrompts"/>
  56. <cm:property name="options"/>
  57. <cm:property name="defaultPortalAction"/>
  58. </cm:properties>
  59. <cm:options schemaInfo="true" maxObjects="1"/>
  60. </cm:query>
  61. </xts:transform>
  62. </send:request>
  63. </xts:transform>
  64. </xts:append>
  65. </xts:sequence>
  66. </xsl:template>
  67. </xsl:stylesheet>
  68. </xts:block>
  69. <!--
  70. ===============================================================================================
  71. renderPage - render the page
  72. ===============================================================================================
  73. -->
  74. <xts:block id="renderPage" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="getContent getTabs classNames">
  75. <xts:logicsheet path="logicsheets/portal.xsl"/>
  76. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  77. <xts:logicsheet path="logicsheets/presentation/dialog/ui-templates.xsl"/>
  78. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  79. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  80. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  81. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  82. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  83. <xts:logicsheet path="logicsheets/presentation/dialog/confirm.xslt"/>
  84. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  85. <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  86. <xsl:stylesheet version="1.0"
  87. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  88. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  89. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  90. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  91. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  92. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  93. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  94. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  95. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  96. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  97. xmlns:ut="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/ui-templates/"
  98. xmlns:dc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/confirm/1/"
  99. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  100. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  101. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  102. xmlns:thm="http://developer.cognos.com/schemas/xts/logicsheets/xslt/theme/"
  103. exclude-result-prefixes="xsl cf cp df dp dc lyt cm cml thm utml xtsext ut">
  104. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  105. <!-- current file name -->
  106. <xsl:variable name="mname" select="'properties_powerplay_run_options.xts'"/>
  107. <xsl:variable name="has_write_permission" select="contains(concat(' ', /root/cm:queryResponse/*[position()=1]/cm:permissions, ' '), ' write ')"/>
  108. <xsl:variable name="has_policy_permission" select="contains(concat(' ', /root/cm:queryResponse/*[position()=1]//cm:permissions, ' '), ' setPolicy ')"/>
  109. <xsl:variable name="showOKCancel" select="$has_write_permission or $has_policy_permission"/>
  110. <pf:variables/>
  111. <cml:single-object/>
  112. <!-- start the output -->
  113. <xsl:template match="/root">
  114. <xsl:variable name="browserTitle">
  115. <xts:string id="IDS_PROPERTIES_TITLE">
  116. <xts:param name="objectName">
  117. <span lang="{$contentLocale}"><xsl:value-of select="xtsext:enforceBTD(key('env-param', 'm_name'), $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/></span>
  118. </xts:param>
  119. </xts:string>
  120. </xsl:variable>
  121. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  122. <dp:meta>
  123. <pf:meta/> <!-- Standard meta tags -->
  124. </dp:meta>
  125. <!-- get passed in parameters -->
  126. <dp:script>
  127. <pf:help context="HID_PP_RUN_OPTIONS"/> <!-- Help system -->
  128. <xsl:if test="$has_write_permission = true()">
  129. <script language="javascript">
  130. function init()
  131. {
  132. var frm = document.pform;
  133. frm.m.value = 'portal/properties_powerplay_run_options.xts';
  134. frm.method.value="";
  135. }
  136. </script>
  137. <dc:confirm-cancel/>
  138. </xsl:if>
  139. </dp:script>
  140. <utml:form name="pform" method="post" action="{$gateway}">
  141. <utml:read-only>
  142. <xsl:choose>
  143. <xsl:when test="$has_write_permission = true()">
  144. <xsl:text>false</xsl:text>
  145. </xsl:when>
  146. <xsl:otherwise>
  147. <xsl:text>true</xsl:text>
  148. </xsl:otherwise>
  149. </xsl:choose>
  150. </utml:read-only>
  151. <!--
  152. add a hidden input for the 'ps_nav_op', doing this will define the default behavior when submitting
  153. this form, we don't want the operation set when tabing, so set it to empty here. ideally this would
  154. be done by the tabbing itself, but since it's done in the theme stuff (and can't use utml) we'll just do
  155. it here.
  156. -->
  157. <utml:input type="hidden" name="ps_nav_op" value="" utml:update="false"/>
  158. <!--
  159. this defines the form command operation to be performed when all the collected properties are submitted.
  160. -->
  161. <utml:input type="hidden" name="ifrmcmd" value="save" utml:update="false"/>
  162. <!-- dialog header -->
  163. <dp:header useBackURL="not($showOKCancel)">
  164. <!-- header titles-->
  165. <dp:title><xsl:copy-of select="$browserTitle"/></dp:title>
  166. </dp:header>
  167. <!-- property tabs -->
  168. <df:propertiesTabs select="run_options">
  169. <df:hasSetPolicy><xsl:value-of select="$has_policy_permission"/></df:hasSetPolicy>
  170. </df:propertiesTabs>
  171. <!-- description tabs -->
  172. <dp:description>
  173. <xts:string id="IDS_PROP_RUN_INTRO"/>
  174. </dp:description>
  175. <!-- get the format saved in CM. -->
  176. <xsl:variable name="savedOutputFormat">
  177. <xsl:value-of select="/root/cm:queryResponse/cm:powerPlayReport/cm:options/cm:powerPlayOptionOutputFormat[cm:name='outputFormat']/cm:value"/>
  178. </xsl:variable>
  179. <!-- used by ut:propDefaultActionSection template -->
  180. <xsl:variable name="defaultAction">
  181. <xsl:choose>
  182. <xsl:when test="$savedOutputFormat != ''">
  183. <xsl:choose>
  184. <xsl:when test="$savedOutputFormat = 'html' or $savedOutputFormat = 'HTML'"><xsl:value-of select="'edit'"/></xsl:when>
  185. <xsl:when test="$savedOutputFormat = 'pdf' or $savedOutputFormat = 'PDF'"><xsl:value-of select="'run'"/></xsl:when>
  186. </xsl:choose>
  187. </xsl:when>
  188. <xsl:when test="key('env-param', 'm_p_defaultPortalAction') and key('env-param', 'm_p_defaultPortalAction') != ''">
  189. <xsl:value-of select="key('env-param', 'm_p_defaultPortalAction')"/>
  190. </xsl:when>
  191. <xsl:when test="/root/cm:queryResponse/*[position()=1]/cm:defaultPortalAction != ''">
  192. <xsl:value-of select="/root/cm:queryResponse/*[position()=1]/cm:defaultPortalAction"/>
  193. </xsl:when>
  194. <xsl:otherwise>
  195. <xsl:value-of select="'run'"/>
  196. </xsl:otherwise>
  197. </xsl:choose>
  198. </xsl:variable>
  199. <!-- used by ut:propDefaultActionSection template -->
  200. <xsl:variable name="studioName">
  201. <xts:string id="IDS_TOOLS_REPORT"/>
  202. </xsl:variable>
  203. <lyt:layout style="1">
  204. <!-- default action section -->
  205. <lyt:section>
  206. <ut:propDefaultActionSection/>
  207. </lyt:section>
  208. <!-- deprecated property that needs to be set to blank -->
  209. <xsl:if test="$savedOutputFormat != ''">
  210. <utml:input name="m_ppro_outputFormat" utml:track="true" value=""/>
  211. </xsl:if>
  212. <!-- PowerPlay Studio options -->
  213. <lyt:section>
  214. <xsl:variable name="design_checked">
  215. <xsl:choose>
  216. <xsl:when test="key('env-param', 'm_ppro_data') = 'previewWithNoData'">true</xsl:when>
  217. <xsl:when test="/root/cm:queryResponse/cm:powerPlayReport/cm:options/cm:powerPlayOptionData[cm:name='data']/cm:value = 'previewWithNoData' and not(key('env-param','changed_m_ppro_data'))">true</xsl:when>
  218. <xsl:otherwise>false</xsl:otherwise>
  219. </xsl:choose>
  220. </xsl:variable>
  221. <dp:choice title="IDS_PROP_RUN_POWERPLAY_STUDIO_OPTION">
  222. <dp:section1>
  223. <utml:input type="checkbox" name="m_ppro_data" value="previewWithNoData" utml:track="true" utml:default-condition="$design_checked='true'">
  224. </utml:input>
  225. </dp:section1>
  226. <dp:section2>
  227. <xts:string id="IDS_PROP_RUN_OPEN_DESIGN"/>
  228. </dp:section2>
  229. </dp:choice>
  230. </lyt:section>
  231. <!-- Prompt for values -->
  232. <lyt:section>
  233. <!-- only show the prompt section if the powerPlayReport has prompts -->
  234. <xsl:if test="/root/cm:queryResponse/cm:powerPlayReport/cm:hasPrompts = 'true'">
  235. <xsl:variable name="prompt_checked">
  236. <xsl:choose>
  237. <xsl:when test="key('env-param', 'm_ppro_prompt') = 'true'">true</xsl:when>
  238. <xsl:when test="/root/cm:queryResponse/cm:powerPlayReport/cm:options/cm:powerPlayOptionBoolean[cm:name='prompt']/cm:value = 'true' and not(key('env-param','changed_m_ppro_prompt'))">true</xsl:when>
  239. <xsl:otherwise>false</xsl:otherwise>
  240. </xsl:choose>
  241. </xsl:variable>
  242. <dp:choice title="IDS_PROP_RUN_PROMPT">
  243. <dp:section1>
  244. <utml:input type="checkbox" value="true" name="m_ppro_prompt" utml:track="true" utml:default-condition="$prompt_checked='true'">
  245. </utml:input>
  246. </dp:section1>
  247. <dp:section2>
  248. <xts:string id="IDS_PROP_RUN_PROMPT_VALUES"/>
  249. </dp:section2>
  250. </dp:choice>
  251. </xsl:if>
  252. </lyt:section>
  253. </lyt:layout>
  254. <dp:footer>
  255. <xsl:choose>
  256. <xsl:when test="$showOKCancel">
  257. <df:button df:id="IDS_OK" utml:validate="true" df:style="submit" df:nav_op="stack-down"/>
  258. <xsl:choose>
  259. <xsl:when test="key('env-param', 'ps_nav_stack') and not(key('env-param', 'ps_nav_stack') = '') ">
  260. <df:button df:id="IDS_CANCEL" df:style="stack-down" onclick="{$dc-confirm-cancel}"/>
  261. </xsl:when>
  262. <xsl:otherwise>
  263. <df:button df:id="IDS_CANCEL" df:style="back-url" onclick="{$dc-confirm-cancel}"/>
  264. </xsl:otherwise>
  265. </xsl:choose>
  266. </xsl:when>
  267. <xsl:otherwise>
  268. <df:button df:id="IDS_CLOSE" df:style="back-url"/>
  269. </xsl:otherwise>
  270. </xsl:choose>
  271. </dp:footer>
  272. </utml:form>
  273. </dp:page>
  274. </xsl:template>
  275. </xsl:stylesheet>
  276. </xts:block>
  277. <!--
  278. ===============================================================================================
  279. debug - display debug information
  280. ===============================================================================================
  281. -->
  282. <xts:block id="debug" dependency="renderPage" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  283. <!-- get the debug logic sheet -->
  284. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  285. <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">
  286. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  287. <xsl:template match="/">
  288. <dbg:dumpxml select="/root"/>
  289. </xsl:template>
  290. </xsl:stylesheet>
  291. </xts:block>
  292. </xts:morphlet>