save_as.xts 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786
  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, 2015
  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. <!--
  14. This morphlet (save_as.xts) consists of the following blocks:
  15. formlogic_init - update various /root/env level parameters based on new or changed /root/env parameters.
  16. getRootNames - build to /root/cmRoots structure and the /root/session/param with name attributes e_proot (public), e_mroot (private) and e_hp (home page).
  17. getContent - retrieve CM Information for this page.
  18. getRootMap - build the /root/CMRootMap/class structure with name and root attributes.
  19. renderPage - render the Save as page when user doing a copy or saving a Query Studio report.
  20. -->
  21. <!-- formlogic_init =============================================================================================== -->
  22. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  23. <!-- If the CM roots (personal/public) have not been determined (i.e. exist in the session) then get them. ======================= -->
  24. <xts:block id="getRootNames" path="portal/cmroots.xml" condition=".[not(/root/session/param[@name = 'e_proot'])]" processor="XSLT" type="exec" mandatory="false">
  25. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  26. </xts:block>
  27. <!--
  28. ===============================================================================================
  29. getContent - get our data from Content Manager
  30. ===============================================================================================
  31. -->
  32. <xts:block id="getContent" processor="XSLT" type="exec" dependency="formlogic_init getRootNames getRootMap">
  33. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  34. <xsl:stylesheet
  35. xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  36. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  37. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  38. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  39. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  40. <xsl:key name="session-param" match="/root/session/param" use="@name"/>
  41. <xsl:variable name="newClass">
  42. <xsl:choose>
  43. <xsl:when test="string(/root/env/param[@name='m_new_class']) != ''">
  44. <xsl:value-of select="/root/env/param[@name='m_new_class']"/>
  45. </xsl:when>
  46. <xsl:when test="string(/root/env/param[@name = 'm_app'])='qs'">
  47. <xsl:value-of select="'query'"/>
  48. </xsl:when>
  49. <xsl:when test="string(/root/env/param[@name = 'm_app'])='AS'">
  50. <xsl:value-of select="'agentDefinition'"/>
  51. </xsl:when>
  52. </xsl:choose>
  53. </xsl:variable>
  54. <xsl:variable name="CMRoot" select="/root/CMRootMap/class[@name=$newClass]"/>
  55. <xsl:variable name="objectPath" select="/root/env/param[@name = 'm_obj']"/>
  56. <xsl:variable name="pRootIdStr">storeID("<xsl:value-of select="key('session-param', 'prootid')"/>")</xsl:variable>
  57. <xsl:variable name="containerPath">
  58. <xsl:choose>
  59. <xsl:when test="string(/root/env/param[@name='so.searchPath'])!=''">
  60. <xsl:value-of select="/root/env/param[@name = 'so.searchPath']"/>
  61. </xsl:when>
  62. <xsl:otherwise>
  63. <!-- Only packages and folders can be stored in /content so if m_path is /content and this is not a package or a folder, leave $containerPath empty.
  64. This will ensure that the default destination is never '/content' for objects other than packages and folders (and we save one CM call) -->
  65. <xsl:if test="(string(/root/env/param[@name='m_path'])!='/content' and string(/root/env/param[@name='m_path'])!=$pRootIdStr) or $newClass='folder' or $newClass='package'">
  66. <xsl:value-of select="/root/env/param[@name = 'm_path']"/>
  67. </xsl:if>
  68. </xsl:otherwise>
  69. </xsl:choose>
  70. </xsl:variable>
  71. <xsl:template match="/">
  72. <xts:sequence>
  73. <!--
  74. If we are doing a save as operation then we expect an m_obj var to be passed to identify that object.
  75. Describe it to get default Name/Description .. etc.
  76. We also use the container of this object as the default destination in case no m_path var is passed on the request.
  77. -->
  78. <xsl:if test="$objectPath != ''">
  79. <xts:append>
  80. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  81. <send:request provider="cm">
  82. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  83. <cm:query>
  84. <cm:search>
  85. <xsl:value-of select="$objectPath"/>
  86. </cm:search>
  87. <cm:properties>
  88. <cm:property name="defaultName"/>
  89. <cm:property name="searchPath"/>
  90. <cm:property name="ancestors"/>
  91. <cm:property name="defaultDescription"/>
  92. </cm:properties>
  93. <cm:options schemaInfo="false"/>
  94. </cm:query>
  95. </xts:transform>
  96. </send:request>
  97. </xts:transform>
  98. </xts:append>
  99. </xsl:if>
  100. <!-- If a new path has been chosen (or handed to us on the request) then get its ancestors.-->
  101. <xsl:if test=" $containerPath != '' ">
  102. <xts:append>
  103. <newpath>
  104. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  105. <send:request provider="cm">
  106. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  107. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  108. <cm:search>
  109. <xsl:value-of select="$containerPath"/>
  110. </cm:search>
  111. <cm:properties>
  112. <cm:property name="defaultName"/>
  113. <cm:property name="searchPath"/>
  114. <cm:property name="storeID"/>
  115. <cm:property name="permissions"/>
  116. <cm:property name="ancestors"/>
  117. </cm:properties>
  118. </cm:query>
  119. </xts:transform>
  120. </send:request>
  121. </xts:transform>
  122. </newpath>
  123. </xts:append>
  124. <xts:replace select="/root/env/param[@name='m_path']">
  125. <param name="m_path">
  126. <xsl:value-of select="$containerPath"/>
  127. </param>
  128. </xts:replace>
  129. </xsl:if>
  130. <xsl:if test="string($CMRoot/@root) = '/content'">
  131. <xts:append>
  132. <myfolder>
  133. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  134. <send:request provider="cm">
  135. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  136. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  137. <cm:search><xsl:value-of select="/root/session/param[@name='e_hp']"/>/folder[permission("write") and permission("traverse")]</cm:search>
  138. <cm:properties>
  139. <cm:property name="searchPath"/>
  140. <cm:property name="defaultName"/>
  141. <cm:property name="permissions"/>
  142. <cm:property name="storeID"/>
  143. </cm:properties>
  144. </cm:query>
  145. </xts:transform>
  146. </send:request>
  147. </xts:transform>
  148. </myfolder>
  149. </xts:append>
  150. </xsl:if>
  151. <xts:delete select="/root/env/param[contains(string(@name),'pagerfrom')]"/>
  152. <xts:delete select="/root/env/param[contains(string(@name),'pagerto')]"/>
  153. <xts:delete select="/root/env/param[@name='pageitem']"/>
  154. </xts:sequence>
  155. </xsl:template>
  156. </xsl:stylesheet>
  157. </xts:block>
  158. <!-- Load default root map for CM objects ==================================== -->
  159. <xts:block id="getRootMap" type="exec" mode="input" processor="XML" path="/portal/uiExtensions.xml" mandatory="false">
  160. <xts:logicsheet path="/logicsheets/uiobjects/uiobjects_roots.xslt"/>
  161. </xts:block>
  162. <!--
  163. ===============================================================================================
  164. renderPage - render the HTML page
  165. ===============================================================================================
  166. -->
  167. <xts:block id="renderPage" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="formlogic_init getContent">
  168. <xts:logicsheet path="logicsheets/portal.xsl"/>
  169. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  170. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  171. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  172. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  173. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  174. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  175. <xts:logicsheet path="logicsheets/validation.xslt"/>
  176. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  177. <xsl:stylesheet version="1.0"
  178. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  179. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  180. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  181. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  182. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  183. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  184. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  185. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  186. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  187. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  188. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  189. exclude-result-prefixes="xsl xts cm pf df lyt dp cf cp utml bus xtsext">
  190. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  191. <pf:variables/>
  192. <pf:modalVariables/>
  193. <xsl:key name="root-map" match="/root/CMRootMap/class" use="@name"/>
  194. <!-- start the output -->
  195. <xsl:template match="/root">
  196. <xsl:variable name="mname" select="'save_as.xts'"/>
  197. <!-- shortcut of myfolder -->
  198. <xsl:variable name="myFldrRef" select="/root/myfolder/cm:queryResponse/*"/>
  199. <!-- shortcut of destination folder -->
  200. <xsl:variable name="destinationFldrRef" select="/root/newpath/cm:queryResponse/*"/>
  201. <xsl:variable name="canWriteMyFldr" select="contains(string($myFldrRef/cm:permissions),'write')"/>
  202. <!-- Path to the container where we want to place this new entry. Leave this empty if the user does not have write access.
  203. This will also be left empty when there is no <newpath> element as may be the case when arriving here via search (Reference bug 515061). -->
  204. <xsl:variable name="path">
  205. <xsl:if test="contains($destinationFldrRef/cm:permissions, 'write')">
  206. <xsl:value-of select="$destinationFldrRef/cm:searchPath"/>
  207. </xsl:if>
  208. </xsl:variable>
  209. <xsl:variable name="myFoldersPath">
  210. <xsl:if test="$canWriteMyFldr">
  211. <xsl:value-of select="$myFldrRef/cm:searchPath"/>
  212. </xsl:if>
  213. </xsl:variable>
  214. <!-- Determine if path coming in is My Folders -->
  215. <xsl:variable name="myFldrId" select="string($myFldrRef/cm:storeID)"/>
  216. <xsl:variable name="pathId" select="string($destinationFldrRef/cm:storeID)"/>
  217. <!-- Determine if the current path points to the personal folder space (We need a session element to make this determination) -->
  218. <xsl:variable name="isPersonalPath" select="$myFldrId = $pathId"/>
  219. <!-- determine if current path is under personal folder -->
  220. <xsl:variable name="underMyFldr" select="boolean(/root/newpath/cm:queryResponse/*/cm:ancestors/*/cm:storeID[ . =$myFldrId])"/>
  221. <!-- Determines if this dialog is called from Query Studio -->
  222. <xsl:variable name="isQueryStudio" select=" (key('env-param','m_app') and key('env-param','m_app') = 'qs') "/>
  223. <xsl:variable name="isAgentStudio" select=" (key('env-param','m_app') and key('env-param','m_app') = 'AS') "/>
  224. <xsl:variable name="isPPA" select="starts-with(string(key('env-param','m_new_class')),'powerPlay') and string(key('env-param','ifrmcmd'))!='copy'"/>
  225. <xsl:variable name="new-class">
  226. <xsl:choose>
  227. <xsl:when test="key('env-param', 'm_new_class') and key('env-param','m_new_class') != ''">
  228. <xsl:value-of select="key('env-param','m_new_class')"/>
  229. </xsl:when>
  230. <xsl:when test="$isQueryStudio">
  231. <xsl:value-of select="'query'"/>
  232. </xsl:when>
  233. <xsl:when test="$isAgentStudio">
  234. <xsl:value-of select="'agentDefinition'"/>
  235. </xsl:when>
  236. </xsl:choose>
  237. </xsl:variable>
  238. <xsl:variable name="saveAsName">
  239. <xsl:if test="key('env-param','ifrmcmd') and key('env-param','ifrmcmd')='copy'">
  240. <xsl:text/><xts:string id="IDS_ACT_COPY_OF"><xts:param name="curName"><xsl:value-of select="key('env-param','m_name')"/></xts:param></xts:string><xsl:text/>
  241. </xsl:if>
  242. </xsl:variable>
  243. <xsl:variable name="selectAdmin">
  244. <xsl:if test="$new-class='jobDefinition'">
  245. <xsl:choose>
  246. <xsl:when test="string(key('env-param','from_schedule_tool'))='true'">
  247. <xsl:if test="starts-with(string(key('env-param','m_obj')),'/adminFolder')">
  248. <xsl:text/>.admin<xsl:text/>
  249. </xsl:if>
  250. </xsl:when>
  251. <xsl:when test="string(key('env-param','from_tool'))='true'">
  252. <xsl:text/>.admin<xsl:text/>
  253. </xsl:when>
  254. </xsl:choose>
  255. </xsl:if>
  256. </xsl:variable>
  257. <!-- If the current path leads to the personal folder space OR the object we are creating does not belong in the main portal content space then do not show the option to place the new entry in "My Folders". Also check for write access and not a jobDefinition -->
  258. <xsl:variable name="showMyFoldersChoice" select="not($isPersonalPath) and /root/CMRootMap/class[@name=$new-class]/@root = '/content' and $new-class != 'drillPath' and $selectAdmin='' and $canWriteMyFldr"/>
  259. <xsl:variable name="browserTitle">
  260. <xsl:choose>
  261. <xsl:when test="key('env-param', 'ifrmcmd') and string(key('env-param', 'ifrmcmd')) = 'copy'"><xts:string id="IDS_SAVE_AS_TITLE_COPY"/></xsl:when>
  262. <xsl:otherwise><xts:string id="IDS_SAVE_AS_TITLE"/></xsl:otherwise>
  263. </xsl:choose>
  264. </xsl:variable>
  265. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text>
  266. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
  267. <dp:meta>
  268. <pf:meta/> <!-- Standard meta tags -->
  269. </dp:meta>
  270. <!-- get passed in parameters -->
  271. <dp:script>
  272. <xsl:choose>
  273. <xsl:when test="key('env-param', 'ifrmcmd') and string(key('env-param', 'ifrmcmd')) = 'copy'"><pf:help context="HID_COPY"/></xsl:when>
  274. <xsl:otherwise><pf:help context="HID_DISTRIB_SAVE"/></xsl:otherwise>
  275. </xsl:choose>
  276. <script language="javascript">
  277. var b_isModalMode = <xsl:value-of select="$isModal"/>;
  278. function init()
  279. {
  280. <xsl:if test="$isQueryStudio">
  281. var cf=getConfigFrame?getConfigFrame():null;
  282. if (cf &amp;&amp; cf.saveAsDlgInit) cf.saveAsDlgInit(this);
  283. </xsl:if>
  284. <xsl:if test="$isAgentStudio">
  285. var cf=getConfigFrame?getConfigFrame():null;
  286. if (cf &amp;&amp; cf.saveAsDlgInit) cf.saveAsDlgInit(this);
  287. </xsl:if>
  288. if (document.pform.m_p_defaultName)
  289. document.pform.m_p_defaultName.focus();
  290. }
  291. function validate()
  292. {
  293. <!-- validate the name -->
  294. if (document.pform.m_p_defaultName)
  295. {
  296. document.pform.m_p_defaultName.value = trim(document.pform.m_p_defaultName.value);
  297. if ( document.pform.m_p_defaultName.value == "" )
  298. {
  299. alert( "<xts:string id="IDS_NEW_ERR_NO_NAME" encode="javascript"/>" );
  300. document.pform.m_p_defaultName.focus();
  301. return false;
  302. }
  303. }
  304. <!-- validate the destination -->
  305. var myFolders = getSessionValue("mfst");
  306. if (document.pform.m_path.value == "" || ( ((myFolders==0) &amp;&amp; ('<xsl:value-of select="xtsext:javascriptencode(string($path))"/>' == '')) &amp;&amp; ("<xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='m_path']))"/>" != "")) || ((myFolders==1) &amp;&amp; ('<xsl:value-of select="xtsext:javascriptencode(string($myFoldersPath))"/>' == '')) )
  307. {
  308. alert( "<xts:string id="IDS_SAVE_AS_NO_DESTINATION" encode="javascript"/>" );
  309. return false;
  310. }
  311. resetPageState();
  312. return true;
  313. }
  314. function doModalCancel()
  315. {
  316. <!-- Set the right call back target -->
  317. var callBackTarget = <xsl:value-of select="$callBackTargetJSVar"/>;
  318. if( callBackTarget )
  319. {
  320. callBackTarget.<xsl:value-of select="$callBackFunctionName"/>("cancel", null);
  321. }
  322. }
  323. <xsl:if test="$isPPA">
  324. function ppw_cancel()
  325. {
  326. resetPageState();
  327. if(b_isModalMode)
  328. {
  329. doModalCancel();
  330. }
  331. else
  332. {
  333. document.pform.doPostURL.value="backURL";
  334. document.pform.m.value="portal/postURL.xts";
  335. document.pform.submit();
  336. }
  337. }
  338. function ppw_ok()
  339. {
  340. if ( validate() )
  341. {
  342. resetPageState();
  343. document.pform.ifrmcmd.value="create";
  344. document.pform.m.value = "<xsl:value-of select="$app"/>/submit.xts";
  345. document.pform.submit();
  346. }
  347. }
  348. </xsl:if>
  349. </script>
  350. <script language="javascript" src="{$webcontent}/{$app}/js/utilities.js"></script>
  351. <!-- Add any JavaScript code required by QS if we are invoked from QS. -->
  352. <xsl:if test="$isQueryStudio">
  353. <script language="javascript" src="{$webRoot}/qs/layout.js"></script>
  354. <script language="javascript">
  355. function QS_saveAs()
  356. {
  357. if ( validate() ) {
  358. resetPageState();
  359. getConfigFrame().doSaveAs(document.pform.m_path.value, document.pform.m_p_defaultName.value, document.pform.m_p_defaultDescription.value, document.pform.m_p_defaultScreenTip.value);
  360. }
  361. }
  362. function QS_cancel()
  363. {
  364. resetPageState();
  365. getConfigFrame().hideDialogFrame();
  366. }
  367. </script>
  368. </xsl:if>
  369. <xsl:if test="$isAgentStudio">
  370. <script language="javascript" src="{$webRoot}/ags/layout.js"></script>
  371. <script language="javascript">
  372. function AS_saveAs()
  373. {
  374. if ( validate() ) {
  375. // do the save from here
  376. resetPageState();
  377. // send us on our way
  378. document.pform.m.value = '/ags/submit.xts';
  379. document.pform.ps_nav_op.value = 'maintain';
  380. document.pform.submit();
  381. }
  382. }
  383. function AS_cancel()
  384. {
  385. resetPageState();
  386. getConfigFrame().hideDialogFrame();
  387. }
  388. </script>
  389. </xsl:if>
  390. </dp:script>
  391. <utml:form name="pform" method="post" action="{$gateway}">
  392. <xsl:if test="cm:queryResponse/*/cm:objectClass = 'portlet'">
  393. <input name="cmdErrorUpdateActionReplace" type="hidden" value="true"/>
  394. </xsl:if>
  395. <xsl:if test="cm:queryResponse/*/cm:objectClass = 'userInterfaceProfile'">
  396. <input name="cmdAquirePermissionsFromTargetParent" type="hidden" value="true"/>
  397. </xsl:if>
  398. <utml:input name="m_new_class" type="hidden" value=""/>
  399. <utml:input name="m" type="hidden" value=""/>
  400. <!-- Header -->
  401. <!-- =============================================================================== -->
  402. <xsl:choose>
  403. <xsl:when test="$isQueryStudio">
  404. <dp:header>
  405. <dp:title><xsl:value-of select="$browserTitle"/></dp:title>
  406. <dp:close><a href="javascript:QS_cancel()"><dp:closeMarker/></a></dp:close>
  407. <dp:description><xts:string id="IDS_NEW_INTRO"/></dp:description>
  408. </dp:header>
  409. </xsl:when>
  410. <xsl:when test="$isAgentStudio">
  411. <dp:header>
  412. <dp:title><xsl:value-of select="$browserTitle"/></dp:title>
  413. <dp:close><a href="javascript:AS_cancel()"><dp:closeMarker/></a></dp:close>
  414. <dp:description><xts:string id="IDS_NEW_INTRO"/></dp:description>
  415. </dp:header>
  416. </xsl:when>
  417. <xsl:otherwise>
  418. <dp:header>
  419. <dp:title><xsl:value-of select="$browserTitle"/></dp:title>
  420. <dp:description><xts:string id="IDS_NEW_INTRO_SAVE"/></dp:description>
  421. </dp:header>
  422. </xsl:otherwise>
  423. </xsl:choose>
  424. <!-- Name / Description -->
  425. <!-- =============================================================================== -->
  426. <lyt:layout style="1">
  427. <lyt:section>
  428. <dp:input>
  429. <dp:section1><label for="lbl_ccSAVEAS_defaultName"><xts:string id="IDS_NEW_NAME"/></label></dp:section1>
  430. <dp:section2>
  431. <utml:input type="text" name="m_p_defaultName" class="pInput" size="30" maxlength="256" id="lbl_ccSAVEAS_defaultName">
  432. <xsl:if test="$isQueryStudio or $isAgentStudio">
  433. <xsl:attribute name="onfocus">setfocus('field')</xsl:attribute>
  434. </xsl:if>
  435. <utml:value>
  436. <xsl:choose>
  437. <xsl:when test="key('env-param','m_p_defaultName')">
  438. <xsl:value-of select="key('env-param','m_p_defaultName')"/>
  439. </xsl:when>
  440. <xsl:when test="$saveAsName">
  441. <xsl:choose>
  442. <xsl:when test="string-length($saveAsName) &gt; 256">
  443. <xsl:value-of select="substring($saveAsName,0,257)"/>
  444. </xsl:when>
  445. <xsl:otherwise>
  446. <xsl:value-of select="$saveAsName"/>
  447. </xsl:otherwise>
  448. </xsl:choose>
  449. </xsl:when>
  450. </xsl:choose>
  451. </utml:value>
  452. </utml:input>
  453. </dp:section2>
  454. </dp:input>
  455. </lyt:section>
  456. <!-- Hide description / tooltip if this is a copy action since the current CM API does not support it. -->
  457. <lyt:section>
  458. <xsl:if test="not(key('env-param', 'ifrmcmd') and key('env-param', 'ifrmcmd') = 'copy')">
  459. <dp:input>
  460. <dp:section1><label for="lbl_ccSAVEAS_description"><xts:string id="IDS_NEW_DESCRIPTION"/></label></dp:section1>
  461. <dp:section2>
  462. <utml:textarea rows="4" cols="30" class="pTextarea" name="m_p_defaultDescription" id="lbl_ccSAVEAS_description">
  463. <xsl:if test="$isQueryStudio or $isAgentStudio">
  464. <xsl:attribute name="onfocus">setfocus('textarea')</xsl:attribute>
  465. </xsl:if>
  466. <xsl:if test="not(key('env-param','m_p_defaultDescription'))">
  467. <xsl:value-of select="cm:queryResponse/*/cm:defaultDescription"/>
  468. </xsl:if>
  469. </utml:textarea>
  470. </dp:section2>
  471. </dp:input>
  472. <dp:input>
  473. <dp:section1>
  474. <label for="lbl_ccSAVEAS_screentip">
  475. <xts:string id="IDS_NEW_SCREENTIP"/>
  476. </label>
  477. </dp:section1>
  478. <dp:section2>
  479. <utml:input type="text" name="m_p_defaultScreenTip" class="pInput" maxlength="100" size="30" id="lbl_ccSAVEAS_screentip">
  480. <xsl:if test="$isQueryStudio or $isAgentStudio">
  481. <xsl:attribute name="onfocus">setfocus('field')</xsl:attribute>
  482. </xsl:if>
  483. </utml:input>
  484. </dp:section2>
  485. </dp:input>
  486. </xsl:if>
  487. </lyt:section>
  488. </lyt:layout>
  489. <!-- Path / Destination folder -->
  490. <!-- =============================================================================== -->
  491. <lyt:layout style="1" joinSection="yes">
  492. <lyt:section>
  493. <dp:list>
  494. <dp:section><dp:label><xts:string id="IDS_NEW_DESTINATION"/></dp:label></dp:section>
  495. <dp:section wrap="wrap">
  496. <div id="path" style="padding:0px; display:none; ">
  497. <xsl:choose>
  498. <xsl:when test="$isPPA and ($path = '' or $path = '/content')">
  499. <dp:inactiveText><xts:string id="IDS_NONE"/>&#160;&#160;</dp:inactiveText>
  500. </xsl:when>
  501. <xsl:when test="$path != ''">
  502. <dp:text valign="top" wrap="wrap">
  503. <xsl:variable name="rootPath">
  504. <xsl:choose>
  505. <xsl:when test="$isPersonalPath or $underMyFldr">
  506. <xsl:value-of select="concat(key('session-param', 'e_hp'), '/folder')"/>
  507. </xsl:when>
  508. <xsl:when test="starts-with($path, '/content')">
  509. <xsl:value-of select="$defaultContentRoot"/>
  510. </xsl:when>
  511. </xsl:choose>
  512. </xsl:variable>
  513. <cf:do-the-path-link>
  514. <cf:param name="familytree">$destinationFldrRef/cm:ancestors</cf:param>
  515. <cf:param name="familymember">$destinationFldrRef/cm:defaultName</cf:param>
  516. <cf:param name="home"><xsl:value-of select="$rootPath"/></cf:param>
  517. </cf:do-the-path-link>
  518. </dp:text>
  519. </xsl:when>
  520. <xsl:otherwise>
  521. <dp:inactiveText><xts:string id="IDS_NONE"/>&#160;&#160;</dp:inactiveText>
  522. </xsl:otherwise>
  523. </xsl:choose>
  524. </div>
  525. </dp:section>
  526. <dp:section wrap="wrap">
  527. <div id="myfolder" style="padding:0px; display:none; ">
  528. <xsl:choose>
  529. <xsl:when test="$canWriteMyFldr and $new-class != 'drillPath'">
  530. <xsl:choose>
  531. <xsl:when test="key('session-param', 'e_mroot') != ''">
  532. <dp:text><xsl:value-of select="key('session-param', 'e_mroot')"/></dp:text>
  533. </xsl:when>
  534. <xsl:otherwise>
  535. <dp:text><xts:string id="IDS_PERSONAL"/></dp:text>
  536. </xsl:otherwise>
  537. </xsl:choose>
  538. </xsl:when>
  539. <xsl:otherwise>
  540. <dp:inactiveText><i><xts:string id="IDS_NONE"/></i>&#160;&#160;</dp:inactiveText>
  541. </xsl:otherwise>
  542. </xsl:choose>
  543. </div>
  544. </dp:section>
  545. <dp:section>
  546. <div>
  547. <dp:group>
  548. <xsl:if test="not(key('root-map', $new-class)/@fixedRoot='T' or contains(' portlet portalSkin ', concat(' ', $new-class, ' ')))">
  549. <dp:groupItem valign="top">
  550. <utml:a utml:op="maintain">
  551. <utml:target>
  552. <xsl:value-of select="$app"/>/select/select.xts<xsl:text/>
  553. </utml:target>
  554. <xsl:attribute name="onclick">javascript:resetPageState()</xsl:attribute>
  555. <xsl:text/><xts:string id="IDS_SELECT_ANOTHER_FOLDER"/><xsl:text/>
  556. </utml:a>
  557. <img height="1" width="5" border="0"><xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute></img>
  558. </dp:groupItem>
  559. </xsl:if>
  560. <dp:section wrap="wrap">
  561. <dp:groupItem valign="top">
  562. <div id="showMyFldr" style="padding:0px; display:none; ">
  563. <xsl:if test="$showMyFoldersChoice">
  564. <xsl:text/><a href="#" id="destinationMF">
  565. <xsl:attribute name="onclick">javascript:changeSelection('myfolder')</xsl:attribute>
  566. <xsl:text/><xts:string id="IDS_SELECT_MY_FLDR_CM_NAME"><xts:param name="myfldr"><xsl:value-of select="string($myFldrRef/cm:defaultName)"/></xts:param></xts:string><xsl:text/>
  567. </a><xsl:text/>
  568. </xsl:if>
  569. </div>
  570. </dp:groupItem>
  571. </dp:section>
  572. </dp:group>
  573. </div>
  574. </dp:section>
  575. </dp:list>
  576. <xsl:if test="$isPPA">
  577. <utml:input name="doPostURL" type="hidden"/>
  578. </xsl:if>
  579. <!-- If m_path is not stored in a radio input then we must create a hidden input for it -->
  580. <utml:input name="so.defaultLocation" type="hidden" utml:update="false">
  581. <utml:value><xsl:value-of select="/root/env/param[@name='m_path']"/></utml:value>
  582. </utml:input>
  583. <utml:input name="so.select" type="hidden">
  584. <utml:value><xsl:value-of select="/root/env/param[@name='m_new_class']"/>.container<xsl:value-of select="$selectAdmin"/></utml:value>
  585. </utml:input>
  586. <xsl:choose>
  587. <xsl:when test="string(key('env-param','ifrmcmd'))='copy'">
  588. <utml:input name="so.editOp" type="hidden" value="copy" utml:update="false"/>
  589. <utml:input name="so.defaultEditOpObject" type="hidden" utml:update="false">
  590. <utml:value><xsl:value-of select="/root/env/param[@name='m_obj']"/></utml:value>
  591. </utml:input>
  592. </xsl:when>
  593. </xsl:choose>
  594. <utml:input type="hidden" name="so.return.m">
  595. <utml:value><xsl:value-of select="concat('/portal/',$mname)"/></utml:value>
  596. </utml:input>
  597. <utml:input name="m_path" type="hidden" utml:update="false">
  598. <utml:value><xsl:value-of select="/root/env/param[@name='m_path']"/></utml:value>
  599. </utml:input>
  600. <utml:input type="hidden" name="ifrmcmd"/>
  601. </lyt:section>
  602. </lyt:layout>
  603. <script language="javascript">
  604. function changeSelection(divName)
  605. {
  606. var pathdiv = document.getElementById('path');
  607. var mfdiv = document.getElementById('myfolder');
  608. var sMF = document.getElementById('showMyFldr');
  609. switch (divName)
  610. {
  611. case "path":
  612. {
  613. mfdiv.style.display = "none";
  614. pathdiv.style.display = "";
  615. sMF.style.display = "";
  616. break;
  617. }
  618. case "myfolder":
  619. {
  620. mfdiv.style.display = "";
  621. pathdiv.style.display = "none";
  622. sMF.style.display = "none";
  623. setMyFolder();
  624. break;
  625. }
  626. }
  627. }
  628. function setMyFolder()
  629. {
  630. setStateValue("mfst",1);
  631. document.pform["so.defaultLocation"].value = document.pform.m_path.value="<xsl:value-of select="xtsext:javascriptencode(string($myFoldersPath))"/>";
  632. if (document.pform.elements["so.id"])
  633. document.pform.elements["so.id"].value = "<xsl:value-of select="xtsext:javascriptencode($myFldrId)"/>";
  634. }
  635. function resetPageState()
  636. {
  637. <!-- Clear the cookie value mfst -->
  638. clearSessionEntry('mfst');
  639. }
  640. </script>
  641. <script language="javascript">
  642. var mf = getSessionValue("mfst");
  643. if ( mf !=null &amp;&amp; mf != "" )
  644. {
  645. if( mf == 1 ) {
  646. document.getElementById('myfolder').style.display = "";
  647. document.getElementById('path').style.display = "none";
  648. document.getElementById('showMyFldr').style.display = "none";
  649. setMyFolder(); //Make sure the path is set to My Folders when the myfolder div is visible.
  650. }
  651. else {
  652. document.getElementById('path').style.display = "";
  653. document.getElementById('myfolder').style.display = "none";
  654. document.getElementById('showMyFldr').style.display = "";
  655. }
  656. } else
  657. {
  658. <xsl:choose>
  659. <xsl:when test="$isPPA and ($path = '' or $path = '/content')">;
  660. document.getElementById('path').style.display = "";
  661. document.getElementById('myfolder').style.display = "none";
  662. document.getElementById('showMyFldr').style.display = "";
  663. setStateValue("mfst",0);
  664. </xsl:when>
  665. <xsl:when test="$path!='' or $new-class='drillPath'">
  666. document.getElementById('path').style.display = "";
  667. document.getElementById('myfolder').style.display = "none";
  668. document.getElementById('showMyFldr').style.display ="";
  669. setStateValue("mfst",0);
  670. </xsl:when>
  671. <xsl:otherwise>
  672. document.getElementById('path').style.display = "none";
  673. document.getElementById('myfolder').style.display = "";
  674. document.getElementById('showMyFldr').style.display = "none";
  675. setStateValue("mfst",1);
  676. setMyFolder(); //Make sure the path is set to My Folders when the myfolder div is visible.
  677. </xsl:otherwise>
  678. </xsl:choose>
  679. }
  680. </script>
  681. <!-- Footer -->
  682. <!-- =============================================================================== -->
  683. <dp:footer>
  684. <xsl:choose>
  685. <xsl:when test="$isQueryStudio">
  686. <df:button df:id="IDS_OK" df:style="href" df:href="javascript:QS_saveAs()" df:defaultKey="active">
  687. <df:defaultAct>QS_saveAs();</df:defaultAct>
  688. </df:button>
  689. <df:button df:id="IDS_CANCEL" df:style="href" df:href="javascript:QS_cancel()"/>
  690. </xsl:when>
  691. <xsl:when test="$isAgentStudio">
  692. <df:button df:id="IDS_OK" df:style="href" df:href="javascript:AS_saveAs()" df:defaultKey="active">
  693. <df:defaultAct>AS_saveAs();</df:defaultAct>
  694. </df:button>
  695. <df:button df:id="IDS_CANCEL" df:style="href" df:href="javascript:AS_cancel()"/>
  696. </xsl:when>
  697. <xsl:when test="$isPPA">
  698. <df:button df:id="IDS_OK" df:style="href" df:href="javascript:ppw_ok()" df:defaultKey="active"/>
  699. <df:button df:id="IDS_CANCEL" df:style="href" df:href="javascript:ppw_cancel()"/>
  700. </xsl:when>
  701. <xsl:when test="key('env-param','backURL') and key('env-param','backURL')!=''">
  702. <df:button df:id="IDS_OK" utml:validate="true" df:style="submit" df:defaultKey="active"/>
  703. <df:button df:id="IDS_CANCEL" df:style="back-url"/>
  704. </xsl:when>
  705. <xsl:otherwise>
  706. <df:button df:id="IDS_OK" utml:validate="true" df:style="submit" df:defaultKey="active"/>
  707. <df:button df:id="IDS_CANCEL" onclick="javascript:resetPageState()" df:style="stack-down"/>
  708. </xsl:otherwise>
  709. </xsl:choose>
  710. </dp:footer>
  711. </utml:form>
  712. </dp:page>
  713. </xsl:template>
  714. </xsl:stylesheet>
  715. </xts:block>
  716. <!--
  717. ===============================================================================================
  718. debug
  719. ===============================================================================================
  720. -->
  721. <xts:block id="debug" dependency="renderPage" condition=".[ /root/session/param[@name='debug'] = '1' ]" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  722. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  723. <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">
  724. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  725. <xsl:template match="/">
  726. <dbg:dumpxml select="/root"/>
  727. </xsl:template>
  728. </xsl:stylesheet>
  729. </xts:block>
  730. </xts:morphlet>