123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427 |
- <?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 messageBase="messages/portal.xml, messages/portalRL.xml" xmlns:xts="http://developer.cognos.com/schemas/xts/">
- <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
-
- <!--
- ===============================================================================================
- getContent - get content about printer.
- ===============================================================================================
- -->
- <xts:block id="getContent" processor="XSLT" type="exec" dependency="formlogic_init">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <cml:object-predicates/>
- <xsl:template match="root">
- <xts:sequence>
- <xts:append>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:requests>
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:search>CAMID(':')</cm:search>
- <cm:properties>
- <cm:property name="permissions"/>
- </cm:properties>
- </cm:query>
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:search>
- <xsl:text>CAMID(':')/printer[permission('read')]</xsl:text>
- <xsl:value-of select="$hidden-objects-predicate"/>
- </cm:search>
- <cm:properties>
- <cm:property name="defaultName"/>
- <cm:property name="searchPath"/>
- <cm:property name="location"/>
- <cm:property name="modelName"/>
- <cm:property name="printerAddress"/>
- <cm:property name="iconURI"/>
- <cm:property name="hidden"/>
- </cm:properties>
- <cm:sortBy>
- <cm:sort name="defaultName" order="ascending"/>
- </cm:sortBy>
- </cm:query>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:append>
-
- <xts:delete select="/root/env/param[@name='pagerfrom']"/>
- <xts:delete select="/root/env/param[@name='pagerto']"/>
- <xts:delete select="/root/env/param[@name='pagerfrom_d']"/>
- <xts:delete select="/root/env/param[@name='pagerto_d']"/>
-
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- select default printer
- ===============================================================================================
- -->
- <xts:block id="selectDefault" processor="XSLT" type="exec" dependency="getContent" condition=".[/root/env/param[@name='x_p_defaultName']!='']" mandatory="false">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.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:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- exclude-result-prefixes="xsl cm xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:variable name="newPrinterName" select="/root/env/param[@name='x_p_defaultName']"/>
- <xsl:template match="/root/cm:queryResponse/cm:queryReply[2]/cm:printer[cm:defaultName=$newPrinterName]">
- <xts:sequence>
- <xts:replace select="/root/env/param[@name='m_ro_printerAddress']">
- <param name="m_ro_printerAddress">
- <xsl:value-of select="cm:printerAddress"/>
- </param>
- </xts:replace>
- <xts:replace select="/root/env/param[@name='select_printerAddress']">
- <param name="select_printerAddress">
- <xsl:value-of select="cm:printerAddress"/>
- </param>
- </xts:replace>
- <xts:replace select="/root/env/param[@name='m_ro_printer']">
- <param name="m_ro_printer">
- <xsl:value-of select="cm:searchPath"/>
- </param>
- </xts:replace>
- <xts:delete select="/root/env/param[@name='printeritem' or @name='select_printerName']"/>
- <xts:append select="/root/env">
- <param name="printeritem"><xsl:value-of select="cm:searchPath"/></param>
- <param name="select_printerName"><xsl:value-of select="cm:defaultName"/></param>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <xts:block id="format" dependency="getContent selectDefault" mode="output" processor="XSLT" type="exec" mimeType="text/html">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/layout.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:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- 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:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
- 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:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
- exclude-result-prefixes="xsl cf cp df dp cf lyt cm utml xtsext">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
- <!-- current file name -->
- <xsl:variable name="mname" select="'specify_printer.xts'"/>
- <!-- icon generator -->
- <pf:gen-icon/>
- <!-- portal variables -->
- <pf:variables/>
- <xsl:variable name="has_write_permission" select="contains(/root/cm:queryResponse/cm:queryReply[1]/*/cm:permissions, 'write')"/>
- <xsl:variable name="xreturn">
- <xsl:choose>
- <xsl:when test="key('env-param','x_return') and key('env-param','x_return')!=''">
- <xsl:value-of select="key('env-param','x_return')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="key('env-param','m_return')">
- <xsl:value-of select="key('env-param','m_return')"/>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="lines">
- <xsl:choose>
- <xsl:when test="key('session-param', 'linesPerPage')">
- <xsl:value-of select="key('session-param', 'linesPerPage')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/system/param[@name='defaultPortalPreferences']/pref[@name='lines']"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- This is here for show only. It is required by some controls to be present on the page. -->
- <xsl:variable name="back-url" select="key('env-param', 'backURL')"/>
- <xsl:variable name="newJobString">
- <xts:string id="IDS_ADDENTRIES_TITLE_NEW_JOB"/>
- </xsl:variable>
- <xsl:variable name="browserTitle">
- <xts:string id="IDS_SELECT_PRINTER_TITLE">
- <xts:param name="obj_name">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name = 'm_new_class'] and (/root/env/param[@name = 'm_new_class'] != '') ">
- <xsl:value-of select="xtsext:enforceBTD($newJobString, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
- </xsl:when>
- <xsl:otherwise>
- <span lang="{$contentLocale}"><xsl:value-of select="xtsext:enforceBTD(key('env-param', 'm_name'), $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/></span>
- </xsl:otherwise>
- </xsl:choose>
- </xts:param>
- </xts:string>
- </xsl:variable>
- <!-- Start output -->
- <xsl:template match="/root">
- <xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text><dp:page longTitle="$browserTitle">
- <dp:meta>
- <pf:meta/>
- <!-- Standard meta tags -->
- </dp:meta>
- <dp:script>
- <pf:help context="HID_DISTRIB_PRINT"/>
- <!-- Help system -->
- <script language="JavaScript">
- function init()
- {
- <!-- Reset all form fields that get modified using client-side Javascript -->
- document.pform.m.value = "<xsl:value-of select="$app"/>/<xsl:value-of select="$mname"/>";
- document.pform.ps_nav_op.value = "maintain";
- document.pform.m_return.value = "<xsl:value-of select="xtsext:javascriptencode(string($xreturn))"/>";
-
- <xsl:if test="key('env-param','x_path') and key('env-param','x_path')!=''">
- document.pform.ifrmcmd.value = "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','x_ifrmcmd')))"/>";
- resetXCommand();
- </xsl:if>
- }
-
- function resetXCommand()
- {
- document.pform.x_path.value = "";
- document.pform.x_ifrmcmd.value = "";
- document.pform.x_p_defaultName.value = "";
- document.pform.x_p_defaultScreenTip.value = "";
- document.pform.x_p_defaultDescription.value = "";
- document.pform.x_new_class.value = "";
- document.pform.x_return.value = "";
- document.pform.x_p_printerAddress.value = "";
- document.pform.x_p_location.value = "";
- document.pform.x_p_modelName.value = "";
- }
-
- function radioState(radio, printerAdd, printerName)
- {
- document.pform.m_ro_printer.value = radio.value;
- document.pform.m_ro_printerAddress.value = printerAdd;
- document.pform.select_printerAddress.value = printerAdd;
- document.pform.select_printerName.value = printerName;
- }
-
- function doNewPrinter()
- {
- document.pform.x_ifrmcmd.value = "create";
- document.pform.x_path.value = "CAMID(':')";
- document.pform.x_return.value = "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','m_return')))"/>";
- document.pform.m_return.value = "<xsl:value-of select="$app"/>/<xsl:value-of select="$mname"/>";
- document.pform.m.value = "<xsl:value-of select="$app"/>/new_printer.xts";
- document.pform.submit();
- }
- function validate()
- {
- if ( !entrySelected() )
- {
- alert("<xts:string id="IDS_SELECT_PRINTER_ERR_NO_SELECTION" encode="javascript"/>" );
- return false;
- }
- else
- {
- //use "m_ro_printer" instead of "m_ro_printerAddress" to identify a printer
- document.pform.ro_printer_kw.value = 'printer';
- return true;
- }
- }
-
- function entrySelected()
- {
- <!--
- // See if we have radio buttons on the page. If there are, then make sure at least one is checked.
- // There is a special case when only one radio button exists.
- -->
- if (document.pform.printeritem)
- {
- if (document.pform.printeritem.length > 0)
- {
- for (var i=0; i<document.pform.printeritem.length; i++)
- {
- if (document.pform.printeritem[i].checked)
- return true;
- }
- }
- else
- {
- return document.pform.printeritem.checked;
- }
- }
- return false;
- }
- </script>
- </dp:script>
- <utml:form name="pform" method="post" action="{$gateway}">
- <dp:header>
- <dp:title>
- <xsl:copy-of select="$browserTitle"/>
- </dp:title>
- <dp:description>
- <xts:string id="IDS_SELECT_PRINTER_INTRO"/>
- </dp:description>
- </dp:header>
- <lyt:layout style="1" border="no">
- <lyt:section>
- <utml:radio-group name="printeritem">
- <cf:main-pager-section form="pform">
- <cf:param name="item-path">cm:queryResponse/cm:queryReply[2]/*</cf:param>
- <cf:param name="target">concat(concat($app,'/'),$mname)</cf:param>
- <cf:param name="lines-per-page">
- <xsl:value-of select="$lines"/>
- </cf:param>
- <cf:param name="rows">
- <cp:tableHeader>
- <cp:columnHeader width="16"/>
- <cp:columnHeader width="20"/>
- <cp:columnHeader width="120">
- <xts:string id="IDS_NAME"/>
- </cp:columnHeader>
- <cp:columnHeader width="120">
- <xts:string id="IDS_PRINTER_ADDRESS"/>
- </cp:columnHeader>
- <cp:columnHeader width="120">
- <xts:string id="IDS_PRINTER_MODEL"/>
- </cp:columnHeader>
- <cp:columnHeader width="100%">
- <xts:string id="IDS_PRINTER_LOCATION"/>
- </cp:columnHeader>
- </cp:tableHeader>
- <cp:tableContent>
- <cp:columnContent>
- <utml:input type="radio" name="printeritem" onclick="radioState(this, '{xtsext:javascriptencode(string(cm:printerAddress))}', '{xtsext:javascriptencode(string(cm:defaultName))}')">
- <xsl:attribute name="aria-label"><xts:string id="IDS_SELECTION_FOR_PAGER_ITEM" encode="html"><xts:param name="pagerItemName"><xsl:value-of select="cm:defaultName"/></xts:param></xts:string></xsl:attribute>
- <utml:value>
- <xsl:value-of select="cm:searchPath"/>
- </utml:value>
- </utml:input>
- </cp:columnContent>
- <cp:columnContent>
- <xsl:call-template name="gen-icon">
- <xsl:with-param name="hiddenObject" select="cm:hidden"/>
- </xsl:call-template>
- </cp:columnContent>
- <cp:columnContent>
- <xsl:value-of select="xtsext:enforceBTD(cm:defaultName, $baseTextDirection, $productLocale, boolean($isBidiEnabled='true'))"/>
- </cp:columnContent>
- <cp:columnContent>
- <xsl:value-of select="cm:printerAddress"/>
- </cp:columnContent>
- <cp:columnContent>
- <xsl:choose>
- <xsl:when test="cm:modelName != ''">
- <xsl:value-of select="cm:modelName"/>
- </xsl:when>
- <xsl:otherwise> </xsl:otherwise>
- </xsl:choose>
- </cp:columnContent>
- <cp:columnContent>
- <xsl:choose>
- <xsl:when test="cm:location!= ''">
- <xsl:value-of select="cm:location"/>
- </xsl:when>
- <xsl:otherwise> </xsl:otherwise>
- </xsl:choose>
- </cp:columnContent>
- </cp:tableContent>
- <!-- Show the "New Printer" option -->
- <cp:action>
- <xsl:if test="$has_write_permission">
- <utml:a utml:align="right">
- <utml:href>
- <xsl:text/>javascript:doNewPrinter()<xsl:text/>
- </utml:href>
- <xsl:text/><xts:string id="IDS_NEW_PRINTER"/><xsl:text/>
- </utml:a>
- <!-- Insert form variables to implement the "new printer" function -->
- <utml:input type="hidden" name="x_ifrmcmd" value=""/>
- <utml:input type="hidden" name="x_path" value=""/>
- <utml:input type="hidden" name="x_return" value=""/>
- <utml:input type="hidden" name="x_p_defaultName" value=""/>
- <utml:input type="hidden" name="x_p_defaultScreenTip" value=""/>
- <utml:input type="hidden" name="x_new_class" value=""/>
- <utml:input type="hidden" name="x_p_defaultDescription" value=""/>
- <utml:input type="hidden" name="x_p_printerAddress" value=""/>
- <utml:input type="hidden" name="x_p_modelName" value=""/>
- <utml:input type="hidden" name="x_p_location" value=""/>
- </xsl:if>
- </cp:action>
- </cf:param>
- </cf:main-pager-section>
- </utml:radio-group>
- </lyt:section>
- </lyt:layout>
- <!-- ===============================================================
- F o o t e r
- ================================================================= -->
- <dp:footer>
- <df:button df:id="IDS_OK" utml:validate="true" df:style="stack-down-save"/>
- <df:button df:id="IDS_CANCEL" df:style="stack-down"/>
- </dp:footer>
- <utml:input type="hidden" name="m_return" value=""/>
- <utml:input type="hidden" name="select_printerAddress" utml:update="false">
- <xsl:attribute name="value"><xsl:value-of select="key('env-param', 'm_ro_printerAddress')"/></xsl:attribute>
- </utml:input>
- <utml:input type="hidden" name="select_printerName" utml:update="false">
- <xsl:attribute name="value"><xsl:value-of select="/root/cm:queryResponse/cm:queryReply[2]/cm:printer[cm:printerAddress=key('env-param', 'm_ro_printerAddress')]/cm:defaultName"/></xsl:attribute>
- </utml:input>
- </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>
|