edit.xslt 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: Viewer
  5. (C) Copyright IBM Corp. 2001, 2011
  6. US Government Users Restricted Rights - Use, duplication or
  7. disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  8. -->
  9. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:frag="http://developer.cognos.com/schemas/cps/logic/fragment/1/" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:ui="http://developer.cognos.com/schemas/cps/logic/ui/1/" xmlns:nui="http://developer.cognos.com/schemas/cps/logic/nav/ui/1/" xmlns:nav="http://developer.cognos.com/schemas/cps/navigation/1/" xmlns:layout="http://developer.cognos.com/common/layout" xmlns:valerr="http://developer.cognos.com/validation/errrormessages/1/" xmlns:java="java:com.cognos.portal.utils.CCLLocaleUtils" exclude-result-prefixes="xts xtsext ui nui nav">
  10. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  11. <layout:selectortemplates/>
  12. <xsl:template match="/">
  13. <xsl:variable name="dialogSubmit" select="/root/interactions/param[@name='dialogSubmit']"/>
  14. <xsl:choose>
  15. <xsl:when test="/root/interactions/param[@name='formaction'] = 'objectSelect'">
  16. <xsl:call-template name="generateMarkupForObjectSelect"/>
  17. </xsl:when>
  18. <xsl:when test="$dialogSubmit = 'true'">
  19. <layout:script>
  20. <xsl:variable name="propsURL" select="/root/interactions/param[@name='propsURL']"/>
  21. <xsl:if test="$propsURL != ''">
  22. var propsURL = "<xsl:value-of select="$propsURL"/>";
  23. </xsl:if>
  24. function _THIS_init(evt){
  25. if (evt.eventPhase == evt.AT_TARGET){
  26. _THIS_.raiseEvent("cognos.viewer.plugin.preferences.save", propsURL, "xsd:string");
  27. }
  28. }
  29. </layout:script>
  30. </xsl:when>
  31. <xsl:otherwise>
  32. <div>
  33. <layout formname="form">
  34. <xsl:call-template name="generateMarkupForFullPage"/>
  35. </layout>
  36. </div>
  37. </xsl:otherwise>
  38. </xsl:choose>
  39. </xsl:template>
  40. <xsl:template name="buildVariable">
  41. <xsl:param name="name" select="."/>
  42. <xsl:choose>
  43. <xsl:when test="/root/state/param[@name='{$name}'] != ''">
  44. <xsl:value-of select="/root/state/param[@name='{$name}']"/>
  45. </xsl:when>
  46. <xsl:when test="/root/customs/param[@name='{$name}'] != ''">
  47. <xsl:value-of select="/root/customs/param[@name='{$name}']"/>
  48. </xsl:when>
  49. </xsl:choose>
  50. </xsl:template>
  51. <xsl:template name="generateMarkupForObjectSelect">
  52. <xsl:variable name="dialogMode" select="/root/controllerParams/param[@name='frag-view'] = 'dialog'"/>
  53. <xsl:variable name="formAction" select="/root/interactions/param[@name='formaction']"/>
  54. <xsl:variable name="selectionId" select="/root/interactions/param[@name='p_navSelectionId']"/>
  55. <xsl:variable name="dialogSubmit" select="/root/interactions/param[@name='dialogSubmit']"/>
  56. <xsl:variable name="reportLaunchOption">
  57. <xsl:call-template name="buildVariable">
  58. <xsl:with-param name="name">reportLaunchOption</xsl:with-param>
  59. </xsl:call-template>
  60. </xsl:variable>
  61. <xsl:variable name="promptOption">
  62. <xsl:call-template name="buildVariable">
  63. <xsl:with-param name="name">promptOption</xsl:with-param>
  64. </xsl:call-template>
  65. </xsl:variable>
  66. <xsl:variable name="usePromptChannel">
  67. <xsl:call-template name="buildVariable">
  68. <xsl:with-param name="name">usePromptChannel</xsl:with-param>
  69. </xsl:call-template>
  70. </xsl:variable>
  71. <xsl:variable name="useDrillChannel">
  72. <xsl:call-template name="buildVariable">
  73. <xsl:with-param name="name">useDrillChannel</xsl:with-param>
  74. </xsl:call-template>
  75. </xsl:variable>
  76. <xsl:variable name="useAuthoredDrillChannel">
  77. <xsl:call-template name="buildVariable">
  78. <xsl:with-param name="name">useAuthoredDrillChannel</xsl:with-param>
  79. </xsl:call-template>
  80. </xsl:variable>
  81. <xsl:variable name="viewerToolbarNormalMode">
  82. <xsl:call-template name="buildVariable">
  83. <xsl:with-param name="name">viewerToolbarNormalMode</xsl:with-param>
  84. </xsl:call-template>
  85. </xsl:variable>
  86. <xsl:variable name="viewerToolbarMaximizeMode">
  87. <xsl:call-template name="buildVariable">
  88. <xsl:with-param name="name">viewerToolbarMaximizeMode</xsl:with-param>
  89. </xsl:call-template>
  90. </xsl:variable>
  91. <layout:section id="ReportOptions">
  92. <layout:label>
  93. <layout:text>
  94. <xts:string id="IDS_PROP_FRAGMENT_OPTION_CAPTION"/>
  95. </layout:text>
  96. </layout:label>
  97. <layout:radio name="p_reportLaunchOption" id="reportLaunchOption">
  98. <xsl:if test="($reportLaunchOption = 'runIcon')">
  99. <xsl:attribute name="selected">true</xsl:attribute>
  100. </xsl:if>
  101. <layout:text>
  102. <xts:string id="IDS_PROP_REPORT_SHOW_RUN_ACTION_CAPTION"/>
  103. </layout:text>
  104. <layout:value>runIcon</layout:value>
  105. </layout:radio>
  106. <layout:radio name="p_reportLaunchOption" id="reportLaunchOption">
  107. <xsl:choose>
  108. <xsl:when test="($reportLaunchOption = 'run')">
  109. <xsl:attribute name="selected">true</xsl:attribute>
  110. </xsl:when>
  111. </xsl:choose>
  112. <layout:text>
  113. <xts:string id="IDS_PROP_REPORT_RUN_REPORT_CAPTION"/>
  114. </layout:text>
  115. <layout:value>run</layout:value>
  116. </layout:radio>
  117. <layout:radio name="p_reportLaunchOption" id="reportLaunchOption">
  118. <xsl:choose>
  119. <xsl:when test="($reportLaunchOption = 'output')">
  120. <xsl:attribute name="selected">true</xsl:attribute>
  121. </xsl:when>
  122. <xsl:when test="$reportLaunchOption = ''">
  123. <xsl:attribute name="selected">true</xsl:attribute>
  124. </xsl:when>
  125. </xsl:choose>
  126. <layout:text>
  127. <xts:string id="IDS_PROP_REPORT_SHOW_SNAPSHOT_CAPTION"/>
  128. </layout:text>
  129. <layout:value>output</layout:value>
  130. <layout:rcsection>
  131. <layout:select name="p_reportLaunchSubOption" id="reportLaunchSubOption">
  132. <layout:label>
  133. <layout:text>
  134. <xts:string id="IDS_PROP_REPORT_NO_SAVED_OUTPUT_CAPTION"/>
  135. </layout:text>
  136. </layout:label>
  137. <layout:option value="run">
  138. <xts:string id="IDS_PROP_REPORT_RUN_REPORT_CAPTION"/>
  139. </layout:option>
  140. <layout:option value="runIcon">
  141. <xts:string id="IDS_PROP_REPORT_SHOW_RUN_ACTION_CAPTION"/>
  142. </layout:option>
  143. </layout:select>
  144. </layout:rcsection>
  145. </layout:radio>
  146. </layout:section>
  147. <layout:section id="Prompt values">
  148. <layout:select name="p_promptOption" id="promptOption">
  149. <layout:label>
  150. <layout:text>
  151. <xts:string id="IDS_PROP_PROMPT_USER"/>
  152. </layout:text>
  153. </layout:label>
  154. <layout:option value="false">
  155. <xts:string id="IDS_PROP_PROMPT_SETTING_ONLY_WHEN_REQUIRED"/>
  156. </layout:option>
  157. <layout:option value="true">
  158. <xts:string id="IDS_PROP_PROMPT_SETTING_ALWAYS"/>
  159. </layout:option>
  160. <layout:option value="default">
  161. <xts:string id="IDS_PROP_PROMPT_SETTING_DEFAULT"/>
  162. </layout:option>
  163. <layout:option value="hide">
  164. <xts:string id="IDS_PROP_PROMPT_SETTING_HIDE_UNTIL_VALUES_PROVIDED"/>
  165. </layout:option>
  166. </layout:select>
  167. </layout:section>
  168. <layout:section id="Portlet communction">
  169. <layout:label>
  170. <layout:text>
  171. <xts:string id="IDS_PROP_PORTLET_COMMUNICATION_OPTIONS"/>
  172. </layout:text>
  173. <layout:hint>
  174. <xts:string id="IDS_PROP_PORTLET_COMMUNICATION_OPTIONS_HINT"/>
  175. </layout:hint>
  176. </layout:label>
  177. <!--Global Prompts-->
  178. <layout:section id="promptValues">
  179. <layout:label>
  180. <layout:text>
  181. <xts:string id="IDS_PROP_PROMPT_VALUES"/>
  182. </layout:text>
  183. </layout:label>
  184. <layout:checkbox name="p_sharePromptValues" id="sharePromptValues">
  185. <layout:text>
  186. <xts:string id="IDS_PROP_PORTLET_COMMUNICATE_WITH_OTHER_PORTLETS"/>
  187. </layout:text>
  188. <layout:value>true</layout:value>
  189. <layout:rcsection>
  190. <layout:radio name="p_usePromptChannel" id="sharePromptAllChannels">
  191. <layout:text>
  192. <xts:string id="IDS_PROP_PORTLET_COMMUNICATE_ALL_PORTLETS"/>
  193. </layout:text>
  194. <layout:value>false</layout:value>
  195. <xsl:if test="$usePromptChannel='false'">
  196. <xsl:attribute name="selected">true</xsl:attribute>
  197. </xsl:if>
  198. </layout:radio>
  199. <layout:radio name="p_usePromptChannel" id="sharePromptOnSpecifiedChannel">
  200. <layout:text>
  201. <xts:string id="IDS_PROP_PORTLET_COMMUNICATE_CHANNELED_PORTLET"/>
  202. </layout:text>
  203. <layout:value>true</layout:value>
  204. <xsl:if test="$usePromptChannel='true'">
  205. <xsl:attribute name="selected">true</xsl:attribute>
  206. </xsl:if>
  207. <layout:rcsection>
  208. <layout:field id="promptEventChannel" name="p_promptEventChannel" type="text" maxlength="1024"/>
  209. </layout:rcsection>
  210. </layout:radio>
  211. <layout:section id="MatchOn">
  212. <layout:select name="p_matchOnParameterNameOnly" id="matchOnParameterNameOnly" disabled="disabled">
  213. <layout:label>
  214. <layout:text>
  215. <xts:string id="IDS_PROP_PORTLET_MATCH_ON"/>
  216. </layout:text>
  217. </layout:label>
  218. <layout:option value="false">
  219. <xts:string id="IDS_PROP_PORTLET_MATCH_ON_PARAMETER_AND_DATA_ITEM"/>
  220. </layout:option>
  221. <layout:option value="true">
  222. <xts:string id="IDS_PROP_PORTLET_MATCH_ON_PARAMETER_ONLY"/>
  223. </layout:option>
  224. </layout:select>
  225. </layout:section>
  226. </layout:rcsection>
  227. </layout:checkbox>
  228. </layout:section>
  229. <!--End of Global Prompts-->
  230. <!--Drill up/Drill down-->
  231. <layout:section id="drillUpDown">
  232. <layout:label>
  233. <layout:text>
  234. <xts:string id="IDS_PROP_PORTLET_COMMUNICATE_DRILL_UP_DOWN"/>
  235. </layout:text>
  236. </layout:label>
  237. <layout:checkbox name="p_shareDrillEvents" id="shareDrillEvents">
  238. <layout:text>
  239. <xts:string id="IDS_PROP_PORTLET_COMMUNICATE_WITH_OTHER_PORTLETS_ON_PAGE"/>
  240. </layout:text>
  241. <layout:value>true</layout:value>
  242. <layout:rcsection>
  243. <layout:radio name="p_useDrillChannel" id="shareDrillEventOnAllChannels">
  244. <layout:text>
  245. <xts:string id="IDS_PROP_PORTLET_COMMUNICATE_ALL_PORTLETS"/>
  246. </layout:text>
  247. <layout:value>false</layout:value>
  248. <xsl:if test="$useDrillChannel='false'">
  249. <xsl:attribute name="selected">true</xsl:attribute>
  250. </xsl:if>
  251. </layout:radio>
  252. <layout:radio name="p_useDrillChannel" id="shareDrillEventOnSpecifiedChannel">
  253. <layout:text>
  254. <xts:string id="IDS_PROP_PORTLET_COMMUNICATE_CHANNELED_PORTLET"/>
  255. </layout:text>
  256. <layout:value>true</layout:value>
  257. <layout:rcsection>
  258. <layout:field id="drillChannel" name="p_drillChannel" type="text" maxlength="1024"/>
  259. </layout:rcsection>
  260. <xsl:if test="$useDrillChannel='true'">
  261. <xsl:attribute name="selected">true</xsl:attribute>
  262. </xsl:if>
  263. </layout:radio>
  264. </layout:rcsection>
  265. </layout:checkbox>
  266. </layout:section>
  267. <!--End of Drill up/Drill down-->
  268. <!--Authored drill through-->
  269. <layout:rcsection id="authoredDrillThrough">
  270. <layout:label>
  271. <layout:text>
  272. <xts:string id="IDS_PROP_PORTLET_COMMUNICATE_REPORT_DRILL_THROUGH"/>
  273. </layout:text>
  274. </layout:label>
  275. <layout:checkbox name="p_shareAuthoredDrillEvents" id="shareAuthoredDrillEvents">
  276. <layout:text>
  277. <xts:string id="IDS_PROP_PORTLET_COMMUNICATE_WITH_OTHER_PORTLETS_ON_PAGE"/>
  278. </layout:text>
  279. <layout:value>true</layout:value>
  280. <layout:rcsection>
  281. <layout:field id="authoredDrillChannel" name="p_authoredDrillChannel" type="text" maxlength="1024"/>
  282. </layout:rcsection>
  283. </layout:checkbox>
  284. </layout:rcsection>
  285. <!--End of authored drill-->
  286. </layout:section>
  287. <layout:section id="View options" format="division">
  288. <layout:label>
  289. <layout:text>
  290. <xts:string id="IDS_PROP_RVF_VIEW_OPTIONS"/>
  291. </layout:text>
  292. </layout:label>
  293. </layout:section>
  294. <layout:section>
  295. <layout:label>
  296. <layout:text>
  297. <xts:string id="IDS_PROP_FRAGMENT_SHOW_TOOLBAR_CAPTION"/>
  298. </layout:text>
  299. </layout:label>
  300. <layout:checkbox name="p_viewerToolbarNormalMode" id="viewerToolbarNormalMode">
  301. <xsl:if test="($viewerToolbarNormalMode = 'showNormal')">
  302. <xsl:attribute name="selected">true</xsl:attribute>
  303. </xsl:if>
  304. <layout:text>
  305. <xts:string id="IDS_PROP_FRAGMENT_SHOW_NORMAL_MODE_CAPTION"/>
  306. </layout:text>
  307. <layout:value>showNormal</layout:value>
  308. </layout:checkbox>
  309. <layout:checkbox name="p_viewerToolbarMaximizeMode" id="viewerToolbarMaximizeMode">
  310. <xsl:choose>
  311. <xsl:when test="($viewerToolbarMaximizeMode = 'showMaximize')">
  312. <xsl:attribute name="selected">true</xsl:attribute>
  313. </xsl:when>
  314. <xsl:when test="($viewerToolbarMaximizeMode != 'showMaximize') and ($viewerToolbarNormalMode != 'showNormal')">
  315. <xsl:attribute name="selected">true</xsl:attribute>
  316. </xsl:when>
  317. </xsl:choose>
  318. <layout:text>
  319. <xts:string id="IDS_PROP_FRAGMENT_SHOW_MAXIMIZE_MODE_CAPTION"/>
  320. </layout:text>
  321. <layout:value>showMaximize</layout:value>
  322. </layout:checkbox>
  323. </layout:section>
  324. </xsl:template>
  325. <xsl:template name="generateMarkupForFullPage">
  326. <xsl:variable name="selection">
  327. <xsl:choose>
  328. <xsl:when test="/root/state/param[@name='viewerSelectedLanguage']">
  329. <xsl:value-of select="/root/state/param[@name='viewerSelectedLanguage']"/>
  330. </xsl:when>
  331. <xsl:when test="/root/preferences/param[@name='contentLocale']">
  332. <xsl:value-of select="/root/preferences/param[@name='contentLocale']"/>
  333. </xsl:when>
  334. </xsl:choose>
  335. </xsl:variable>
  336. <xsl:variable name="titleOptions">
  337. <xsl:choose>
  338. <xsl:when test="/root/state/param[@name='viewerTitleOptions'] != ''">
  339. <xsl:value-of select="/root/state/param[@name='viewerTitleOptions']"/>
  340. </xsl:when>
  341. <xsl:when test="/root/customs/param[@name='viewerTitleOptions'] != ''">
  342. <xsl:value-of select="/root/customs/param[@name='viewerTitleOptions']"/>
  343. </xsl:when>
  344. </xsl:choose>
  345. </xsl:variable>
  346. <layout:form id="_THIS_form" name="_THIS_form" method="get" action="_THIS?/THIS_">
  347. <layout:script>
  348. <xsl:value-of select="xtsext:cafaction('get_jsconfig', '')"/>
  349. var _THIS_itemList = new Array("title");
  350. _THIS_.addEventListener("cognos.ui.dialog.*", "CViewerFragmentPropertiesPage_processDialogEvents", false);
  351. function _THIS_cancelEdit()
  352. {
  353. _THIS_.setMode('view');
  354. _THIS_.retrieve();
  355. }
  356. var _THIS_currentObjDiv = "";
  357. var _THIS_currentObjType ="";
  358. var _THIS_currentProperty ="";
  359. var _THIS_TransientsFetched = false;
  360. <xsl:variable name="reportId">
  361. <xsl:choose>
  362. <xsl:when test="/root/interactions/param[@name='p_navSelectionId'] != ''">
  363. <xsl:value-of select="/root/interactions/param[@name='p_navSelectionId']"/>
  364. </xsl:when>
  365. <xsl:when test="/root/state/param[@name='navSelectionId'] != ''">
  366. <xsl:value-of select="/root/state/param[@name='navSelectionId']"/>
  367. </xsl:when>
  368. <xsl:when test="/root/customs/param[@name='navSelectionId'] != ''">
  369. <xsl:value-of select="/root/customs/param[@name='navSelectionId']"/>
  370. </xsl:when>
  371. </xsl:choose>
  372. </xsl:variable>
  373. var theAmp = "&amp;";
  374. var _THIS_Action = "_THIS?frag-urlType=gateway/THIS_";
  375. var _THIS_GetTransientsURLParams = "b_action=cognosViewer" + theAmp +
  376. "ui.action=getTransients" + theAmp +
  377. "cv.useAjax=false" + theAmp +
  378. "cv.id=_THIS_" + theAmp +
  379. "cv.responseFormat=getTransients" + theAmp +
  380. "ui.object=storeID('<xsl:value-of select="$reportId"/>')";
  381. var _THIS_NO_CHANNEL_SPECIFIED_ERROR = '<xts:string id="IDS_PROP_PORTLET_NO_CHANNEL_SPECIFIED_ERROR" encode="javascript"/>';
  382. function _THIS_init(evt)
  383. {
  384. if (evt.eventPhase == evt.AT_TARGET)
  385. {
  386. if (_THIS_.ownerDialog.data)
  387. {
  388. CViewerFragmentPropertiesPage_setData('_THIS_', _THIS_.ownerDialog.data);
  389. var promptOption = document.getElementById('_THIS_' + "promptOption");
  390. var sharePromptValuesCheckBox = document.getElementById('_THIS_' + "sharePromptValues");
  391. if(promptOption != null &amp;&amp; promptOption.value == 'hide')
  392. {
  393. if(sharePromptValuesCheckBox != null)
  394. {
  395. sharePromptValuesCheckBox.disabled = true;
  396. }
  397. }
  398. if (sharePromptValuesCheckBox)
  399. {
  400. var matchOnParameterNameOnly = document.getElementById('_THIS_' + "matchOnParameterNameOnly");
  401. if (matchOnParameterNameOnly)
  402. {
  403. matchOnParameterNameOnly.disabled = !sharePromptValuesCheckBox.checked;
  404. }
  405. }
  406. }
  407. CViewerFragmentPropertiesPage_attachOnClickEvents('_THIS_');
  408. }
  409. }
  410. _THIS_.addEventListener("fragment.load", "_THIS_init", false);
  411. </layout:script>
  412. <layout:section format="header">
  413. <layout:text><xts:string id="IDS_PROP_EDIT_REPORT_VIEW_TITLE_HINT"/></layout:text>
  414. </layout:section>
  415. <xsl:call-template name="generateMarkupForObjectSelect"/>
  416. <!-- hidden inputs -->
  417. <xsl:variable name="transientSpecification">
  418. <xsl:choose>
  419. <xsl:when test="/root/state/param[@name='transientSpecification'] != ''">
  420. <xsl:value-of select="/root/state/param[@name='transientSpecification']"/>
  421. </xsl:when>
  422. <xsl:when test="/root/customs/param[@name='transientSpecification'] != ''">
  423. <xsl:value-of select="/root/customs/param[@name='transientSpecification']"/>
  424. </xsl:when>
  425. </xsl:choose>
  426. </xsl:variable>
  427. <layout:hidden id="transientSpecification" name="p_transientSpecification" value="{$transientSpecification}"/>
  428. </layout:form>
  429. </xsl:template>
  430. </xsl:stylesheet>