addNewsItem.xts 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: AGS
  5. (C) Copyright IBM Corp. 2005, 2014
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. =================================================================================================================================
  10. add url.xts
  11. create a url news item to be dropped into the portal
  12. =================================================================================================================================
  13. -->
  14. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/AGS.xml,messages/portal.xml, messages/portalRL.xml" requiredCapability="canUseEventStudio">
  15. <!-- If the CM roots (personal/public) have not been determined (i.e. exist in the session) then get them. ======================= -->
  16. <xts:block id="getRootNames" path="portal/cmroots.xml" condition=".[not(/root/session/param[@name = 'e_proot']) and /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup']" processor="XSLT" type="exec" mandatory="false">
  17. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  18. </xts:block>
  19. <!--
  20. ===============================================================================================
  21. returnResult - We're done with the email options morphlet, so return the appropriate response
  22. ===============================================================================================
  23. -->
  24. <xts:block id="returnResult" path="/ags/tabResultTemplate.xslt" dependency="getRootNames" type="exec" processor="XSLT" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'finished']" mandatory="false">
  25. <xts:logicsheet path="logicsheets/portal.xsl"/>
  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="returnResult" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup']">
  33. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  34. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  35. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  36. <xsl:variable name="url_location">
  37. <xsl:choose>
  38. <xsl:when test="/root/env/param[@name = 'selected_path'] and /root/env/param[@name = 'url_request_mode'] = 'url_location'">
  39. <xsl:value-of select="/root/env/param[@name = 'selected_path']"/>
  40. </xsl:when>
  41. <xsl:otherwise>
  42. <xsl:value-of select="/root/env/param[@name = 'url_location']"/>
  43. </xsl:otherwise>
  44. </xsl:choose>
  45. </xsl:variable>
  46. <xsl:variable name="url_entry">
  47. <xsl:choose>
  48. <xsl:when test="/root/env/param[@name = 'selected_path'] and /root/env/param[@name = 'url_request_mode'] = 'url_entry'">
  49. <xsl:value-of select="/root/env/param[@name = 'selected_path']"/>
  50. </xsl:when>
  51. <xsl:otherwise>
  52. <xsl:value-of select="/root/env/param[@name = 'url_entry']"/>
  53. </xsl:otherwise>
  54. </xsl:choose>
  55. </xsl:variable>
  56. <xsl:template match="/">
  57. <xts:sequence>
  58. <xsl:if test="$url_location != '' ">
  59. <xts:append>
  60. <url_location>
  61. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  62. <send:request provider="cm" requester="AGS:addNewsItem">
  63. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  64. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  65. <cm:search>
  66. <xsl:value-of select="$url_location"/>
  67. </cm:search>
  68. <cm:properties>
  69. <cm:property name="defaultName"/>
  70. <cm:property name="searchPath"/>
  71. <cm:property name="permissions"/>
  72. <cm:property name="ancestors"/>
  73. </cm:properties>
  74. </cm:query>
  75. </xts:transform>
  76. </send:request>
  77. </xts:transform>
  78. </url_location>
  79. </xts:append>
  80. </xsl:if>
  81. <xsl:if test="$url_entry != '' ">
  82. <xts:append>
  83. <url_entry>
  84. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  85. <send:request provider="cm" requester="AGS:addNewsItem">
  86. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  87. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  88. <cm:search>
  89. <xsl:value-of select="$url_entry"/>
  90. </cm:search>
  91. <cm:properties>
  92. <cm:property name="defaultName"/>
  93. <cm:property name="searchPath"/>
  94. <cm:property name="permissions"/>
  95. <cm:property name="ancestors"/>
  96. </cm:properties>
  97. </cm:query>
  98. </xts:transform>
  99. </send:request>
  100. </xts:transform>
  101. </url_entry>
  102. </xts:append>
  103. </xsl:if>
  104. <!--stop these malingerers free loading -->
  105. <xts:delete select="/root/env/param[@name='selected_path' or @name='m_path']"/>
  106. </xts:sequence>
  107. </xsl:template>
  108. </xsl:stylesheet>
  109. </xts:block>
  110. <!--
  111. ===============================================================================================
  112. update names with the fresh value from cm
  113. ===============================================================================================
  114. -->
  115. <xts:block id="updatePaths" processor="XSLT" type="exec" dependency="getContent" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup'] ">
  116. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  117. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  118. <xsl:template match="/">
  119. <xts:sequence>
  120. <xsl:if test="/root/url_location">
  121. <xts:delete select="/root/env/param[@name='url_location']"/>
  122. <xts:append select="/root/env">
  123. <param name="url_location">
  124. <xsl:value-of select="/root/url_location/cm:queryResponse/*/cm:searchPath"/>
  125. </param>
  126. </xts:append>
  127. </xsl:if>
  128. <xsl:if test="/root/url_entry">
  129. <xts:delete select="/root/env/param[@name='url_entry']"/>
  130. <xts:delete select="/root/env/param[@name='url_entry_name']"/>
  131. <xts:append select="/root/env">
  132. <param name="url_entry">
  133. <xsl:value-of select="/root/url_entry/cm:queryResponse/*/cm:searchPath"/>
  134. </param>
  135. <param name="url_entry_name">
  136. <xsl:value-of select="/root/url_entry/cm:queryResponse/*/cm:defaultName"/>
  137. </param>
  138. </xts:append>
  139. </xsl:if>
  140. </xts:sequence>
  141. </xsl:template>
  142. </xsl:stylesheet>
  143. </xts:block>
  144. <!--
  145. ===============================================================================================
  146. genMarkup -
  147. ===============================================================================================
  148. -->
  149. <xts:block id="genMarkup" type="exec" dependency="updatePaths" processor="XSLT" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup' or /root/*[local-name()='morphletResponse']]">
  150. <!-- logicsheets -->
  151. <!-- portal specific information -->
  152. <xts:logicsheet path="logicsheets/portal.xsl"/>
  153. <xts:logicsheet path="ags/logicsheets/dialogs.xsl"/>
  154. <!-- Dialog specific logicsheets -->
  155. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  156. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  157. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  158. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  159. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  160. <!-- Generic logicsheets -->
  161. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  162. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  163. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  164. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:out="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/" xmlns:agsdlg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/dialog/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" 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:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/" xmlns:req-params="http://developer.cognos.com/schemas/request/params" exclude-result-prefixes="agsdlg xts xsl cm pf xtsext lyt dp df cf cp xos">
  165. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  166. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  167. <pf:variables/>
  168. <pf:gen-icon/>
  169. <xsl:template match="/">
  170. <xts:sequence>
  171. <xts:append select="/root/output">
  172. <xos:part>
  173. <xos:entityHeader>
  174. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  175. </xos:entityHeader>
  176. <xos:entityBody>
  177. <xsl:element name="{key('request-param','resultNode')}" namespace="">
  178. <markup>
  179. <xts:transform name="XMLEncode">
  180. <utml:form name="pform">
  181. <!--in order to use utml transforms -->
  182. <xsl:variable name="input-size" select="'45'"/>
  183. <xsl:variable name="textarea-size" select="'120'"/>
  184. <xsl:variable name="headline-size" select="'60'"/>
  185. <utml:input type="hidden" name="url_entry" id="url_entry">
  186. <utml:value>
  187. <xsl:value-of select="/root/env/param[@name='url_entry']"/>
  188. </utml:value>
  189. </utml:input>
  190. <utml:input type="hidden" name="m_path" id="m_path" value=""/>
  191. <utml:input type="hidden" name="taskName" id="taskName" utml:update="false" >
  192. <utml:value>
  193. <xsl:if test="key('env-param', 'taskName') and string-length(string(key('env-param', 'taskName'))) > 0">
  194. <xsl:value-of select="key('env-param', 'taskName')"/>
  195. </xsl:if>
  196. </utml:value>
  197. </utml:input>
  198. <!--enum of url_none, url_location, url_entry used to eyeball the m.o. of the specify_location usageage-->
  199. <utml:input type="hidden" name="url_request_mode" id="url_request_mode" value="url_none"/>
  200. <xsl:variable name="ags_image_root">../ags/images/summary/</xsl:variable>
  201. <!-- ================================================================ -->
  202. <!-- H E A D E R -->
  203. <!-- ================================================================ -->
  204. <agsdlg:header>
  205. <dp:image>
  206. <img alt="" border="0">
  207. <xsl:attribute name="src"><xsl:value-of select="$ags_image_root"/>icon_newsitem_24.gif</xsl:attribute>
  208. </img>
  209. </dp:image>
  210. <dp:title>
  211. <xts:string id="DIALOG_URL_TITLE"/>
  212. </dp:title>
  213. <dp:description>
  214. <xts:string id="DIALOG_URL_DESCRIPTION"/>
  215. </dp:description>
  216. </agsdlg:header>
  217. <!-- need this to be included by default -->
  218. <script type="text/javascript" src="../ags/dragDropHandler.js"/>
  219. <script language="javascript">
  220. function init()
  221. {
  222. droppy.registerDropZone("url_name","","",'true',&quot;<xsl:value-of select="xtsext:javascriptencode(string(/root/req-params:requestParams/req-params:param[@name='tabSelectedID']))"/>&quot;);
  223. droppy.registerDropZone("url_screentip","","",'true',&quot;<xsl:value-of select="xtsext:javascriptencode(string(/root/req-params:requestParams/req-params:param[@name='tabSelectedID']))"/>&quot;);
  224. droppy.registerDropZone("url_description","","",'true',&quot;<xsl:value-of select="xtsext:javascriptencode(string(/root/req-params:requestParams/req-params:param[@name='tabSelectedID']))"/>&quot;);
  225. }
  226. /**
  227. function that does a screen scrape after the entry text box is exited
  228. to update the form variable that holds the entry
  229. */
  230. function setUriRadio(uri){
  231. //array of labels in the same order they appear on the page
  232. var label_index = new Array("url_eventList", "url_entry", "url_url");
  233. for(var i = 0; i &lt; label_index.length; i++){
  234. if(label_index[i] == uri){
  235. //this is our baby
  236. document.pform.url_uri[i].checked = true;
  237. }else{
  238. document.pform.url_uri[i].checked = false;
  239. }
  240. }
  241. }
  242. <xsl:variable name="entry_start_path">
  243. <xsl:if test="/root/url_entry/cm:queryResponse/*/cm:ancestors/cm:ancestorInfo[last()]/cm:searchPath != ''">
  244. <xsl:value-of select="/root/url_entry/cm:queryResponse/*/cm:ancestors/cm:ancestorInfo[last()]/cm:searchPath"/>
  245. </xsl:if>
  246. </xsl:variable>
  247. /**
  248. a flaggette to discern whether we are recently come from an entry select or a url location select
  249. */
  250. function setRequestMode(mode){
  251. //so we know what to do on return to this page
  252. document.pform.url_request_mode.value = mode;
  253. var cf=parent.getConfigFrame?parent.getConfigFrame():getConfigFrame();
  254. var location_start_path = '<xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='url_location']))"/>';
  255. location_start_path = location_start_path != '' ? location_start_path : decodeURIComponent(cf.cfgGet('PackageRoot'));
  256. //adjust m_class to represent the start point of the appropriate property
  257. if(mode == "url_location"){
  258. document.pform.m_path.value = location_start_path;
  259. }else if( mode == "url_entry"){
  260. document.pform.m_path.value = '<xsl:value-of select="xtsext:javascriptencode(string($entry_start_path))"/>';
  261. }
  262. }
  263. /*
  264. this method will shortly be removed..... as validation is to be moved to a server call
  265. */
  266. function validate(){
  267. var handler = new ErrorHandler();
  268. handler.check(!document.pform.taskName.value, &quot;<xts:string id="DIALOG_URL_NO_ACTION_NAME" encode="javascript"/>&quot;);
  269. handler.check(!document.pform.url_name.value, &quot;<xts:string id="DIALOG_URL_NO_HEADLINE" encode="javascript"/>&quot;);
  270. //if entry is checked, there must be an entry or if url is checked, there must be a url
  271. //var valid_uri = (document.pform.url_uri[1].checked &amp;&amp; document.pform.url_entry.value) || (document.pform.url_uri[2].checked &amp;&amp; document.pform.url_url.value) || (document.pform.url_uri[0].checked);
  272. var valid_uri = (document.pform.url_uri[0].checked &amp;&amp; document.pform.url_entry.value) || (document.pform.url_uri[1].checked &amp;&amp; document.pform.url_url.value);
  273. handler.check(!valid_uri, dialogNoLinkWarning);
  274. handler.check(!document.pform.url_location, agentItemsNoLocationWarning);
  275. if(!handler.isValid()){
  276. alert(handler.getMessage());
  277. }
  278. return handler.isValid();
  279. }
  280. function ErrorHandler(){
  281. this.error_message = '';
  282. }
  283. ErrorHandler.prototype.check = function(expression, message){
  284. if(expression){
  285. this.addToMessage(message);
  286. }
  287. }
  288. ErrorHandler.prototype.isValid = function(){
  289. return this.error_message == '';
  290. }
  291. ErrorHandler.prototype.getMessage = function(){
  292. return this.error_message;
  293. }
  294. ErrorHandler.prototype.addToMessage = function(messagePart){
  295. if (messagePart){
  296. if(this.error_message != ''){
  297. this.error_message += "\n";
  298. }
  299. this.error_message += messagePart;
  300. }
  301. }
  302. // submit the operation and service name
  303. function leavingDialog(){
  304. if(window.argumentsLeavingDialog){
  305. argumentsLeavingDialog();
  306. }
  307. var headLine = document.pform.url_name.value;
  308. if(headLine){
  309. document.pform.taskName.value = headLine;
  310. }
  311. if (document.pform.url_url.value) {
  312. // Trim spaces from the url.
  313. //
  314. var s=document.pform.url_url.value;
  315. s=s.replace(/^\s*(.*)/, "$1");
  316. s=s.replace(/(.*?)\s*$/, "$1");
  317. document.pform.url_url.value = s;
  318. }
  319. }
  320. function selectLocation() {
  321. var cf = parent.getConfigFrame();
  322. if (!cf.checkCAF()) {
  323. setRequestMode('url_entry');
  324. setUriRadio('url_entry');
  325. doSelectObject('rss_content.es', '<xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='url_entry']))"/>')
  326. }
  327. }
  328. function selectNewsList() {
  329. var cf = parent.getConfigFrame();
  330. if (!cf.checkCAF()) {
  331. setRequestMode('url_location');
  332. doSelectObject('folder.es', '<xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='url_location']))"/>')
  333. }
  334. }
  335. </script>
  336. <!-- ================================================================ -->
  337. <!-- B O D Y -->
  338. <!-- ================================================================ -->
  339. <!-- Define a new layout-->
  340. <lyt:layout style="2">
  341. <lyt:section>
  342. <dp:textarea section3_align="left">
  343. <!-- the agent name label-->
  344. <dp:section1>
  345. <xts:string id="DIALOG_URL_NAME_LABEL"/>
  346. </dp:section1>
  347. <!-- the agent name input-->
  348. <dp:section2>
  349. <agsdlg:insertButton targetId="url_name">
  350. <utml:textarea rows="4" cols="{$headline-size}" name="url_name" onKeydown="parent.getConfigFrame().checkMaxLength(this)" maxlength="255"/>
  351. </agsdlg:insertButton>
  352. </dp:section2>
  353. </dp:textarea>
  354. </lyt:section>
  355. <lyt:section>
  356. <xsl:value-of select="key('request-param','suppressionDetails')" disable-output-escaping="yes"/>
  357. </lyt:section>
  358. </lyt:layout>
  359. <lyt:layout style="2">
  360. <lyt:section>
  361. <dp:textarea section3_align="left">
  362. <!-- the agent name label-->
  363. <dp:section1>
  364. <xts:string id="DIALOG_URL_SCREENTIP_LABEL"/>
  365. </dp:section1>
  366. <!-- the agent url_screentip input-->
  367. <dp:section2>
  368. <agsdlg:insertButton targetId="url_screentip">
  369. <utml:textarea rows="3" cols="{$textarea-size}" name="url_screentip" onChange="parent.getConfigFrame().checkMaxLength(this)" maxlength="255"/>
  370. <!-- <utml:input type="text" name="url_screentip" id="url_screentip" size="{$input-size}"/>-->
  371. </agsdlg:insertButton>
  372. </dp:section2>
  373. </dp:textarea>
  374. </lyt:section>
  375. <!-- <lyt:section>
  376. <xsl:if test="key('request-param','eventList') != ''">
  377. <dp:textarea>
  378. <dp:section1>
  379. <xsl:variable name="taskName">
  380. <xts:string id="AGS_URL_TASK"/>
  381. </xsl:variable>
  382. <xts:string id="DIALOG_SUPPRESSION_SUMMARY_TEXT_HEADING">
  383. <xts:param name="taskType">
  384. <xsl:value-of select="$taskName"/>
  385. </xts:param>
  386. </xts:string>
  387. </dp:section1>
  388. <dp:section2>
  389. <xsl:value-of select="key('request-param','eventList')"/>
  390. </dp:section2>
  391. </dp:textarea>
  392. </xsl:if>
  393. </lyt:section> -->
  394. </lyt:layout>
  395. <lyt:layout style="1">
  396. <lyt:section>
  397. <dp:textarea>
  398. <!-- the url description label-->
  399. <dp:section1>
  400. <xts:string id="DIALOG_URL_DESCRIPTION_LABEL"/>
  401. </dp:section1>
  402. <!-- the description input-->
  403. <dp:section2>
  404. <agsdlg:insertButton targetId="url_description">
  405. <utml:textarea rows="3" cols="{$textarea-size}" name="url_description" onChange="parent.getConfigFrame().checkMaxLength(this)" maxlength="1024"/>
  406. </agsdlg:insertButton>
  407. </dp:section2>
  408. </dp:textarea>
  409. </lyt:section>
  410. </lyt:layout>
  411. <lyt:layout style="2">
  412. <lyt:section>
  413. <xsl:variable name="url_url" select="/root/env/param[@name='url_url']"/>
  414. <xsl:variable name="url_entry" select="/root/env/param[@name='url_entry']"/>
  415. <xsl:variable name="url_uri" select="/root/env/param[@name='url_uri']"/>
  416. <utml:radio-group name="url_uri">
  417. <utml:default-value>
  418. <xsl:value-of select="$url_uri"/>
  419. </utml:default-value>
  420. <dp:textarea section3_align="left" width="{$textarea-size}">
  421. <dp:section1>
  422. <xts:string id="DIALOG_URL_LINK_LABEL"/>
  423. </dp:section1>
  424. <dp:section2>
  425. <xts:string id="DIALOG_URL_LINK_DESCRIPTION"/>
  426. </dp:section2>
  427. </dp:textarea>
  428. <dp:section>
  429. <dp:choice>
  430. <dp:section1>
  431. <utml:input type="radio">
  432. <utml:value>url_eventList</utml:value>
  433. </utml:input>
  434. </dp:section1>
  435. <dp:section2 onclick="setUriRadio('url_eventList')">
  436. <xts:string id="DIALOG_URL_EVENT_LIST"/>
  437. </dp:section2>
  438. </dp:choice>
  439. </dp:section>
  440. <dp:section>
  441. <dp:choice>
  442. <dp:section1>
  443. <utml:input type="radio">
  444. <utml:value>url_entry</utml:value>
  445. </utml:input>
  446. </dp:section1>
  447. <dp:section2>
  448. <dp:list>
  449. <dp:section>
  450. <xts:string id="DIALOG_URL_ENTRY_LABEL"/>
  451. </dp:section>
  452. <dp:section>
  453. <dp:box>
  454. <xsl:choose>
  455. <xsl:when test="/root/env/param[@name='url_entry_name']">
  456. <dp:boxSection>
  457. <xsl:text>...></xsl:text>
  458. </dp:boxSection>
  459. <dp:boxSection hgap="5"/>
  460. <dp:boxSection type="label">
  461. <xsl:value-of select="/root/env/param[@name='url_entry_name']"/>
  462. </dp:boxSection>
  463. </xsl:when>
  464. <xsl:otherwise>
  465. <dp:boxSection>
  466. <xts:string id="IDS_NONE"/>
  467. <!--xts:string id="IDS_PROP_CONN_COMMAND_NONE"/> -->
  468. </dp:boxSection>
  469. </xsl:otherwise>
  470. </xsl:choose>
  471. <dp:boxSection hgap="5"/>
  472. <dp:boxSection>
  473. <a href="#" onclick="selectLocation();">
  474. <xts:string id="DIALOG_URL_ENTRY_SELECT_LABEL"/>
  475. </a>
  476. </dp:boxSection>
  477. </dp:box>
  478. </dp:section>
  479. </dp:list>
  480. </dp:section2>
  481. </dp:choice>
  482. </dp:section>
  483. <dp:section>
  484. <dp:choice valign="top">
  485. <dp:section1>
  486. <utml:input type="radio">
  487. <utml:value>url_url</utml:value>
  488. </utml:input>
  489. </dp:section1>
  490. <dp:section2>
  491. <dp:list>
  492. <dp:section>
  493. <xts:string id="IDS_NEW_URL_HINT"/>
  494. </dp:section>
  495. <dp:section>
  496. <utml:input type="text" name="url_url" id="url_url" size="{$input-size}" onclick="setUriRadio('url_url')">
  497. <utml:value>
  498. <xsl:value-of select="$url_url"/>
  499. </utml:value>
  500. </utml:input>
  501. </dp:section>
  502. </dp:list>
  503. </dp:section2>
  504. </dp:choice>
  505. </dp:section>
  506. </utml:radio-group>
  507. </lyt:section>
  508. <lyt:section>
  509. <!-- Path / Destination folder -->
  510. <!-- =============================================================================== -->
  511. <!-- Path to the container where we want to place this new entry. Leave this empty if the user does not have write access. -->
  512. <xsl:variable name="path">
  513. <xsl:if test="contains(/root/url_location/cm:queryResponse/*/cm:permissions, 'write')">
  514. <xsl:value-of select="/root/url_location/cm:queryResponse/*/cm:searchPath"/>
  515. </xsl:if>
  516. </xsl:variable>
  517. <xsl:variable name="new-class" select="folder"/>
  518. <!-- Determine if the current path points to the personal folder space (We need a session element to make this determination) -->
  519. <xsl:variable name="isPersonalPath" select="starts-with($path, '~') or ( key('session-param', 'e_hp') and starts-with($path, key('session-param', 'e_hp')) )"/>
  520. <xsl:variable name="showMyFoldersChoice" select="not($isPersonalPath)"/>
  521. <utml:default-value>
  522. <xsl:value-of select="$path"/>
  523. </utml:default-value>
  524. <dp:list>
  525. <dp:section>
  526. <xsl:text> &#160;&#160;</xsl:text>
  527. </dp:section>
  528. <dp:section>
  529. <dp:list title="DIALOG_URL_NEWS_LOCATION_LABEL">
  530. <dp:section>
  531. <xsl:choose>
  532. <xsl:when test=" $path != '' ">
  533. <dp:text valign="top" wrap="wrap">
  534. <!-- For personal folder destinations, render the path starting at the
  535. directory/namespace/account/folder ancestor. -->
  536. <xsl:variable name="rootPath">
  537. <xsl:choose>
  538. <xsl:when test="$isPersonalPath">
  539. <xsl:value-of select="concat(key('session-param', 'e_hp'), '/folder')"/>
  540. </xsl:when>
  541. <xsl:when test="starts-with($path, '/content')">
  542. <xsl:value-of select="$defaultContentRoot"/>
  543. </xsl:when>
  544. </xsl:choose>
  545. </xsl:variable>
  546. <cf:do-the-path-link>
  547. <cf:param name="familytree">/root/url_location/cm:queryResponse/*/cm:ancestors</cf:param>
  548. <cf:param name="familymember">/root/url_location/cm:queryResponse/*/cm:defaultName</cf:param>
  549. <cf:param name="home">
  550. <xsl:value-of select="$rootPath"/>
  551. </cf:param>
  552. </cf:do-the-path-link>
  553. </dp:text>
  554. </xsl:when>
  555. <xsl:otherwise>
  556. <!--<dp:inactiveText> -->
  557. <xts:string id="IDS_NONE"/>
  558. &#160;&#160;
  559. <!-- </dp:inactiveText> -->
  560. </xsl:otherwise>
  561. </xsl:choose>
  562. </dp:section>
  563. </dp:list>
  564. </dp:section>
  565. <dp:section>
  566. <dp:lastSection>
  567. <!-- Select a folder link -->
  568. <dp:group>
  569. <!-- is there a reason for this img other than cosmetic?? -->
  570. <!-- <dp:groupItem>
  571. <img height="1" width="5" border="0">
  572. <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute>
  573. </img>
  574. </dp:groupItem> -->
  575. <dp:groupItem valign="top">
  576. <xsl:if test="not(contains(' package printer pageDefinition dataSource portlet portalSkin ', concat(' ', $new-class, ' ')))">
  577. <a href="#" onclick="selectNewsList();">
  578. <xts:string id="DIALOG_URL_LOCATION_SELECT_LABEL"/>
  579. </a>
  580. <utml:input type="hidden" name="qssave" id="qssave" value="true"/>
  581. </xsl:if>
  582. </dp:groupItem>
  583. </dp:group>
  584. </dp:lastSection>
  585. </dp:section>
  586. </dp:list>
  587. </lyt:section>
  588. </lyt:layout>
  589. <!-- footer -->
  590. <dp:emptyFooter/>
  591. </utml:form>
  592. </xts:transform>
  593. </markup>
  594. </xsl:element>
  595. </xos:entityBody>
  596. </xos:part>
  597. </xts:append>
  598. </xts:sequence>
  599. </xsl:template>
  600. </xsl:stylesheet>
  601. </xts:block>
  602. <!--
  603. ===============================================================================================
  604. debug - special debug block for nested requests
  605. ===============================================================================================
  606. -->
  607. <xts:block id="debug" type="exec" processor="XSLT" mimeType="text/html" dependency="genMarkup" condition=".[/root/session/param[@name='debug']='1']" mandatory="false">
  608. <!-- get the debug logic sheet -->
  609. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  610. <xsl:stylesheet version="1.0" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/" exclude-result-prefixes="dbg xos">
  611. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  612. <xsl:template match="/">
  613. <xts:sequence>
  614. <xsl:variable name="resultNode" select="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='resultNode']"/>
  615. <xts:append select="/root/output/*[local-name()='part']/*[local-name()='entityBody']/*[local-name()='{$resultNode}']">
  616. <debugDump>
  617. <xts:transform name="XMLEncode">
  618. <dbg:dumpxml select="/root/*[local-name()!='header' and local-name()!='output' and local-name()!='system' and local-name()!='http' and local-name()!='session']">
  619. <dbg:title>addNewsItem.xts</dbg:title>
  620. </dbg:dumpxml>
  621. </xts:transform>
  622. </debugDump>
  623. </xts:append>
  624. </xts:sequence>
  625. </xsl:template>
  626. </xsl:stylesheet>
  627. </xts:block>
  628. </xts:morphlet>