viewer-saveAs.xts 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  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. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/viewer.xml, messages/portal.xml, messages/portalRL.xml" requiredCapability="canUseCognosViewer">
  10. <!-- Reads session-sensitive info from CM -->
  11. <xts:block processor="XSLT" type="exec" mandatory="false"
  12. id="refreshSession"
  13. path="portal/cc/read_session.xml"
  14. condition=".[
  15. string(/root/cookies/cookie[@name = 'cc_session']) = ''
  16. or /root/env/param[@name='m_reload']
  17. or /root/env/param[@name='m_root'] ]">
  18. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  19. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  20. </xts:block>
  21. <!-- Update the <session> element for this request. -->
  22. <xts:block id="buildSession" path="portal/session.xml" dependency="refreshSession" processor="XSLT" type="exec"
  23. condition=".[
  24. /root/newSession
  25. or /root/env/param[@name='ui']
  26. or /root/env/param[@name='d']
  27. or /root/env/param[starts-with(@name,'m_s_')]
  28. or /root/env/param[@name = 'resetSort'] ]"
  29. mandatory="false"/>
  30. <!-- Save changes to the state info in a cookie -->
  31. <xts:block mode="interpret" processor="XSLT" type="exec"
  32. id="setSession"
  33. path="portal/set_session.xml"
  34. dependency="buildSession"
  35. condition=".[/root/updateSession]"
  36. mandatory="false"/>
  37. <xts:block id="get-object" type="exec" mode="interpret" condition=".[string(/root/env/param[@name='initializeSave'])='true']" processor="XSLT" mandatory="false">
  38. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  39. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  40. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  41. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  42. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  43. <xsl:template match="/root">
  44. <xts:sequence>
  45. <xts:append>
  46. <source>
  47. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  48. <send:request provider="cm">
  49. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  50. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  51. <cm:search>
  52. <xsl:value-of select="/root/env/param[@name='ui.object']"/>
  53. </cm:search>
  54. <cm:properties>
  55. <cm:property name="defaultName"/>
  56. <cm:property name="searchPath"/>
  57. <cm:property name="permissions"/>
  58. <cm:property name="base"/>
  59. <cm:property name="executionFormat"/>
  60. <cm:property name="executionPrompt"/>
  61. <cm:property name="defaultOutputFormat"/>
  62. <cm:property name="format"/>
  63. <cm:property name="burstKey"/>
  64. <cm:property name="locale"/>
  65. <cm:property name="ancestors"/>
  66. <cm:property name="searchPathForURL"/>
  67. <cm:property name="routingServerGroup"/>
  68. <cm:property name="metadataModelPackage"/>
  69. <cm:property name="metadataModel"/>
  70. </cm:properties>
  71. <cm:options schemaInfo="true">
  72. <cm:refProps>
  73. <cm:refProp refPropName="base">
  74. <cm:properties>
  75. <cm:property name="searchPath"/>
  76. <cm:property name="permissions"/>
  77. </cm:properties>
  78. </cm:refProp>
  79. </cm:refProps>
  80. </cm:options>
  81. </cm:query>
  82. </xts:transform>
  83. </send:request>
  84. </xts:transform>
  85. </source>
  86. </xts:append>
  87. <xts:delete select="/root/env/param[@name='initializeSave']"/>
  88. </xts:sequence>
  89. </xsl:template>
  90. </xsl:stylesheet>
  91. </xts:block>
  92. <xts:block id="formlogic_init" dependency="get-object" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt"/>
  93. <!--
  94. ================================================================================
  95. checkDuplicate
  96. Before we call the reportServer to do the save, query CM to check if an object
  97. with the same name already exists
  98. ================================================================================
  99. -->
  100. <xts:block id="checkDuplicate" processor="XSLT" type="exec" mode="interpret" dependency="formlogic_init" nodelist="env, header" condition=".[/root/env/param[@name='visited_save_as'] = 'true' and string(/root/env/param[@name='currentAction']) != 'overwrite']" mandatory="false">
  101. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  102. <xsl:stylesheet version="1.0"
  103. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  104. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  105. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  106. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  107. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  108. <xsl:variable name="saveAsName">
  109. <xsl:choose>
  110. <xsl:when test="key('env-param','err_rename') != ''"><xsl:value-of select="key('env-param','err_rename')"/></xsl:when>
  111. <xsl:otherwise><xsl:value-of select="key('env-param','m_ro_saveAsName')"/></xsl:otherwise>
  112. </xsl:choose>
  113. </xsl:variable>
  114. <xsl:variable name="saveAsPath">
  115. <xsl:choose>
  116. <xsl:when test="string(key('env-param','so.searchPath')) != ''">
  117. <xsl:value-of select="key('env-param','so.searchPath')"/>
  118. </xsl:when>
  119. <xsl:otherwise>
  120. <xsl:value-of select="key('env-param','m_ro_saveAsPath')"/>
  121. </xsl:otherwise>
  122. </xsl:choose>
  123. </xsl:variable>
  124. <xsl:template match="/">
  125. <xts:sequence>
  126. <xts:append>
  127. <checkDuplicate>
  128. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  129. <send:request provider="cm">
  130. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  131. <query xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  132. <search>
  133. <xsl:value-of select="concat($saveAsPath, '/*[@defaultName=&quot;', $saveAsName, '&quot;]')"/>
  134. </search>
  135. <properties>
  136. <property name="defaultName"/>
  137. </properties>
  138. </query>
  139. </xts:transform>
  140. </send:request>
  141. </xts:transform>
  142. </checkDuplicate>
  143. </xts:append>
  144. <xts:delete select="/root/env/param[@name='m_ro_saveAsName']"/>
  145. <xts:append select="/root/env">
  146. <param name="m_ro_saveAsName"><xsl:value-of select="$saveAsName"/></param>
  147. </xts:append>
  148. </xts:sequence>
  149. </xsl:template>
  150. </xsl:stylesheet>
  151. </xts:block>
  152. <xts:block id="launchSaveAsPage" processor="XSLT" type="exec" mode="output" dependency="setSession get-object" mimeType="text/html" contentId="callrv" partId="1" condition=".[/root/source]" mandatory="false">
  153. <xsl:stylesheet version="1.0"
  154. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  155. xmlns:cm="http://developer.cognos.com/schemas/bibus/3/"
  156. xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/"
  157. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  158. xmlns:req-params="http://developer.cognos.com/schemas/request/params"
  159. exclude-result-prefixes="xsl dlgctrl cm xtsext req-params">
  160. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  161. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  162. <xsl:template match="/">
  163. <xsl:variable name="folder">
  164. <xsl:choose>
  165. <xsl:when test="key('env-param', 'ui.folder') and key('env-param', 'ui.folder')!=''">
  166. <xsl:value-of select="key('env-param', 'ui.folder')"/>
  167. </xsl:when>
  168. <xsl:when test="/root/env/param[@name='modelPath']">
  169. <xsl:value-of select="/root/packageBase//*[local-name()='parent']//*[local-name()='searchPath']"/>
  170. </xsl:when>
  171. <xsl:when test="/root/source/*/*/*[local-name()='ancestors']/*[local-name()='ancestorInfo'][*[local-name()='objectClass']='folder' or *[local-name()='objectClass']='package']">
  172. <xsl:value-of select="/root/*[local-name()='source']/*/*/*[local-name()='ancestors']/*[local-name()='ancestorInfo'][*[local-name()='objectClass']='folder' or *[local-name()='objectClass']='package'][position() = last()]/*[local-name()='searchPath']" disable-output-escaping="yes"/>
  173. </xsl:when>
  174. </xsl:choose>
  175. </xsl:variable>
  176. <xsl:variable name="reportName">
  177. <xsl:value-of select="/root/*[local-name()='source']/*[local-name()='queryResponse']/*/*[local-name()='defaultName']"/>
  178. </xsl:variable>
  179. <html>
  180. <xsl:attribute name="lang"><xsl:value-of select="/root/user/param[@name='productLocale']"/></xsl:attribute>
  181. <head>
  182. <script language="javascript">
  183. function createFormField(sName, sValue)
  184. {
  185. var formField = document.createElement("input");
  186. formField.setAttribute("type", "hidden");
  187. formField.setAttribute("name", sName);
  188. formField.setAttribute("value", sValue);
  189. return(formField);
  190. }
  191. function submitForm()
  192. {
  193. <xsl:variable name="cvId">
  194. <xsl:value-of select="key('env-param', 'cv.id')"/>
  195. </xsl:variable>
  196. var viewerDialogForm = document.getElementById("launchSaveAs");
  197. var oCognosViewerObject = parent.oCV<xsl:value-of select="$cvId"/>;
  198. if (oCognosViewerObject)
  199. {
  200. viewerDialogForm.appendChild(createFormField("ui.conversation", oCognosViewerObject.getConversation()));
  201. viewerDialogForm.appendChild(createFormField("m_tracking", oCognosViewerObject.getTracking()));
  202. }
  203. else if (window.opener)
  204. {
  205. viewerDialogForm.appendChild(createFormField("ui.conversation", window.opener.oCV<xsl:value-of select="$cvId"/>.getConversation()));
  206. viewerDialogForm.appendChild(createFormField("m_tracking", window.opener.oCV<xsl:value-of select="$cvId"/>.getTracking()));
  207. }
  208. viewerDialogForm.submit();
  209. }
  210. </script>
  211. </head>
  212. <body onload="submitForm();">
  213. <form action="{/root/http/param[@name='SCRIPT_NAME']}" name="launchSaveAs" id="launchSaveAs" method="post" style="height:100%;margin:0px">
  214. <xsl:for-each select="/root/env/param[not(@name='m')]">
  215. <input type="hidden" name="{./@name}" value="{.}"/>
  216. </xsl:for-each>
  217. <input type="hidden" name="m" value="portal/save_as_run_option.xts"/>
  218. <input type="hidden" name="m_ro_saveAsName">
  219. <xsl:attribute name="value"><xts:string id="IDS_ACT_CUSTOM_OF"><xts:param name="curName"><xsl:value-of select="$reportName"/></xts:param></xts:string></xsl:attribute>
  220. </input>
  221. <input type="hidden" name="m_return" value="portal/viewer-saveAs.xts"/>
  222. <input type="hidden" name="save_how" value=""/>
  223. <input type="hidden" name="ps_nav_stack" value=""/>
  224. <input type="hidden" name="ps_nav_source" value="portal/viewer-saveAs.xts"/>
  225. <input type="hidden" name="ps_nav_op" value="push"/>
  226. <input type="hidden" name="m_ro_saveAsPath" value="{$folder}"/>
  227. <input type="hidden" name="tempPath" value="{$folder}"/>
  228. <input type="hidden" name="saveAsPathText" value="{$folder}"/>
  229. <input type="hidden" name="ifrmcmd" value="execute"/>
  230. <input type="hidden" name="changed_m_ro_prompt" value="0"/>
  231. <input type="hidden" name="m_ro_prompt" value="false"/>
  232. <input type="hidden" name="m_ro_saveAsType" value="reportView"/>
  233. <input type="hidden" name="m_class" value="reportView"/>
  234. <input type="hidden" name="specify_format" value="checked"/>
  235. </form>
  236. </body>
  237. </html>
  238. </xsl:template>
  239. </xsl:stylesheet>
  240. </xts:block>
  241. <xts:block id="sendRequest" processor="XSLT" type="exec" mode="output" dependency="checkDuplicate" mimeType="text/html" contentId="callSaveAs" partId="1" condition=".[not(/root/source) and string(/root/checkDuplicate/*[local-name()='queryResponse']/*/*[local-name()='defaultName']) = '' and not(/root/env/param[@name='executeSaveAs']='true') ]" mandatory="false">
  242. <xts:logicsheet path="logicsheets/portal.xsl"/>
  243. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:req-params="http://developer.cognos.com/schemas/request/params" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" exclude-result-prefixes="xsl dlgctrl xtsext req-params">
  244. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  245. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  246. <pf:variables/>
  247. <xsl:template match="/">
  248. <xsl:variable name="saveAsPath">
  249. <xsl:choose>
  250. <xsl:when test="string(key('env-param','so.searchPath')) != ''">
  251. <xsl:value-of select="key('env-param','so.searchPath')"/>
  252. </xsl:when>
  253. <xsl:otherwise>
  254. <xsl:value-of select="key('env-param','m_ro_saveAsPath')"/>
  255. </xsl:otherwise>
  256. </xsl:choose>
  257. </xsl:variable>
  258. <xsl:variable name="saveAsOption">
  259. &lt;saveAs&gt;
  260. &lt;objectClass&gt;reportView&lt;/objectClass&gt;
  261. &lt;objectNames&gt;
  262. &lt;objectName&gt;
  263. &lt;locale&gt;
  264. <xsl:choose>
  265. <xsl:when test="/root/*[local-name()='conversation']/*/*[local-name()='options']/*[local-name()='item']/*[local-name()='name']='outputLocale'">
  266. <xsl:value-of select="/root/*[local-name()='conversation']/*/*[local-name()='options']/*[local-name()='item'][/*[local-name()='name']='outputLocale']/*[local-name()='value']/*[local-name()='value']"/>
  267. </xsl:when>
  268. <xsl:otherwise>
  269. <xsl:value-of select="/root/user/param[@name='contentLocale']"/>
  270. </xsl:otherwise>
  271. </xsl:choose>
  272. &lt;/locale&gt;
  273. &lt;value&gt;<xsl:value-of select="xtsext:xmlencode(string(/root/env/*[@name='m_ro_saveAsName']))"/>&lt;/value&gt;
  274. &lt;/objectName&gt;
  275. &lt;/objectNames&gt;
  276. &lt;parentSearchPath&gt;<xsl:value-of select="xtsext:xmlencode(string($saveAsPath))"/>&lt;/parentSearchPath&gt;
  277. &lt;/saveAs&gt;
  278. </xsl:variable>
  279. <html>
  280. <head>
  281. <link rel="stylesheet" type="text/css" href="{$skin_root}/portal/default.css"/>
  282. <link rel="stylesheet" type="text/css" href="{$skin_root}/qs/RVReport.css"/>
  283. <script language="javascript">
  284. function finish()
  285. {
  286. var form = document.getElementById("executeSaveAs");
  287. if (typeof form != "undefined" &amp;&amp; form != null)
  288. {
  289. if (typeof form.pageVisited != "undefined" &amp;&amp; form.pageVisited != null &amp;&amp; form.pageVisited.value.length > 0)
  290. {
  291. window.history.go(+1);
  292. return;
  293. }
  294. else if (typeof form.pageVisited != "undefined" &amp;&amp; form.pageVisited != null)
  295. {
  296. <!-- set the page visited value so if the user hits the back button in the browser it'll have a value -->
  297. form.pageVisited.value = "true";
  298. }
  299. }
  300. var oCognosViewerObject = parent.oCV<xsl:value-of select="key('env-param', 'cv.id')"/>;
  301. <xsl:choose>
  302. <xsl:when test="/root/env/param[@name='visited_save_as'] = 'true'">
  303. if (oCognosViewerObject)
  304. {
  305. oCognosViewerObject.closeActiveHTTPConnection();
  306. <xsl:if test="key('env-param','run.continueConversation')='false'">
  307. <!--so the viewer framework doesn't cancel the request when we exit, set it to keep the session alive-->
  308. oCognosViewerObject.setKeepSessionAlive(true);
  309. </xsl:if>
  310. }
  311. form.submit();
  312. setTimeout('document.progress.src="<xsl:value-of select="xtsext:javascriptencode($brand_images)"/>progress.gif"',1);
  313. </xsl:when>
  314. <xsl:otherwise>
  315. if(typeof parent.destroyCModal == "function")
  316. {
  317. parent.destroyCModal();
  318. }
  319. else if (window.opener)
  320. {
  321. window.close();
  322. }
  323. if(oCognosViewerObject.getStatus() == "working" || oCognosViewerObject.getStatus() == "stillWorking")
  324. {
  325. oCognosViewerObject.getWorkingDialog.show();
  326. }
  327. </xsl:otherwise>
  328. </xsl:choose>
  329. }
  330. </script>
  331. </head>
  332. <body onload="finish();">
  333. <form action="{/root/http/param[@name='SCRIPT_NAME']}" name="executeSaveAs" id="executeSaveAs" method="post" style="display:none;height:100%;margin:0px">
  334. <input type="hidden" name="pageVisited" value=""/>
  335. <input type="hidden" name="b_action" value="cognosViewer"/>
  336. <input type="hidden" name="ui.action" value="saveAs"/>
  337. <input type="hidden" name="cv.responseFormat" value="closeDialog"/>
  338. <input type="hidden" name="cv.id" value="{key('env-param','cv.id')}"/>
  339. <input type="hidden" name="m_tracking" value="{key('env-param','m_tracking')}"/>
  340. <input type="hidden" name="ui.conversation" value="{key('env-param','ui.conversation')}"/>
  341. <input type="hidden" name="ui.routingServerGroup" value="{key('env-param','ui.routingServerGroup')}"/>
  342. <input type="hidden" name="run.continueConversation" value="{key('env-param','run.continueConversation')}"/>
  343. <input type="hidden" name="ui.backURL">
  344. <xsl:attribute name="value">
  345. <xsl:choose>
  346. <xsl:when test="string(key('env-param','ui.backURL')) != ''">
  347. <xsl:value-of select="key('env-param','ui.backURL')"/>
  348. </xsl:when>
  349. <xsl:otherwise>
  350. <xsl:value-of select="key('env-param','backURL')"/>
  351. </xsl:otherwise>
  352. </xsl:choose>
  353. </xsl:attribute>
  354. </input>
  355. <input type="hidden" name="run.saveAs" value="{$saveAsOption}"/>
  356. </form>
  357. <table id="workingStatus" cellspacing="0" height="100%" width="100%" cellpadding="0" align="center" valign="middle">
  358. <tr>
  359. <td width="100%" height="100%" align="center" valign="middle">
  360. <!-- start of indicator-->
  361. <table align="center" cellspacing="0" cellpadding="0" style="vertical-align:middle; border:1px outset;" class="busyBody">
  362. <tr>
  363. <td rowspan="2">
  364. <img src="{$brand_images}progress.gif" style="margin:5px;" width="48" height="48" name="progress"/>
  365. </td>
  366. <td nowrap="nowrap">
  367. <span class="busyUpdatingStr">
  368. <xts:string id="GOTO_WORKING"/>
  369. </span>
  370. </td>
  371. </tr>
  372. <tr>
  373. <td nowrap="nowrap">
  374. <span class="busyUpdatingStr">
  375. <xts:string id="RV_PLEASE_WAIT"/>
  376. </span>
  377. </td>
  378. </tr>
  379. <tr>
  380. <td style="height:7px;" colspan="2"/>
  381. </tr>
  382. </table>
  383. <!-- end of indicator-->
  384. </td>
  385. </tr>
  386. </table>
  387. </body>
  388. </html>
  389. </xsl:template>
  390. </xsl:stylesheet>
  391. </xts:block>
  392. <xts:block id="duplicateFound" processor="XSLT" type="exec" mode="output" dependency="checkDuplicate" mimeType="text/html" contentId="callrv" partId="1" condition=".[not(/root/source) and string(/root/checkDuplicate/*[local-name()='queryResponse']/*/*[local-name()='defaultName']) != '']" mandatory="false">
  393. <xts:logicsheet path="logicsheets/portal.xsl"/>
  394. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  395. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  396. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  397. <xts:logicsheet path="logicsheets/validation.xslt"/>
  398. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  399. <xsl:stylesheet version="1.0"
  400. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  401. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  402. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  403. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  404. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  405. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  406. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  407. exclude-result-prefixes="xsl xts lyt pf dp df xtsext">
  408. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  409. <!-- current file name -->
  410. <xsl:variable name="mname" select="'viewer-saveAs.xts'"/>
  411. <!-- add any theme variables -->
  412. <pf:variables/>
  413. <xsl:variable name="browserTitle"><xts:string id="IDS_COGNOS_REPORTS"/></xsl:variable>
  414. <xsl:template match="/">
  415. <dp:page longTitle="$browserTitle">
  416. <dp:meta>
  417. <pf:meta/> <!-- Standard meta tags -->
  418. </dp:meta>
  419. <dp:script>
  420. <pf:help context=""/> <!-- Help system -->
  421. <script language="javascript">
  422. function closePage()
  423. {
  424. if(typeof parent.destroyCModal == "function")
  425. {
  426. parent.destroyCModal();
  427. }
  428. else if (window.opener)
  429. {
  430. window.close();
  431. }
  432. }
  433. function setCurrentAction(str)
  434. {
  435. document.pform.currentActionValue.value = str;
  436. }
  437. </script>
  438. </dp:script>
  439. <form name="pform" method="post" action="{$gateway}">
  440. <input type="hidden" name="currentActionValue" value="overwrite"/>
  441. <!-- dialog header -->
  442. <dp:header>
  443. <!-- header titles-->
  444. <dp:title showName="false">
  445. <xsl:value-of select="$browserTitle"/>
  446. </dp:title>
  447. <!-- header introduction -->
  448. <dp:close>
  449. <xsl:variable name="close"><xts:string id="IDS_CLOSE"/></xsl:variable>
  450. <a href="javascript:closePage();"><img height="16" width="16" class="dialogClose" vspace="2" border="0" src="{$skin_images}close.gif" alt="{$close}" onmouseover="this.className = 'dialogCloseOver'" onmouseout="this.className = 'dialogClose'"/></a>
  451. </dp:close>
  452. </dp:header>
  453. <lyt:layout style="1">>
  454. <lyt:section>
  455. <dp:group>
  456. <dp:groupItem valign="top">
  457. <img height="32" width="32" border="0">
  458. <xsl:attribute name="src">
  459. <xsl:value-of select="$webcontent"/>/<xsl:value-of select="$app"/>
  460. <xsl:text/>/images/msg_warning.gif<xsl:text/>
  461. </xsl:attribute>
  462. <xsl:attribute name="alt"><xts:string id="IDS_STATUS_WARN"/></xsl:attribute>
  463. </img>
  464. </dp:groupItem>
  465. <dp:groupItem>
  466. <!-- used for alignment -->
  467. <dp:text/><xsl:text>&#160;</xsl:text>
  468. </dp:groupItem>
  469. <dp:groupItem valign="top">
  470. <dp:text nospace="nospace" wrap="wrap">
  471. <xts:string id="IDS_DUPLICATE_ERROR_RENAME_REPLACE_ERROR"><xts:param name="entryName"><xsl:value-of select="key('env-param','m_ro_saveAsName')"/></xts:param></xts:string>
  472. <br/>
  473. <table border="0" cellspacing="0" cellpadding="1">
  474. <tr>
  475. <td class="formText">
  476. <input type="radio" id="inputCurrentAction" name="currentAction" value="overwrite" onClick="document.getElementById('inputNewName').disabled = true; javascript:setCurrentAction('overwrite')">
  477. <xsl:if test="string(key('env-param','currentAction')) = '' or string(key('env-param','currentAction')) = 'overwrite'">
  478. <xsl:attribute name="checked">true</xsl:attribute>
  479. </xsl:if>
  480. </input>
  481. </td>
  482. <td class="formText">
  483. <label for="inputCurrentAction"><xts:string id="IDS_DUPLICATE_ERROR_REPLACE_ENTRY_OPTION"/></label>
  484. </td>
  485. </tr>
  486. <tr>
  487. <td valign="top" class="formText">
  488. <input type="radio" name="currentAction" value="rename" onClick="document.getElementById('inputNewName').disabled = false; javascript:setCurrentAction('rename');">
  489. <xsl:if test="string(key('env-param','currentAction')) = 'rename'">
  490. <xsl:attribute name="checked">true</xsl:attribute>
  491. </xsl:if>
  492. <xsl:attribute name="title"><xts:string id="IDS_DUPLICATE_ERROR_RENAME_ENTRY_OPTION"/></xsl:attribute>
  493. </input>
  494. </td>
  495. <td class="formText">
  496. <label for="inputNewName"><xts:string id="IDS_DUPLICATE_ERROR_RENAME_ENTRY_OPTION"/></label><br/>
  497. <input name="err_rename" id="inputNewName" size='45' onFocus="javascript:setCurrentAction('rename'); document.pform.currentAction[1].checked = true;">
  498. <xsl:if test="string(key('env-param','currentAction')) = '' or string(key('env-param','currentAction')) != 'rename'">
  499. <xsl:attribute name="disabled">true</xsl:attribute>
  500. </xsl:if>
  501. <xsl:attribute name="value">
  502. <xsl:value-of select="key('env-param','m_ro_saveAsName')"/>
  503. </xsl:attribute>
  504. </input>
  505. </td>
  506. </tr>
  507. <tr>
  508. <td>
  509. <img height="5" width="1" alt="">
  510. <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute>
  511. </img>
  512. </td>
  513. </tr>
  514. <tr>
  515. <td colspan='2' class="formText"><xts:string id="IDS_DUPLICATE_ERROR_CONTINUE"/><br/></td>
  516. </tr>
  517. </table>
  518. </dp:text>
  519. </dp:groupItem>
  520. </dp:group>
  521. </lyt:section>
  522. </lyt:layout>
  523. <dp:footer>
  524. <!-- Default. Use Ok/Cancel buttons -->
  525. <df:button df:id="IDS_DUPLICATE_ERROR_OK" df:style="href" df:href="javascript:document.pform.submit();"/>
  526. <df:button df:id="IDS_DUPLICATE_ERROR_CANCEL" df:style="href" df:href="javascript:closePage();"/>
  527. </dp:footer>
  528. <xsl:for-each select="/root/env/param[@name != 'm']">
  529. <input name="{@name}" type="hidden" value="{.}"/>
  530. </xsl:for-each>
  531. <input type="hidden" name="m" value="portal/viewer-saveAs.xts"/>
  532. <input type="hidden" name="b_action" value="xts.run"/>
  533. </form>
  534. </dp:page>
  535. </xsl:template>
  536. </xsl:stylesheet>
  537. </xts:block>
  538. <!--
  539. ===============================================================================================
  540. debug - display debug information
  541. ===============================================================================================
  542. -->
  543. <xts:block id="debug" dependency="launchSaveAsPage duplicateFound" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  544. <!-- get the debug logic sheet -->
  545. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  546. <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">
  547. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  548. <xsl:template match="/">
  549. <dbg:dumpxml select="/root"/>
  550. </xsl:template>
  551. </xsl:stylesheet>
  552. </xts:block>
  553. </xts:morphlet>