properties_metrics_import _titan.xts 13 KB

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