properties_metrics_import.xts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  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">
  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. getContent - get our data from Content Manager
  24. ===============================================================================================
  25. -->
  26. <xts:block id="getContent" processor="XSLT" type="exec" dependency="formlogic_init">
  27. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  28. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  29. <xsl:stylesheet version="1.0"
  30. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  31. xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
  32. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/">
  33. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  34. <xsl:template match="/">
  35. <xts:sequence>
  36. <xts:append>
  37. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  38. <send:request provider="cm">
  39. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  40. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  41. <cm:search>
  42. <xsl:value-of select="/root/env/param[@name='m_obj']"/>
  43. </cm:search>
  44. <cm:properties>
  45. <cm:property name="defaultName"/>
  46. <cm:property name="options"/>
  47. <cm:property name="owner"/>
  48. <cm:property name="permissions"/>
  49. <cm:property name="runAsOwner"/>
  50. </cm:properties>
  51. <cm:options schemaInfo="true">
  52. <cm:refProps>
  53. <cm:refProp refPropName="owner">
  54. <cm:properties>
  55. <cm:property name="searchPath"/>
  56. <cm:property name="defaultName"/>
  57. <cm:property name="email"/>
  58. </cm:properties>
  59. </cm:refProp>
  60. </cm:refProps>
  61. </cm:options>
  62. </cm:query>
  63. </xts:transform>
  64. </send:request>
  65. </xts:transform>
  66. </xts:append>
  67. </xts:sequence>
  68. </xsl:template>
  69. </xsl:stylesheet>
  70. </xts:block>
  71. <!--
  72. ===============================================================================================
  73. Produce default options under /root/env, but only on first visit to the page
  74. ===============================================================================================
  75. -->
  76. <xts:block id="generateDefaultOptions" processor="XSLT" type="exec" dependency="getContent" condition=".[not(/root/env/param[@name = 'visited_metrics_import_property'])]" mandatory="false">
  77. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  78. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  79. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  80. <xsl:variable name="the-object" select="/root/cm:queryResponse/*[1]"/>
  81. <xsl:template match="/">
  82. <xts:sequence>
  83. <xts:append select="/root/env">
  84. <xts:transform src="transforms/portal/options/generateParams.xslt" processor="XSLT">
  85. <xts:param name="messageBase">/messages/portal.xml</xts:param>
  86. <root>
  87. <xsl:copy-of select="$the-object/*[local-name()='options']"/>
  88. <defaultOptions>true</defaultOptions>
  89. </root>
  90. </xts:transform>
  91. <xsl:if test="$the-object/cm:runAsOwner!=''">
  92. <param name="m_re_runAsOwner">
  93. <xsl:value-of select="$the-object/cm:runAsOwner"/>
  94. </param>
  95. </xsl:if>
  96. </xts:append>
  97. </xts:sequence>
  98. </xsl:template>
  99. </xsl:stylesheet>
  100. </xts:block>
  101. <!--
  102. ===============================================================================================
  103. renderPage - render the page
  104. ===============================================================================================
  105. -->
  106. <xts:block id="renderPage" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="generateDefaultOptions getTabs">
  107. <xts:logicsheet path="logicsheets/portal.xsl"/>
  108. <xts:logicsheet path="logicsheets/presentation/dialog/ui-templates.xsl"/>
  109. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  110. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  111. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  112. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  113. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  114. <xts:logicsheet path="logicsheets/presentation/dialog/confirm.xslt"/>
  115. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  116. <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  117. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  118. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  119. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  120. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  121. xmlns:dc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/confirm/1/"
  122. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  123. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  124. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  125. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  126. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  127. xmlns:ut="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/ui-templates/"
  128. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  129. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  130. <!-- current file name -->
  131. <xsl:variable name="mname" select="'properties_metrics_import.xts'"/>
  132. <xsl:variable name="the-object" select="/root/cm:queryResponse/*[1]"/>
  133. <xsl:variable name="the-class" select="/root/cm:queryResponse/*[1]/cm:objectClass"/>
  134. <xsl:variable name="has_write_permission" select="contains(concat(' ', /root/cm:queryResponse/*[1]/cm:permissions, ' '), ' write ')"/>
  135. <xsl:variable name="has_policy_permission" select="contains(concat(' ', /root/cm:queryResponse/*[1]/cm:permissions, ' '), ' setPolicy ')"/>
  136. <xsl:variable name="showOKCancel" select="$has_write_permission or $has_policy_permission"/>
  137. <pf:variables/>
  138. <xsl:template match="/">
  139. <xsl:variable name="browserTitle"><xts:string id="IDS_PROPERTIES_TITLE"><xts:param name="objectName"><span lang="{$contentLocale}"><xsl:value-of select="key('env-param', 'm_name')"/></span></xts:param></xts:string></xsl:variable>
  140. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  141. <dp:meta>
  142. <pf:meta/> <!-- Standard meta tags -->
  143. </dp:meta>
  144. <!-- get passed in parameters -->
  145. <dp:script>
  146. <pf:help context="HID_PROPERTIES"/> <!-- Help system -->
  147. <xsl:if test="$has_write_permission = true()">
  148. <dc:confirm-cancel/>
  149. </xsl:if>
  150. </dp:script>
  151. <utml:form name="pform" method="post" action="{$gateway}">
  152. <utml:read-only>
  153. <xsl:choose>
  154. <xsl:when test="$has_write_permission = true()">
  155. <xsl:text>false</xsl:text>
  156. </xsl:when>
  157. <xsl:otherwise>
  158. <xsl:text>true</xsl:text>
  159. </xsl:otherwise>
  160. </xsl:choose>
  161. </utml:read-only>
  162. <utml:input type="hidden" name="ps_nav_op" value="" utml:update="false"/>
  163. <utml:input type="hidden" name="ifrmcmd" value="save" utml:update="false"/>
  164. <utml:input type="hidden" value="true" name="m_validate" utml:update="false"/>
  165. <utml:input type="hidden" value="true" name="visited_metrics_import_property" utml:update="false"/>
  166. <!-- dialog header -->
  167. <dp:header useBackURL="not($showOKCancel)">
  168. <!-- header titles-->
  169. <dp:title><xsl:copy-of select="$browserTitle"/></dp:title>
  170. </dp:header>
  171. <!-- property tabs -->
  172. <df:propertiesTabs select="metrics_import">
  173. <df:hasSetPolicy><xsl:value-of select="$has_policy_permission"/></df:hasSetPolicy>
  174. </df:propertiesTabs>
  175. <!-- description tabs -->
  176. <dp:description>
  177. <xsl:choose>
  178. <xsl:when test="$the-class='metricsFileImportTask'">
  179. <xts:string id="IDS_PROP_METRICS_FILE_IMPORT_INTRO"/>
  180. </xsl:when>
  181. <xsl:otherwise>
  182. <xts:string id="IDS_PROP_METRICS_DATASOURCE_IMPORT_INTRO"/>
  183. </xsl:otherwise>
  184. </xsl:choose>
  185. </dp:description>
  186. <lyt:layout style="1">
  187. <lyt:section>
  188. <ut:metricsImportOptionsUI/>
  189. </lyt:section>
  190. </lyt:layout>
  191. <lyt:layout style="1">
  192. <lyt:section>
  193. <!-- run as owner -->
  194. <dp:choice id="m_re_runAsOwnerGroup" title="IDS_OTHERRUN_RUN_AS_OWNER">
  195. <dp:section1>
  196. <utml:input type="checkbox" name="m_re_runAsOwner" value="true" utml:track="true" id="ctrl_m_re_runAsOwner"/>
  197. </dp:section1>
  198. <dp:section2 for="ctrl_m_re_runAsOwner">
  199. <dp:text>
  200. <xsl:choose>
  201. <xsl:when test="(key('env-param', 'm_defaultName')) and not(key('env-param', 'm_defaultName') = '')">
  202. <xsl:value-of select="key('env-param', 'm_defaultName')"/>
  203. </xsl:when>
  204. <xsl:when test="$the-object/cm:owner/*/cm:defaultName">
  205. <xsl:value-of select="$the-object/cm:owner/*/cm:defaultName"/>
  206. </xsl:when>
  207. <xsl:when test="$the-object/cm:owner/*/cm:email">
  208. <xsl:value-of select="$the-object/cm:owner/*/cm:email"/>
  209. </xsl:when>
  210. <xsl:when test="$the-object/cm:owner/cm:nil">
  211. <xts:string id="IDS_PROP_UNKNOWN_OWNER"/>
  212. </xsl:when>
  213. <xsl:otherwise>
  214. <xts:string id="IDS_NONE"/>
  215. </xsl:otherwise>
  216. </xsl:choose>
  217. </dp:text>
  218. </dp:section2>
  219. </dp:choice>
  220. </lyt:section>
  221. </lyt:layout>
  222. <dp:footer>
  223. <xsl:choose>
  224. <xsl:when test="$showOKCancel">
  225. <df:button df:id="IDS_OK" utml:validate="true" df:style="submit" df:nav_op="stack-down"/>
  226. <xsl:choose>
  227. <xsl:when test="key('env-param', 'ps_nav_stack') and not(key('env-param', 'ps_nav_stack') = '') ">
  228. <df:button df:id="IDS_CANCEL" df:style="stack-down" onclick="{$dc-confirm-cancel}"/>
  229. </xsl:when>
  230. <xsl:otherwise>
  231. <df:button df:id="IDS_CANCEL" df:style="back-url" onclick="{$dc-confirm-cancel}"/>
  232. </xsl:otherwise>
  233. </xsl:choose>
  234. </xsl:when>
  235. <xsl:otherwise>
  236. <df:button df:id="IDS_CLOSE" df:style="back-url"/>
  237. </xsl:otherwise>
  238. </xsl:choose>
  239. </dp:footer>
  240. </utml:form>
  241. </dp:page>
  242. </xsl:template>
  243. </xsl:stylesheet>
  244. </xts:block>
  245. <!--
  246. ===============================================================================================
  247. debug - display debug information
  248. ===============================================================================================
  249. -->
  250. <xts:block id="debug" dependency="renderPage" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  251. <!-- get the debug logic sheet -->
  252. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  253. <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">
  254. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  255. <xsl:template match="/">
  256. <dbg:dumpxml select="/root"/>
  257. </xsl:template>
  258. </xsl:stylesheet>
  259. </xts:block>
  260. </xts:morphlet>