properties_page_size.xts 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  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/" 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" resolverBase="prompting" requiredCapability="canUseAdministrationPortal">
  13. <!--
  14. ===============================================================================================
  15. formlogic_init
  16. Standard form logic initialization
  17. ===============================================================================================
  18. -->
  19. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  20. <!-- Load object-specific property tabs map ============================================================== -->
  21. <xts:block id="getTabs" type="exec" mode="interpret" processor="XML" path="/portal/uiobjects_tabs.xml"/>
  22. <!--
  23. ================================================================================
  24. get_content
  25. Retrieve the printer details from Content Manager.
  26. ================================================================================
  27. -->
  28. <xts:block id="get_content" processor="XSLT" type="exec" mode="interpret">
  29. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  30. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  31. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  32. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  33. <xsl:template match="/">
  34. <xts:sequence>
  35. <xts:append>
  36. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  37. <send:request provider="cm">
  38. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  39. <query xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  40. <search>
  41. <xsl:value-of select="key('env-param','m_obj')"/>
  42. <xsl:text>[permission('read')]</xsl:text>
  43. </search>
  44. <properties>
  45. <cm:property name="width"/>
  46. <cm:property name="height"/>
  47. <cm:property name="unit"/>
  48. <cm:property name="permissions"/>
  49. </properties>
  50. </query>
  51. </xts:transform>
  52. </send:request>
  53. </xts:transform>
  54. </xts:append>
  55. </xts:sequence>
  56. </xsl:template>
  57. </xsl:stylesheet>
  58. </xts:block>
  59. <!--
  60. ================================================================================
  61. render_page
  62. Render the HTML page.
  63. ================================================================================
  64. -->
  65. <xts:block id="render_page" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="get_content formlogic_init getTabs">
  66. <!-- portal specific information -->
  67. <xts:logicsheet path="logicsheets/portal.xsl"/>
  68. <!-- get the presentation theme -->
  69. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  70. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  71. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  72. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  73. <xts:logicsheet path="logicsheets/presentation/dialog/confirm.xslt"/>
  74. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  75. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  76. <!-- apply the form logic -->
  77. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  78. <xts:logicsheet path="logicsheets/validation.xslt"/>
  79. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  80. <xsl:stylesheet version="1.0"
  81. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  82. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  83. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  84. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  85. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  86. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  87. xmlns:dc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/confirm/1/"
  88. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  89. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  90. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  91. xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
  92. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl cm pf df dp dc lyt utml cp cf xtsext dt">
  93. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  94. <!-- current file name -->
  95. <xsl:variable name="mname" select="'properties_page_size.xts'"/>
  96. <xsl:variable name="promptLocale" select="$productLocale"/>
  97. <xsl:variable name="promptFormName" select="'pform'"/>
  98. <xsl:variable name="skin" select="key('user-param', 'skin')"/>
  99. <!-- add any theme variables -->
  100. <pf:variables/>
  101. <!-- Prompt Control XSL include -->
  102. <xsl:include href="p_include.xsl"/>
  103. <xsl:variable name="object" select="/root/cm:queryResponse/*"/>
  104. <!-- start the output -->
  105. <xsl:template match="/root">
  106. <!-- get passed in parameters -->
  107. <xsl:variable name="canWrite" select="contains(concat(' ',$object/cm:permissions,' '),' write ')"/>
  108. <xsl:variable name="canSetPolicy" select="contains(concat(' ', $object/cm:permissions, ' '), ' setPolicy ')"/>
  109. <xsl:variable name="showOKCancel" select="$canWrite or $canSetPolicy"/>
  110. <xsl:variable name="browserTitle">
  111. <xts:string id="IDS_PROPERTIES_TITLE">
  112. <xts:param name="objectName">
  113. <span lang="{$contentLocale}"><xsl:value-of select="/root/env/param[@name='m_name']"/></span>
  114. </xts:param>
  115. </xts:string>
  116. </xsl:variable>
  117. <pf:dojo>
  118. <require>com.ibm.cognos.ps.propertiesPageSize</require>
  119. </pf:dojo>
  120. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  121. <dp:meta>
  122. <!-- Standard meta tags -->
  123. <pf:meta/>
  124. </dp:meta>
  125. <dp:script>
  126. <!-- Help system -->
  127. <pf:help/>
  128. <xsl:if test="$canWrite">
  129. <xsl:call-template name="getPromptCommonIncludes"/>
  130. <xsl:call-template name="gettextBoxIncludes">
  131. <xsl:with-param name="promptLocale" select="$promptLocale"/>
  132. <xsl:with-param name="promptContentLocale" select="$contentLocale"/>
  133. </xsl:call-template>
  134. <dt:FloatTextBoxJavaScript/>
  135. <script language="javascript">
  136. <xsl:variable name="label_printerAddress">
  137. <xts:string id="IDS_PRINTER_ADDRESS" encode="javascript"/>
  138. </xsl:variable>
  139. <xsl:variable name="errmsg">
  140. <xts:string id="IDS_ERR_MANDATORY" encode="javascript">
  141. <xts:param name="field">' + label + '</xts:param>
  142. </xts:string>
  143. </xsl:variable>
  144. function init() {
  145. com.ibm.cognos.ps.propertiesPageSize.instance = new com.ibm.cognos.ps.propertiesPageSize(window,document.pform,{
  146. 'IDS_ERR_NON_NEGATIVE':'<xts:string id="IDS_ERR_NON_NEGATIVE" encode="javascript"/>'
  147. }
  148. );
  149. }
  150. function validate() {
  151. return com.ibm.cognos.ps.propertiesPageSize.instance.validate();
  152. }
  153. </script>
  154. <dc:confirm-cancel/>
  155. <script language="javascript" src="{$webcontent}/{$app}/js/utilities.js"/>
  156. </xsl:if>
  157. </dp:script>
  158. <utml:form name="pform" method="post" action="{$gateway}">
  159. <utml:read-only>
  160. <xsl:choose>
  161. <xsl:when test="$canWrite">false</xsl:when>
  162. <xsl:otherwise>true</xsl:otherwise>
  163. </xsl:choose>
  164. </utml:read-only>
  165. <utml:exclusion-list>m_p_width m_p_height _FLOATDISPLAY_m_p_width _FLOATDISPLAY_m_p_height</utml:exclusion-list>
  166. <!--
  167. this defines the form command operation to be performed when all the collected properties are submitted.
  168. -->
  169. <utml:input type="hidden" name="ifrmcmd" value="save" utml:update="false"/>
  170. <!-- dialog header -->
  171. <dp:header useBackURL="not($showOKCancel)">
  172. <!-- header titles-->
  173. <dp:title>
  174. <xsl:copy-of select="$browserTitle"/>
  175. </dp:title>
  176. </dp:header>
  177. <!-- property tabs -->
  178. <df:propertiesTabs select="page_size">
  179. <df:hasSetPolicy>
  180. <xsl:value-of select="$canSetPolicy"/>
  181. </df:hasSetPolicy>
  182. </df:propertiesTabs>
  183. <!-- description tabs -->
  184. <dp:description>
  185. <xts:string id="IDS_PROP_PAGE_SIZE_INTRO"/>
  186. </dp:description>
  187. <lyt:layout style="1">
  188. <lyt:section>
  189. <xsl:variable name="widthValue">
  190. <xsl:choose>
  191. <xsl:when test="key('env-param','m_p_width') and key('env-param','m_p_width')!=''"><xsl:value-of select="string(key('env-param','m_p_width'))"/></xsl:when>
  192. <xsl:otherwise><xsl:value-of select="string(/root/cm:queryResponse/child::node()/cm:width)"/></xsl:otherwise>
  193. </xsl:choose>
  194. </xsl:variable>
  195. <xsl:variable name="heightValue">
  196. <xsl:choose>
  197. <xsl:when test="key('env-param','m_p_height') and key('env-param','m_p_height')!=''"><xsl:value-of select="string(key('env-param','m_p_height'))"/></xsl:when>
  198. <xsl:otherwise><xsl:value-of select="string(/root/cm:queryResponse/child::node()/cm:height)"/></xsl:otherwise>
  199. </xsl:choose>
  200. </xsl:variable>
  201. <xsl:call-template name="paperSizeInputFields">
  202. <xsl:with-param name="widthValue" select="$widthValue"/>
  203. <xsl:with-param name="heightValue" select="$heightValue"/>
  204. <xsl:with-param name="utml-form-name" select="$utml-form-name"/>
  205. <xsl:with-param name="form-read-only" select="$form-read-only"/>
  206. <xsl:with-param name="isUnitInchSelected" select="/root/cm:queryResponse/child::node()/cm:unit = 'in'"/>
  207. <xsl:with-param name="isUnitCentimeterSelected" select="/root/cm:queryResponse/child::node()/cm:unit = 'cm'"/>
  208. </xsl:call-template>
  209. </lyt:section>
  210. </lyt:layout>
  211. <dp:footer>
  212. <xsl:choose>
  213. <xsl:when test="$showOKCancel">
  214. <df:button df:id="IDS_OK" utml:validate="true" df:style="submit"/>
  215. <xsl:choose>
  216. <xsl:when test="key('env-param', 'ps_nav_stack') and not(key('env-param', 'ps_nav_stack') = '') ">
  217. <df:button df:id="IDS_CANCEL" df:style="stack-down" onclick="{$dc-confirm-cancel}"/>
  218. </xsl:when>
  219. <xsl:otherwise>
  220. <df:button df:id="IDS_CANCEL" df:style="back-url" onclick="{$dc-confirm-cancel}"/>
  221. </xsl:otherwise>
  222. </xsl:choose>
  223. </xsl:when>
  224. <xsl:otherwise>
  225. <df:button df:id="IDS_CLOSE" df:style="back-url"/>
  226. </xsl:otherwise>
  227. </xsl:choose>
  228. </dp:footer>
  229. </utml:form>
  230. </dp:page>
  231. </xsl:template>
  232. <dt:paperSizeInputFields/>
  233. <dt:localizedFloatTextBox/>
  234. </xsl:stylesheet>
  235. </xts:block>
  236. <!--
  237. ===============================================================================================
  238. debug - display debug information
  239. ===============================================================================================
  240. -->
  241. <xts:block id="debug" dependency="render_page" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  242. <!-- get the debug logic sheet -->
  243. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  244. <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">
  245. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  246. <xsl:template match="/">
  247. <dbg:dumpxml select="/root"/>
  248. </xsl:template>
  249. </xsl:stylesheet>
  250. </xts:block>
  251. </xts:morphlet>