versions.xts 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  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, 2013
  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. <!-- Initialize utml -->
  14. <!-- =============================================================================================== -->
  15. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  16. <!-- Cleanup after a delete operation -->
  17. <!-- =============================================================================================== -->
  18. <xts:block id="removeParam" processor="XML" type="exec" dependency="formlogic_init" condition=".[root/env/param[@name='vrsn_del']='true']" mandatory="false">
  19. <xts:sequence>
  20. <xts:delete select="/root/env/param[@name='packed-output']"/>
  21. <xts:delete select="/root/env/param[@name='packed-langs']"/>
  22. <xts:delete select="/root/env/param[@name='vrsn_del']"/>
  23. <xts:delete select="/root/env/param[@name='ifrmcmd']"/>
  24. <xts:delete select="/root/env/param[starts-with(@name,'checkbox_')]"/>
  25. </xts:sequence>
  26. </xts:block>
  27. <!-- Get the versions -->
  28. <!-- =============================================================================================== -->
  29. <xts:block id="getVersions" processor="XSLT" type="exec" dependency="removeParam" mandatory="false">
  30. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  31. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  32. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  33. <xsl:template match="/root">
  34. <xsl:variable name="sortOrder">
  35. <xsl:choose>
  36. <xsl:when test="/root/env/param[@name = 's_version'] = 'na'">ascending</xsl:when>
  37. <xsl:otherwise>descending</xsl:otherwise>
  38. </xsl:choose>
  39. </xsl:variable>
  40. <xsl:variable name="maxObjects">
  41. <xsl:choose>
  42. <xsl:when test="string(/root/env/param[@name = 'm_pagertoversions']) !='' and string(/root/env/param[@name = 'm_pagerfromversions']) !=''"><xsl:value-of select="(/root/env/param[@name = 'm_pagertoversions'] - /root/env/param[@name = 'm_pagerfromversions']) + 1"/></xsl:when>
  43. <xsl:otherwise><xsl:value-of select="/root/session/param[@name='linesPerPage']"/></xsl:otherwise>
  44. </xsl:choose>
  45. </xsl:variable>
  46. <xsl:variable name="skipObjects">
  47. <xsl:choose>
  48. <xsl:when test="/root/env/param[@name = 'm_pagerfromversions'] and /root/env/param[@name = 'm_pagerfromversions']!=''">
  49. <xsl:value-of select="(/root/env/param[@name = 'm_pagerfromversions'])-1"/>
  50. </xsl:when>
  51. <xsl:when test="/root/env/param[@name='m_versionssection']!=''">
  52. <xsl:choose>
  53. <xsl:when test="/root/env/param[@name='m_versionssection']!='-1'">
  54. <xsl:value-of select="((/root/env/param[@name='m_versionssection']) -1)"/>
  55. </xsl:when>
  56. <xsl:otherwise>
  57. <xsl:value-of select="($maxObjects) * -1"/>
  58. </xsl:otherwise>
  59. </xsl:choose>
  60. </xsl:when>
  61. <xsl:otherwise>0</xsl:otherwise>
  62. </xsl:choose>
  63. </xsl:variable>
  64. <xts:sequence>
  65. <xts:append>
  66. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  67. <send:request provider="cm">
  68. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  69. <cm:query>
  70. <cm:requests>
  71. <cm:query>
  72. <cm:search>
  73. <xsl:value-of select="/root/env/param[@name='m_obj']"/>
  74. </cm:search>
  75. <cm:properties>
  76. <cm:property name="permissions"/>
  77. </cm:properties>
  78. </cm:query>
  79. <cm:query>
  80. <cm:search>
  81. <xsl:choose>
  82. <xsl:when test="/root/env/param[@name='m_class'] = 'document'"><xsl:value-of select="/root/env/param[@name='m_obj']"/>/documentVersion[permission('read')][@shown='true']</xsl:when>
  83. <xsl:otherwise><xsl:value-of select="/root/env/param[@name='m_obj']"/>/reportVersion[permission('read')][@shown='true']<xsl:text/></xsl:otherwise>
  84. </xsl:choose>
  85. </cm:search>
  86. <cm:properties>
  87. <cm:property name="defaultName"/>
  88. <cm:property name="modificationTime"/>
  89. <cm:property name="searchPath"/>
  90. <cm:property name="permissions"/>
  91. <cm:property name="asOfTime"/>
  92. <cm:property name="position"/>
  93. <cm:property name="hidden"/>
  94. </cm:properties>
  95. <cm:sortBy>
  96. <cm:sort name="defaultName" order="{$sortOrder}"/>
  97. </cm:sortBy>
  98. <cm:options schemaInfo="true" maxObjects="{($maxObjects)+1}" skipObjects="{$skipObjects}"/>
  99. </cm:query>
  100. </cm:requests>
  101. </cm:query>
  102. </xts:transform>
  103. </send:request>
  104. </xts:transform>
  105. </xts:append>
  106. <xts:delete select="/root/env/param[@name='pagerfromversions']"/>
  107. <xts:delete select="/root/env/param[@name='pagertoversions']"/>
  108. <xts:delete select="/root/env/param[@name='pagerfrom_dversions']"/>
  109. <xts:delete select="/root/env/param[@name='pagerto_dversions']"/>
  110. </xts:sequence>
  111. </xsl:template>
  112. </xsl:stylesheet>
  113. </xts:block>
  114. <!-- Response -->
  115. <!-- =============================================================================================== -->
  116. <xts:block id="format" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="getVersions">
  117. <xts:logicsheet path="logicsheets/portal.xsl"/>
  118. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  119. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  120. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  121. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  122. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  123. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  124. <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  125. <xsl:stylesheet version="1.0"
  126. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  127. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  128. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  129. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  130. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  131. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  132. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  133. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  134. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  135. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  136. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  137. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  138. exclude-result-prefixes="xsl cm cml pf xts xtsext lyt dp df cf cp utml">
  139. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  140. <xsl:variable name="mname" select="'versions.xts'"/>
  141. <pf:variables/>
  142. <xsl:template match="/root">
  143. <!--
  144. We use access permission on the report object (instad of each version) to determine if the user can delete.
  145. This assumes that the versions inherit security from the report
  146. -->
  147. <xsl:variable name="canWrite" select="contains(/root/cm:queryResponse/cm:queryReply[1]/*/cm:permissions,'write')"/>
  148. <xsl:variable name="browserTitle">
  149. <xsl:choose>
  150. <xsl:when test="key('env-param', 'm_class') = 'document'">
  151. <xts:string id="IDS_DOCUMENT_PREVIOUS_VERSION_MANAGE_VERSIONS_TITLE">
  152. <xts:param name="objectName">
  153. <span lang="{$contentLocale}"><xsl:value-of select="key('env-param', 'm_name')"/></span>
  154. </xts:param>
  155. </xts:string>
  156. </xsl:when>
  157. <xsl:otherwise>
  158. <xts:string id="IDS_PREVIOUS_VERSION_MANAGE_VERSIONS_TITLE">
  159. <xts:param name="objectName">
  160. <span lang="{$contentLocale}"><xsl:value-of select="key('env-param', 'm_name')"/></span>
  161. </xts:param>
  162. </xts:string>
  163. </xsl:otherwise>
  164. </xsl:choose>
  165. </xsl:variable>
  166. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  167. <dp:meta>
  168. <pf:meta/>
  169. </dp:meta>
  170. <dp:script>
  171. <xsl:choose>
  172. <xsl:when test="/root/env/param[@name='m_class'] = 'document'"><pf:help/></xsl:when>
  173. <xsl:otherwise><pf:help context="HID_VIEW_REPORT_VERSION"/></xsl:otherwise>
  174. </xsl:choose>
  175. <script language="javascript">
  176. var sParamDelimiter = "<xsl:value-of select="xtsext:javascriptencode(string(key('system-param', 'delimiters')/@d1))"/>";
  177. var sNameValueDelimiter = "<xsl:value-of select="xtsext:javascriptencode(string(key('system-param', 'delimiters')/@d2))"/>";
  178. </script>
  179. <script language="javascript">
  180. <xsl:attribute name="src">
  181. <xsl:value-of select="$webcontent"/>/<xsl:value-of select="$app"/>/js/list.js<xsl:text/>
  182. </xsl:attribute>
  183. </script>
  184. <script language="JavaScript">
  185. <!-- Find out what object we are dealing with -->
  186. <xsl:variable name="objClass" select="xtsext:javascriptencode(string(/root/cm:queryResponse/cm:queryReply[1]/*/cm:objectClass))"/>
  187. var isDocumentObj = <xsl:value-of select="$objClass = 'document'"/>;
  188. function sort()
  189. {
  190. if ("<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 's_version')))"/>" == "" || "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 's_version')))"/>" == "nd")
  191. document.pform.s_version.value = "na";
  192. else
  193. document.pform.s_version.value = "nd";
  194. document.pform.ps_nav_op.value = "maintain";
  195. document.pform.m.value = "<xsl:value-of select="$app"/>/<xsl:value-of select="$mname"/>";
  196. document.pform.submit();
  197. }
  198. function closePage()
  199. {
  200. var bNoObjectsFound = <xsl:value-of select="(count(/root/cm:queryResponse/cm:queryReply[2]/cm:reportVersion) = 0) and (count(/root/cm:queryResponse/cm:queryReply[2]/cm:documentVersion) = 0)"/>;
  201. if (bNoObjectsFound)
  202. {
  203. if (document.pform.backURL.value != "")
  204. document.location.href = document.pform.backURL.value;
  205. else
  206. document.location.href = "<xsl:value-of select="/root/http/param[@name='SCRIPT_NAME']"/>?<xsl:value-of select="key('system-param', 'COGNOSHome')"/>";
  207. }
  208. else
  209. {
  210. document.pform.ps_nav_op.value = "maintain";
  211. document.pform.m.value = "<xsl:value-of select="$app"/>/outputs.xts";
  212. document.pform.submit();
  213. }
  214. }
  215. function view(version)
  216. {
  217. document.pform.ps_nav_op.value = "maintain";
  218. document.pform.m.value = "<xsl:value-of select="$app"/>/outputs.xts";
  219. document.pform.reportVersionPath.value = version;
  220. if (document.pform.m_outputssection)
  221. document.pform.m_outputssection.value = 1;
  222. document.pform.submit();
  223. }
  224. function doDelete()
  225. {
  226. <!-- // check for no selection -->
  227. if (isEmptySelection('pform', 'checkbox_'))
  228. {
  229. alert("<xts:string id="IDS_ERR_DELETE_NO_SELECTION" encode="javascript"/>");
  230. return;
  231. }
  232. <!-- Prevent a delete all versions for document objects -->
  233. if (isDocumentObj &amp;&amp; isDeleteAll())
  234. {
  235. var sErrorMsg = "<xts:string id="IDS_PREVIOUS_VERSION_DOCUMENT_DELETE_ERROR" encode="javascript"/>";
  236. alert(sErrorMsg);
  237. return;
  238. }
  239. <!--
  240. /*
  241. Reproduce the search path of the version being viewed using the path to the report (m_obj) and the version name.
  242. This path must match the pattern of the search path returned by CM so that we can successfully detect if a version being viewed is now getting deleted.
  243. */
  244. -->
  245. <xsl:variable name="activeVersion">
  246. <xsl:choose>
  247. <xsl:when test="key('env-param', 'versionName') and key('env-param', 'versionName') != ''">
  248. <xsl:value-of select="key('env-param', 'm_obj')"/>/reportVersion[@name='<xsl:value-of select="key('env-param', 'versionName')"/>']<xsl:text/>
  249. </xsl:when>
  250. <xsl:otherwise>
  251. <xsl:value-of select="key('env-param', 'reportVersionPath')"/>
  252. </xsl:otherwise>
  253. </xsl:choose>
  254. </xsl:variable>
  255. var activeVersion = "<xsl:value-of select="xtsext:urlencode(string($activeVersion))"/>";
  256. var elements = document.pform.elements.length;
  257. <!-- // If an opened version is being deleted then remove any references to it ... -->
  258. for (var k = 0; k &lt; elements; k++)
  259. {
  260. if (document.pform.elements[k].name.indexOf("checkbox") == 0 &amp;&amp; document.pform.elements[k].checked &amp;&amp; document.pform.elements[k].value == activeVersion)
  261. {
  262. <!-- // clear target version if it is being deleted -->
  263. document.pform.reportVersionPath.value = "";
  264. <!-- // Clear the name of a version being deleted if it is being referenced by name -->
  265. if (document.pform.versionName )
  266. document.pform.versionName.value = "";
  267. <!-- // clear page number -->
  268. if (document.pform.m_outputssection)
  269. document.pform.m_outputssection.value = 1;
  270. break;
  271. }
  272. }
  273. <!--Perform the delete after confirmation -->
  274. if ( confirm("<xts:string id="IDS_CONF_DELETE_MULTI" encode="javascript"/>") )
  275. {
  276. document.pform.ifrmcmd.value = "delete"; <!--set the operation, and submit it. -->
  277. document.pform.m_return.value = "<xsl:value-of select="concat($app, '/', $mname)"/>";
  278. document.pform.vrsn_del.value="true";
  279. document.pform.m.value="<xsl:value-of select="concat($app, '/submit.xts')"/>";
  280. document.pform.submit();
  281. }
  282. return;
  283. }
  284. <!-- Generic function to detect if the current delete operation will clear all version objects from the DataStore -->
  285. function isDeleteAll()
  286. {
  287. var nCheckedEntriesCount = 0;
  288. var nDisplayedEntriesCount = 0;
  289. var nFormFieldCount = document.pform.elements.length;
  290. for (var k = 0; k &lt; nFormFieldCount; k++)
  291. {
  292. if (document.pform.elements[k].name.indexOf("checkbox_") == 0)
  293. {
  294. nDisplayedEntriesCount++;
  295. if (document.pform.elements[k].checked)
  296. nCheckedEntriesCount++;
  297. }
  298. }
  299. <!-- Position of the first entry. -->
  300. var nPositionOfFirstVersion = <xsl:value-of select="number(/root/cm:queryResponse/cm:queryReply[2]/*[1]/cm:position)"/>;
  301. <!-- Actual count of entries requested from CM. (We typically request the number of items in the LinesPerPage preference + 1) -->
  302. var nTotalCountOfItemsRequested = <xsl:value-of select="count(/root/cm:queryResponse/cm:queryReply[2]/*)"/>;
  303. <!-- Detect if we are currently looking at a "paged" list of entries (i.e. there are entries before or after. -->
  304. var bThereIsMoreBefore = (nPositionOfFirstVersion &gt; 0);
  305. var bThereIsMoreAfter = (nTotalCountOfItemsRequested &gt; nDisplayedEntriesCount);
  306. if (bThereIsMoreBefore || bThereIsMoreAfter)
  307. <!-- We must be paging - It is safe to "delete all" -->
  308. return false;
  309. if (nCheckedEntriesCount &lt; nDisplayedEntriesCount)
  310. <!-- Not all items are tagged for delete - OK to proceed with delete operation -->
  311. return false;
  312. if (nCheckedEntriesCount == nDisplayedEntriesCount)
  313. return true;
  314. return false;
  315. }
  316. </script>
  317. </dp:script>
  318. <utml:form name="pform" method="post" action="{$gateway}">
  319. <utml:exclusion-list>
  320. <xsl:value-of select="' savedEnv '"/>
  321. </utml:exclusion-list>
  322. <utml:exclude-prefix>checkbox_</utml:exclude-prefix>
  323. <utml:input name="s_version" type="hidden" value=""/>
  324. <utml:input name="ifrmcmd" type="hidden" value=""/>
  325. <utml:input name="m_return" type="hidden" value=""/>
  326. <utml:input name="vrsn_del" type="hidden" value=""/>
  327. <utml:input name="method" type="hidden" value=""/>
  328. <utml:input name="m" type="hidden" value=""/>
  329. <dp:header>
  330. <dp:title><xsl:copy-of select="$browserTitle"/></dp:title>
  331. <dp:close><a href="javascript:closePage()"><dp:closeMarker/></a></dp:close>
  332. <dp:description>
  333. <xts:string id="IDS_PREVIOUS_VERSION_DELETE_VERSIONS"/>
  334. </dp:description>
  335. </dp:header>
  336. <lyt:layout style="1">
  337. <lyt:section>
  338. <xsl:choose>
  339. <xsl:when test="count(/root/cm:queryResponse/cm:queryReply[2]/cm:reportVersion) > 0 or (key('env-param', 'm_pagertoversions') != '')">
  340. <cf:main-pager-section name="versions" form="pform" width="100%" virtualPage="true">
  341. <cf:param name="item-path">/root/cm:queryResponse/cm:queryReply[2]/*</cf:param>
  342. <cf:param name="target">concat(concat($app,'/'),$mname)</cf:param>
  343. <cf:param name="lines-per-page"><xsl:value-of select="key('session-param', 'linesPerPage')"/></cf:param>
  344. <cf:param name="actions">
  345. <cp:action>
  346. <xsl:if test="$canWrite">
  347. <a href="javascript:if(window.preDeleteversions)preDeleteversions('pform','checkbox_');doDelete()"><xts:string id="IDS_DELETE"/></a>
  348. </xsl:if>
  349. </cp:action>
  350. </cf:param>
  351. <cf:param name="rows">
  352. <!-- Header ========================== -->
  353. <cp:tableHeader sort_track_type="page" session-name="s_version">
  354. <!-- Col 1 - Delete check box - only if has write permissions -->
  355. <cp:columnHeader width="16" toggleName="checkbox_"/>
  356. <!-- Col 2 - Versions (dates)-->
  357. <cp:columnHeader width="50%" sort="n">
  358. <cp:sortHref>javascript:sort()</cp:sortHref>
  359. <xts:string id="IDS_PREVIOUS_VERSION_VERSIONS"/>
  360. </cp:columnHeader>
  361. <!-- Col 5 - asOfTime -->
  362. <cp:columnHeader width="50%"><xts:string id="IDS_PREVIOUS_VERSION_ASOFTIME"/></cp:columnHeader>
  363. </cp:tableHeader>
  364. <!-- Content ========================== -->
  365. <cp:tableContent>
  366. <!-- Col 1 - Delete checkbox column content - only if has write permissions -->
  367. <cp:columnContent valign="top" position="start">
  368. <xsl:if test="$canWrite">
  369. <input type="checkbox" value="{xtsext:urlencode(string(cm:searchPath))}" name="checkbox_{position()}" id="checkbox_{position()}"/>
  370. </xsl:if>
  371. </cp:columnContent>
  372. <!-- Col 2 - Versions (dates)-->
  373. <cp:columnContent valign="top">
  374. <xsl:if test="string(cm:hidden)='true'">
  375. <xsl:attribute name="class">
  376. <xsl:text/>inactiveTableText<xsl:text/>
  377. </xsl:attribute>
  378. </xsl:if>
  379. <xsl:variable name="versionDisplayName" select="xtsext:formatDateFromUTC( string( cm:defaultName ), number( '2' ), number( '3' ), string( $timeZone ), string( $contentLocale ) )"/>
  380. <xsl:choose>
  381. <xsl:when test="key('system-param', 'versions')/optimized">
  382. <a href="#" onclick="view('{xtsext:javascriptencode(string(cm:searchPath))}')"><xsl:value-of select="$versionDisplayName"/></a>
  383. </xsl:when>
  384. <xsl:otherwise>
  385. <xsl:value-of select="$versionDisplayName"/>
  386. </xsl:otherwise>
  387. </xsl:choose>
  388. </cp:columnContent>
  389. <!-- Col 5 - As of time -->
  390. <cp:columnContent valign="top">
  391. <xsl:value-of select="xtsext:formatDateFromUTC( string( cm:asOfTime ), number( '2' ), number( '3' ), string( $timeZone ), string( $contentLocale ) )"/>
  392. </cp:columnContent>
  393. </cp:tableContent>
  394. </cf:param>
  395. </cf:main-pager-section>
  396. </xsl:when>
  397. <xsl:when test="(count(/root/cm:queryResponse/cm:queryReply[2]/cm:documentVersion) > 0) or (key('env-param', 'm_pagertoversions') != '')">
  398. <cf:main-pager-section name="versions" form="pform" width="100%" virtualPage="true">
  399. <cf:param name="item-path">/root/cm:queryResponse/cm:queryReply[2]/*</cf:param>
  400. <cf:param name="target">concat(concat($app,'/'),$mname)</cf:param>
  401. <cf:param name="lines-per-page"><xsl:value-of select="key('session-param', 'linesPerPage')"/></cf:param>
  402. <cf:param name="actions">
  403. <cp:action>
  404. <xsl:if test="$canWrite">
  405. <a href="javascript:if(window.preDeleteversions)preDeleteversions('pform','checkbox_');doDelete()"><xts:string id="IDS_DELETE"/></a>
  406. </xsl:if>
  407. </cp:action>
  408. </cf:param>
  409. <cf:param name="rows">
  410. <!-- Header ========================== -->
  411. <cp:tableHeader sort_track_type="page" session-name="s_version">
  412. <!-- Col 1 - Delete check box - only if has write permissions -->
  413. <cp:columnHeader width="5" toggleName="checkbox_"/>
  414. <!-- Col 2 - Versions (dates)-->
  415. <cp:columnHeader width="100%" sort="n">
  416. <cp:sortHref>javascript:sort()</cp:sortHref>
  417. <xts:string id="IDS_PREVIOUS_VERSION_VERSIONS"/>
  418. </cp:columnHeader>
  419. </cp:tableHeader>
  420. <!-- Content ========================== -->
  421. <cp:tableContent>
  422. <!-- Col 1 - Delete checkbox column content - only if has write permissions -->
  423. <cp:columnContent valign="top" position="start">
  424. <xsl:if test="$canWrite">
  425. <input type="checkbox" value="{xtsext:urlencode(string(cm:searchPath))}" name="checkbox_{position()}"/>
  426. </xsl:if>
  427. </cp:columnContent>
  428. <!-- Col 2 - Versions (dates)-->
  429. <cp:columnContent valign="top">
  430. <xsl:variable name="versionDisplayName" select="xtsext:formatDateFromUTC( string( cm:defaultName ), number( '2' ), number( '3' ), string( $timeZone ), string( $contentLocale ) )"/>
  431. <xsl:choose>
  432. <xsl:when test="key('system-param', 'versions')/optimized">
  433. <a href="#" onclick="view('{xtsext:javascriptencode(string(cm:searchPath))}')"><xsl:value-of select="$versionDisplayName"/></a>
  434. </xsl:when>
  435. <xsl:otherwise>
  436. <xsl:value-of select="$versionDisplayName"/>
  437. </xsl:otherwise>
  438. </xsl:choose>
  439. </cp:columnContent>
  440. </cp:tableContent>
  441. </cf:param>
  442. </cf:main-pager-section>
  443. </xsl:when>
  444. <xsl:otherwise>
  445. <dp:list>
  446. <dp:section>
  447. <dp:text/>
  448. <dp:text tdClass="dialogHeaderText">
  449. <xts:string id="IDS_NO_SAVED_VERSIONS"/>
  450. <br/>
  451. </dp:text>
  452. </dp:section>
  453. </dp:list>
  454. </xsl:otherwise>
  455. </xsl:choose>
  456. </lyt:section>
  457. </lyt:layout>
  458. <!-- =================== F o o t e r ===================== -->
  459. <dp:footer>
  460. <df:button df:id="IDS_CLOSE" df:style="href" df:href="javascript:closePage()"/>
  461. </dp:footer>
  462. </utml:form>
  463. </dp:page>
  464. </xsl:template>
  465. </xsl:stylesheet>
  466. </xts:block>
  467. <!-- Debug -->
  468. <!-- ============================================================================= -->
  469. <xts:block id="debug" dependency="format" condition=".[ /root/session/param[@name='debug'] = '1' ]" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html" >
  470. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  471. <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">
  472. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  473. <dbg:templates/>
  474. <xsl:template match="/">
  475. <dbg:dumpxml select="/root"/>
  476. </xsl:template>
  477. </xsl:stylesheet>
  478. </xts:block>
  479. </xts:morphlet>