conditional_subscribe3.xts 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ASV
  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. <xts:morphlet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/subscribe.xml,messages/portal.xml, messages/portalRL.xml" resolverBase="prompting" requiredCapability="canUseConditionalSubscriptions">
  9. <!--
  10. ===============================================================================================
  11. formlogic_init - standard form logic initialization
  12. ===============================================================================================
  13. -->
  14. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  15. <!--
  16. ================================================================================
  17. If the CM roots (personal/public) have not been determined (i.e. exist in the session) then get them
  18. ===============================================================================================
  19. -->
  20. <xts:block id="getRootNames" path="portal/cmroots.xml" condition=".[not(/root/session/param[@name = 'e_proot'])]" processor="XSLT" type="exec" mandatory="false">
  21. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  22. </xts:block>
  23. <!--
  24. ================================================================================
  25. Load default root map for CM objects
  26. ===============================================================================================
  27. -->
  28. <xts:block id="getRootMap" type="exec" mode="input" processor="XML" path="/portal/uiExtensions.xml" mandatory="false">
  29. <xts:logicsheet path="/logicsheets/uiobjects/uiobjects_roots.xslt"/>
  30. </xts:block>
  31. <!--
  32. ===============================================================================================
  33. Query for the default destination container
  34. ===============================================================================================
  35. -->
  36. <xts:block id="getContent" processor="XSLT" type="exec" dependency="formlogic_init getRootNames getRootMap">
  37. <xts:logicsheet path="logicsheets/portal.xsl"/>
  38. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  39. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  40. <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:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  41. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  42. <xsl:template match="/">
  43. <!-- most of these have to be redefined -->
  44. <xsl:variable name="class" select="'reportDataServiceAgentDefinition'"/>
  45. <xsl:variable name="CMRoot" select="/root/CMRootMap/class[@name=$class]"/>
  46. <xsl:variable name="usePath">
  47. <xsl:choose>
  48. <xsl:when test="string(/root/env/param[@name='so.searchPath'])!=''">
  49. <xsl:value-of select="/root/env/param[@name='so.searchPath']"/>
  50. </xsl:when>
  51. <xsl:otherwise>
  52. <xsl:value-of select="/root/env/param[@name='m_path']"/>
  53. </xsl:otherwise>
  54. </xsl:choose>
  55. </xsl:variable>
  56. <xsl:variable name="path">
  57. <xsl:choose>
  58. <xsl:when test="$usePath != '' and (not($CMRoot/@fixedRoot) or $CMRoot/@fixedRoot!='T')">
  59. <xsl:value-of select="$usePath"/>
  60. </xsl:when>
  61. <xsl:otherwise>
  62. <xsl:value-of select="$CMRoot/@root"/>
  63. </xsl:otherwise>
  64. </xsl:choose>
  65. </xsl:variable>
  66. <xts:sequence>
  67. <!-- get some new stuff -->
  68. <xts:append>
  69. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  70. <send:request provider="cm">
  71. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  72. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  73. <cm:requests>
  74. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  75. <cm:search>
  76. <xsl:value-of select="$path"/>
  77. </cm:search>
  78. <cm:properties>
  79. <cm:property name="defaultName"/>
  80. <cm:property name="searchPath"/>
  81. <cm:property name="ancestors"/>
  82. <cm:property name="permissions"/>
  83. <cm:property name="storeID"/>
  84. </cm:properties>
  85. </cm:query>
  86. <xsl:if test="string($CMRoot/@root) = '/content' ">
  87. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  88. <cm:search>
  89. <xsl:value-of select="/root/session/param[@name='e_hp']"/>/folder[permission("write") and permission("traverse")]</cm:search>
  90. <cm:properties>
  91. <cm:property name="defaultName"/>
  92. <cm:property name="permissions"/>
  93. <cm:property name="storeID"/>
  94. </cm:properties>
  95. </cm:query>
  96. </xsl:if>
  97. </cm:requests>
  98. </cm:query>
  99. </xts:transform>
  100. </send:request>
  101. </xts:transform>
  102. </xts:append>
  103. <xts:delete select="/root/env/param[contains(string(@name),'pagerfrom')]"/>
  104. <xts:delete select="/root/env/param[contains(string(@name),'pagerto')]"/>
  105. <xts:delete select="/root/env/param[@name='pageitem']"/>
  106. </xts:sequence>
  107. </xsl:template>
  108. </xsl:stylesheet>
  109. </xts:block>
  110. <!--
  111. ===============================================================================================
  112. format - render the page
  113. ===============================================================================================
  114. -->
  115. <xts:block id="format" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="getContent">
  116. <xts:logicsheet path="subscribe/logicsheets/rdsad.xsl"/>
  117. <xts:logicsheet path="logicsheets/portal.xsl"/>
  118. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  119. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  120. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  121. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  122. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  123. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  124. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  125. <xts:logicsheet path="logicsheets/validation.xslt"/>
  126. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  127. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/" xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/" xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:rdsad="http://developer.cognos.com/schemas/xts/rdsad/" exclude-result-prefixes="xsl cf cp pf df dp lyt cm cml utml xts xtsext rdsad">
  128. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  129. <!-- current file name -->
  130. <xsl:variable name="m_name" select="'conditional_subscribe3.xts'"/>
  131. <xsl:variable name="promptLocale" select="$productLocale"/>
  132. <xsl:variable name="promptFormName" select="'pform'"/>
  133. <xsl:variable name="skin" select="key('user-param', 'skin')"/>
  134. <pf:variables/>
  135. <!-- Prompt Control XSL include -->
  136. <xsl:include href="p_include.xsl"/>
  137. <!-- start the output -->
  138. <xsl:template match="/root">
  139. <!-- The object type we are about to create -->
  140. <xsl:variable name="new-class" select="'reportDataServiceAgentDefinition'"/>
  141. <!-- Current destination folder. -->
  142. <xsl:variable name="usePath">
  143. <xsl:choose>
  144. <xsl:when test="string(/root/env/param[@name='so.searchPath'])!=''">
  145. <xsl:value-of select="/root/env/param[@name='so.searchPath']"/>
  146. </xsl:when>
  147. <xsl:otherwise>
  148. <xsl:value-of select="string(/root/env/param[@name='m_path'])"/>
  149. </xsl:otherwise>
  150. </xsl:choose>
  151. </xsl:variable>
  152. <xsl:variable name="path">
  153. <xsl:choose>
  154. <xsl:when test="$usePath!=''">
  155. <xsl:if test="$usePath != '/content' ">
  156. <xsl:choose>
  157. <xsl:when test="not(starts-with($usePath,'storeID'))">
  158. <xsl:value-of select="$usePath"/>
  159. </xsl:when>
  160. <xsl:otherwise>
  161. <xsl:value-of select="cm:queryResponse/cm:queryReply[1]/*/cm:searchPath"/>
  162. </xsl:otherwise>
  163. </xsl:choose>
  164. </xsl:if>
  165. </xsl:when>
  166. <xsl:otherwise>
  167. <xsl:value-of select="/root/CMRootMap/class[@name=$new-class]/@root"/>
  168. </xsl:otherwise>
  169. </xsl:choose>
  170. </xsl:variable>
  171. <!-- Determine if we can write to the currently selected folder. -->
  172. <xsl:variable name="canWrite" select="contains(cm:queryResponse/cm:queryReply[1]/*/cm:permissions, 'write') and contains(cm:queryResponse/cm:queryReply[1]/*/cm:permissions, 'traverse')"/>
  173. <!-- Determine if the current path points to the personal folder space (We need a session element to make this determination) -->
  174. <xsl:variable name="isPersonalPath" select="starts-with($path, '~') or ( key('session-param', 'e_hp') and starts-with($path, key('session-param', 'e_hp')) )"/>
  175. <xsl:variable name="isAdminPath" select="/root/cm:queryResponse/cm:queryReply[1]/*/cm:objectClass = 'adminFolder'"/>
  176. <!-- 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" -->
  177. <xsl:variable name="showMyFoldersChoice" select="not($isPersonalPath) and not($isAdminPath) and (/root/CMRootMap/class[@name=$new-class]/@root = '/content' )"/>
  178. <!-- get the title -->
  179. <xsl:variable name="wizardTitle">
  180. <xts:string id="IDS_CUSTSUB_TITLE"/>
  181. </xsl:variable>
  182. <xsl:variable name="new-general-title">
  183. <xts:string id="IDS_NEW_TITLE_NAME_LOCATION">
  184. <xts:param name="wizardTitle">
  185. <xsl:value-of select="$wizardTitle"/>
  186. </xts:param>
  187. </xts:string>
  188. </xsl:variable>
  189. <xsl:variable name="target-obj">
  190. <xsl:choose>
  191. <xsl:when test="key('env-param','sc_target_obj')">
  192. <xsl:value-of select="key('env-param','sc_target_obj')"/>
  193. </xsl:when>
  194. <xsl:otherwise>
  195. <xsl:value-of select="key('env-param','m_obj')"/>
  196. </xsl:otherwise>
  197. </xsl:choose>
  198. </xsl:variable>
  199. <xsl:variable name="target-name">
  200. <xsl:choose>
  201. <xsl:when test="key('env-param','sc_target_name')">
  202. <xsl:value-of select="key('env-param','sc_target_name')"/>
  203. </xsl:when>
  204. <xsl:otherwise>
  205. <xsl:value-of select="key('env-param','m_name')"/>
  206. </xsl:otherwise>
  207. </xsl:choose>
  208. </xsl:variable>
  209. <xsl:variable name="operatorString">
  210. <xsl:call-template name="conditionEnumShortValue">
  211. <xsl:with-param name="conditionEnum">
  212. <xsl:value-of select="/root/env/param[@name='m_sub_operation']"/>
  213. </xsl:with-param>
  214. </xsl:call-template>
  215. </xsl:variable>
  216. <!-- This is the "default" string that we will display in the name field -->
  217. <xsl:variable name="default_new_name">
  218. <xsl:choose>
  219. <xsl:when test="/root/env/param[@name='m_sub_type']='nonMetric' and /root/env/param[@name='m_sub_operation']='between' "><xts:string id="IDS_CUSTSUB_DEFAULT_NAME2"><xts:param name="measureName"><xsl:value-of select="/root/env/param[@name='m_subData_measure_name']"/></xts:param><xts:param name="operator"><xsl:value-of select="$operatorString"/></xts:param><xts:param name="value1"><xsl:value-of select="/root/env/param[@name='m_sub_measure_value']"/></xts:param><xts:param name="value2"><xsl:value-of select="/root/env/param[@name='m_sub_measure_value1']"/></xts:param></xts:string></xsl:when>
  220. <xsl:when test="/root/env/param[@name='m_sub_type']='nonMetric' and not(/root/env/param[@name='m_sub_operation']='between') "><xts:string id="IDS_CUSTSUB_DEFAULT_NAME"><xts:param name="measureName"><xsl:value-of select="/root/env/param[@name='m_subData_measure_name']"/></xts:param><xts:param name="operator"><xsl:value-of select="$operatorString"/></xts:param><xts:param name="value1"><xsl:value-of select="/root/env/param[@name='m_sub_measure_value']"/></xts:param></xts:string></xsl:when>
  221. <xsl:when test="/root/env/param[@name='m_sub_type']='metric'"><xts:string id="IDS_CUSTSUB_DEFAULT_NAME_METRIC"><xts:param name="measureName"><xsl:value-of select="/root/env/param[@name='m_subData_measure_name']"/></xts:param></xts:string></xsl:when>
  222. </xsl:choose>
  223. </xsl:variable>
  224. <xsl:variable name="CMRoot" select="/root/CMRootMap/class[@name=$new-class]"/>
  225. <xsl:variable name="fullTask">
  226. <xsl:value-of select="$new-class"/>.container<xsl:text/>
  227. </xsl:variable>
  228. <xsl:text disable-output-escaping="yes">&lt;!DOCTYPE html&gt;</xsl:text>
  229. <dp:page longTitle="$new-general-title">
  230. <dp:meta>
  231. <!-- Help system -->
  232. <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
  233. <pf:meta/>
  234. </dp:meta>
  235. <dp:script>
  236. <!-- Help system -->
  237. <pf:help context="HID_MY_WATCH_ITEMS"/>
  238. <script language="javascript">
  239. <!-- XTS strings used in validation -->
  240. <xsl:variable name="label_name">
  241. <xts:string id="IDS_NEW_NAME" encode="javascript"/>
  242. </xsl:variable>
  243. <xsl:variable name="label_url">
  244. <xts:string id="IDS_NEW_URL" encode="javascript"/>
  245. </xsl:variable>
  246. <xsl:variable name="label_printerAddress">
  247. <xts:string id="IDS_PROP_PRINTER_ADDRESS" encode="javascript"/>
  248. </xsl:variable>
  249. <xsl:variable name="errmsg">
  250. <xts:string id="IDS_ERR_MANDATORY" encode="javascript">
  251. <xts:param name="field">" + label + "</xts:param>
  252. </xts:string>
  253. </xsl:variable>
  254. function init()
  255. {
  256. try {
  257. if (document.pform.m_p_defaultName)
  258. document.pform.m_p_defaultName.focus();
  259. } catch (e) {
  260. //possibly when the control's container is not (yet) visible
  261. }
  262. }
  263. function validateInputField(field, label)
  264. {
  265. field.value = trim(field.value);
  266. if (field.value == '')
  267. {
  268. alert("<xsl:value-of select="normalize-space($errmsg)"/>");
  269. field.focus();
  270. return false;
  271. }
  272. return true;
  273. }
  274. function validate()
  275. {
  276. var f = document.pform;
  277. <!-- Validate the name -->
  278. if ( !validateInputField(f.m_p_defaultName, "<xsl:value-of select="normalize-space($label_name)"/>") )
  279. return false;
  280. <!-- Validate the destination -->
  281. if (f.m_path.value == "")
  282. {
  283. alert( "<xts:string id="IDS_SAVE_AS_NO_DESTINATION" encode="javascript"/>" );
  284. return false;
  285. }
  286. return true;
  287. }
  288. function clearSelect()
  289. {
  290. if (document.pform.elements['so.searchPath']) {
  291. document.pform.elements['so.searchPath'].value = '';
  292. }
  293. }
  294. </script>
  295. <script language="javascript" src="{$webcontent}/{$app}/js/utilities.js"/>
  296. </dp:script>
  297. <utml:form name="pform" method="post" action="{$gateway}">
  298. <input type="hidden" name="ui.backURL" value="{/root/env/param[@name='backURL']}"/>
  299. <!-- this defines the form command operation to be performed when all the collected properties are submitted... -->
  300. <utml:input type="hidden" name="ifrmcmd" value="create" utml:update="false"/>
  301. <utml:input type="hidden" name="m_new_class" value=""/>
  302. <utml:input type="hidden" name="m_class" utml:update="false">
  303. <utml:value>
  304. <xsl:value-of select="$new-class"/>
  305. </utml:value>
  306. </utml:input>
  307. <utml:input type="hidden" name="so.select" utml:update="false">
  308. <utml:value>
  309. <xsl:value-of select="$fullTask"/>
  310. </utml:value>
  311. </utml:input>
  312. <utml:input type="hidden" name="so.return.m" utml:update="false">
  313. <utml:value>
  314. <xsl:value-of select="concat('subscribe/', $m_name)"/>
  315. </utml:value>
  316. </utml:input>
  317. <utml:input name="so.defaultLocation" type="hidden">
  318. <xsl:attribute name="value"><xsl:value-of select="$path"/></xsl:attribute>
  319. </utml:input>
  320. <!-- Following type used by faultHandler when cannot create folder. Performs faultHandler's doCancel function. -->
  321. <!-- By Default if errURL is specified but empty - doCancel() is done.-->
  322. <utml:input type="hidden" name="errURL" utml:update="false">
  323. <xsl:choose>
  324. <xsl:when test="/root/env/param[@name='errURL']">
  325. <utml:value>
  326. <xsl:value-of select="/root/env/param[@name='errURL']"/>
  327. </utml:value>
  328. </xsl:when>
  329. <xsl:otherwise>
  330. <utml:value/>
  331. </xsl:otherwise>
  332. </xsl:choose>
  333. </utml:input>
  334. <!-- Header -->
  335. <!-- ================================================================ -->
  336. <dp:header>
  337. <dp:title>
  338. <xsl:value-of select="$new-general-title"/>
  339. </dp:title>
  340. <dp:close>
  341. <xsl:choose>
  342. <xsl:when test="/root/env/param[@name='backURL']">
  343. <a href="{/root/env/param[@name = 'backURL']}">
  344. <dp:closeMarker/>
  345. </a>
  346. </xsl:when>
  347. <xsl:otherwise>
  348. <a href="javascript:doCancel()">
  349. <dp:closeMarker/>
  350. </a>
  351. </xsl:otherwise>
  352. </xsl:choose>
  353. </dp:close>
  354. <dp:description>
  355. <xts:string id="IDS_NEW_INTRO"/>
  356. </dp:description>
  357. </dp:header>
  358. <!-- Name and Description -->
  359. <!-- ================================================================ -->
  360. <lyt:layout style="1">
  361. <lyt:section>
  362. <!-- Name -->
  363. <dp:list>
  364. <dp:section>
  365. <dp:label>
  366. <label for="m_p_defaultName">
  367. <xts:string id="IDS_NEW_NAME"/>
  368. </label>
  369. </dp:label>
  370. </dp:section>
  371. <dp:section>
  372. <utml:input type="text" size="30" id="m_p_defaultName" name="m_p_defaultName" class="pInput" maxlength="256">
  373. <utml:value>
  374. <xsl:choose>
  375. <xsl:when test="not(key('env-param', 'm_p_defaultName')) and string-length($default_new_name) &lt;= 256">
  376. <xsl:value-of select="$default_new_name"/>
  377. </xsl:when>
  378. <xsl:when test="not(key('env-param', 'm_p_defaultName')) and string-length($default_new_name) &gt; 256">
  379. <xsl:value-of select="substring($default_new_name,0,257)"/>
  380. </xsl:when>
  381. <xsl:otherwise>
  382. <xsl:text/>
  383. </xsl:otherwise>
  384. </xsl:choose>
  385. </utml:value>
  386. </utml:input>
  387. </dp:section>
  388. <dp:section>
  389. <img height="5" width="1">
  390. <xsl:attribute name="src"><xsl:value-of select="'{$webcontent}'"/>/images/space.gif</xsl:attribute>
  391. </img>
  392. </dp:section>
  393. </dp:list>
  394. <!-- Description -->
  395. <dp:list>
  396. <dp:section>
  397. <dp:label>
  398. <label for="m_p_defaultDescription">
  399. <xts:string id="IDS_NEW_DESCRIPTION"/>
  400. </label>
  401. </dp:label>
  402. </dp:section>
  403. <dp:section>
  404. <utml:textarea id="m_p_defaultDescription" name="m_p_defaultDescription" class="pTextarea" cols="30" rows="4"/>
  405. </dp:section>
  406. <dp:section>
  407. <img height="5" width="1">
  408. <xsl:attribute name="src"><xsl:value-of select="'{$webcontent}'"/>/images/space.gif</xsl:attribute>
  409. </img>
  410. </dp:section>
  411. </dp:list>
  412. <!-- ScreenTip -->
  413. <dp:list>
  414. <dp:section>
  415. <dp:label>
  416. <label for="m_p_defaultScreenTip">
  417. <xts:string id="IDS_NEW_SCREENTIP"/>
  418. </label>
  419. </dp:label>
  420. </dp:section>
  421. <dp:section>
  422. <utml:input type="text" id="m_p_defaultScreenTip" name="m_p_defaultScreenTip" class="pInput" maxlength="100" size="30"/>
  423. </dp:section>
  424. <dp:section>
  425. <img height="5" width="1">
  426. <xsl:attribute name="src"><xsl:value-of select="'{$webcontent}'"/>/images/space.gif</xsl:attribute>
  427. </img>
  428. </dp:section>
  429. </dp:list>
  430. <!-- Object-Specific input/hidden fields -->
  431. <!-- ================================================================ -->
  432. <!--<xsl:choose>
  433. will need some of these for things for all the options which are passed to us from ReportViewer.
  434. </xsl:choose> -->
  435. </lyt:section>
  436. </lyt:layout>
  437. <!-- only show this if the desitnation is not ~/folder or /content for anything other than folders -->
  438. <!-- Path / Destination folder -->
  439. <!-- =============================================================================== -->
  440. <lyt:layout style="1" joinSection="yes">
  441. <lyt:section>
  442. <dp:list>
  443. <dp:section>
  444. <dp:label>
  445. <xts:string id="IDS_NEW_DESTINATION"/>
  446. </dp:label>
  447. </dp:section>
  448. <dp:section wrap="wrap">
  449. <div id="ng_path" style="padding:0px; display:none; ">
  450. <xsl:choose>
  451. <xsl:when test="$canWrite">
  452. <dp:text valign="top" wrap="wrap">
  453. <xsl:variable name="rootPath">
  454. <xsl:choose>
  455. <xsl:when test="$isPersonalPath">
  456. <xsl:value-of select="concat(key('session-param', 'e_hp'), '/subscriptionFolder')"/>
  457. </xsl:when>
  458. <xsl:when test="starts-with($path, '/content')">
  459. <xsl:value-of select="$defaultContentRoot"/>
  460. </xsl:when>
  461. </xsl:choose>
  462. </xsl:variable>
  463. <cf:do-the-path-link>
  464. <cf:param name="familytree">cm:queryResponse/cm:queryReply[1]/*/cm:ancestors</cf:param>
  465. <cf:param name="familymember">cm:queryResponse/cm:queryReply[1]/*/cm:defaultName</cf:param>
  466. <cf:param name="home">
  467. <xsl:value-of select="$rootPath"/>
  468. </cf:param>
  469. </cf:do-the-path-link>
  470. </dp:text>
  471. </xsl:when>
  472. <xsl:otherwise>
  473. <dp:inactiveText>
  474. <i>
  475. <xts:string id="IDS_NONE"/>
  476. </i>&#160;&#160;</dp:inactiveText>
  477. </xsl:otherwise>
  478. </xsl:choose>
  479. </div>
  480. </dp:section>
  481. <dp:section wrap="wrap">
  482. <div id="ng_myfolder" style="padding:0px; display:none; ">
  483. <xsl:choose>
  484. <xsl:when test="key('session-param', 'e_mroot') != ''">
  485. <dp:text>
  486. <xsl:value-of select="key('session-param', 'e_mroot')"/>
  487. </dp:text>
  488. </xsl:when>
  489. <xsl:when test="/root/cm:queryResponse/cm:queryReply[2]/*/cm:defaultName and contains(string(/root/cm:queryResponse/cm:queryReply[2]/*/cm:permissions),'write') and key('session-param','write')='true'">
  490. <xts:string id="IDS_PERSONAL"/>
  491. </xsl:when>
  492. <xsl:otherwise>
  493. <dp:inactiveText>
  494. <i>
  495. <xts:string id="IDS_NONE"/>
  496. </i>&#160;&#160;</dp:inactiveText>
  497. </xsl:otherwise>
  498. </xsl:choose>
  499. </div>
  500. </dp:section>
  501. <dp:section>
  502. <dp:group>
  503. <xsl:if test="(not($CMRoot/@fixedRoot) or $CMRoot/@fixedRoot!='T')">
  504. <dp:groupItem valign="top">
  505. <utml:a utml:op="maintain">
  506. <utml:target>
  507. <xsl:value-of select="$app"/>/select/select.xts<xsl:text/>
  508. </utml:target>
  509. <xsl:attribute name="onclick">javascript:resetPageState()</xsl:attribute>
  510. <xsl:attribute name="style">font-size:143%</xsl:attribute>
  511. <xsl:text/>
  512. <xts:string id="IDS_SELECT_ANOTHER_FOLDER"/>
  513. <xsl:text/>
  514. </utml:a>
  515. </dp:groupItem>
  516. </xsl:if>
  517. <xsl:if test="not($isAdminPath) and /root/cm:queryResponse/cm:queryReply[2]/*/cm:defaultName and contains(string(/root/cm:queryResponse/cm:queryReply[2]/*/cm:permissions),'write') and key('session-param','write')='true' ">
  518. <dp:groupItem valign="top">
  519. <img height="1" width="10" border="0">
  520. <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute>
  521. </img>
  522. <xsl:text/>
  523. <a href="#">
  524. <xsl:text/>
  525. <xsl:attribute name="onclick">javascript:changeSelection('myfolder')</xsl:attribute>
  526. <xsl:text/>
  527. <xts:string id="IDS_SELECT_MY_FOLDERS"/>
  528. <xsl:text/>
  529. </a>
  530. <xsl:text/>
  531. </dp:groupItem>
  532. </xsl:if>
  533. </dp:group>
  534. </dp:section>
  535. </dp:list>
  536. <utml:input name="m_path" type="hidden">
  537. <xsl:attribute name="value"><xsl:value-of select="$path"/></xsl:attribute>
  538. </utml:input>
  539. </lyt:section>
  540. </lyt:layout>
  541. <script language="javascript">
  542. function changeSelection(divName)
  543. {
  544. var pathdiv = document.getElementById('ng_path');
  545. var mfdiv = document.getElementById('ng_myfolder');
  546. switch (divName)
  547. {
  548. case "myfolder":
  549. {
  550. mfdiv.style.display = "";
  551. pathdiv.style.display = "none";
  552. setMyFolder();
  553. break;
  554. }
  555. default:
  556. {
  557. mfdiv.style.display = "none";
  558. pathdiv.style.display = "";
  559. break;
  560. }
  561. }
  562. }
  563. function setMyFolder()
  564. {
  565. setStateValue("mfst",1);
  566. document.pform.m_path.value="<xsl:value-of select="xtsext:javascriptencode(key('session-param','e_hp'))"/>/folder";
  567. document.pform["so.defaultLocation"].value = "<xsl:value-of select="xtsext:javascriptencode(key('session-param','e_hp'))"/>/folder";
  568. }
  569. </script>
  570. <script language="javascript">
  571. var mf = getSessionValue("mfst");
  572. if ( mf !=null &amp;&amp; mf != "" )
  573. {
  574. var ngp = document.getElementById('ng_path');
  575. var ngm = document.getElementById('ng_myfolder');
  576. if( mf == 1 ) {
  577. ngm.style.display = "";
  578. ngp.style.display = "none";
  579. }
  580. else {
  581. ngp.style.display = "";
  582. ngm.style.display = "none";
  583. }
  584. } else
  585. {
  586. var ngp = document.getElementById('ng_path');
  587. var ngm = document.getElementById('ng_myfolder');
  588. <xsl:choose>
  589. <xsl:when test="$path!='' ">
  590. ngp.style.display = "";
  591. ngm.style.display = "none";
  592. setStateValue("mfst",0);
  593. </xsl:when>
  594. <xsl:otherwise>
  595. ngm.style.display = "";
  596. ngp.style.display = "none";
  597. setStateValue("mfst",1);
  598. </xsl:otherwise>
  599. </xsl:choose>
  600. }
  601. </script>
  602. <script language="javascript">
  603. function resetPageState()
  604. {
  605. <!-- Clear the cookie value mfst -->
  606. clearSessionEntry('mfst');
  607. }
  608. function doCancel()
  609. {
  610. window.close();
  611. }
  612. </script>
  613. <!-- Footer -->
  614. <!-- ================================================================ -->
  615. <dp:footer>
  616. <xsl:variable name="back-target">
  617. <!-- we know where we're going -->
  618. <xsl:text>subscribe/conditional_subscribe2.xts</xsl:text>
  619. </xsl:variable>
  620. <xsl:variable name="finish-target">
  621. <!-- we know where we're going -->
  622. <xsl:text>subscribe/submit.xts</xsl:text>
  623. </xsl:variable>
  624. <df:button df:id="IDS_CANCEL" df:style="href">
  625. <df:href>
  626. <xsl:choose>
  627. <xsl:when test="/root/env/param[@name='backURL']">
  628. <xsl:value-of select="/root/env/param[@name='backURL']"/>
  629. </xsl:when>
  630. <xsl:otherwise>
  631. <xsl:text>javascript:doCancel();</xsl:text>
  632. </xsl:otherwise>
  633. </xsl:choose>
  634. </df:href>
  635. </df:button>
  636. <df:button df:id="IDS_BACK" df:style="maintain" utml:validate="true" onClick="clearSelect();">
  637. <df:target>
  638. <xsl:value-of select="$back-target"/>
  639. </df:target>
  640. </df:button>
  641. <df:button df:id="IDS_NEXT"/>
  642. <df:button df:id="IDS_FINISH" df:style="maintain" utml:validate="true">
  643. <df:target>
  644. <xsl:value-of select="$finish-target"/>
  645. </df:target>
  646. </df:button>
  647. </dp:footer>
  648. </utml:form>
  649. <xsl:if test="key('env-param','fromCMM')">
  650. <dt:cmmPostBackForm/>
  651. </xsl:if>
  652. </dp:page>
  653. </xsl:template>
  654. <dt:localizedFloatTextBox/>
  655. <rdsad:enumTemplates/>
  656. </xsl:stylesheet>
  657. </xts:block>
  658. <!-- Debug -->
  659. <xts:block id="debug" type="exec" dependency="format" mode="output" condition=".[ /root/session/param[@name='debug'] = '1' ]" processor="XSLT" mandatory="false" mimeType="text/html">
  660. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  661. <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="xsl dbg">
  662. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  663. <dbg:templates/>
  664. <xsl:template match="/">
  665. <dbg:dumpxml select="/root"/>
  666. </xsl:template>
  667. </xsl:stylesheet>
  668. </xts:block>
  669. </xts:morphlet>