123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: cpscrn
- (C) Copyright IBM Corp. 2005, 2014
- 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/nav/portlet-impl/search/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:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- 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:trustedSession="java:com.cognos.portal.utils.TrustedSessionHelper"
- exclude-result-prefixes="xts xtsext ui uix utml">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <!-- declare global variables... -->
- <xsl:variable name="delete" select="$ui-navigational-params[@name = 'tmp_delete']"/>
- <xsl:variable name="consumer-escape" select="$ui-registration-params[@name = 'consumerEscape']"/>
- <utml:variables/>
- <!-- create portal variable: $ui-consumer-info-->
- <ui:consumer/>
- <ui:property name="display-max-objects" select="'display_max_objects'"/>
- <ui:property name="display-details" select="'display_details'"/>
- <ui:property name="display-actions-link" select="'display_actions_link'"/>
- <ui:property name="display-maximize" select="'display_maximize'"/>
- <xsl:template match="/">
- <script language="javascript">
- function wsrp_rewrite_validate() {
- var cForm = document.wsrp_rewrite_form;
- var wsrp_rewrite_err1 = "<xts:string id="IDS_NAV_ERR_NAME_EXISTS" encode="javascript"/>";
- var wsrp_rewrite_err2 = "<xts:string id="IDS_NAV_ERR_NAME_BLANK" encode="javascript"/>";
- <xsl:variable name="savedSearchNames">
- <xsl:choose>
- <xsl:when test="key( 'utml-key-params', 'edit_visited' ) = 'true'">
- <xsl:for-each select="$utml-params[starts-with( @name, 'p_saved_n' ) and ( @name != string($delete) )]">
- <xsl:sort select="." order="ascending"/>
- <xsl:text/>"<xsl:value-of select="xtsext:javascriptencode( string( . ) )"/>"<xsl:text/>
- <xsl:text/>,<xsl:text/>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="$ui-state-params[starts-with( @name, 'saved_n' )]">
- <xsl:sort select="." order="ascending"/>
- <xsl:text/>"<xsl:value-of select="xtsext:javascriptencode( string( . ) )"/>"<xsl:text/>
- <xsl:text/>,<xsl:text/>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- var savedSearchNamesArray = new Array( <xsl:value-of select="$savedSearchNames"/> "" );
- for (var loop = 1; ; loop++) {
- var f = cForm.elements["p_saved_n"+loop];
- if (f != null) {
- f.value = wsrp_rewrite_trim(f.value);
- for ( var i=0; i<savedSearchNamesArray.length; i++ ) {
- if (f.value == ""){
- window.alert(wsrp_rewrite_err2);
- f.focus();
- return false;
- }
- else if ( (f.value == savedSearchNamesArray[i]) && ((i+1) != loop) ) {
- window.alert(wsrp_rewrite_err1);
- f.focus();
- return false;
- }
- }
- } else {
- break;
- }
- }
- if (cForm.tmp_saved_n != null && cForm.tmp_saved_n.value != "") {
- // do the save...
- cForm.tmp_saved_n.value = wsrp_rewrite_trim(cForm.tmp_saved_n.value);
- for ( var i=0; i<savedSearchNamesArray.length; i++ ) {
- if ( (cForm.tmp_saved_n.value == savedSearchNamesArray[i]) ) {
- window.alert(wsrp_rewrite_err1);
- cForm.tmp_saved_n.focus();
- return false;
- }
- }
- cForm.tmp_saved_n.name = "p_saved_n"+loop;
- cForm.tmp_saved_s.name = "p_saved_s"+loop;
- <!--
- <HACK_ALERT>
- WE MUST BE AWARE THAT THE UTML BELOW COULD HAVE GENERATED AN INPUT FIELD WITH
- THE SAME NAME AS THE ABOVE, BUT WITH THE $consumer-escape PREFIX.
- -->
- <xsl:if test="$consumer-escape != ''">
- cForm.<xsl:value-of select="$consumer-escape"/>tmp_saved_n.name = "<xsl:value-of select="$consumer-escape"/>p_saved_n"+loop;
- </xsl:if>
- <!--</HACK_ALERT> -->
- }
- if ( !wsrp_rewrite_isValidChannel(cForm.p_target.value, document.getElementById("wsrp_rewrite_radio_target").checked) ) {
- window.alert("<xts:string id="IDS_NAV_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_NAV_ERR_INVALID_CHANNEL_NAME" encode="javascript"/>");
- cForm.p_channel.focus();
- return false;
- }
- if ( !wsrp_rewrite_isValidBoundary(cForm.p_display_max_objects.value,1,1000) ) {
- window.alert("<xts:string id="IDS_NAV_ERR_NUMBER_BETWEEN" encode="javascript"><xts:param name="min">1</xts:param><xts:param name="max">1000</xts:param></xts:string>");
- cForm.p_display_max_objects.focus();
- return false;
- }
- return true;
- }
- function wsrp_rewrite_doDelete(searchID) {
- var cForm = document.wsrp_rewrite_form;
- cForm.tmp_delete.value = searchID;
- <utml:form-submit
- utml:formName="wsrp_rewrite_form"
- utml:targetPage="edit"
- utml:operation="maintain"
- utml:validate="false"/>
- }
- function wsrp_rewrite_doSaveNew() {
- var cForm = document.wsrp_rewrite_form;
-
- var err1 = "<xts:string id="IDS_NAV_ERR_NAME_BLANK" encode="javascript"/>";
-
- cForm.tmp_saved_n.value = wsrp_rewrite_trim(cForm.tmp_saved_n.value);
- if ( cForm.tmp_saved_n.value == "" ) {
- window.alert(err1);
- cForm.tmp_saved_n.focus();
- return false;
- }
- cForm.tmp_save_performed.value = 'true';
- <utml:form-submit
- utml:formName="wsrp_rewrite_form"
- utml:targetPage="edit"
- utml:operation="maintain"
- utml:validate="true"/>
- }
- </script>
- <uix:script-trim/>
- <uix:script-isValidChannel/>
- <uix:script-isValidBoundary/>
- <ui:about/>
- <ui:help/>
- <xsl:variable name="searchEditRegion"><xts:string id="IDS_PRO_UIX_EDITMODE_REGION_TITLE_SEARCH" encode="html"/></xsl:variable>
- <div role="region" aria-label="{$searchEditRegion}">
- <utml:form name="wsrp_rewrite_form" action="wsrp_rewrite?wsrp-urlType=blockingAction/wsrp_rewrite" method="post" utml:escape-prefix="$consumer-escape" utml:maintainPrevNavState="true">
- <utml:exclude-prefix>p_saved_</utml:exclude-prefix>
- <utml:input type="hidden" name="tmp_save_performed" value="false" utml:update="true"/>
- <utml:input type="hidden" name="tmp_delete" value="" utml:update="false"/>
-
-
- <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>
-
- <ui:page>
- <ui:page-description><xts:string id="IDS_NAV_EDT_DESC_SEARCH"/></ui:page-description>
- <xsl:if test="/root/portlet/consumer/supportTitle = 'true'">
- <ui:page-section>
- <!-- this will generate a ui:page-sub-section-group -->
- <uix:title/>
- </ui:page-section>
- </xsl:if>
- <ui:page-section>
- <ui:page-section-divider><xts:string id="IDS_NAV_EDT_GROUP_SAVED_SEARCHES"/></ui:page-section-divider>
- <ui:page-section-desc><xts:string id="IDS_NAV_EDT_DESC_SAVED_SEARCHES"/></ui:page-section-desc>
-
- <xsl:variable name="saved-searches1" select="$utml-params[starts-with( @name, 'p_saved_n' ) and ( @name != string($delete) )]"/>
- <xsl:variable name="saved-searches2" select="$ui-state-params[starts-with( @name, 'saved_n' )]"/>
- <ui:page-sub-section-group>
- <ui:page-sub-section tailing-space="false">
- <ui:page-sub-section-content>
- <table border="0" cellspacing="0" cellpadding="3" width="100%" role="presentation">
- <tr>
- <td class="portlet-form-field-label" width="45%"><xts:string id="IDS_NAV_EDT_LABEL_SAVED_SEARCHES"/></td>
- <td class="portlet-form-field" width="10%"><br/></td>
- <td class="portlet-form-field-label" width="45%"><xts:string id="IDS_NAV_EDT_LABEL_LAST_SEARCH"/></td>
- </tr>
- <tr>
- <td valign="top">
- <table border="0" cellpadding="0" cellspacing="0" role="presentation">
- <xsl:choose>
- <xsl:when test="( key( 'utml-key-params', 'edit_visited' ) = 'true' ) and $saved-searches1">
- <xsl:for-each select="$saved-searches1">
- <xsl:sort select="." order="ascending"/>
- <xsl:call-template name="render-saved-search"/>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="not( key( 'utml-key-params', 'edit_visited' )) and $saved-searches2">
- <xsl:for-each select="$saved-searches2">
- <xsl:sort select="." order="ascending"/>
- <xsl:call-template name="render-saved-search"/>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <tr>
- <td class="portlet-form-field"><xts:string id="IDS_NAV_EDT_LABEL_NO_SEARCHES_SAVED"/></td>
- </tr>
- </xsl:otherwise>
- </xsl:choose>
- </table>
- </td>
-
- <xsl:choose>
- <xsl:when test="not( key( 'utml-key-params', 'tmp_save_performed' ) = 'true' ) and ( ( key( 'utml-key-params', 'execute' ) = 'true' ) or ( key( 'utml-key-params', 'last_search' ) != '' ))">
- <td class="portlet-form-field" valign="top">
- <input class="portlet-form-button" type="button" onclick="javascript:wsrp_rewrite_doSaveNew()">
- <xsl:attribute name="value"><xts:string id="IDS_NAV_EDT_LABEL_SAVE"/></xsl:attribute>
- </input>
- </td>
- <td class="portlet-form-field" valign="top">
- <xsl:call-template name="render-new-search"/>
- </td>
- </xsl:when>
- <xsl:otherwise>
- <td class="portlet-form-field" valign="top">
- <br/>
- </td>
- <td class="portlet-form-field" valign="top"><xts:string id="IDS_NAV_EDT_LABEL_NO_LAST_SEARCH"/></td>
- </xsl:otherwise>
- </xsl:choose>
- </tr>
- </table>
- </ui:page-sub-section-content>
- </ui:page-sub-section>
- </ui:page-sub-section-group>
- </ui:page-section>
-
- <ui:page-section>
- <ui:page-sub-section-group>
- <ui:page-sub-section tailing-space="false">
- <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_NAV_COM_DESC_CHANNEL_VIEWER" rgLabel="IDS_PRO_UIX_LABEL_OPEN_LINKS" />
- </ui:page-sub-section-content>
- </ui:page-sub-section>
- </ui:page-sub-section-group>
- </ui:page-section>
-
- <ui:page-section>
- <ui:page-section-divider><xts:string id="IDS_NAV_COM_GROUP_VIEWING_OPTIONS"/></ui:page-section-divider>
- <ui:page-sub-section-group>
- <ui:page-sub-section>
- <ui:page-sub-section-title><label for="wsrp_rewrite_p_display_max_objects"><xts:string id="IDS_NAV_EDT_LABEL_SEARCH_DISPLAY_MAX_OBJECTS"/></label></ui:page-sub-section-title>
- <ui:page-sub-section-content>
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td>
- <utml:input id="wsrp_rewrite_p_display_max_objects" class="portlet-form-input-field" name="p_display_max_objects" type="text" size="5">
- <utml:value>
- <xsl:value-of select="$display-max-objects"/>
- </utml:value>
- </utml:input>
- </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_NAV_COM_CONTENT_OF_VIEW"/></ui:page-sub-section-title>
- <ui:page-sub-section-content>
- <table border="0" cellspacing="0" cellpadding="1" role="presentation">
- <tr>
- <td class="portlet-form-field">
- <utml:input name="p_display_details" id="wsrp_rewrite_IDS_NAV_EDT_LABEL_DISPLAY_DETAIL" type="checkbox" value="true">
- <xsl:if test="$display-details = 'true'">
- <xsl:attribute name="checked"/>
- </xsl:if>
- </utml:input>
- </td>
- <td class="portlet-form-field"><label for="wsrp_rewrite_IDS_NAV_EDT_LABEL_DISPLAY_DETAIL"><xts:string id="IDS_NAV_EDT_LABEL_DISPLAY_DETAIL"/></label></td>
- </tr>
- <tr>
- <td class="portlet-form-field">
- <utml:input id="wsrp_rewrite_IDS_NAV_EDT_LABEL_DISPLAY_ACTIONS" name="p_display_actions_link" type="checkbox" value="true">
- <xsl:if test="$display-actions-link = 'true'">
- <xsl:attribute name="checked"/>
- </xsl:if>
- </utml:input>
- </td>
- <td class="portlet-form-field"><label for="wsrp_rewrite_IDS_NAV_EDT_LABEL_DISPLAY_ACTIONS"><xts:string id="IDS_NAV_EDT_LABEL_DISPLAY_ACTIONS"/></label></td>
- </tr>
- </table>
- </ui:page-sub-section-content>
- </ui:page-sub-section>
-
- <xsl:if test="$ui-markups/wsrp:validNewWindowStates[ .='wsrp:maximized' ]">
- <ui:page-sub-section>
- <ui:page-sub-section-title><xts:string id="IDS_NAV_EDT_LABEL_SEARCH_RESULTS"/></ui:page-sub-section-title>
- <ui:page-sub-section-content>
- <table border="0" cellspacing="0" cellpadding="1" role="presentation">
- <tr>
- <td class="portlet-form-field">
- <utml:input id="wsrp_rewrite_IDS_NAV_EDT_LABEL_SEARCH_MAXIMIZE_VIEW" name="p_display_maximize" type="checkbox" value="true">
- <xsl:if test="$display-maximize = 'true'">
- <xsl:attribute name="checked"/>
- </xsl:if>
- </utml:input>
- </td>
- <td class="portlet-form-field"><label for="wsrp_rewrite_IDS_NAV_EDT_LABEL_SEARCH_MAXIMIZE_VIEW"><xts:string id="IDS_NAV_EDT_LABEL_SEARCH_MAXIMIZE_VIEW"/></label></td>
- </tr>
- </table>
- </ui:page-sub-section-content>
- </ui:page-sub-section>
- </xsl:if>
-
- <!-- SAP-HACK-START -->
- <ui:admin-settings/>
- <!-- SAP-HACK-END -->
- </ui:page-sub-section-group>
- </ui:page-section>
- </ui:page>
- </utml:form>
- </div>
- </xsl:template>
- <xsl:template name="render-saved-search">
- <xsl:param name="name" select="@name"/>
- <xsl:param name="pos" select="position()"/>
- <xsl:variable name="saved-s" select="concat( concat( substring-before( $name, '_n' ), '_s' ), substring-after( $name, '_n' ) )"/>
- <tr>
- <td class="portlet-form-field">
- <utml:input class="portlet-form-input-field" type="text" name="p_saved_n{ $pos }" size="30" maxlength="45" utml:escape="true" utml:escape-prefix="$consumer-escape">
- <utml:value>
- <xsl:choose>
- <xsl:when test="key( 'utml-key-params', string($name) )">
- <xsl:value-of select="key( 'utml-key-params', string($name) )"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$ui-state-params[@name = $name]"/>
- </xsl:otherwise>
- </xsl:choose>
- </utml:value>
- <xsl:attribute name="aria-label"><xts:string id="IDS_NAV_EDT_LABEL_SAVED_SEARCHES_INP"><xts:param name="searchNum"><xsl:value-of select="$pos"/></xts:param></xts:string></xsl:attribute>
- </utml:input>
- <xsl:text> </xsl:text>
- <a xsl:use-attribute-sets="anchor" href="javascript:wsrp_rewrite_doDelete('p_saved_n{ $pos }');"><xts:string id="IDS_NAV_EDT_LABEL_DELETE"/></a>
- <utml:input type="hidden" name="p_saved_s{ $pos }">
- <utml:value>
- <xsl:choose>
- <xsl:when test="key( 'utml-key-params', string($saved-s) )">
- <xsl:value-of select="key( 'utml-key-params', string($saved-s) )"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$ui-state-params[@name = string($saved-s)]"/>
- </xsl:otherwise>
- </xsl:choose>
- </utml:value>
- </utml:input>
- </td>
- </tr>
- </xsl:template>
- <xsl:template name="render-new-search">
- <xsl:variable name="inpLabel"><xts:string id="IDS_NAV_EDT_LABEL_LAST_SEARCH"/></xsl:variable>
- <utml:input aria-label="{$inpLabel}" class="portlet-form-input-field" type="text" name="tmp_saved_n" size="30" maxlength="45" utml:escape="true" utml:escape-prefix="$consumer-escape"/>
- <utml:input type="hidden" name="tmp_saved_s">
- <utml:value>
- <xsl:choose>
- <xsl:when test="key( 'utml-key-params', 'last_search' ) != ''">
- <xsl:value-of select="key( 'utml-key-params', 'last_search' )"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="saved-search">
- <xsl:for-each select="$utml-params[starts-with(@name, 'cps_')]">
- <xsl:call-template name="gen-param"/>
- </xsl:for-each>
- <xsl:call-template name="gen-param">
- <xsl:with-param name="name" select="'execute'"/>
- <xsl:with-param name="value" select="'true'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="xtsext:base64encode( string( $saved-search ), true() )"/>
- </xsl:otherwise>
- </xsl:choose>
- </utml:value>
- </utml:input>
- </xsl:template>
- <xsl:template name="gen-param">
- <xsl:param name="name" select="@name"/>
- <xsl:param name="value" select="."/>
- <xsl:text><param name="</xsl:text>
- <xsl:value-of select="$name"/>
- <xsl:text>"></xsl:text>
- <xsl:value-of select="xtsext:xmlencode(string($value))"/>
- <xsl:text></param></xsl:text>
- </xsl:template>
- </xsl:stylesheet>
|