render_old_versions.xslt 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666
  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. 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. <xsl:stylesheet version="1.0"
  13. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  14. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  15. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  16. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  17. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  18. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  19. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  20. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  21. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  22. xmlns:op="http://developer.cognos.com/schemas/xts/op"
  23. xmlns:dv="http://developer.cognos.com/schemas/xts/dv"
  24. xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xsl pf xts xtsext lyt dp df cp utml op dv">
  25. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  26. <pf:variables/>
  27. <dv:variables/>
  28. <xsl:variable name="lang-filter" select="key('env-param', 'cur_lang')"/>
  29. <xsl:variable name="mname" select="'outputs.xts'"/>
  30. <!-- Need to honur reportVersionPath if outputs was called from view/view_details then object path is different when archived tab is selected -->
  31. <xsl:variable name="isReportVersionPath" select="string(/root/env/param[@name= 'reportVersionPath']) != ''"/>
  32. <xsl:variable name="objectName">
  33. <xsl:choose>
  34. <xsl:when test="$isReportVersionPath"><xsl:value-of select="/root/cm:queryResponse/cm:queryReply/*/cm:parent/*/cm:defaultName"/></xsl:when>
  35. <xsl:otherwise><xsl:value-of select="/root/cm:queryResponse/cm:queryReply/*/cm:defaultName"/></xsl:otherwise>
  36. </xsl:choose>
  37. </xsl:variable>
  38. <xsl:variable name="browserTitle">
  39. <xsl:choose>
  40. <xsl:when test="/root/cm:queryResponse/cm:queryReply/*/cm:objectClass = 'document'">
  41. <xts:string id="IDS_DOCUMENT_PREVIOUS_VERSION_TITLE">
  42. <xts:param name="objectName">
  43. <span lang="{$contentLocale}"><xsl:value-of select="xtsext:enforceBTD($objectName, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/></span>
  44. </xts:param>
  45. </xts:string>
  46. </xsl:when>
  47. <xsl:otherwise>
  48. <xts:string id="IDS_PREVIOUS_VERSION_TITLE">
  49. <xts:param name="objectName">
  50. <span lang="{$contentLocale}"><xsl:value-of select="xtsext:enforceBTD($objectName, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/></span>
  51. </xts:param>
  52. </xts:string>
  53. </xsl:otherwise>
  54. </xsl:choose>
  55. </xsl:variable>
  56. <xsl:variable name="tabDescription"><xts:string id="IDS_PREVIOUS_VERSION_ARCHIVED_TAB_A11Y"/>&#160;<xts:string id="IDS_PREVIOUS_VERSION_ARCHIVE_TAB_INTRO"/></xsl:variable>
  57. <xsl:variable name="objectID">
  58. <xsl:choose>
  59. <xsl:when test="$isReportVersionPath"><xsl:value-of select="/root/cm:queryResponse/cm:queryReply/*/cm:parent/*/cm:storeID"/></xsl:when>
  60. <xsl:otherwise><xsl:value-of select="/root/cm:queryResponse/cm:queryReply/*/cm:storeID"/></xsl:otherwise>
  61. </xsl:choose>
  62. </xsl:variable>
  63. <xsl:variable name="containingClass" select="key('env-param', 'm_class')"/>
  64. <xsl:template match="/root">
  65. <xsl:variable name="connections" select="/root/cm:queryResponse[2]/cm:queryReply[1]"/>
  66. <xsl:variable name="defaultConnection" select="/root/cm:queryResponse[2]/cm:queryReply[2]"/>
  67. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle" dp:kbA11y="true" >
  68. <dp:meta>
  69. <pf:meta/>
  70. <link rel="stylesheet" type="text/css" href="{$webRoot}/dojo16/dijit/themes/tundra/tundra.css" />
  71. <link rel="stylesheet" type="text/css" href="{$webRoot}/dojo16/dojox/grid/resources/Grid.css" />
  72. <link rel="stylesheet" type="text/css" href="{$webRoot}/skins/{$user_skin}/portal/pager.css" />
  73. </dp:meta>
  74. <dp:script>
  75. <pf:help context="HID_VIEW_REPORT_VERSION_ARCHIVE"/>
  76. <xsl:variable name="startingVersionsPagerURL">
  77. <xsl:value-of select="$gateway"/>
  78. <xsl:text>/atom/ecm/versions/</xsl:text>
  79. <xsl:value-of select="$objectID"/>
  80. <xsl:text>?datebefore=</xsl:text>
  81. <xsl:value-of select="$requestToDate"/>
  82. <xsl:text>&amp;dateafter=</xsl:text>
  83. <xsl:value-of select="$requestFromDate"/>
  84. <xsl:text>&amp;containingClass=</xsl:text>
  85. <xsl:value-of select="$containingClass"/>
  86. <xsl:text>&amp;json</xsl:text>
  87. </xsl:variable>
  88. <script type="text/javascript" src="{$webcontent}/{$app}/js/utilities.js"></script>
  89. <script type="text/javascript" src="{$webcontent}/{$app}/js/ajaxutils.js"></script>
  90. <script type="text/javascript">
  91. var versionsPager, outputsPager;
  92. var versionsPagerURL = '<xsl:value-of select="xtsext:javascriptencode($startingVersionsPagerURL)"/>';
  93. var productLocale = '<xsl:value-of select="xtsext:javascriptencode($productLocale)"/>';
  94. var contentLocale = '<xsl:value-of select="xtsext:javascriptencode($contentLocale)"/>';
  95. var pagerWebcontent = '<xsl:value-of select="xtsext:javascriptencode($webRoot)"/>';
  96. var pagerGateway = '<xsl:value-of select="xtsext:javascriptencode($gateway)"/>';
  97. var pagerSkin = '<xsl:value-of select="xtsext:javascriptencode($user_skin)"/>';
  98. var sVersionsPagerName = '<xts:string id="IDS_PREVIOUS_VERSION_VERSIONS" encode="javascript"/>';
  99. var sVersionsReportFormat = '<xts:string id="IDS_PERS_TAB_GENERAL_FORMAT" encode="javascript"/>';
  100. var sAllLangs = '<xts:string id="IDS_PREVIOUS_VERSION_ALL_LANGUAGES" encode="javascript"/>';
  101. var sHeadingFormats = '<xts:string id="IDS_PREVIOUS_VERSION_FORMATS" encode="javascript"/>';
  102. var sHeadingLangs = '<xts:string id="IDS_PREVIOUS_VERSION_LANGUAGES" encode="javascript"/>';
  103. var sInsufficientPrivilegesMsg = '<xts:string id="IDS_PREVIOUS_VERSION_ARCHIVE_INSUFFICIENT_PRIVILEGES" encode="javascript"/>';
  104. //need to setup a javascript object to map locale translated names to locale shortforms
  105. var locales = {
  106. '': sAllLangs
  107. <xsl:for-each select="/root/config/param[@name='locale']/locale[@type='contentLocale']">
  108. ,'<xsl:value-of select="id"/>': '<xsl:value-of select="xtsext:javascriptencode(displayName)"/>'
  109. </xsl:for-each>
  110. };
  111. var djConfig = {
  112. locale: productLocale
  113. };
  114. function getTenancyParm() {
  115. var connectionDropDown = document.getElementById('p_connectionTenantID');
  116. if (connectionDropDown) {
  117. return "&amp;connectionTenantID="+connectionDropDown.value;
  118. }
  119. return "";
  120. }
  121. </script>
  122. <script type="text/javascript" src="{$webRoot}/dojo16/dojo/dojo.js"></script>
  123. <script type="text/javascript">
  124. var reportsOutputPagerLabel = "<xts:string id="IDS_PROP_A11Y_REPORT_OUTPUT_LABEL" encode="javascript"/>";
  125. var reportsVersionsPagerLabel = "<xts:string id="IDS_PROP_A11Y_REPORT_VERSION_LABEL" encode="javascript"/>";
  126. <![CDATA[
  127. dojo.registerModulePath('ps', '../../ps/portal/js/dojo/ps');
  128. dojo.require('ps.i18n');
  129. dojo.require('ps.pager');
  130. dojo.addOnLoad(function() {
  131. ps.i18n.setLocale(productLocale);
  132. var isDropdownSelected = false;
  133. var versionsPagerLayout = [
  134. {
  135. field: 'title',
  136. name: sVersionsPagerName,
  137. width: '100%',
  138. sortable: true,
  139. sortField: 'name',
  140. formatter: function(data) {
  141. return (isBidiEnabled ? bidi.btdInjectUCCIntoStr(data._text, "auto") : data._text);
  142. }
  143. }
  144. ];
  145. var outputsPagerLayout = [
  146. {
  147. field: 'title',
  148. name: sHeadingFormats,
  149. width: '50%',
  150. formatter: function(data, index) {
  151. var entry = outputsPager.getEntry(index);
  152. var downloadLink = outputsPager.getEntryLink(entry, 'alternate').href;
  153. var iconLink = outputsPager.getEntryLink(entry, 'icon').href;
  154. var tooltip = data._text;
  155. var alignStyle;
  156. if(document.body.dir=="rtl"){
  157. alignStyle= "float:right";
  158. } else {
  159. alignStyle= "float:left";
  160. }
  161. var markup = '<div style="'+ alignStyle +'; width: 40%"><a href="#" onclick="retrieveOutputFor(event, ';
  162. markup += "'" + downloadLink + "'";
  163. markup += ')" onkeypress="javascript:if (event.keyCode==13 || event.keyCode==32 || event.charCode==32){retrieveOutputFor(event, ';
  164. markup += "'" + downloadLink + "'";
  165. markup += ');return false;} return true;">';
  166. markup += '<img height="16" width="16" src="' + iconLink + '" title="' + tooltip + '" alt="' + sVersionsReportFormat + ' ' + tooltip +'" style="margin-right: 4px;float:left;" />';
  167. markup += '</a>';
  168. markup += '<a href="#" onclick="retrieveOutputFor(event, ';
  169. markup += "'" + downloadLink + "'";
  170. markup += ')" onkeypress="javascript:if (event.keyCode==13 || event.keyCode==32 || event.charCode==32){retrieveOutputFor(event, ';
  171. markup += "'" + downloadLink + "'";
  172. markup += ');return false;} return true;">' + tooltip + '</a></div>';
  173. if (entry.cm$burstKeyDisplayString !== ""){
  174. markup += "<div style='float: left;width: 60%'>" + entry.cm$burstKeyDisplayString + "</div>";
  175. }
  176. return markup;
  177. }
  178. },
  179. {
  180. field: 'cm$locale',
  181. name: sHeadingLangs,
  182. width: '50%',
  183. filterRel: 'localeselection',
  184. filterSet: locales,
  185. filterTokens: ['locale'],
  186. filterUIHook: function(value) {
  187. contentLocale = value;
  188. isDropdownSelected = true;
  189. },
  190. formatter: function(data, index) {
  191. return locales[data];
  192. }
  193. }
  194. ];
  195. ps.registerErrorTypeHandler('InsufficientPrivilegeFault',
  196. function() {
  197. versionsPager.clearData();
  198. outputsPager.clearData();
  199. alert(sInsufficientPrivilegesMsg);
  200. }
  201. )
  202. versionsPagerURL+=getTenancyParm();
  203. versionsPager = new ps.pager({
  204. pagerLabel: reportsVersionsPagerLabel,
  205. id: 'versionsPager',
  206. webcontent: pagerWebcontent,
  207. gateway: pagerGateway,
  208. skin: pagerSkin,
  209. url: versionsPagerURL,
  210. layoutSpec: versionsPagerLayout,
  211. hideLast: true,
  212. initialRowSelect: true,
  213. rowAction: function(entry) {
  214. if (entry) {
  215. var outputLink = this.getEntryLink(entry, 'alternate').href + '&locale=' + contentLocale;
  216. outputLink+=getTenancyParm();
  217. outputsPager.getData(outputLink);
  218. }
  219. },
  220. postLoad: function(totalResults) {
  221. if (totalResults === 0) {
  222. outputsPager.clearData();
  223. }
  224. }
  225. }, 'versionsPager');
  226. outputsPager = new ps.pager({
  227. pagerLabel: reportsOutputPagerLabel,
  228. id: 'outputsPager',
  229. webcontent: pagerWebcontent,
  230. gateway: pagerGateway,
  231. skin: pagerSkin,
  232. layoutSpec: outputsPagerLayout,
  233. rowSelectable: false,
  234. rowHighlightable: false,
  235. hideLast: true,
  236. focusFirstCell: true,
  237. postLoad: function(totalResults) {
  238. var locale = this.getFilter('cm$locale')[0];
  239. if (totalResults === 0 && locale !== '' && isDropdownSelected === false) {
  240. this.filter('cm$locale', '');
  241. }
  242. }
  243. }, 'outputsPager');
  244. });
  245. ]]>
  246. </script>
  247. <script type="text/javascript">
  248. var extWindow = null; // External window obj for loading dialogs into a stand-alone window.
  249. var currentDateRequest;
  250. var dateSelection;
  251. <!-- The following is for MODAL handling of dateSelector -->
  252. function maskWindow() {
  253. var d = document.getElementById("windowMask");
  254. d.style.display = "block";
  255. }
  256. function openDialog() {
  257. setDialogContainer();
  258. document.pform.m.value = "portal/outputs/src/dateSelector.xts";
  259. document.pform.target = "dialogWindow2";
  260. document.pform.submit();
  261. document.getElementById("dialogWindowContainer").focus();
  262. }
  263. function setDialogContainer() {
  264. // Get ready to show a modal dialog
  265. maskWindow();
  266. var i = document.getElementById("dialogWindowContainer");
  267. i.style.display = "block";
  268. // Size it
  269. i.style.position = "absolute";
  270. i.style.height = "500px";
  271. i.style.width = "300px";
  272. // Position it
  273. i.style.top = Math.abs((document.body.clientHeight - i.scrollHeight) / 2) + document.body.scrollTop + "px";
  274. i.style.left = Math.abs((document.body.clientWidth - i.scrollWidth) / 2) + document.body.scrollLeft + "px";
  275. }
  276. //-- Closes a simple dialog
  277. function closeDialog() {
  278. document.pform.target = "_self";
  279. document.pform.m.value ="<xsl:value-of select="$app"/>/outputs.xts";
  280. document.getElementById("windowMask").style.display = "none";
  281. document.getElementById("dialogWindowContainer").style.display = "none";
  282. document.getElementById("dialogWindow2").src = "../ps/images/space.gif";
  283. document.getElementById("dateSelectorLink").focus();
  284. }
  285. //-- Handle Call back
  286. //------------------------------------------------------------------------------------------
  287. function ccModalCmdTarget(cmd) {
  288. var result = "";
  289. if (cmd == 'error')
  290. result = document.getElementById(dialogWindow()).document.enterdfaultact();
  291. else
  292. result = cmd;
  293. closeDialog();
  294. }
  295. function ccModalCallBack(cmd,sResponse) {
  296. // If opened in an external window then close it.
  297. if(extWindow)
  298. extWindow.close();
  299. closeDialog();
  300. if (cmd == "ok")
  301. {
  302. updateVersionAfterDateSelection(sResponse);
  303. }
  304. }
  305. function parseDateSelectionResponse(sResponse) {
  306. var xmlDoc = null;
  307. var decodedResponse = xmlDecodeResponse(sResponse);
  308. if (window.DOMParser) {
  309. xmlDoc=new DOMParser().parseFromString(decodedResponse,"text/xml");
  310. } else { // Internet Explorer (less than IE 7)
  311. xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  312. xmlDoc.async="false";
  313. xmlDoc.loadXML(decodedResponse);
  314. }
  315. var items = xmlDoc.getElementsByTagName("item");
  316. var fromDate = "";
  317. var toDate = "";
  318. var period = "";
  319. for(var i = 0; i &lt; items.length; i++) {
  320. var formElementName = items[i].getElementsByTagName("name")[0].firstChild.nodeValue;
  321. var formElementValue = items[i].getElementsByTagName("value")[0].firstChild.nodeValue;
  322. if (formElementName == "period"){
  323. period = formElementValue;
  324. }else if (formElementName == "fromDate"){
  325. fromDate = formElementValue;
  326. } else if (formElementName == "toDate"){
  327. toDate = formElementValue;
  328. }
  329. }
  330. var newDateSelection = {"fromDate":fromDate, "toDate":toDate, "period": period};
  331. updateFormForNewDateSelection(newDateSelection);
  332. return (newDateSelection);
  333. }
  334. function updateFormForNewDateSelection(newDateSelection){
  335. with(document.pform){
  336. p_period.value = newDateSelection.period;
  337. if ( newDateSelection.period == "day"){
  338. p_output_date.value = newDateSelection.fromDate;
  339. } else {
  340. p_output_from_date.value = newDateSelection.fromDate;
  341. p_output_to_date.value = newDateSelection.toDate;
  342. }
  343. }
  344. }
  345. function updateVersionAfterDateSelection(sResponse)
  346. {
  347. dateSelection = parseDateSelectionResponse(sResponse);
  348. currentDateRequest = getXMLHttpRequest();
  349. <xsl:variable name="dateURL">
  350. <xsl:value-of select="$gateway"/>
  351. <xsl:text>?b_action=xts.run&amp;m=portal/outputs/dateFormat.xts</xsl:text>
  352. </xsl:variable>
  353. var dateUrl = "<xsl:value-of select="xtsext:javascriptencode($dateURL)"/>&amp;fromDate=" + dateSelection.fromDate;
  354. dateUrl += "&amp;toDate=" + dateSelection.toDate;
  355. dateUrl += "&amp;datePeriod=" + dateSelection.period;
  356. currentDateRequest.open("GET", dateUrl, true);
  357. currentDateRequest.onreadystatechange = updateSelectedDateSection;
  358. currentDateRequest.send(null);
  359. var containingClass = "<xsl:value-of select="xtsext:javascriptencode($containingClass)"/>";
  360. <xsl:variable name="versionsURL">
  361. <xsl:value-of select="$gateway"/>
  362. <xsl:text>/atom/ecm/versions/</xsl:text>
  363. <xsl:value-of select="/root/cm:queryResponse/cm:queryReply[1]/*/cm:storeID"/>
  364. </xsl:variable>
  365. var url = "<xsl:value-of select="xtsext:javascriptencode($versionsURL)"/>";
  366. url += "?dateafter=" + dateSelection.fromDate + "&amp;datebefore=" + dateSelection.toDate;
  367. url += "&amp;period=" + dateSelection.period + "&amp;containingClass=" + containingClass;
  368. url += "&amp;json";
  369. url += getTenancyParm();
  370. versionsPager.getData(url);
  371. }
  372. function getData(selectedConnectionTenantID) {
  373. var dateAfter = '<xsl:value-of select="$output_from_date"/>';
  374. var dateBefore = '<xsl:value-of select="$output_to_date"/>';
  375. var period = 'range';
  376. if (dateSelection) {
  377. dateAfter = dateSelection.fromDate;
  378. dateBefore = dateSelection.toDate
  379. period = dateSelection.period;
  380. }
  381. connectionTenantID = selectedConnectionTenantID;
  382. currentDateRequest = getXMLHttpRequest();
  383. <xsl:variable name="dateURL2">
  384. <xsl:value-of select="$gateway"/>
  385. <xsl:text>?b_action=xts.run&amp;m=portal/outputs/dateFormat.xts</xsl:text>
  386. </xsl:variable>
  387. var containingClass = "<xsl:value-of select="xtsext:javascriptencode($containingClass)"/>";
  388. var url = "<xsl:value-of select="xtsext:javascriptencode($versionsURL)"/>";
  389. url += "?dateafter="+dateAfter;
  390. url += "&amp;datebefore="+dateBefore;
  391. url += "&amp;period="+period;
  392. url += "&amp;containingClass=" + containingClass;
  393. url += "&amp;json";
  394. url += getTenancyParm();
  395. versionsPager.getData(url);
  396. }
  397. function updateSelectedDateSection(){
  398. try{
  399. if (currentDateRequest.readyState == 4)
  400. {
  401. if (currentDateRequest.status &gt;= 200 &amp;&amp; currentDateRequest.status &lt; 300)
  402. {
  403. var response = eval("(" + currentDateRequest.responseText + ")");
  404. var dateSpan = document.getElementById("dateSelectionResult");
  405. dateSpan.innerHTML = response.formatedString;
  406. }
  407. }
  408. }
  409. catch (e){alert(e);}
  410. }
  411. <!-- End of modal -->
  412. function changeTab(tab) {
  413. var form = document.pform;
  414. form.m.value = '<xsl:value-of select="$app"/>/outputs.xts';
  415. if (tab === 'recentVersions') {
  416. form.output_tab.value = '';
  417. form.submit();
  418. } else if (tab === 'oldVersions') {
  419. form.cur_lang.value = 'all';
  420. form.ps_nav_op.value = 'maintain';
  421. form.output_tab.value = 'arch';
  422. form.submit();
  423. }
  424. }
  425. function retrieveOutputFor(event, url) {
  426. var outputWindow = window.open(url, 'outputWindow', 'toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=750,height=600');
  427. event.cancelBubble = 'true';
  428. if (event.stopPropagation) {
  429. event.stopPropagation();
  430. event.preventDefault();
  431. }
  432. return false;
  433. }
  434. </script>
  435. </dp:script>
  436. <utml:form name="pform" method="post" action="{$gateway}">
  437. <utml:input name="output_tab" type="hidden" value="arch"/>
  438. <dp:header dp:kbA11y="true">
  439. <dp:title>
  440. <xsl:copy-of select="$browserTitle"/>
  441. </dp:title>
  442. </dp:header>
  443. <dp:tabs>
  444. <cp:tabset>
  445. <cp:select>oldVersions</cp:select>
  446. <cp:tab name="recentVersions" position="start">
  447. <a href="#" onclick="javascript:changeTab('recentVersions');">
  448. <xsl:attribute name="onkeypress">javascript:if (event.keyCode==13 || event.keyCode==32 || event.charCode==32){this.onclick(); return false;}return true;</xsl:attribute>
  449. <xsl:text/><cp:label><xts:string id="IDS_PREVIOUS_VERSION_CURRENT_TAB"/></cp:label><xsl:text/>
  450. </a>
  451. </cp:tab>
  452. <cp:tab name="oldVersions" position="end">
  453. <a href="#" onclick="javascript:changeTab('oldVersions');">
  454. <xsl:attribute name="onkeypress">javascript:if (event.keyCode==13 || event.keyCode==32 || event.charCode==32){this.onclick(); return false;}return true;</xsl:attribute>
  455. <xsl:text/><cp:label><xts:string id="IDS_PREVIOUS_VERSION_ARCHIVED_TAB"/></cp:label><xsl:text/>
  456. </a>
  457. </cp:tab>
  458. </cp:tabset>
  459. </dp:tabs>
  460. <dp:description dp:kbA11y="true" aria-labelledby="oldTabIntro">
  461. <xts:string id="IDS_PREVIOUS_VERSION_ARCHIVE_TAB_INTRO"/>
  462. </dp:description>
  463. <span class="psPagerHiddenLabel" id="oldTabIntro"><xsl:value-of select="$tabDescription"/></span>
  464. <xsl:variable name="dateSelectorTitle"><xts:string id="IDS_PREVIOUS_VERSION_DATE_SELECT_TITLE"/></xsl:variable>
  465. <iframe name="dialogWindow" id="dialogWindow" style="display:none; z-index:50; position: absolute;" />
  466. <xsl:variable name="drTitle"><xts:string id="IDS_PREVIOUS_VERSION_ARCHIVE_TAB_SELECT_DATE_RANGE_DIALOG"/></xsl:variable>
  467. <div id="dialogWindowContainer" tabindex="-1" style="cursor:default;display:none; position: absolute; z-index:50; overflow:none; padding-top:10px;" role="dialog" aria-label="{$drTitle}">
  468. <iframe name="dialogWindow2" id="dialogWindow2" style="width:500px; height:300px; position: relative;" class="visible" />
  469. </div>
  470. <div id="windowMask" style="z-index:49; display:none; position: absolute; width:100%; height:100%; left:0px; top:0px;">
  471. <table width="100%" height="100%" role="presentation">
  472. <tr>
  473. <td/>
  474. </tr>
  475. </table>
  476. </div>
  477. <xsl:variable name="dateRangeValue">
  478. <xsl:choose>
  479. <xsl:when test="/root/env/param[@name = 'p_period'] != 'range'">
  480. <xsl:variable name="outputDateValue">
  481. <xsl:value-of select="xtsext:formatDateOnlyFromUTC( string( $output_date ), number( '2' ), string( $timeZone ), string( $contentLocale ) )"/>
  482. </xsl:variable>
  483. <xsl:value-of select="xtsext:enforceBTD($outputDateValue, 'auto', $productLocale, boolean($isBidiEnabled='true'))"/>
  484. </xsl:when>
  485. <xsl:otherwise>
  486. <xsl:variable name="FromOutputDateValue">
  487. <xsl:value-of select="xtsext:formatDateOnlyFromUTC( string( $output_from_date ), number( '2' ), string( $timeZone ), string( $contentLocale ) )"/>
  488. </xsl:variable>
  489. <xsl:variable name="ToOutputDateValue">
  490. <xsl:value-of select="xtsext:formatDateOnlyFromUTC( string( $output_to_date ), number( '2' ), string( $timeZone ), string( $contentLocale ) )"/>
  491. </xsl:variable>
  492. <xts:string id="IDS_PREVIOUS_VERSION_ARCHIVED_TAB_DATE_RANGE_VALUE">
  493. <xts:param name="from"><xsl:value-of select="xtsext:enforceBTD($FromOutputDateValue, 'auto', $productLocale, boolean($isBidiEnabled='true'))"/></xts:param>
  494. <xts:param name="to"><xsl:value-of select="xtsext:enforceBTD($ToOutputDateValue, 'auto', $productLocale, boolean($isBidiEnabled='true'))"/></xts:param>
  495. </xts:string>
  496. </xsl:otherwise>
  497. </xsl:choose>
  498. </xsl:variable>
  499. <lyt:layout style="2" lyt:kbA11y="true">
  500. <lyt:section>
  501. <dp:list width="100%" dp:kbA11y="true">
  502. <dp:section dp:kbA11y="true" aria-labelledby="dateRange">
  503. <dp:label valign="top" width="15%"><xts:string id="IDS_PREVIOUS_VERSION_ARCHIVED_TAB_DATE_RANGE"/></dp:label>
  504. </dp:section>
  505. <span class="psPagerHiddenLabel" id="dateRange"><xts:string id="IDS_PREVIOUS_VERSION_ARCHIVED_TAB_DATE_RANGE"/></span>
  506. <dp:section>
  507. <dp:text nowrap="nowrap" valign="top">
  508. <span id="dateSelectionResult" aria-labelledby="dateRangeValue">
  509. <xsl:value-of select="$dateRangeValue"/>
  510. </span>
  511. <span class="psPagerHiddenLabel" id="dateRangeValue"><xsl:value-of select="$dateRangeValue"/></span>
  512. </dp:text>
  513. <dp:link>
  514. <a href="#" onclick="openDialog();" style="margin-left: 3px;" title="" alt="" id="dateSelectorLink" role="button" >
  515. <xsl:attribute name="onkeypress">javascript:if (event.keyCode==13 || event.keyCode==32 || event.charCode==32){this.onclick(); return false;}return true;</xsl:attribute>
  516. <xts:string id="IDS_PREVIOUS_VERSION_ARCHIVE_TAB_SELECT_DATE_RANGE"/>
  517. </a>
  518. </dp:link>
  519. </dp:section>
  520. </dp:list>
  521. </lyt:section>
  522. <lyt:section lyt:kbA11y="true">
  523. <dp:list width="100%" dp:kbA11y="true">
  524. <dp:section>
  525. </dp:section>
  526. </dp:list>
  527. </lyt:section>
  528. </lyt:layout>
  529. <!-- connection drop down -->
  530. <xsl:if test="count($connections/*[local-name()='dataSourceConnection']) &gt; 1">
  531. <lyt:layout style="2" lyt:kbA11y="true">
  532. <lyt:section>
  533. <dp:list width="100%" dp:kbA11y="true">
  534. <dp:section dp:kbA11y="true" aria-labelledby="connection">
  535. <dp:label valign="top" width="15%"><xts:string id="IDS_PREVIOUS_VERSION_ARCHIVED_TAB_CONNECTION"/></dp:label>
  536. </dp:section>
  537. <span class="psPagerHiddenLabel" id="connection"><xts:string id="IDS_PREVIOUS_VERSION_ARCHIVED_TAB_CONNECTION"/></span>
  538. <dp:section>
  539. <dp:group>
  540. <dp:groupItem>
  541. <utml:select id="p_connectionTenantID" name="p_connectionTenantID" onchange="getData(this.value)">
  542. <utml:default-value><xsl:value-of select="$defaultConnection/*[local-name()='dataSourceConnection']/*[local-name()='tenantID']"/></utml:default-value>
  543. <xsl:for-each select="$connections/*[local-name()='dataSourceConnection']">
  544. <xsl:variable name="label">
  545. <xsl:choose>
  546. <xsl:when test="(key('session-param', 'e_showTenantInfo') = 'true') and (*[local-name()='tenantID'] != '') and (key('session-param', 'e_tenantDisplayName') != '')">
  547. <xts:string id="IDS_USERINFO_WITHTENANT">
  548. <xts:param name="userName"><xsl:value-of select="*[local-name()='defaultName']"/></xts:param>
  549. <xts:param name="tenantName"><xsl:value-of select="*[local-name()='tenantName']"/></xts:param>
  550. </xts:string>
  551. </xsl:when>
  552. <xsl:otherwise>
  553. <xts:string id="IDS_USERINFO">
  554. <xts:param name="userName"><xsl:value-of select="*[local-name()='defaultName']"/></xts:param>
  555. </xts:string>
  556. </xsl:otherwise>
  557. </xsl:choose>
  558. </xsl:variable>
  559. <utml:option>
  560. <utml:value><xsl:value-of select="*[local-name()='tenantID']"/></utml:value>
  561. <xsl:value-of select="$label"/></utml:option>
  562. </xsl:for-each>
  563. </utml:select>
  564. </dp:groupItem>
  565. </dp:group>
  566. </dp:section>
  567. </dp:list>
  568. </lyt:section>
  569. </lyt:layout>
  570. </xsl:if>
  571. <lyt:layout style="2" lyt:kbA11y="true">
  572. <lyt:section>
  573. <xsl:variable name="verGroupLab"><xts:string id="IDS_PROP_A11Y_REPORT_VERSION_LABEL" encode="html"/></xsl:variable>
  574. <div style="padding: 3px" role="group" aria-label="{$verGroupLab}">
  575. <div role="application" >
  576. <xsl:attribute name="aria-label"><xts:string id="IDS_PREVIOUS_VERSION_ARCHIVED_TAB_VERSIONS_GRID" encode="html"/></xsl:attribute>
  577. <div id="versionsPager"/>
  578. </div>
  579. </div>
  580. </lyt:section>
  581. <lyt:section>
  582. <xsl:variable name="outGroupLab"><xts:string id="IDS_PROP_A11Y_REPORT_OUTPUT_LABEL" encode="html"/></xsl:variable>
  583. <div style="padding: 3px" role="group" aria-label="{$outGroupLab}">
  584. <div role="application">
  585. <xsl:attribute name="aria-label"><xts:string id="IDS_PREVIOUS_VERSION_ARCHIVED_TAB_OUTPUTS_GRID" encode="html"/></xsl:attribute>
  586. <div id="outputsPager" />
  587. </div>
  588. </div>
  589. </lyt:section>
  590. </lyt:layout>
  591. <dp:footer>
  592. <df:button df:id="IDS_CLOSE" df:style="back-url" df:kbA11y="true"/>
  593. </dp:footer>
  594. <utml:input type="hidden" name="p_period">
  595. <xsl:attribute name="value">
  596. <xsl:choose>
  597. <xsl:when test="/root/env/param[@name='p_period']"><xsl:value-of select="/root/env/param[@name='p_period']"/></xsl:when>
  598. <xsl:otherwise>range</xsl:otherwise>
  599. </xsl:choose>
  600. </xsl:attribute>
  601. </utml:input>
  602. <utml:input type="hidden" name="p_output_date" />
  603. <utml:input type="hidden" name="p_output_from_date" >
  604. <xsl:attribute name="value"><xsl:value-of select="$output_from_date_unAdj"/></xsl:attribute>
  605. </utml:input>
  606. <utml:input type="hidden" name="p_output_to_date" >
  607. <xsl:attribute name="value"><xsl:value-of select="$output_to_date_unAdj"/></xsl:attribute>
  608. </utml:input>
  609. </utml:form>
  610. </dp:page>
  611. </xsl:template>
  612. </xsl:stylesheet>