123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: AGS
- (C) Copyright IBM Corp. 2005, 2009
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml,messages/AGS.xml,messages/portalRL.xml" requiredCapability="canUseEventStudio">
- <!--
- ================================================================================
- formlogic init
- ================================================================================
- -->
- <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt"/>
- <!--
- ================================================================================
- decode
- ================================================================================
- -->
- <xts:block id="decode" processor="XSLT" type="exec" mode="interpret" dependency="formlogic_init">
- <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xsl:choose>
- <xsl:when test="/root/env/param[@name = 'agent_definition_blob']">
- <!-- decode the agent items -->
- <xts:append select="/root">
- <xsl:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap_settemplatename_decodeagentdefinition_settemplateid_presave001', string( /root/env/param[@name = 'agent_definition_blob'])), true() )" disable-output-escaping="yes"/>
- </xts:append>
- <!-- get rid of the blob for the time being -->
- <xts:delete select="/root/env/param[@name = 'agent_definition_blob']"/>
- </xsl:when>
- </xsl:choose>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ================================================================================
- Process
- ================================================================================
- -->
- <xts:block id="process" processor="XSLT" type="exec" mode="interpret" dependency="decode" nodelist="env,agent_definition">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" exclude-result-prefixes="xsl pf xtsext xos">
- <xsl:template match="/">
- <xts:sequence>
- <xsl:if test="/root/env/param[@name='removeNList'] = '1'">
- <xts:delete select="/root/agent_definition/notificationList/item"/>
- <xts:append select="/root/agent_definition">
- <removeNotificationList/>
- </xts:append>
- </xsl:if>
- <xsl:if test="/root/env/param[@name='changed_allowNotification']">
- <!-- If changed then we check to see if alloNotification is there and we use it to get the value-->
- <xts:delete select="/root/agent_definition/allowNotification"/>
- <xts:append select="/root/agent_definition">
- <allowNotification>
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='allowNotification'='1']">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </allowNotification>
- </xts:append>
- </xsl:if>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ================================================================================
- Get the notificationList member names
- Creates a batch request to CM to retrieve the defaultName property for the searchpathids in /root/agent_definition/notificationList/item.
- Only query those that are to be shown in the pager
- ================================================================================
- -->
- <xts:block id="getlist" processor="XSLT" type="exec" mode="interpret" dependency="process">
- <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:cm="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- exclude-result-prefixes="cm">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
- <xsl:variable name="userPrefs" select="/root/session/param"/>
- <xsl:variable name="userPrefsDefault" select="/root/system/param[@name='defaultPortalPreferences']"/>
- <!-- the max items to be shown in the pager -->
- <xsl:variable name="maxObjects">
- <xsl:choose>
- <xsl:when test="string(/root/env/param[@name = 'm_pagerto']) !='' and string(/root/env/param[@name = 'm_pagerfrom']) !=''">
- <xsl:value-of select="(/root/env/param[@name = 'm_pagerto'] - root/env/param[@name = 'm_pagerfrom']) + 1"/>
- </xsl:when>
- <xsl:when test="$userPrefs[@name='linesPerPage']!=''">
- <xsl:value-of select="$userPrefs[@name='linesPerPage']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$userPrefsDefault/pref[@name='lines']"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!--- the number of items to be skipped, e.g. if this value is 5, then we start with the item at position 5 and end with the item at position 5+maxObjects, if zero we pass all items to the pager-->
- <xsl:variable name="skipObjects">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name = 'm_pagerfrom'] and /root/env/param[@name = 'm_pagerfrom']!=''">
- <xsl:value-of select="(/root/env/param[@name = 'm_pagerfrom'])-1"/>
- </xsl:when>
- <xsl:when test="key('env-param','m_section')!=''">
- <xsl:choose>
- <xsl:when test="key('env-param','m_section')!='-1'">
- <xsl:value-of select="((key('env-param','m_section')) -1)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="count(/root/agent_definition/notificationList/item) - ($maxObjects)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:template match="/">
- <xts:sequence>
- <xsl:call-template name="createPagerItem">
- <xsl:with-param name="max" select="$maxObjects+1"/>
- <xsl:with-param name="skip" select="$skipObjects"/>
- </xsl:call-template>
- </xts:sequence>
- </xsl:template>
- <xsl:template name="createPagerItem">
- <xsl:param name="pos" select="1"/>
- <xsl:param name="max" select="1"/>
- <xsl:param name="skip" select="0"/>
- <xsl:variable name="item">
- <xsl:value-of select="/root/agent_definition/notificationList/item[$pos]"/>
- </xsl:variable>
- <xsl:if test="$max > 0 and $item!=''">
- <xsl:if test="$pos > $skip">
- <xts:append>
- <pagerItem>
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <send:request provider="cm" requester="AGS:notificationList">
- <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>
- <cm:search>
- <xsl:value-of select="$item"/>
- </cm:search>
- <cm:properties>
- <cm:property name="defaultName"/>
- </cm:properties>
- </cm:query>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- <position type="cm:nonNegativeIntegerProp"><xsl:value-of select="($pos)-1"/></position>
- </pagerItem>
- </xts:append>
- </xsl:if>
- <xsl:variable name="newMax">
- <xsl:choose>
- <xsl:when test="$pos > $skip"><xsl:value-of select="$max - 1"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="$max"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="createPagerItem">
- <xsl:with-param name="pos" select="$pos+1"/>
- <xsl:with-param name="max" select="$newMax"/>
- <xsl:with-param name="skip" select="$skip"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!--
- ===================================================================================================================================
- updatePagedItems - the pager needs the position of each item in order to calculate where it is in the virtual list. Update each one by moving the <position/> element into each queryResult
- ===================================================================================================================================
- -->
- <xts:block id="updatePagedItems" processor="XSLT" type="exec" mode="interpret" dependency="getlist" nodelist="env,pagerItem">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
- exclude-result-prefixes="xsl xtsext xsi cm">
- <xsl:template match="/">
- <xts:sequence>
- <xsl:for-each select="/root/pagerItem/*[local-name()='queryResponse']/returns/item">
- <xsl:variable name="pos"><xsl:value-of select="position()"/></xsl:variable>
- <xts:append select="/root/pagerItem/*[local-name()='queryResponse']/returns/item[{position()}]/queryResult/item">
- <xsl:copy-of select="../../../position"/>
- </xts:append>
- <xts:delete select="/root/pagerItem[position()]/position']"/>
- </xsl:for-each>
- <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>
-
- <!--================================================================================
- encode the agent items again
- ================================================================================
- -->
- <xts:block id="encode_agent_definition" dependency="updatePagedItems" processor="XSLT" type="exec">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="pf xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:serialize-xml/>
- <pf:variables/>
- <xsl:template match="/">
- <xts:sequence>
- <xsl:variable name="markup">
- <xsl:call-template name="serialize-xml">
- <xsl:with-param name="node-set" select="/root/agent_definition"/>
- </xsl:call-template>
- </xsl:variable>
- <xts:append select="/root/env">
- <param name="agent_definition_blob">
- <xsl:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport, '_settemplatename_encodeagentdefinition_settemplateid_seqagenttasks002'), xtsext:web64encode( string( $markup ), true()))"/>
- </param>
- </xts:append>
- <!-- get rid of the set variables -->
- <xts:delete select="/root/env/param[@name='changed_allowNotification']"/>
- <xts:delete select="/root/env/param[@name='allowNotification']"/>
- <xts:delete select="/root/env/param[@name='removeNList']"/>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ================================================================================
- Format the output
- ================================================================================
- -->
- <xts:block id="format" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="encode_agent_definition">
- <!-- portal specific information -->
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <!-- Dialog specific logicsheets -->
- <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/main/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/main/presentation.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
- <!-- Generic logicsheets -->
- <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
- <!-- apply the form logic -->
- <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:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf"
- 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:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
- xmlns:dc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/confirm/1/"
- xmlns:st="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/specializetabs/"
- 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:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
- xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:rdb="http://developer.cognos.com/schemas/xts/rdb"
- exclude-result-prefixes="xsl cm cml df dp pf bus dc utml xts xtsext lyt st cf cp mf">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
- <mf:variables stateParams="m_section m_pagerfrom m_pagerto"/>
- <xsl:variable name="mname" select="'notificationList.xts'"/>
- <xsl:variable name="cm-class">account</xsl:variable>
- <xsl:template match="/root">
- <xsl:variable name="browserTitle">
- <xts:string id="DIALOG_NOTIFICATION_TITLE"/>
- </xsl:variable>
- <dp:page longTitle="$browserTitle">
- <link href="{$skin_root}/ags/ags.css" type="text/css" rel="stylesheet"/>
- <dp:meta/>
- <dp:script>
- <pf:help context="ug_cr_as_ag_mng_ntf_lst" eventStudio="true"/>
- </dp:script>
- <utml:form name="pform" method="post" action="{$gateway}">
- <utml:input type="hidden" name="s_nl_pager" id="s_nl_pager"/>
- <utml:input type="hidden" name="removeNList" id="removeNList" value="0"/>
- <utml:input type="hidden" name="agentItemOp" id="agentItemOp" size="30" value="none"/>
- <utml:input type="hidden" name="hid" id="hid" utml:update="false" value="ug_cr_as_ag_mng_ntf_lst"/>
- <dp:header help="true">
- <dp:title>
- <xts:string id="DIALOG_NOTIFICATION_TITLE"/>
- </dp:title>
- <dp:description>
- <xts:string id="DIALOG_NOTIFICATION_DESC"/>
- </dp:description>
- <dp:close>
- <a href="#" onclick="doCancel();">
- <dp:closeMarker/>
- </a>
- </dp:close>
- </dp:header>
- <!-- ================================================================ -->
- <!-- B O D Y -->
- <!-- ================================================================ -->
- <!-- do the body -->
- <body class="reportBody">
- <lyt:layout style="1">
- <lyt:section valign="top">
- <dp:choice title="DIALOG_NOTIFICATION_SUBSCRIPTION" noSpace="true">
- <dp:section1 type="hint">
- <xts:string id="DIALOG_NOTIFICATION_SUBSCRIPTION_DESC"/>
- </dp:section1>
- </dp:choice>
- <!--Select this option to allow users to add their email address to the alert list for this agent.-->
- <dp:choice>
- <dp:section1>
- <utml:input type="checkbox" name="allowNotification" id="allowNotification" onclick="allowNotificationClicked();" utml:track="true" utml:default-condition="/root/agent_definition/allowNotification = 'true'"/>
- </dp:section1>
- <dp:section2>
- <xts:string id="DIALOG_NOTIFICATION_ALLOW_SUBSCRIBE"/>
- </dp:section2>
- </dp:choice>
- <table border="0" cellspacing="0" cellpadding="0" width="100%" name="slist">
- <tr>
- <td>
- <cf:main-pager-section width="100%" virtualPage="true" form="pform">
- <cf:param name="target">concat('/ags/',$mname)</cf:param>
- <cf:param name="item-path">/root/pagerItem//queryResult/item</cf:param>
- <cf:param name="lines-per-page">
- <xsl:value-of select="key('session-param', 'linesPerPage')"/>
- </cf:param>
- <cf:param name="label"><xts:string id="DIALOG_NOTIFICATION_LIST_LABEL"/></cf:param>
- <cf:param name="rows">
- <cp:tableHeader session-name="s_nl_pager" sort_track_type="page">
- <cp:columnHeader width="20"/>
- <cp:columnHeader width="16">
- <img align="absmiddle" hspace="4" src="{$skin_images}path.gif"/>
- </cp:columnHeader>
- <cp:columnHeader width="100%">
- <xts:string id="IDS_PERS_TAB_PERSONAL_NAME_HEADER"/>
- </cp:columnHeader>
- </cp:tableHeader>
- <cp:tableContent>
- <cp:columnContent>
- <xsl:call-template name="gen-icon">
- <xsl:with-param name="class">account</xsl:with-param>
- </xsl:call-template>
- </cp:columnContent>
- <cp:columnContent>
- <img border="0" align="absmiddle" hspace="4" src="{$skin_images}path.gif"/>
- </cp:columnContent>
- <cp:columnContent>
- <xsl:value-of select="defaultName"/>
- </cp:columnContent>
- </cp:tableContent>
- </cf:param>
- </cf:main-pager-section>
- </td>
- </tr>
- <tr>
- <td width="100%" align="right" class="formLink" nowrap="nowrap" valign="bottom">
- <a href="#" onclick="javascript:resetNList()">
- <xts:string id="DIALOG_NOTIFICATION_RESET"/>
- </a>
- </td>
- </tr>
- </table>
- </lyt:section>
- </lyt:layout>
- </body>
- <dp:footer>
- <df:button df:id="IDS_OK" onclick="doOK();" df:style="href" df:href="#"/>
- <df:button df:id="IDS_CANCEL" df:style="href" df:href="#" onclick="doCancel();"/>
- </dp:footer>
- </utml:form>
- <dp:script>
- <script type="text/javascript" src="../ags/help.js"/>
- <script type="text/javascript">
- var cf = parent.cf;
- function init() {
- cf.showDialogFrame("100%");
- }
- function resetNList()
- {
- document.pform.removeNList.value="1";
- doSubmit('','/ags/notificationList.xts');
- }
- function allowNotificationClicked()
- {
- doSubmit('','/ags/notificationList.xts');
- }
- // function which is called when we ok
- function doOK()
- {
- var msgFrame = cf.getMessageIFrame();
- if (msgFrame != null) {
- var elmnt = msgFrame.document.getElementById("agent_definition_blob");
- if (elmnt == null) {
- elmnt = cf.createHiddenInput(msgFrame.document, "agent_definition_blob", "");
- msgFrame.pform.appendChild(elmnt);
- }
- // SEC_INFO: agent_definition_blob is already encoded
- elmnt.value = '<xsl:value-of select="/root/env/param[@name='agent_definition_blob']"/>';
- }
-
- cf.agentHasChanged(true);
- cf.hideDialogFrame();
- }
- function doSubmit(code,path)
- {
- document.pform.agentItemOp.value = 'notificationList';
- document.pform.ps_nav_op.value = code;
- document.pform.m.value=path;
- document.pform.submit();
- }
- function doCancel() {
- cf.hideDialogFrame();
- }
- </script>
- </dp:script>
- </dp:page>
- </xsl:template>
- <pf:gen-icon/>
- </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"/>
- <xsl:template match="/">
- <dbg:dumpxml select="/root"/>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|