annotation1.xts 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: Viewer
  5. (C) Copyright IBM Corp. 2001, 2012
  6. US Government Users Restricted Rights - Use, duplication or
  7. disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  8. -->
  9. <xts:morphlet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/viewer.xml,messages/portal.xml, messages/portalRL.xml" resolverBase="prompting">
  10. <!--
  11. ===============================================================================================
  12. formlogic_init - standard form logic initialization
  13. ===============================================================================================
  14. -->
  15. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  16. <!--
  17. ================================================================================
  18. start us on the right path if we've started from RV
  19. ================================================================================
  20. -->
  21. <xts:block id="startingFromRV" processor="XSLT" type="exec" condition=".[not(/root/env/param[@name='soapFault'])]" mandatory="false">
  22. <xts:logicsheet path="logicsheets/portal.xsl"/>
  23. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  24. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  25. <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">
  26. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  27. <xsl:template match="/">
  28. <xts:sequence>
  29. <!-- need information about the report - the defaultName to be precise -->
  30. <xts:append select="/root">
  31. <annotationSource>
  32. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  33. <send:request provider="cm">
  34. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  35. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  36. <cm:search>
  37. <xsl:value-of select="/root/env/param[@name='ui.object']"/>
  38. </cm:search>
  39. <cm:properties>
  40. <cm:property name="ancestors"/>
  41. <cm:property name="defaultName"/>
  42. <cm:property name="defaultDescription"/>
  43. <cm:property name="searchPath"/>
  44. </cm:properties>
  45. </cm:query>
  46. </xts:transform>
  47. </send:request>
  48. </xts:transform>
  49. </annotationSource>
  50. </xts:append>
  51. </xts:sequence>
  52. </xsl:template>
  53. </xsl:stylesheet>
  54. </xts:block>
  55. <!--
  56. ===============================================================================================
  57. append the error
  58. ===============================================================================================
  59. -->
  60. <xts:block id="appendError" processor="XSLT" type="exec" dependency="startingFromRV" condition=".[/root/env/param[@name='soapFault']]" mandatory="false">
  61. <xts:logicsheet path="logicsheets/portal.xsl"/>
  62. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  63. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  64. <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">
  65. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  66. <xsl:template match="/">
  67. <xts:sequence>
  68. <!-- need information about the report - the defaultName to be precise -->
  69. <xts:append select="/root">
  70. <soapFault>
  71. <xsl:value-of select="/root/env/param[@name='soapFault']" disable-output-escaping="yes"/>
  72. </soapFault>
  73. </xts:append>
  74. </xts:sequence>
  75. </xsl:template>
  76. </xsl:stylesheet>
  77. </xts:block>
  78. <!--
  79. ===============================================================================================
  80. render the error using the default portal error page
  81. ===============================================================================================
  82. -->
  83. <xts:block id="portalDisplayError" dependency="appendError" processor="XSLT" type="exec" mode="interpret" condition=".[/root/soapFault and /root/soapFault//*[local-name()='exception']/*[local-name()='errorCode'] != 'cmDuplicateName']" mandatory="false">
  84. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  85. xmlns:fault="http://developer.cognos.com/schemas/xts/portal/iFaultHandler/1/"
  86. xmlns:xos="http://developer.cognos.com/schemas/xts/output/" >
  87. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  88. <xsl:template match="/">
  89. <xts:sequence>
  90. <xts:append select="/root/output">
  91. <xos:part>
  92. <xos:entityHeader>
  93. <xos:param name="Content-Type">text/html; charset=utf-8</xos:param>
  94. </xos:entityHeader>
  95. <xos:entityBody>
  96. <xts:request name="BUS" target="bus://xts2/portal/iFaultHandler/handleFault.xts" option="content" outputHeader="true">
  97. <!-- env -->
  98. <xsl:copy-of select="/root/env"/>
  99. <!-- system -->
  100. <xsl:copy-of select="/root/system"/>
  101. <!-- http -->
  102. <xsl:copy-of select="/root/http"/>
  103. <!-- session -->
  104. <xsl:copy-of select="/root/session"/>
  105. <!-- credential -->
  106. <xsl:copy-of select="/root/credential"/>
  107. <!-- cookies-->
  108. <xsl:copy-of select="/root/cookies"/>
  109. <!-- user vars -->
  110. <xsl:copy-of select="/root/user"/>
  111. <!-- header vars -->
  112. <xsl:copy-of select="/root/header"/>
  113. <command>
  114. <fault:handleFault>
  115. <!-- copy the fault which was encoded -->
  116. <xsl:copy-of select="/root/soapFault"/>
  117. <!-- copy the header from this request - it should have all the form vars -->
  118. <fault:originalRequest>
  119. <xsl:copy-of select="/root/header"/>
  120. </fault:originalRequest>
  121. </fault:handleFault>
  122. </command>
  123. </xts:request>
  124. </xos:entityBody>
  125. </xos:part>
  126. </xts:append>
  127. </xts:sequence>
  128. </xsl:template>
  129. </xsl:stylesheet>
  130. </xts:block>
  131. <!--
  132. ===============================================================================================
  133. format - render the page
  134. ===============================================================================================
  135. -->
  136. <xts:block id="format" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="portalDisplayError" condition=".[not(/root/soapFault) or /root/soapFault//*[local-name()='exception']/*[local-name()='errorCode'] = 'cmDuplicateName']" mandatory="false">
  137. <xts:logicsheet path="logicsheets/portal.xsl"/>
  138. <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
  139. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  140. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  141. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  142. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  143. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  144. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  145. <xts:logicsheet path="logicsheets/validation.xslt"/>
  146. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  147. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  148. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  149. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  150. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  151. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  152. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  153. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  154. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  155. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  156. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  157. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  158. xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
  159. xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
  160. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  161. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  162. exclude-result-prefixes="xsl cf cp pf df dp lyt cm cml utml xts xtsext SOAP-ENV bus dt">
  163. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  164. <!-- current file name -->
  165. <xsl:variable name="m_name" select="'annotation1.xts'"/>
  166. <xsl:variable name="skin" select="key('user-param', 'skin')"/>
  167. <pf:variables/>
  168. <!-- start the output -->
  169. <xsl:template match="/root">
  170. <!-- The object type we are about to create -->
  171. <xsl:variable name="new-class" select="'annotation'"/>
  172. <!-- always define booleans in the var declaration -->
  173. <xsl:variable name="viewAnnotation" select="boolean(not(/root/env/param[@name='action_hint']) or /root/env/param[@name='action_hint']='')"/>
  174. <!-- get the title -->
  175. <xsl:variable name="wizardTitle">
  176. <xsl:choose>
  177. <xsl:when test="$viewAnnotation">
  178. <xts:string id="IDS_VIEW_ANNOTATION_TITLE"/>
  179. </xsl:when>
  180. <xsl:when test="/root/env/param[@name='action_hint']='save'">
  181. <xts:string id="IDS_MODIFY_ANNOTATION_TITLE"/>
  182. </xsl:when>
  183. <xsl:otherwise>
  184. <xts:string id="IDS_ANNOTATION_TITLE"/>
  185. </xsl:otherwise>
  186. </xsl:choose>
  187. </xsl:variable>
  188. <xsl:variable name="new-general-title">
  189. <xsl:choose>
  190. <xsl:when test="/root/soapFault">
  191. <xts:string id="IDS_COGNOS_REPORTS"/>
  192. </xsl:when>
  193. <xsl:otherwise>
  194. <xsl:value-of select="$wizardTitle"/>
  195. </xsl:otherwise>
  196. </xsl:choose>
  197. </xsl:variable>
  198. <xsl:variable name="new-general-description">
  199. <xsl:choose>
  200. <xsl:when test="/root/soapFault or not((/root/env/param[@name='action_hint']) or /root/env/param[@name='action_hint']='')">
  201. <xsl:text/>
  202. </xsl:when>
  203. <xsl:otherwise>
  204. <xts:string id="IDS_ANNOTATION_NEW_INTRO"/>
  205. </xsl:otherwise>
  206. </xsl:choose>
  207. </xsl:variable>
  208. <!-- This is the "default" string that we will display in the name field -->
  209. <xsl:variable name="defaultName">
  210. <xsl:choose>
  211. <!-- just use the name from the object given to us - which will either be the report itself or the annotation -->
  212. <xsl:when test="/root/env/param[@name='action_hint'] = 'create'">
  213. <xsl:text/>
  214. </xsl:when>
  215. <xsl:otherwise>
  216. <xsl:value-of select="/root/*[local-name()='annotationSource']/*/*/*[local-name()='defaultName']"/>
  217. </xsl:otherwise>
  218. </xsl:choose>
  219. </xsl:variable>
  220. <!-- Have to use the defaultDescription from an annotation - otherwise have to leave it blank -->
  221. <xsl:variable name="defaultDescription">
  222. <xsl:choose>
  223. <xsl:when test="/root/*[local-name()='annotationSource']/*/*/*[local-name()='objectClass']='annotation'">
  224. <xsl:value-of select="/root/*[local-name()='annotationSource']/*/*/*[local-name()='defaultDescription']"/>
  225. </xsl:when>
  226. <xsl:otherwise>
  227. <!-- this it just blank -->
  228. <xsl:text/>
  229. </xsl:otherwise>
  230. </xsl:choose>
  231. </xsl:variable>
  232. <xsl:variable name="label_name"><xts:string id="IDS_NEW_NAME" encode="javascript"/></xsl:variable>
  233. <xsl:variable name="errmsg">
  234. <xts:string id="IDS_ERR_MANDATORY" encode="javascript">
  235. <xts:param name="field">" + label + "</xts:param>
  236. </xts:string>
  237. </xsl:variable>
  238. <dp:page longTitle="$new-general-title" dp:kbA11y="true">
  239. <dp:meta>
  240. <!-- Help system -->
  241. <pf:meta/>
  242. </dp:meta>
  243. <dp:script>
  244. <!-- Help system -->
  245. <pf:help context=""/>
  246. <script type="text/javascript" src="../prompting/CDispatcher.js">//</script>
  247. <script language="javascript">
  248. function init()
  249. {
  250. try {
  251. if (document.pform.m_p_defaultName)
  252. document.pform.m_p_defaultName.focus();
  253. } catch (e) {
  254. //possibly when the control's container is not (yet) visible
  255. }
  256. }
  257. function validateInputField(field, label)
  258. {
  259. field.value = trim(field.value);
  260. if (field.value == '')
  261. {
  262. alert("<xsl:value-of select="normalize-space($errmsg)"/>");
  263. field.focus();
  264. return false;
  265. }
  266. return true;
  267. }
  268. function validate()
  269. {
  270. var f = document.pform;
  271. var res = CAFContainsInvalidString(f.m_p_defaultName.value);
  272. if (res)
  273. {
  274. CAFReportValidationError(cafInvalidStringMsg + res);
  275. highlight = res;
  276. if (highlight != null)
  277. {
  278. CAFSelectText(f.m_p_defaultName, highlight);
  279. }
  280. return false;
  281. }
  282. var res = CAFContainsInvalidString(f.m_p_defaultDescription.value);
  283. if (res)
  284. {
  285. CAFReportValidationError(cafInvalidStringMsg + res);
  286. highlight = res;
  287. if (highlight != null)
  288. {
  289. CAFSelectText(f.m_p_defaultDescription, highlight);
  290. }
  291. return false;
  292. }
  293. <!-- Validate the name -->
  294. if ( !validateInputField(f.m_p_defaultName, "<xsl:value-of select="normalize-space($label_name)"/>"))
  295. {
  296. return false;
  297. }
  298. if(document.pform.m_p_defaultDescription.value.length > 3772)
  299. {
  300. alert('<xts:string id="IDS_ANNOTATION_LONG_MSG_ALERT" encode="javascript"/>');
  301. return false;
  302. }
  303. return true;
  304. }
  305. var FAULT_SOAPFAULT = "SOAP-ENV:Fault";
  306. var FAULT_PASSPORT = "authenticationFault";
  307. var SUCCESS_RESPONSE = "response";
  308. function resetPageState()
  309. {
  310. <!-- Clear the cookie value mfst -->
  311. clearSessionEntry('mfst');
  312. }
  313. function doCancel()
  314. {
  315. window.close();
  316. }
  317. // a global async dispatcher
  318. var gDispatcher = new CDispatcher();
  319. //encode the URI
  320. function URIEncode(name, value)
  321. {
  322. return (value) ? "&amp;" + name + "=" + encodeURIComponent(value) : "";
  323. }
  324. function getTextNodeValue(obj)
  325. {
  326. var text_data = "";
  327. if(obj &amp;&amp; obj.childNodes){
  328. for(var i = 0; i &lt; obj.childNodes.length; i++){
  329. text_data += obj.childNodes[i].data;
  330. }
  331. }
  332. return text_data;
  333. }
  334. function createHiddenInput(document, name, value){
  335. var inline = document.createElement("INPUT");
  336. inline.setAttribute("name", name);
  337. inline.setAttribute("value", value);
  338. inline.setAttribute("id", name);
  339. inline.setAttribute("type", "hidden");
  340. return inline;
  341. }
  342. function checkSOAPPassportExpire(obj)
  343. {
  344. var ret_value = false;
  345. // find the CAM/exception/promptInfo/displayObjects/item[./name="h_CAM_action"]/value
  346. // and see if it's a logonAS.
  347. var CAM = obj.getElementsByTagName("CAM");
  348. if (CAM &amp;&amp; CAM.length == 1) {
  349. var exception = CAM[0].getElementsByTagName("exception");
  350. if (exception &amp;&amp; exception.length == 1) {
  351. var promptInfo = exception[0].getElementsByTagName("promptInfo");
  352. if (promptInfo &amp;&amp; promptInfo.length == 1) {
  353. var displayObjects = promptInfo[0].getElementsByTagName("displayObjects");
  354. if (displayObjects &amp;&amp; displayObjects.length == 1) {
  355. var items = displayObjects[0].getElementsByTagName("item");
  356. if (items &amp;&amp; items.length &gt; 0) {
  357. // have to loop over all the items
  358. for (var i = 0; i &lt; items.length; i++) {
  359. var name = items[i].getElementsByTagName("name");
  360. var value = items[i].getElementsByTagName("value");
  361. var nameValue = (name &amp;&amp; name.length &gt; 0) ? getTextNodeValue(name[0]) : null;
  362. var valueValue = (value &amp;&amp; value.length &gt; 0) ? getTextNodeValue(value[0]) : null;
  363. if (nameValue &amp;&amp; nameValue == "h_CAM_action" &amp;&amp; valueValue &amp;&amp; valueValue.indexOf("logon")==0) {
  364. ret_value = true;
  365. break;
  366. }
  367. }
  368. }
  369. }
  370. }
  371. }
  372. }
  373. return ret_value;
  374. }
  375. // have to submit an async request to viewer to do the work
  376. function submitToViewer()
  377. {
  378. if (!validate()) return;
  379. // otherwise we have to submit to the viewer
  380. var gateway = "<xsl:value-of select="xtsext:javascriptencode($gateway)"/>";
  381. // have to build the params
  382. var params = "b_action=cognosViewer";
  383. // add the name of the annotation
  384. if (pform["action_hint"].value=="save") {
  385. params += URIEncode("ui.action", "updateAnnotation");
  386. }
  387. else {
  388. params += URIEncode("ui.action", "createAnnotation");
  389. }
  390. params += URIEncode("rv.annotationName",pform["m_p_defaultName"].value);
  391. params += URIEncode("rv.annotationDescription",pform["m_p_defaultDescription"].value);
  392. params += URIEncode("ui.object", pform["ui.object"].value);
  393. params += URIEncode("cv.catchLogOnFault", "true");
  394. // force an XML response - have to decide what to do.
  395. params += URIEncode("forceSOAPFault", "true");
  396. var request = gDispatcher.createRequest(gateway, params, viewerCallback);
  397. request.setResponseType("XMLHTML");
  398. gDispatcher.dispatchRequest(request);
  399. }
  400. // have the callback function from viewer
  401. function viewerCallback(responseArray)
  402. {
  403. // get the values returned
  404. var responseXML = responseArray[0];
  405. var responseText = responseArray[1];
  406. // look for the various responses
  407. var passport = responseXML.getElementsByTagName(FAULT_PASSPORT);
  408. var soapFault = responseXML.getElementsByTagName(FAULT_SOAPFAULT);
  409. var success = responseXML.getElementsByTagName(SUCCESS_RESPONSE);
  410. // have to check the response
  411. if (success.length == 1) {
  412. // everything was ok - just close the window
  413. window.close();
  414. }
  415. // can't pass the general soap-fault for a passport to the ifaultHandler cause
  416. // the submit to ourselves might fail at the dispatcher stage - which will display the logon page.
  417. // logging in - will then show the logon page again - which isn't what's wanted. For a passport
  418. // failure - we just have to go back to the same page - either dispatcher will catch the error (if logged out)
  419. // or the call to CM will catch it (passport expired)
  420. else if (passport.length == 1 || checkSOAPPassportExpire(responseXML)) {
  421. // we've got a passport error - resubmit to ourselves - this should fire up the logon page
  422. pform.submit();
  423. }
  424. else if (soapFault.length == 1) {
  425. // have to decompose the fault - see what sort of error it is
  426. // have to string the header from XML response
  427. var soapFaultTxt = responseText;
  428. if (soapFaultTxt.indexOf("?xml")!=-1) {
  429. soapFaultTxt = soapFaultTxt.substring(soapFaultTxt.indexOf('>')+1);
  430. }
  431. var faultInput = null;
  432. if (pform["soapFault"] == null) {
  433. faultInput = createHiddenInput(document, "soapFault", soapFaultTxt);
  434. } else {
  435. faultInput = pform["soapFault"];
  436. faultInput.value = soapFaultTxt;
  437. }
  438. pform.appendChild(faultInput);
  439. // submit the form
  440. pform.submit();
  441. }
  442. else
  443. if (responseText.indexOf("&lt;html&gt;") > -1 ||
  444. responseText.indexOf("&lt;HTML&gt;") > -1) {
  445. doHTMLResponse(responseText);
  446. } else {
  447. // none of the above - we really don't know what happened.
  448. alert(responseText);
  449. }
  450. }
  451. </script>
  452. <script language="javascript" src="../ps/portal/js/utilities.js">//</script>
  453. </dp:script>
  454. <link href="{$skin_root}/portal/default.css" type="text/css" rel="stylesheet" dp:kbA11y="true"/>
  455. <utml:form name="pform" method="post" action="{$gateway}" dp:kbA11y="true">
  456. <input type="hidden" name="ui.backURL" value="{/root/env/param[@name='backURL']}"/>
  457. <!-- By Default if errURL is specified but empty - doCancel() is done.-->
  458. <utml:input type="hidden" name="errURL" utml:update="false">
  459. <xsl:choose>
  460. <xsl:when test="/root/env/param[@name='errURL']">
  461. <utml:value>
  462. <xsl:value-of select="/root/env/param[@name='errURL']"/>
  463. </utml:value>
  464. </xsl:when>
  465. <xsl:otherwise>
  466. <utml:value/>
  467. </xsl:otherwise>
  468. </xsl:choose>
  469. </utml:input>
  470. <!-- Header -->
  471. <!-- ================================================================ -->
  472. <dp:header dp:kbA11y="true">
  473. <dp:title dp:kbA11y="true">
  474. <xsl:value-of select="$new-general-title"/>
  475. </dp:title>
  476. <dp:close>
  477. <xsl:choose>
  478. <xsl:when test="/root/env/param[@name='backURL']">
  479. <a href="{/root/env/param[@name = 'backURL']}">
  480. <xsl:call-template name="myCloseMarker"/>
  481. </a>
  482. </xsl:when>
  483. <xsl:otherwise>
  484. <a href="javascript:doCancel()">
  485. <xsl:call-template name="myCloseMarker"/>
  486. </a>
  487. </xsl:otherwise>
  488. </xsl:choose>
  489. </dp:close>
  490. <dp:description dp:kbA11y="true">
  491. <xsl:value-of select="$new-general-description"/>
  492. </dp:description>
  493. </dp:header>
  494. <!-- what to display if there's a soapFault -->
  495. <!-- ================================================================ -->
  496. <xsl:choose>
  497. <xsl:when test="/root/soapFault">
  498. <xsl:choose>
  499. <!-- specific cmDuplicate name error -->
  500. <!-- ================================================================ -->
  501. <xsl:when test="/root/soapFault/SOAP-ENV:Envelope/SOAP-ENV:Body/SOAP-ENV:Fault/detail/bus:exception/errorCode = 'cmDuplicateName' ">
  502. <lyt:layout style="1" lyt:kbA11y="true">
  503. <lyt:section lyt:kbA11y="true">
  504. <dp:group>
  505. <dp:groupItem valign="top">
  506. <img height="32" width="32" border="0">
  507. <xsl:attribute name="src">
  508. <xsl:value-of select="$webcontent"/>
  509. <xsl:text/>/portal/images/msg_warning.gif<xsl:text/>
  510. </xsl:attribute>
  511. <xsl:attribute name="alt"><xts:string id="IDS_STATUS_WARN"/></xsl:attribute>
  512. </img>
  513. </dp:groupItem>
  514. <dp:groupItem>
  515. <!-- used for alignment -->
  516. <dp:text/><xsl:text>&#160;</xsl:text>
  517. </dp:groupItem>
  518. <dp:groupItem valign="top">
  519. <dp:text nospace="nospace" wrap="wrap">
  520. <label for="inputDuplicateName"><xts:string id="IDS_DUPLICATE_ERROR_RENAME_ERROR"><xts:param name="entryName"><xsl:value-of select="/root/env/param[@name='m_p_defaultName']"/></xts:param></xts:string>
  521. <br/><br/>
  522. <xts:string id="IDS_DUPLICATE_ERROR_RENAME_ENTRY_OPTION"/><br/></label>
  523. <utml:input type="text" size="30" aria-required="true" id="inputDuplicateName" name="m_p_defaultName" class="pInput" maxlength="256"/>
  524. <br/><br/>
  525. <xts:string id="IDS_DUPLICATE_ERROR_CONTINUE"/>
  526. <!-- add a hidden form field for the description - utml:form will miss it cause it's declared in the other case statement -->
  527. <utml:input type="hidden" name="m_p_defaultDescription"/>
  528. <br/>
  529. </dp:text>
  530. </dp:groupItem>
  531. </dp:group>
  532. </lyt:section>
  533. </lyt:layout>
  534. <dp:footer>
  535. <!-- Default. Use Ok/Cancel buttons -->
  536. <df:button df:id="IDS_DUPLICATE_ERROR_OK" df:style="href" df:href="javascript:submitToViewer();" df:kbA11y="true"/>
  537. <df:button df:id="IDS_DUPLICATE_ERROR_CANCEL" df:style="href" df:href="javascript:window.close();" df:kbA11y="true"/>
  538. </dp:footer>
  539. </xsl:when>
  540. <xsl:otherwise>
  541. <!-- general error - we don't know what to do with it -->
  542. <!-- ================================================================ -->
  543. </xsl:otherwise>
  544. </xsl:choose>
  545. </xsl:when>
  546. <xsl:otherwise>
  547. <!-- what to display when we have a normal page -->
  548. <!-- ================================================================ -->
  549. <lyt:layout style="1" lyt:kbA11y="true">
  550. <lyt:section lyt:kbA11y="true">
  551. <!-- Name -->
  552. <dp:input dp:kbA11y="true">
  553. <dp:section1>
  554. <label for="inputDefaultName"><xts:string id="IDS_ANNOTATION_NEW_NAME"/></label>
  555. </dp:section1>
  556. <dp:section2>
  557. <utml:input type="text" size="30" aria-required="true" name="m_p_defaultName" id="inputDefaultName" class="pInput" maxlength="256">
  558. <utml:read-only><xsl:value-of select="$viewAnnotation"/></utml:read-only>
  559. <utml:value>
  560. <xsl:choose>
  561. <xsl:when test="not(key('env-param', 'm_p_defaultName')) and string-length($defaultName) &lt;= 256">
  562. <xsl:value-of select="$defaultName"/>
  563. </xsl:when>
  564. <xsl:when test="not(key('env-param', 'm_p_defaultName')) and string-length($defaultName) &gt; 256">
  565. <xsl:value-of select="substring($defaultName,0,257)"/>
  566. </xsl:when>
  567. <xsl:otherwise>
  568. <xsl:text/>
  569. </xsl:otherwise>
  570. </xsl:choose>
  571. </utml:value>
  572. </utml:input>
  573. </dp:section2>
  574. </dp:input>
  575. <!-- Description -->
  576. <dp:input dp:kbA11y="true">
  577. <dp:section1>
  578. <label for="inputDefaultDescription"><xts:string id="IDS_ANNOTATION_NEW_DESCRIPTION"/></label>
  579. </dp:section1>
  580. <dp:section2>
  581. <utml:textarea name="m_p_defaultDescription" id="inputDefaultDescription" class="pTextarea" style="height:140px">
  582. <utml:read-only><xsl:value-of select="$viewAnnotation"/></utml:read-only>
  583. <utml:value>
  584. <xsl:value-of select="$defaultDescription"/>
  585. </utml:value>
  586. </utml:textarea>
  587. </dp:section2>
  588. </dp:input>
  589. </lyt:section>
  590. </lyt:layout>
  591. <!-- Footer -->
  592. <!-- ================================================================ -->
  593. <xsl:choose>
  594. <xsl:when test="not($viewAnnotation)">
  595. <dp:footer>
  596. <df:button df:id="IDS_CANCEL" df:style="href" df:kbA11y="true">
  597. <df:href>
  598. <xsl:choose>
  599. <xsl:when test="/root/env/param[@name='backURL']">
  600. <xsl:value-of select="/root/env/param[@name='backURL']"/>
  601. </xsl:when>
  602. <xsl:otherwise>
  603. <xsl:text>javascript:doCancel();</xsl:text>
  604. </xsl:otherwise>
  605. </xsl:choose>
  606. </df:href>
  607. </df:button>
  608. <df:button df:id="IDS_FINISH" df:style="href" df:kbA11y="true">
  609. <df:href>
  610. <xsl:text>javascript:submitToViewer();</xsl:text>
  611. </df:href>
  612. </df:button>
  613. </dp:footer>
  614. </xsl:when>
  615. <xsl:otherwise>
  616. <dp:footer>
  617. <df:button df:id="IDS_FINISH" df:style="href" df:kbA11y="true">
  618. <df:href>
  619. <xsl:text>javascript:window.close();</xsl:text>
  620. </df:href>
  621. </df:button>
  622. </dp:footer>
  623. </xsl:otherwise>
  624. </xsl:choose>
  625. </xsl:otherwise>
  626. </xsl:choose>
  627. </utml:form>
  628. </dp:page>
  629. </xsl:template>
  630. <xsl:template name="myCloseMarker">
  631. <xsl:variable name="close"><xts:string id="IDS_CLOSE"/></xsl:variable>
  632. <img role="button" height="16" width="16" class="dialogClose" vspace="2" border="0" src="{$skin_root}/portal/images/close.gif" alt="{$close}" onmouseover="this.className = 'dialogCloseOver'" onmouseout="this.className = 'dialogClose'"/>
  633. </xsl:template>
  634. </xsl:stylesheet>
  635. </xts:block>
  636. <!-- Debug -->
  637. <xts:block id="debug" type="exec" dependency="format" mode="output" condition=".[ /root/session/param[@name='debug'] = '1' ]" processor="XSLT" mandatory="false" mimeType="text/html">
  638. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  639. <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">
  640. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  641. <dbg:templates/>
  642. <xsl:template match="/">
  643. <dbg:dumpxml select="/root"/>
  644. </xsl:template>
  645. </xsl:stylesheet>
  646. </xts:block>
  647. </xts:morphlet>