new_drillthru_def2.xts 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. *****************************************************************
  4. ** Licensed Materials - Property of IBM
  5. **
  6. ** IBM Cognos Products: drill
  7. **
  8. ** (C) Copyright IBM Corp. 2001, 2015
  9. **
  10. ** US Government Users Restricted Rights - Use, duplication or
  11. ** disclosure restricted by GSA ADP Schedule Contract with
  12. ** IBM Corp.
  13. *****************************************************************
  14. -->
  15. <!--
  16. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  17. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  18. -->
  19. <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,messages/drill.xml">
  20. <!--
  21. ===============================================================================================
  22. formlogic_init - standard form logic initialization
  23. ===============================================================================================
  24. -->
  25. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  26. <xts:block id="cleandrill" type="exec" mode="interpret" processor="XSLT" path="/portal/drillthru/common/response/cleandrill.xslt" dependency="formlogic_init" condition=".[/root/env/param[@name='dp_path'] or /root/env/param[@name='selected_path'] or /root/env/param[@name='selected_scope'] or /root/env/param[@name='m_p_target']]" mandatory="false">
  27. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  28. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  29. </xts:block>
  30. <!--
  31. ===============================================================================================
  32. renderPage - render the page
  33. ===============================================================================================
  34. -->
  35. <xts:block id="render_page" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="formlogic_init cleandrill">
  36. <!-- get the presentation theme -->
  37. <xts:logicsheet path="logicsheets/portal.xsl"/>
  38. <xts:logicsheet path="portal/drillthru/common/response/target.xslt"/>
  39. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  40. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  41. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  42. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  43. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  44. <!-- apply the form logic -->
  45. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  46. <xts:logicsheet path="logicsheets/validation.xslt"/>
  47. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  48. <xsl:stylesheet version="1.0"
  49. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  50. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  51. xmlns:xtsdrillext="xalan://com.cognos.drill.ext.XTSExt"
  52. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  53. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  54. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  55. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  56. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  57. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  58. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  59. xmlns:x="x"
  60. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  61. xmlns:rdb="http://developer.cognos.com/schemas/xts/rdb"
  62. exclude-result-prefixes="xsl cm cf cp pf df dp lyt utml x rdb">
  63. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  64. <!-- current file name -->
  65. <xsl:variable name="mname" select="'new_drillthru_def2.xts'"/>
  66. <!-- add any theme variables -->
  67. <pf:variables/>
  68. <!-- Required for popup menus -->
  69. <cp:flyoutControl/>
  70. <!-- start the output -->
  71. <xsl:template match="/root">
  72. <xsl:variable name="backURL" select="key('env-param','backURL')"/>
  73. <xsl:variable name="wizardTitle">
  74. <xts:string id="IDS_NEW_DRILLPATH_TITLE"/>
  75. </xsl:variable>
  76. <xsl:variable name="browserTitle">
  77. <xsl:text/><xts:string id="IDS_NEW_TITLE_DRILLPATH_SCOPE">
  78. <xts:param name="wizardTitle"><xsl:value-of select="$wizardTitle"/></xts:param>
  79. </xts:string><xsl:text/>
  80. </xsl:variable>
  81. <xsl:variable name="pageDescription">
  82. <xsl:text/>
  83. <xsl:choose>
  84. <!-- Messages are different when abacab is installed -->
  85. <xsl:when test="($userCanUsePPS)">
  86. <xts:string id="WIZ_NEW_INTRO_DRILLPATH_SCOPE_ABACAB"/>
  87. </xsl:when>
  88. <xsl:otherwise>
  89. <xts:string id="WIZ_NEW_INTRO_DRILLPATH_SCOPE"/>
  90. </xsl:otherwise>
  91. </xsl:choose>
  92. <xsl:text/>
  93. </xsl:variable>
  94. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text>
  95. <dp:page longTitle="$browserTitle">
  96. <dp:meta>
  97. <!-- Standard meta tags -->
  98. <pf:meta/>
  99. </dp:meta>
  100. <dp:script>
  101. <script language="javascript"><![CDATA[
  102. function doCancel()
  103. {
  104. window.external.OnClose(1);
  105. }
  106. ]]>
  107. function validate()
  108. {
  109. if( !document.pform.m_p_target || document.pform.m_p_target.value == '')
  110. {
  111. alert("<xts:string id="IDS_PROP_DRILLPATH_SPECIFY_TARGET"/>");
  112. return false;
  113. }
  114. return true;
  115. }
  116. /*
  117. This function is used to call makeSelection with targetType and submit the page
  118. This is used by the items on the drop down menu that allows users pick the target type
  119. */
  120. function selectDrillTarget(targetType){
  121. document.pform.ps_nav_op.value = 'maintain';
  122. makeSelection('target','','',targetType)
  123. document.pform.submit();
  124. }
  125. /*
  126. This global variable is defined to specify if we are in the wizard page or in the properties page.
  127. This variable is used in target.xslt page (used by both wizard and properties page) to pass the right value
  128. to the select dialog page.
  129. */
  130. var inWizard = true;
  131. </script>
  132. <!--Include the required JS file for implementation of drop down menus -->
  133. <script language="javascript" src="{$webcontent}/{$app}/js/CCflyoutMenu.js"></script>
  134. <rdb:scripts/>
  135. <!-- Help system -->
  136. <pf:help context="HID_SET_DRILL_THROUGH_SCOPE_TARGET"/>
  137. </dp:script>
  138. <utml:form name="pform" method="post" action="{$gateway}" >
  139. <rdb:commonInputs/>
  140. <utml:input type="hidden" name="m_p_scope" value=""/>
  141. <dp:header>
  142. <!-- header titles-->
  143. <dp:title><xsl:value-of select="$browserTitle"/></dp:title>
  144. <dp:description><xsl:value-of select="$pageDescription"/></dp:description>
  145. <dp:close>
  146. <xsl:choose>
  147. <xsl:when test="key('env-param','from_bmt')">
  148. <a href="javascript:doCancel()">
  149. <dp:closeMarker/>
  150. </a>
  151. </xsl:when>
  152. <xsl:otherwise>
  153. <a href="{$backURL}">
  154. <dp:closeMarker/>
  155. </a>
  156. </xsl:otherwise>
  157. </xsl:choose>
  158. </dp:close>
  159. </dp:header>
  160. <lyt:layout style="1">
  161. <lyt:section>
  162. <dp:list>
  163. <dp:section>
  164. <dp:label><xts:string id="IDS_PROP_DRILLPATH_DEF_SCOPE"/></dp:label>
  165. </dp:section>
  166. <dp:section>
  167. <dp:hint wrap="wrap" width="100%"><xts:string id="WIZ_PROP_DRILLPATH_DEF_SCOPE_HINT"/></dp:hint>
  168. </dp:section>
  169. <dp:section>
  170. <img height="3" width="1">
  171. <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute>
  172. </img>
  173. </dp:section>
  174. <xsl:choose>
  175. <xsl:when test="contains(string(/root/env/param[@name='m_p_scope']),'].[')">
  176. <dp:section>
  177. <span lang="{$contentLocale}"><dp:text nospace="nospace"><xsl:value-of select="xtsdrillext:enforceSTTAndBTDForMUN(/root/env/param[@name='m_p_scope'], $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/></dp:text></span>
  178. </dp:section>
  179. </xsl:when>
  180. <xsl:otherwise>
  181. <dp:section>
  182. <dp:text nospace="nospace"><xts:string id="IDS_PROP_DRILLPATH_TREE_PKG"/></dp:text>
  183. </dp:section>
  184. </xsl:otherwise>
  185. </xsl:choose>
  186. <dp:section>
  187. <img height="3" width="1">
  188. <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute>
  189. </img>
  190. </dp:section>
  191. <xsl:if test="$userCanSelectMetadata">
  192. <dp:section>
  193. <dp:link>
  194. <utml:a utml:op="stack-up">
  195. <utml:href>
  196. makeSelection('scope')
  197. </utml:href>
  198. <xts:string id="IDS_PROP_DRILLPATH_SELECT_SCOPE"/>
  199. </utml:a>
  200. </dp:link>
  201. </dp:section>
  202. </xsl:if>
  203. <dp:section>
  204. <img height="25" width="1">
  205. <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute>
  206. </img>
  207. </dp:section>
  208. <dp:section>
  209. <dp:label>
  210. <xts:string id="IDS_PROP_DRILLPATH_DEF_TARGET"/>
  211. </dp:label>
  212. </dp:section>
  213. <dp:section>
  214. <img height="3" width="1">
  215. <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute>
  216. </img>
  217. </dp:section>
  218. <dp:section>
  219. <xsl:choose>
  220. <!-- Messages are different when abacab is installed -->
  221. <xsl:when test="($userCanUsePPS)">
  222. <dp:hint wrap="wrap" width="100%"><xts:string id="WIZ_NEW_INTRO_DRILLPATH_TARGET_HINT_ABACAB"/></dp:hint>
  223. </xsl:when>
  224. <xsl:otherwise>
  225. <dp:hint wrap="wrap" width="100%"><xts:string id="WIZ_NEW_INTRO_DRILLPATH_TARGET_HINT"/></dp:hint>
  226. </xsl:otherwise>
  227. </xsl:choose>
  228. </dp:section>
  229. <dp:section>
  230. <img height="3" width="1">
  231. <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute>
  232. </img>
  233. </dp:section>
  234. <!--get the target class to be used in the next page of the wizard -->
  235. <utml:input type="hidden" name="targetClass">
  236. <xsl:attribute name="value">
  237. <xsl:value-of select="/root/target/cm:queryResponse/*/cm:objectClass"/>
  238. </xsl:attribute>
  239. </utml:input>
  240. <!--Get the target class to generate the target ICON -->
  241. <xsl:variable name="targetClassforICON">
  242. <xsl:choose>
  243. <xsl:when test="/root/target">
  244. <xsl:value-of select="string(/root/target/cm:queryResponse/*/cm:objectClass)"/>
  245. </xsl:when>
  246. <xsl:otherwise></xsl:otherwise>
  247. </xsl:choose>
  248. </xsl:variable>
  249. <xsl:variable name="targetBaseClassforICON">
  250. <xsl:choose>
  251. <xsl:when test="/root/target">
  252. <xsl:value-of select="string(/root/target/cm:queryResponse/*/cm:base/*/cm:objectClass)"/>
  253. </xsl:when>
  254. <xsl:otherwise></xsl:otherwise>
  255. </xsl:choose>
  256. </xsl:variable>
  257. <xsl:choose>
  258. <xsl:when test="/root/target">
  259. <xsl:variable name="object-start-at-path">
  260. <xsl:choose>
  261. <!-- Do not provide a path for contact otherwise invalid path displayed for logged on user -->
  262. <xsl:when test="starts-with(/root/target/cm:queryResponse/*/cm:searchPath, '~') or starts-with(/root/target/cm:queryResponse/*/cm:searchPath,key('session-param', 'e_hp'))">
  263. <xsl:value-of select="concat(key('session-param', 'e_hp'), '/folder')"/>
  264. </xsl:when>
  265. <xsl:when test="starts-with(/root/target/cm:queryResponse/*/cm:searchPath,'/content')">
  266. <xsl:value-of select="$defaultContentRoot"/>
  267. </xsl:when>
  268. </xsl:choose>
  269. </xsl:variable>
  270. <dp:section>
  271. <div>
  272. <table role="presentation"><tr><td>
  273. <xsl:call-template name="gen-icon">
  274. <xsl:with-param name="class" select="$targetClassforICON"/>
  275. <xsl:with-param name="baseClass" select="$targetBaseClassforICON"/>
  276. </xsl:call-template>
  277. </td><td valign="middle" class="tableText" lang="{$contentLocale}">
  278. <cf:do-the-path-link>
  279. <cf:param name="familytree">/root/target/cm:queryResponse/*/cm:ancestors</cf:param>
  280. <cf:param name="familymember">/root/target/cm:queryResponse/*/cm:defaultName</cf:param>
  281. <cf:param name="home">
  282. <xsl:value-of select="$object-start-at-path"/>
  283. </cf:param>
  284. </cf:do-the-path-link>
  285. </td></tr></table>
  286. </div>
  287. </dp:section>
  288. </xsl:when>
  289. <xsl:otherwise>
  290. <dp:section>
  291. <dp:text nospace="nospace"><xts:string id="IDS_PROP_DRILLPATH_TARGETNOTSPECIFIED"/></dp:text>
  292. </dp:section>
  293. </xsl:otherwise>
  294. </xsl:choose>
  295. <dp:section>
  296. <img height="3" width="1">
  297. <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute>
  298. </img>
  299. </dp:section>
  300. <!-- Add dropdown menus to allow a user to select a target type
  301. Reports
  302. Cubes
  303. -->
  304. <!-- Unique ids are required to create multiple menus -->
  305. <!-- popup menu ids-->
  306. <xsl:variable name="menuId" select="concat('Menu', generate-id(.))"/>
  307. <xsl:variable name="menuSpanId" select="concat('MenuSpan', generate-id(.))"/>
  308. <!-- menu item ids -->
  309. <xsl:variable name="menuReportId" select="concat('Report', generate-id(.))"/>
  310. <xsl:variable name="menuCubeId" select="concat('Cube', generate-id(.))"/>
  311. <dp:section>
  312. <dp:link>
  313. <xsl:choose>
  314. <!-- This condition is used to show the drop down menu for picking the target type
  315. only when user can use PPS (PPS is installed) -->
  316. <xsl:when test="($userCanUsePPS)">
  317. <utml:a>
  318. <xsl:attribute name="onclick">
  319. <xsl:text>return CCPopupMenu.dropDown(event,0,0,'</xsl:text>
  320. <xsl:value-of select="$menuId"/>
  321. <xsl:text>');</xsl:text>
  322. </xsl:attribute>
  323. <xsl:choose>
  324. <xsl:when test="/root/target">
  325. <xts:string id="WIZ_PROP_DRILLPATH_CHANGE_TARGET"/>
  326. </xsl:when>
  327. <xsl:otherwise>
  328. <xts:string id="WIZ_PROP_DRILLPATH_SELECT_TARGET"/>
  329. </xsl:otherwise>
  330. </xsl:choose>
  331. </utml:a>
  332. <!-- Define a menu with 2 items Run and debug-->
  333. <xsl:variable name="contactMenu">
  334. <flyout id="{$menuId}">
  335. <items>
  336. <item id="{$menuReportId}">
  337. <text><xts:string id="WIZ_TARGET_TYPE_MENU_ITEM_REPORT"/></text>
  338. <action>selectDrillTarget('drillPathPP8Targets');</action>
  339. </item>
  340. <item id="{$menuCubeId}">
  341. <text><xts:string id="WIZ_TARGET_TYPE_MENU_ITEM_CUBE"/></text>
  342. <action>selectDrillTarget('powerPlay8Drill.container');
  343. </action>
  344. </item>
  345. </items>
  346. </flyout>
  347. </xsl:variable>
  348. <!-- A dropdown arrow to invoke drill through assistant. It is only available when Abacan is installed-->
  349. <img align="middle" name="contactMenu_imgFlyControl" src="{$skin_shared_images}dropdown_arrow.gif" title="" alt="">
  350. <xsl:attribute name="onclick">
  351. <xsl:text>return CCPopupMenu.dropDown(event,0,0,'</xsl:text>
  352. <xsl:value-of select="$menuId"/>
  353. <xsl:text>');</xsl:text>
  354. </xsl:attribute>
  355. </img>
  356. <!-- Display menus and add z-index to make sure it is on the top-->
  357. <div id="{$menuSpanId}" style="z-index:1; position: relative;">
  358. </div>
  359. <!--Call to create menus -->
  360. <xsl:call-template name="renderPopup">
  361. <xsl:with-param name="flyoutXML">
  362. <xsl:copy-of select="$contactMenu"/>
  363. </xsl:with-param>
  364. <xsl:with-param name="controlID"><xsl:value-of select="$menuSpanId"/></xsl:with-param>
  365. </xsl:call-template>
  366. <!-- end dropdown -->
  367. </xsl:when>
  368. <!-- When PP8 is not installed we don't show the drop down menu to the user
  369. and do the same thing that we used to do -->
  370. <xsl:otherwise>
  371. <utml:a>
  372. <utml:href>
  373. makeSelection('target')
  374. </utml:href>
  375. <xsl:choose>
  376. <xsl:when test="/root/target">
  377. <xts:string id="WIZ_PROP_DRILLPATH_CHANGE_TARGET"/>
  378. </xsl:when>
  379. <xsl:otherwise>
  380. <xts:string id="WIZ_PROP_DRILLPATH_SELECT_TARGET"/>
  381. </xsl:otherwise>
  382. </xsl:choose>
  383. </utml:a>
  384. </xsl:otherwise>
  385. </xsl:choose>
  386. </dp:link>
  387. </dp:section>
  388. </dp:list>
  389. </lyt:section>
  390. </lyt:layout>
  391. <dp:footer>
  392. <!-- Cancel button -->
  393. <xsl:choose>
  394. <xsl:when test="key('env-param','from_bmt')!=''">
  395. <df:button df:id="IDS_CANCEL" df:style="href" df:href="javascript:doCancel()"/>
  396. </xsl:when>
  397. <xsl:otherwise>
  398. <df:button df:id="IDS_CANCEL" df:style="back-url"/>
  399. </xsl:otherwise>
  400. </xsl:choose>
  401. <!-- Back button -->
  402. <df:button df:id="IDS_BACK" df:style="maintain" df:label="IDS_BACK_LABEL">
  403. <df:target>
  404. <xsl:value-of select="concat($app, '/new_general.xts')"/>
  405. </df:target>
  406. </df:button>
  407. <!-- Next button -->
  408. <xsl:choose>
  409. <xsl:when test="not(/root/target) or string(key('env-param','m_p_target'))=''">
  410. <df:button df:id="IDS_NEXT"/>
  411. </xsl:when>
  412. <xsl:otherwise>
  413. <df:button df:id="IDS_NEXT" df:style="maintain" utml:validate="true" df:label="IDS_NEXT_LABEL">
  414. <df:target>
  415. <xsl:value-of select="concat($app, '/new_drillthru_def3.xts')"/>
  416. </df:target>
  417. </df:button>
  418. </xsl:otherwise>
  419. </xsl:choose>
  420. <!-- Finish button -->
  421. <df:button df:id="IDS_FINISH"/>
  422. </dp:footer>
  423. </utml:form>
  424. </dp:page>
  425. </xsl:template>
  426. <pf:gen-icon/>
  427. </xsl:stylesheet>
  428. </xts:block>
  429. <!--
  430. ===============================================================================================
  431. debug - display debug information
  432. ===============================================================================================
  433. -->
  434. <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">
  435. <!-- get the debug logic sheet -->
  436. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  437. <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">
  438. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  439. <xsl:template match="/">
  440. <dbg:dumpxml select="/root"/>
  441. </xsl:template>
  442. </xsl:stylesheet>
  443. </xts:block>
  444. </xts:morphlet>