properties_skin.xts 12 KB

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