edit.xslt 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: cpscrn
  5. (C) Copyright IBM Corp. 2005, 2011
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. -->
  12. <!-- $Header: //cpscrn/main/templates/cps4/portlets/utility/portlet-impl/rss/edit.xslt#1 $ -->
  13. <!-- $DateTime: 2008/10/22 11:12:04 $ -->
  14. <!-- $Change: 25109 $ -->
  15. <xsl:stylesheet version="1.0"
  16. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  17. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  18. xmlns:ui="http://developer.cognos.com/schemas/cps/logic/ui/1/"
  19. xmlns:uix="http://developer.cognos.com/schemas/cps/logic/ui-ext/1/"
  20. xmlns:utml="http://developer.cognos.com/schemas/cps/logic/form/1/"
  21. xmlns:trustedSession="java:com.cognos.portal.utils.TrustedSessionHelper"
  22. exclude-result-prefixes="xts ui uix utml">
  23. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  24. <!-- declare global variables... -->
  25. <utml:variables/>
  26. <!-- create portal variable: $ui-consumer-info -->
  27. <ui:consumer/>
  28. <ui:property name="rss-use-title" select="'rss_use_title'"/>
  29. <ui:property name="rss-url" select="'rss_url'"/>
  30. <ui:property name="rss-entries" select="'rss_entries'" exclude-nav-state="not( key( 'utml-key-params', 'edit_visited' ) )"/>
  31. <ui:property name="rss-show-desc" select="'rss_show_desc'"/>
  32. <ui:property name="rss-show-image" select="'rss_show_image'"/>
  33. <ui:property name="rss-alternate" select="'rss_alternate'"/>
  34. <xsl:template match="/">
  35. <script language="javascript">
  36. function wsrp_rewrite_validate()
  37. {
  38. var msg1 = "<xts:string id="IDS_UTI_ERR_INVALID_URL" encode="javascript"/>";
  39. var msg2 = "<xts:string id="IDS_UTI_ERR_INVALID_FRAME_NAME" encode="javascript"/>";
  40. var msg3 = "<xts:string id="IDS_UTI_ERR_INVALID_CHANNEL_NAME" encode="javascript"/>";
  41. var msg4 = "<xts:string id="IDS_UTI_ERR_NUMBER_BETWEEN" encode="javascript"><xts:param name="min">1</xts:param><xts:param name="max">1000</xts:param></xts:string>";
  42. var cForm = document.wsrp_rewrite_form;
  43. if ( !wsrp_rewrite_isValidURL(cForm.p_rss_url.value, true, true)) {
  44. window.alert(msg1);
  45. cForm.p_rss_url.focus();
  46. return false;
  47. }
  48. if ( !wsrp_rewrite_isValidChannel(cForm.p_target.value, document.getElementById("wsrp_rewrite_radio_target").checked) ) {
  49. window.alert(msg2);
  50. cForm.p_target.focus();
  51. return false;
  52. }
  53. if ( !wsrp_rewrite_isValidChannel(cForm.p_channel.value, document.getElementById("wsrp_rewrite_radio_channel").checked) ) {
  54. window.alert(msg3);
  55. cForm.p_channel.focus();
  56. return false;
  57. }
  58. if ( !wsrp_rewrite_isValidBoundary(cForm.p_rss_entries.value,1,1000) ) {
  59. window.alert(msg4);
  60. cForm.p_rss_entries.focus();
  61. return false;
  62. }
  63. return true;
  64. }
  65. </script>
  66. <uix:script-isValidURL/>
  67. <uix:script-isValidChannel/>
  68. <uix:script-isValidBoundary/>
  69. <ui:about/>
  70. <ui:help/>
  71. <utml:form name="wsrp_rewrite_form" method="post" utml:maintainPrevNavState="true">
  72. <utml:input type="hidden" name="cps-authToken" utml:update="false">
  73. <utml:value>
  74. <xsl:value-of select="trustedSession:staticGenerateAuthToken(string(/root/cookies/cookie[@name='usersessionid']))"/>
  75. </utml:value>
  76. </utml:input>
  77. <ui:page>
  78. <ui:page-description><xts:string id="IDS_UTI_RSS_DESC"/></ui:page-description>
  79. <ui:page-section>
  80. <ui:page-sub-section-group>
  81. <ui:page-sub-section>
  82. <ui:page-sub-section-title><xts:string id="IDS_PRO_UIX_LABEL_TITLE"/></ui:page-sub-section-title>
  83. <ui:page-sub-section-content>
  84. <utml:radio-group name="p_rss_use_title">
  85. <utml:default-value>
  86. <xsl:value-of select="$rss-use-title"/>
  87. </utml:default-value>
  88. <table border="0" cellspacing="0" cellpadding="1">
  89. <tr>
  90. <td valign="top">
  91. <utml:input type="radio" value="false" class="portlet-form-field"/>
  92. </td>
  93. <td class="portlet-form-field"><xts:string id="IDS_UTI_COM_LABEL_USE_URL"/></td>
  94. </tr>
  95. <tr>
  96. <td valign="top">
  97. <utml:input type="radio" value="true" class="portlet-form-field"/>
  98. </td>
  99. <td><xts:string id="IDS_UTI_COM_LABEL_TYPE_TITLE"/></td>
  100. </tr>
  101. <tr>
  102. <td valign="top" rowspan="2">
  103. <br/>
  104. </td>
  105. <td>
  106. <uix:title onfocus="wsrp_rewrite_form.p_rss_use_title[1].checked = true;"/>
  107. </td>
  108. </tr>
  109. </table>
  110. </utml:radio-group>
  111. </ui:page-sub-section-content>
  112. </ui:page-sub-section>
  113. <ui:page-sub-section>
  114. <ui:page-sub-section-title><xts:string id="IDS_UTI_RSS_LABEL_URL"/></ui:page-sub-section-title>
  115. <ui:page-sub-section-content>
  116. <table border="0" cellspacing="0" cellpadding="1">
  117. <tr>
  118. <td class="portlet-form-field"><xts:string id="IDS_UTI_RSS_LABEL_RSS_SOURCE"/></td>
  119. </tr>
  120. <tr>
  121. <td>
  122. <utml:input name="p_rss_url" type="text" size="100" class="portlet-form-input-field" stttype="url">
  123. <utml:value>
  124. <xsl:value-of select="$rss-url"/>
  125. </utml:value>
  126. </utml:input>
  127. </td>
  128. </tr>
  129. </table>
  130. </ui:page-sub-section-content>
  131. </ui:page-sub-section>
  132. <ui:page-sub-section>
  133. <ui:page-sub-section-title><xts:string id="IDS_UTI_RSS_LABEL_FEATURES"/></ui:page-sub-section-title>
  134. <ui:page-sub-section-content>
  135. <table border="0" cellpadding="1" cellspacing="0">
  136. <tr>
  137. <td>
  138. <utml:input name="p_rss_show_desc" type="checkbox" value="true" class="portlet-form-field">
  139. <xsl:if test="$rss-show-desc = 'true'">
  140. <xsl:attribute name="checked"/>
  141. </xsl:if>
  142. </utml:input>
  143. </td>
  144. <td class="portlet-form-field"><xts:string id="IDS_UTI_RSS_LABEL_SHOW_DESCRIPTION"/></td>
  145. </tr>
  146. <tr>
  147. <td>
  148. <utml:input name="p_rss_show_image" type="checkbox" value="true" class="portlet-form-field">
  149. <xsl:if test="$rss-show-image = 'true'">
  150. <xsl:attribute name="checked"/>
  151. </xsl:if>
  152. </utml:input>
  153. </td>
  154. <td class="portlet-form-field"><xts:string id="IDS_UTI_RSS_LABEL_SHOW_IMAGE"/></td>
  155. </tr>
  156. <tr>
  157. <td>
  158. <utml:input name="p_rss_alternate" type="checkbox" value="true" class="portlet-form-field">
  159. <xsl:if test="$rss-alternate = 'true'">
  160. <xsl:attribute name="checked"/>
  161. </xsl:if>
  162. </utml:input>
  163. </td>
  164. <td class="portlet-form-field"><xts:string id="IDS_UTI_RSS_LABEL_ALTERNATE_BACKGROUND"/></td>
  165. </tr>
  166. </table>
  167. </ui:page-sub-section-content>
  168. </ui:page-sub-section>
  169. <ui:page-sub-section tailing-space="false">
  170. <ui:page-sub-section-title><xts:string id="IDS_PRO_UIX_LABEL_OPEN_LINKS"/></ui:page-sub-section-title>
  171. <ui:page-sub-section-content>
  172. <uix:open-links msgChannel="IDS_UTI_COM_DESC_CHANNEL_HTML"/>
  173. </ui:page-sub-section-content>
  174. </ui:page-sub-section>
  175. </ui:page-sub-section-group>
  176. </ui:page-section>
  177. <ui:page-section>
  178. <ui:page-section-divider><xts:string id="IDS_UTI_COM_GROUP_VIEWING_OPTIONS"/></ui:page-section-divider>
  179. <ui:page-sub-section-group>
  180. <ui:page-sub-section>
  181. <ui:page-sub-section-title><xts:string id="IDS_UTI_RSS_LABEL_MAX_ITEMS"/></ui:page-sub-section-title>
  182. <ui:page-sub-section-content>
  183. <table border="0" cellspacing="0" cellpadding="1">
  184. <tr>
  185. <td>
  186. <utml:input name="p_rss_entries" type="text" size="7" class="portlet-form-input-field">
  187. <utml:value>
  188. <xsl:value-of select="$rss-entries"/>
  189. </utml:value>
  190. </utml:input>
  191. </td>
  192. </tr>
  193. </table>
  194. </ui:page-sub-section-content>
  195. </ui:page-sub-section>
  196. </ui:page-sub-section-group>
  197. </ui:page-section>
  198. </ui:page>
  199. </utml:form>
  200. </xsl:template>
  201. </xsl:stylesheet>