123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cpscrn
- (C) Copyright IBM Corp. 2005, 2011
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
- Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
- -->
- <!-- $Header: //cpscrn/main/templates/cps4/portlets/utility/portlet-impl/bookmarks/edit.xslt#1 $ -->
- <!-- $DateTime: 2008/10/22 11:12:04 $ -->
- <!-- $Change: 25109 $ -->
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:ui="http://developer.cognos.com/schemas/cps/logic/ui/1/"
- xmlns:uix="http://developer.cognos.com/schemas/cps/logic/ui-ext/1/"
- xmlns:utml="http://developer.cognos.com/schemas/cps/logic/form/1/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:trustedSession="java:com.cognos.portal.utils.TrustedSessionHelper"
- exclude-result-prefixes="xts ui uix utml">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <!-- declare global variables... -->
- <utml:variables/>
- <!-- create portal variable: $ui-consumer-info -->
- <ui:consumer/>
- <xsl:variable name="is-input" select="key( 'utml-key-params', 'edit_visited' ) = 'true'"/>
- <xsl:variable name="boo-urls-deleted" select="$utml-params[starts-with( @name, 'tmp_select' ) and ( key( 'utml-key-params', 'tmp_delete' ) = 'true' )]"/>
- <xsl:variable name="boo-urls-input" select="$utml-params[starts-with( @name, 'p_boo_url' ) and not( concat( 'tmp_select', substring-after( @name, 'p_boo_url' ) ) = $boo-urls-deleted/@name )]"/>
- <xsl:variable name="boo-urls-state" select="$ui-state-params[starts-with( @name, 'boo_url' )]"/>
- <xsl:template match="/">
- <xsl:variable name="count">
- <xsl:choose>
- <xsl:when test="$is-input = 'true'">
- <xsl:value-of select="count( $boo-urls-input )"/>
- </xsl:when>
- <xsl:when test="$boo-urls-state">
- <xsl:value-of select="count( $boo-urls-state )"/>
- </xsl:when>
- <xsl:otherwise>5</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <script language="javascript">
- function wsrp_rewrite_validate()
- {
- var cForm = document.wsrp_rewrite_form;
- for (var i=1; i<=<xsl:value-of select="$count"/>; i++) {
- var f = cForm.elements["p_boo_url"+wsrp_rewrite_format(i)];
- var alias = cForm.elements["p_boo_alias"+wsrp_rewrite_format(i)];
-
- if ( !wsrp_rewrite_isValidURL(f.value, wsrp_rewrite_trim(alias.value) != "" )) {
- window.alert("<xts:string id="IDS_UTI_ERR_INVALID_URL" encode="javascript"/>");
- f.focus();
- return false;
- }
- }
- if ( !wsrp_rewrite_isValidChannel(cForm.p_target.value, document.getElementById("wsrp_rewrite_radio_target").checked) ) {
- window.alert("<xts:string id="IDS_UTI_ERR_INVALID_FRAME_NAME" encode="javascript"/>");
- cForm.p_target.focus();
- return false;
- }
- if ( !wsrp_rewrite_isValidChannel(cForm.p_channel.value, document.getElementById("wsrp_rewrite_radio_channel").checked) ) {
- window.alert("<xts:string id="IDS_UTI_ERR_INVALID_CHANNEL_NAME" encode="javascript"/>");
- cForm.p_channel.focus();
- return false;
- }
- return true;
- }
-
- function wsrp_rewrite_selectall()
- {
- var cForm = document.wsrp_rewrite_form;
- for (var i=1; i<=<xsl:value-of select="$count"/>; i++) {
- cForm.elements["tmp_select"+wsrp_rewrite_format(i)].checked = cForm.tmp_all.checked;
- }
- }
- function wsrp_rewrite_format(n)
- {
- var s = n.toString();
- return ("00" + s).substring(s.length);
- }
- function wsrp_rewrite_add()
- {
- <xsl:choose>
- <xsl:when test="number($count) >= 25">
- window.alert("<xts:string id="IDS_UTI_ERR_MAX_ENTRIES_LIMIT" encode="javascript"><xts:param name="count"><xsl:value-of select="$count"/></xts:param></xts:string>");
- </xsl:when>
- <xsl:otherwise>
- var cForm = document.wsrp_rewrite_form;
- var n = wsrp_rewrite_format(<xsl:value-of select="number($count)+1"/>);
- cForm.tmp_add_url.name = "p_boo_url" + n;
- cForm.tmp_add_alias.name = "p_boo_alias" + n;
- <utml:form-submit
- utml:formName="wsrp_rewrite_form"
- utml:targetPage="edit"
- utml:operation="maintain"
- utml:validate="true"/>
- </xsl:otherwise>
- </xsl:choose>
- }
- function wsrp_rewrite_remove()
- {
- if (!window.confirm("<xts:string id="IDS_UTI_BOO_PROMPT_REMOVE" encode="javascript"/>")) {
- return;
- }
- document.wsrp_rewrite_form.tmp_delete.value="true";
- <utml:form-submit
- utml:formName="wsrp_rewrite_form"
- utml:targetPage="edit"
- utml:operation="maintain"
- utml:validate="false"/>
- }
- </script>
- <uix:script-trim/>
- <uix:script-isValidURL/>
- <uix:script-isValidChannel/>
- <ui:about/>
- <ui:help/>
- <utml:form name="wsrp_rewrite_form" method="post" utml:maintainPrevNavState="true">
- <utml:exclude-prefix>p_boo_url</utml:exclude-prefix>
- <utml:exclude-prefix>p_boo_alias</utml:exclude-prefix>
- <utml:exclude-prefix>tmp_select</utml:exclude-prefix>
-
- <utml:input type="hidden" name="cps-authToken" utml:update="false">
- <utml:value>
- <xsl:value-of select="trustedSession:staticGenerateAuthToken(string(/root/cookies/cookie[@name='usersessionid']))"/>
- </utml:value>
- </utml:input>
-
- <utml:input name="tmp_add_url" type="hidden" utml:update="false"/>
- <utml:input name="tmp_add_alias" type="hidden" utml:update="false"/>
- <utml:input name="tmp_delete" type="hidden" utml:update="false"/>
- <ui:page>
- <ui:page-description><xts:string id="IDS_UTI_BOO_DESC"/></ui:page-description>
- <ui:page-section>
- <ui:page-sub-section-group>
- <ui:page-sub-section>
- <ui:page-sub-section-content>
- <uix:title />
- </ui:page-sub-section-content>
- </ui:page-sub-section>
- <ui:page-sub-section>
- <ui:page-sub-section-title><xts:string id="IDS_UTI_BOO_LABEL_BOOKMARKS"/></ui:page-sub-section-title>
- <ui:page-sub-section-content>
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td class="portlet-msg-info"><xts:string id="IDS_UTI_BOO_DESC_BOOKMARKS"/></td>
- </tr>
- <tr>
- <td>
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td>
- <table border="0" cellspacing="0" cellpadding="1" style="border: 1px solid black">
- <tr class="portlet-table-header">
- <td class="portlet-font" width="16">
- <utml:input name="tmp_all" type="checkbox" onclick="wsrp_rewrite_selectall()" class="portlet-form-field" utml:update="false">
- <utml:default-value>false</utml:default-value>
- </utml:input>
- </td>
- <td class="portlet-font" width="12">
- <img src="{ $ui-producer-images }sep.gif" alt="" width="12" height="16"/>
- </td>
- <td class="portlet-table-header" width="280"><xts:string id="IDS_UTI_BOO_HEADER_URLS"/></td>
- <td class="portlet-font" width="12">
- <img src="{ $ui-producer-images }sep.gif" alt="" width="12" height="16"/>
- </td>
- <td class="portlet-table-header" width="100"><xts:string id="IDS_UTI_BOO_HEADER_ALIASES"/></td>
- </tr>
- <xsl:choose>
- <xsl:when test="$is-input = 'true'">
- <xsl:choose>
- <xsl:when test="not($boo-urls-input)">
- <tr>
- <td class="portlet-table-body" valign="top" align="center" colspan="5">
- <br/><xts:string id="IDS_UTI_BOO_NO_ENTRIES"/><br/><br/>
- </td>
- </tr>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="$boo-urls-input">
- <xsl:sort select="@name" order="ascending"/>
- <xsl:call-template name="render-url"/>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$boo-urls-state">
- <xsl:for-each select="$boo-urls-state">
- <xsl:sort select="@name" order="ascending"/>
- <xsl:call-template name="render-url"/>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="render-url">
- <xsl:with-param name="n">01</xsl:with-param>
- </xsl:call-template>
- <xsl:call-template name="render-url">
- <xsl:with-param name="n">02</xsl:with-param>
- </xsl:call-template>
- <xsl:call-template name="render-url">
- <xsl:with-param name="n">03</xsl:with-param>
- </xsl:call-template>
- <xsl:call-template name="render-url">
- <xsl:with-param name="n">04</xsl:with-param>
- </xsl:call-template>
- <xsl:call-template name="render-url">
- <xsl:with-param name="n">05</xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </table>
- </td>
- </tr>
- <tr>
- <td class="portlet-font" align="right">
- <a xsl:use-attribute-sets="anchor" href="javascript:wsrp_rewrite_add()"><xts:string id="IDS_UTI_BOO_ADD_BOOKMARK"/></a>
- <xsl:text>  </xsl:text>
- <a xsl:use-attribute-sets="anchor" href="javascript:wsrp_rewrite_remove()"><xts:string id="IDS_UTI_BOO_DELETE_BOOKMARK"/></a>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </ui:page-sub-section-content>
- </ui:page-sub-section>
- <ui:page-sub-section>
- <ui:page-sub-section-title><xts:string id="IDS_PRO_UIX_LABEL_OPEN_LINKS"/></ui:page-sub-section-title>
- <ui:page-sub-section-content>
- <uix:open-links msgChannel="IDS_UTI_COM_DESC_CHANNEL_HTML"/>
- </ui:page-sub-section-content>
- </ui:page-sub-section>
- </ui:page-sub-section-group>
- </ui:page-section>
- </ui:page>
- </utml:form>
- </xsl:template>
- <xsl:template name="render-url">
- <xsl:param name="n" select="xtsext:formatNumber( string(position()), '00', 'en', 2)"/>
- <tr>
- <td>
- <utml:input name="tmp_select{ $n }" type="checkbox" class="portlet-form-field">
- <utml:default-value>false</utml:default-value>
- </utml:input>
- </td>
- <td class="portlet-font" width="1">
- <img width="1" height="1" alt="" src="{ $ui-producer-images }space.gif"/>
- </td>
- <td>
- <utml:input name="p_boo_url{ $n }" type="text" size="60" class="portlet-form-input-field" utml:update="false" stttype="url">
- <utml:value>
- <xsl:choose>
- <xsl:when test="$is-input = 'true'">
- <xsl:value-of select="$utml-params[@name = current()/@name ]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$ui-state-params[@name = current()/@name ]"/>
- </xsl:otherwise>
- </xsl:choose>
- </utml:value>
- </utml:input>
- </td>
- <td class="portlet-font" width="1">
- <img width="1" height="1" alt="" src="{ $ui-producer-images }space.gif"/>
- </td>
- <td>
- <utml:input name="p_boo_alias{ $n }" type="text" size="20" class="portlet-form-input-field" utml:update="false">
- <utml:value>
- <xsl:choose>
- <xsl:when test="$is-input = 'true'">
- <xsl:value-of select="$utml-params[@name = concat( 'p_boo_alias', substring-after( current()/@name, 'boo_url' ) ) ]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$ui-state-params[@name = concat( 'boo_alias', substring-after( current()/@name, 'boo_url' ) ) ]"/>
- </xsl:otherwise>
- </xsl:choose>
- </utml:value>
- </utml:input>
- </td>
- </tr>
- </xsl:template>
- </xsl:stylesheet>
|