123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (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).
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml" includeConfig="true">
- <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
-
- <!--
- ===============================================================================================
- Create some morphlet variables.
- Since this morphlet is used both from the New Job wizard and in many other pages, determine if we are in a wizard and save
- that information in the DOM for use by other blocks.
- ===============================================================================================
- -->
- <xts:block id="create_morphlet_vars" type="exec" mode="interpret" processor="XSLT">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="root">
- <xsl:variable name="in-wizard">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name = 'm_new_class'] and (/root/env/param[@name = 'm_new_class'] != '') ">
- <xsl:text>true</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>false</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- Append these variables in the input document. -->
- <xts:sequence>
- <xts:append>
- <morphlet>
- <variable name="in-wizard">
- <xsl:value-of select="$in-wizard"/>
- </variable>
- </morphlet>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- HTML output ======================================================= -->
- <xts:block id="format" mode="output" processor="XSLT" type="exec" dependency="formlogic_init create_morphlet_vars" mimeType="text/html">
- <!-- portal specific information -->
- <xts:logicsheet path="logicsheets/portal.xsl"/>
-
- <!-- get the new theme stuff -->
- <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
- <xts:logicsheet path="logicsheets/formlogic.xslt"/>
- <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
- xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
- xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
- xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
- xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
- xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:fault="http://developer.cognos.com/schemas/xts/portal/iFaultHandler/1/"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:faults="http://www.w3.org/2001/09/soap-faults"
- xmlns:cam="http://developer.cognos.com/schemas/CAM/AAA/1/"
- exclude-result-prefixes="xsl cm bus fault SOAP-ENV faults cam xtsext">
-
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
-
- <!-- Global template variables -->
- <pf:variables/>
- <!-- time varibales needed for the calendar control -->
- <xsl:variable name="mname" select="'select_languages.xts'"/>
- <!-- start the output -->
- <xsl:template match="/root">
- <xsl:variable name="newJobString">
- <xts:string id="IDS_ADDENTRIES_TITLE_NEW_JOB"/>
- </xsl:variable>
- <xsl:variable name="browserTitle">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='report_name'] and /root/env/param[@name='report_name'] != ''">
- <xts:string id="IDS_SELECT_LANG_TITLE_JOBSTEP">
- <xts:param name="objectName">
- <xsl:choose>
- <xsl:when test=" /root/morphlet/variable[@name = 'in-wizard'] = 'true' ">
- <xsl:value-of select="$newJobString"/>
- </xsl:when>
- <xsl:otherwise>
- <span lang="{$contentLocale}"><xsl:value-of select="key('env-param', 'm_name')"/></span>
- </xsl:otherwise>
- </xsl:choose>
- </xts:param>
- <xts:param name="step_name">
- <span lang="{$contentLocale}"><xsl:value-of select="/root/env/param[@name='report_name']"/></span>
- </xts:param>
- </xts:string>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_SELECT_LANG_TITLE">
- <xts:param name="objectName">
- <xsl:choose>
- <xsl:when test=" /root/morphlet/variable[@name = 'in-wizard'] = 'true' ">
- <xsl:value-of select="$newJobString"/>
- </xsl:when>
- <xsl:otherwise>
- <span lang="{$contentLocale}"><xsl:value-of select="key('env-param', 'm_name')"/></span>
- </xsl:otherwise>
- </xsl:choose>
- </xts:param>
- </xts:string>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
- <dp:meta>
- <pf:meta/> <!-- Standard meta tags -->
- </dp:meta>
- <pf:help context="HID_SELECT_RPT_LANG"/>
- <script language="javascript">
- // save the correct sort order from CM which takes the locale into account
- var masterSortArray = new Array();
- var i = 0;
- <xsl:for-each select="/root/config/param[@name='locale']/locale[@type='contentLocale']">
- masterSortArray[i] = "<xsl:value-of select="xtsext:javascriptencode(id)"/>";
- i++;
- </xsl:for-each>
- var firstColumn = new Array();
- var i = 0;
- <xsl:for-each select="/root/config/param[@name='locale']/locale[@type='contentLocale' and not(id=key('env-param', 'language'))]">
- firstColumn[i] = new Array("<xsl:value-of select="displayName"/>", "<xsl:value-of select="xtsext:javascriptencode(id)"/>","");
- i++;
- </xsl:for-each>
- var secondColumn = new Array();
- var i = 0;
- <xsl:for-each select="/root/config/param[@name='locale']/locale[@type='contentLocale' and id=key('env-param', 'language')]">
- secondColumn[i] = new Array("<xsl:value-of select="displayName"/>", "<xsl:value-of select="xtsext:javascriptencode(id)"/>","");
- i++;
- </xsl:for-each>
-
-
- function validate()
- {
- if (secondColumn.length < 1)
- {
- alert("<xts:string id="IDS_SELECT_LANG_NO_SELECTION" encode="javascript"/>");
- return false;
- }
-
- var encodedLanguages = "&lt;languages&gt;";
- for (var i=secondColumn.length-1; i>=0; i--)
- {
- encodedLanguages += "&lt;language&gt;" + secondColumn[i][1] + "&lt;/language&gt;";
- }
- encodedLanguages += "&lt;/languages&gt;";
- document.pform.selected_languages.value = encodedLanguages;
-
- if (document.pform.specify_language && document.pform.specify_language.value == '')
- {
- document.pform.specify_language.value = 'checked';
- }
-
- return true;
- }
-
- var availableList = null;
- var selectedList = null;
- var availableListParent = null;
- var selectedListParent = null;
-
-
-
- function removeLists(){
- if (availableList == null){
- availableList = document.getElementsByName("all_lang")[0];
- selectedList = document.getElementsByName("selected_lang")[0];
- }
-
- if ((availableList != null) && (selectedList != null)){
- availableListParent = availableList.parentNode;
- availableListParent.removeChild(availableList);
- selectedListParent = selectedList.parentNode;
- selectedListParent.removeChild(selectedList);
- }
-
- }
-
- function addLists(){
- if ((availableListParent != null) && (availableList) && (selectedListParent != null) && (selectedList)){
- availableListParent.appendChild(availableList);
- selectedListParent.appendChild(selectedList);
- }
- }
-
- // move columns
- function moveColumns( whatFrom, whatTo, arrayFrom, arrayTo ) {
- //have to remove the list from the dom when we mess with the
- //list directly. If we do not then this function will hang for a very long time
- //when jaws screen reader is active
- removeLists();
- for (var i = whatFrom.options.length - 1; i >= 0; i--) {
- //if it is selected and the one after this isn't
- if (whatFrom[i].selected == true){
- arrayFrom[i][3] = "selected";
- arrayTo.push(arrayFrom[i]);
- arrayFrom.splice(i, 1);
- }
- }
- //call the sort the arrays
- sortIndex(whatFrom, arrayFrom);
- sortIndex(whatTo, arrayTo);
- //add this lists back to the dom....
- addLists();
- }
- // move all columns
- function moveAllColumns( whatFrom, whatTo, arrayFrom, arrayTo ) {
- //have to remove the list from the dom when we mess with the
- //list directly. If we do not then this function will hang for a very long time
- //when jaws screen reader is active
- removeLists();
- for (var i = whatFrom.options.length-1; i >= 0; i--) {
- arrayFrom[i][3] = "selected";
- arrayTo.push(arrayFrom[i]);
- arrayFrom.splice(i, 1);
- }
- //call the sort the arrays
- sortIndex(whatFrom, arrayFrom);
- sortIndex(whatTo, arrayTo);
- //add this lists back to the dom....
- addLists();
- }
-
- //sort the options by value
- function sortIndex(what, sortArray) {
- // use theMaster Sort Array to sort the given array
- var n = 0;
- var tempArray = new Array();
- for (var i=0; i < (masterSortArray.length); i++) {
- for (var j=0; j < (sortArray.length); j++) {
- if (masterSortArray[i]==sortArray[j][1]) {
- tempArray[n] = new Array(sortArray[j][0],sortArray[j][1],sortArray[j][2]);
- n++;
- }
- }
- }
-
- // tempArray is now correctly sorted
- for (var i=0; i < (tempArray.length); i++) {
- sortArray[i] = new Array(tempArray[i][0],tempArray[i][1],tempArray[i][2]);
- }
-
- //create selected options array and delete options
- selectedOptions = new Array();
- for (var i=(what.options.length - 1); i > -1; i--) {
- selectedOptions[i] = what[i].selected;
- deleteOption(what,i);
- }
-
- //delete all the options
- for (var i=(what.options.length - 1); i > -1; i--) {
- deleteOption(what,i);
- }
-
- //add the options back in order
- var i=0;
- for (i=0; i < sortArray.length; i++) {
- addOption(what, sortArray[i][0], sortArray[i][1])
- if (sortArray[i][2] != '')
- what[i].selected=true;
- }
- }
- //delete an option
- function deleteOption(what, index) {
- what.options[index] = null;
- }
-
- //add an option
- function addOption(what, text, value) {
- var defaultSelected = false;
- var selected = false;
- var optionName = new Option(text, value, defaultSelected, selected)
- what.options[what.length] = optionName;
- what.options[what.length-1].selected = false;
- }
- </script>
-
- <!-- Get date control includes -->
- <utml:form name="pform" method="post" action="{$gateway}">
- <!-- we don't want to cary over the old languages if the user hits OK -->
- <utml:exclusion-list>
- <xsl:value-of select="'m_ro_outputLocale language'"/>
- </utml:exclusion-list>
-
- <utml:input type="hidden" name="selected_languages"/>
- <utml:input type="hidden" name="select_languages_visited" value="true"/>
-
- <!-- if the specify checkbox wasn't checked then create a hidden entry which will be set to 'checked' if the user hits OK -->
- <utml:input type="hidden" name="specify_language">
- <utml:value>
- <xsl:if test="key('env-param', 'specify_language')"><xsl:value-of select="key('env-param', 'specify_language')"/></xsl:if>
- </utml:value>
- </utml:input>
-
- <!-- header -->
- <dp:header>
- <dp:title>
- <xsl:copy-of select="$browserTitle"/>
- </dp:title>
- <dp:description>
- <xts:string id="IDS_SELECT_LANG_INTRO"/>
- </dp:description>
- </dp:header>
-
-
- <!-- body -->
- <lyt:layout style="1">
- <lyt:section>
- <dp:list>
- <dp:section>
- <dp:list>
- <dp:section>
- <dp:label align="left" nospace="nospace" for="IDS_SELECT_LANG_AVAILABLE">
- <xts:string id="IDS_SELECT_LANG_AVAILABLE"/>
- </dp:label>
- </dp:section>
- <dp:section>
- <utml:select size="18" name="all_lang" multiple="true" style="width:280;" id="IDS_SELECT_LANG_AVAILABLE">
- <xsl:for-each select="/root/config/param[@name='locale']/locale[@type='contentLocale' and not(id=key('env-param', 'language'))]">
- <option value="{id}">
- <xsl:value-of select="displayName"/>
- </option>
- </xsl:for-each>
- <option value="deleteme">
- <xsl:text/>         <xsl:text/>
- <xsl:text/>         <xsl:text/>
- <xsl:text/>         <xsl:text/>
- <xsl:text/>         <xsl:text/>
- <xsl:text/>         <xsl:text/>
- <xsl:text/>         <xsl:text/>
- <xsl:text/>         <xsl:text/>
- </option>
- </utml:select>
- </dp:section>
- </dp:list>
- <dp:list>
- <dp:section>
- <dp:text/>
- </dp:section>
- <dp:section>
- <dp:text/>
- </dp:section>
- <dp:section>
- <dp:columnButtonGroup align="center" width="40" label="IDS_SELECT_LANG_AVAILABLE">
- <dp:columnButton>
- <a href="javascript:moveColumns(document.pform.all_lang, document.pform.selected_lang, firstColumn, secondColumn)">
- <img height="18" width="18" border="0">
- <xsl:attribute name="src"><xsl:value-of select="$image_root"/>move_right.gif<xsl:text/></xsl:attribute>
- <xsl:attribute name="alt"><xts:string id="IDS_SELECT_LANG_ADD"/></xsl:attribute>
- </img>
- </a>
- </dp:columnButton>
- <dp:columnButton>
- <a href="javascript:moveColumns(document.pform.selected_lang, document.pform.all_lang, secondColumn, firstColumn)">
- <img height="18" width="18" border="0">
- <xsl:attribute name="src"><xsl:value-of select="$image_root"/>move_left.gif<xsl:text/></xsl:attribute>
- <xsl:attribute name="alt"><xts:string id="IDS_SELECT_LANG_REMOVE"/></xsl:attribute>
- </img>
- </a>
- </dp:columnButton>
- <dp:columnButton>
- <a href="javascript:moveAllColumns(document.pform.all_lang, document.pform.selected_lang, firstColumn, secondColumn)">
- <img height="18" width="18" border="0">
- <xsl:attribute name="src"><xsl:value-of select="$image_root"/>move_all_right.gif<xsl:text/></xsl:attribute>
- <xsl:attribute name="alt"><xts:string id="IDS_SELECT_LANG_ADD_ALL"/></xsl:attribute>
- </img>
- </a>
- </dp:columnButton>
- <dp:columnButton>
- <a href="javascript:moveAllColumns(document.pform.selected_lang, document.pform.all_lang, secondColumn, firstColumn)">
- <img height="18" width="18" border="0">
- <xsl:attribute name="src"><xsl:value-of select="$image_root"/>move_all_left.gif<xsl:text/></xsl:attribute>
- <xsl:attribute name="alt"><xts:string id="IDS_SELECT_LANG_REMOVE_ALL"/></xsl:attribute>
- </img>
- </a>
- </dp:columnButton>
- </dp:columnButtonGroup>
- </dp:section>
- </dp:list>
- <dp:list>
- <dp:section>
- <dp:label align="left" nospace="nospace" for="IDS_SELECT_LANG_SELECTED">
- <xts:string id="IDS_SELECT_LANG_SELECTED"/>
- </dp:label>
- </dp:section>
- <dp:section>
- <utml:select size="18" name="selected_lang" multiple="true" style="width:280;" id="IDS_SELECT_LANG_SELECTED">
- <xsl:for-each select="/root/config/param[@name='locale']/locale[@type='contentLocale' and id=key('env-param', 'language')]">
- <option value="{id}">
- <xsl:value-of select="displayName"/>
- </option>
- </xsl:for-each>
- <option value="deleteme">
- <xsl:text/>         <xsl:text/>
- <xsl:text/>         <xsl:text/>
- <xsl:text/>         <xsl:text/>
- <xsl:text/>         <xsl:text/>
- <xsl:text/>         <xsl:text/>
- <xsl:text/>         <xsl:text/>
- <xsl:text/>         <xsl:text/>
- </option>
- </utml:select>
- </dp:section>
- </dp:list>
- </dp:section>
- </dp:list>
- </lyt:section>
- </lyt:layout>
- <script language="javascript">
- //delete the blank options
- if (document.pform.selected_lang[(document.pform.selected_lang.length - 1)].value == 'deleteme') {
- document.pform.selected_lang[(document.pform.selected_lang.length - 1)] = null;
- }
- if (document.pform.all_lang[(document.pform.all_lang.length - 1)].value == 'deleteme') {
- document.pform.all_lang[(document.pform.all_lang.length - 1)] = null;
- }
- </script>
-
- <!-- footer -->
- <dp:footer>
- <df:button df:id="IDS_OK" utml:validate="true" df:style="stack-down-save"/>
- <xsl:choose>
- <xsl:when test="key('env-param', 'ps_nav_stack') and not(key('env-param', 'ps_nav_stack') = '') ">
- <df:button df:id="IDS_CANCEL" df:style="stack-down"/>
- </xsl:when>
- <xsl:otherwise>
- <df:button df:id="IDS_CANCEL" df:style="back-url"/>
- </xsl:otherwise>
- </xsl:choose>
- </dp:footer>
- </utml:form>
- </dp:page>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!--
- ===============================================================================================
- debug - display debug information
- ===============================================================================================
- -->
- <xts:block id="debug" dependency="format" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
- <!-- get the debug logic sheet -->
- <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
- <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="dbg">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
- <xsl:template match="/">
- <dbg:dumpxml select="/root"/>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|