edit.xslt 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  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/image/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="img-use-title" select="'img_use_title'"/>
  29. <ui:property name="img-url" select="'img_url'"/>
  30. <ui:property name="img-size" select="'img_size'"/>
  31. <ui:property name="img-height" select="'img_height'"/>
  32. <ui:property name="img-width" select="'img_width'"/>
  33. <ui:property name="img-target-url" select="'img_target_url'"/>
  34. <ui:property name="img-tile" select="'img_tile'"/>
  35. <xsl:template match="/">
  36. <script language="javascript">
  37. function wsrp_rewrite_validate()
  38. {
  39. var msg1 = "<xts:string id="IDS_UTI_ERR_INVALID_URL" encode="javascript"/>";
  40. var msg2 = "<xts:string id="IDS_UTI_ERR_INVALID_FRAME_NAME" encode="javascript"/>";
  41. var msg3 = "<xts:string id="IDS_UTI_ERR_INVALID_CHANNEL_NAME" encode="javascript"/>";
  42. var msg4 = "<xts:string id="IDS_UTI_ERR_NUMBER_BETWEEN" encode="javascript"><xts:param name="min">1</xts:param><xts:param name="max">2000</xts:param></xts:string>";
  43. var cForm = document.wsrp_rewrite_form;
  44. if ( !wsrp_rewrite_isValidURL(cForm.p_img_url.value, true)) {
  45. window.alert(msg1);
  46. cForm.p_img_url.focus();
  47. return false;
  48. }
  49. if ( !wsrp_rewrite_isValidURL(cForm.p_img_target_url.value, false)) {
  50. window.alert(msg1);
  51. cForm.p_img_target_url.focus();
  52. return false;
  53. }
  54. if ( !wsrp_rewrite_isValidChannel(cForm.p_target.value, document.getElementById("wsrp_rewrite_radio_target").checked) ) {
  55. window.alert(msg2);
  56. cForm.p_target.focus();
  57. return false;
  58. }
  59. if ( !wsrp_rewrite_isValidChannel(cForm.p_channel.value, document.getElementById("wsrp_rewrite_radio_channel").checked) ) {
  60. window.alert(msg3);
  61. cForm.p_channel.focus();
  62. return false;
  63. }
  64. var isCustom = cForm.p_img_size[1].checked;
  65. if ( isCustom &amp;&amp; !wsrp_rewrite_isValidBoundary(cForm.p_img_width.value, 1,2000) ) {
  66. window.alert(msg4);
  67. cForm.p_img_width.focus();
  68. return false;
  69. }
  70. if ( isCustom &amp;&amp; !wsrp_rewrite_isValidBoundary(cForm.p_img_height.value, 1, 2000) ) {
  71. window.alert(msg4);
  72. cForm.p_img_height.focus();
  73. return false;
  74. }
  75. return true;
  76. }
  77. </script>
  78. <uix:script-isValidURL/>
  79. <uix:script-isValidChannel/>
  80. <uix:script-isValidBoundary/>
  81. <ui:about/>
  82. <ui:help/>
  83. <utml:form name="wsrp_rewrite_form" method="post" utml:maintainPrevNavState="true">
  84. <utml:input type="hidden" name="cps-authToken" utml:update="false">
  85. <utml:value>
  86. <xsl:value-of select="trustedSession:staticGenerateAuthToken(string(/root/cookies/cookie[@name='usersessionid']))"/>
  87. </utml:value>
  88. </utml:input>
  89. <ui:page>
  90. <ui:page-description><xts:string id="IDS_UTI_IMG_DESC"/></ui:page-description>
  91. <ui:page-section>
  92. <ui:page-sub-section-group>
  93. <ui:page-sub-section>
  94. <ui:page-sub-section-title><xts:string id="IDS_PRO_UIX_LABEL_TITLE"/></ui:page-sub-section-title>
  95. <ui:page-sub-section-content>
  96. <utml:radio-group name="p_img_use_title">
  97. <utml:default-value>
  98. <xsl:value-of select="$img-use-title"/>
  99. </utml:default-value>
  100. <table border="0" cellspacing="0" cellpadding="1">
  101. <tr>
  102. <td valign="top">
  103. <utml:input type="radio" value="false" class="portlet-form-field"/>
  104. </td>
  105. <td class="portlet-form-field"><xts:string id="IDS_UTI_COM_LABEL_USE_URL"/></td>
  106. </tr>
  107. <tr>
  108. <td valign="top">
  109. <utml:input type="radio" value="true" class="portlet-form-field"/>
  110. </td>
  111. <td><xts:string id="IDS_UTI_COM_LABEL_TYPE_TITLE"/></td>
  112. </tr>
  113. <tr>
  114. <td valign="top" rowspan="2">
  115. <br/>
  116. </td>
  117. <td>
  118. <uix:title onfocus="wsrp_rewrite_form.p_img_use_title[1].checked = true;"/>
  119. </td>
  120. </tr>
  121. </table>
  122. </utml:radio-group>
  123. </ui:page-sub-section-content>
  124. </ui:page-sub-section>
  125. <ui:page-sub-section>
  126. <ui:page-sub-section-title><xts:string id="IDS_UTI_IMG_LABEL_IMAGE"/></ui:page-sub-section-title>
  127. <ui:page-sub-section-content>
  128. <table border="0" cellspacing="0" cellpadding="1">
  129. <tr>
  130. <td class="portlet-msg-info"><xts:string id="IDS_UTI_IMG_DESC_IMAGE"/></td>
  131. </tr>
  132. <tr>
  133. <td>
  134. <utml:input name="p_img_url" type="text" size="100" class="portlet-form-input-field" stttype="url">
  135. <utml:value>
  136. <xsl:value-of select="$img-url"/>
  137. </utml:value>
  138. </utml:input>
  139. </td>
  140. </tr>
  141. </table>
  142. </ui:page-sub-section-content>
  143. </ui:page-sub-section>
  144. <ui:page-sub-section>
  145. <ui:page-sub-section-title><xts:string id="IDS_UTI_IMG_LABEL_TARGET_URL"/></ui:page-sub-section-title>
  146. <ui:page-sub-section-content>
  147. <table border="0" cellspacing="0" cellpadding="1">
  148. <tr>
  149. <td class="portlet-msg-info"><xts:string id="IDS_UTI_IMG_DESC_TARGET_URL"/></td>
  150. </tr>
  151. <tr>
  152. <td>
  153. <utml:input name="p_img_target_url" type="text" size="100" class="portlet-form-input-field" stttype="url">
  154. <utml:value>
  155. <xsl:value-of select="$img-target-url"/>
  156. </utml:value>
  157. </utml:input>
  158. </td>
  159. </tr>
  160. </table>
  161. </ui:page-sub-section-content>
  162. </ui:page-sub-section>
  163. <ui:page-sub-section tailing-space="false">
  164. <ui:page-sub-section-title><xts:string id="IDS_PRO_UIX_LABEL_OPEN_LINKS"/></ui:page-sub-section-title>
  165. <ui:page-sub-section-content>
  166. <uix:open-links msgChannel="IDS_UTI_COM_DESC_CHANNEL_HTML"/>
  167. </ui:page-sub-section-content>
  168. </ui:page-sub-section>
  169. </ui:page-sub-section-group>
  170. </ui:page-section>
  171. <ui:page-section>
  172. <ui:page-section-divider><xts:string id="IDS_UTI_COM_GROUP_VIEWING_OPTIONS"/></ui:page-section-divider>
  173. <ui:page-sub-section-group>
  174. <ui:page-sub-section >
  175. <ui:page-sub-section-title><xts:string id="IDS_UTI_IMG_LABEL_IMAGE_SIZE"/></ui:page-sub-section-title>
  176. <ui:page-sub-section-content>
  177. <table border="0" cellspacing="0" cellpadding="1">
  178. <tr>
  179. <td class="portlet-msg-info"><xts:string id="IDS_UTI_IMG_DESC_IMAGE_SIZE"/></td>
  180. </tr>
  181. <tr>
  182. <td valign="top">
  183. <utml:radio-group name="p_img_size">
  184. <utml:default-value>
  185. <xsl:value-of select="$img-size"/>
  186. </utml:default-value>
  187. <table border="0" cellspacing="0" cellpadding="1">
  188. <tr valign="middle">
  189. <td>
  190. <utml:input type="radio" id="p_img_original" value="original" class="portlet-form-field"/>
  191. </td>
  192. <td><label for="p_img_original" class="portlet-form-field"><xts:string id="IDS_UTI_IMG_LABEL_IMAGE_SIZE_ORIGINAL"/></label></td>
  193. </tr>
  194. <tr valign="middle">
  195. <td>
  196. <utml:input type="radio" id="p_img_custom" value="custom" class="portlet-form-field"/>
  197. </td>
  198. <td><label for="p_img_custom" class="portlet-form-field"><xts:string id="IDS_UTI_IMG_LABEL_IMAGE_SIZE_CUSTOM"/></label></td>
  199. </tr>
  200. <tr>
  201. <td rowspan="5"><br/></td>
  202. <td class="portlet-form-field-label"><xts:string id="IDS_UTI_IMG_LABEL_IMAGE_WIDTH"/></td>
  203. </tr>
  204. <tr>
  205. <td>
  206. <utml:input name="p_img_width" type="text" size="10" class="portlet-form-input-field" onfocus="document.wsrp_rewrite_form.p_img_size[1].checked = true">
  207. <utml:value>
  208. <xsl:value-of select="$img-width"/>
  209. </utml:value>
  210. </utml:input>
  211. </td>
  212. </tr>
  213. <tr>
  214. <td class="portlet-form-field-label"><xts:string id="IDS_UTI_IMG_LABEL_IMAGE_HEIGHT"/></td>
  215. </tr>
  216. <tr>
  217. <td>
  218. <utml:input name="p_img_height" type="text" size="10" class="portlet-form-input-field" onfocus="document.wsrp_rewrite_form.p_img_size[1].checked = true">
  219. <utml:value>
  220. <xsl:value-of select="$img-height"/>
  221. </utml:value>
  222. </utml:input>
  223. </td>
  224. </tr>
  225. <tr>
  226. <td>
  227. <table border="0" cellpadding="0" cellspacing="0">
  228. <tr>
  229. <td>
  230. <utml:input name="p_img_tile" type="checkbox" value="true" class="portlet-form-field" onfocus="document.wsrp_rewrite_form.p_img_size[1].checked = true">
  231. <xsl:if test="$img-tile = 'true'">
  232. <xsl:attribute name="checked"/>
  233. </xsl:if>
  234. </utml:input>
  235. </td>
  236. <td class="portlet-form-field"><xts:string id="IDS_UTI_IMG_LABEL_TILE_IMAGE"/></td>
  237. </tr>
  238. </table>
  239. </td>
  240. </tr>
  241. </table>
  242. </utml:radio-group>
  243. </td>
  244. </tr>
  245. </table>
  246. </ui:page-sub-section-content>
  247. </ui:page-sub-section>
  248. </ui:page-sub-section-group>
  249. </ui:page-section>
  250. </ui:page>
  251. </utml:form>
  252. </xsl:template>
  253. </xsl:stylesheet>