123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: HTS
- (C) Copyright IBM Corp. 2005, 2010
- 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/portalRL.xml">
- <!--
- ===============================================================================================
- initController - The first time this morphlet gets executed, set the controller_state to
- wizard_page1|markup to display the first page of the wizard.
- ===============================================================================================
- -->
- <xts:block id="initController" processor="XSLT" type="exec" condition=".[ not(/root/env/param[@name='controller_state']) ]" mandatory="false">
- <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- exclude-result-prefixes="xsl">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root/env">
- <param name="controller_state">addEntries|navigate</param>
- </xts:append>
- <xts:append select="/root">
- <freshControllerState/>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!-- ======================================================== -->
- <!-- Session Management -->
- <!-- ======================================================== -->
-
- <!-- Reads session-sensitive info from CM -->
- <xts:block processor="XSLT" type="exec" mandatory="false"
- id="refreshSession"
- path="portal/cc/read_session.xml"
- condition=".[
- string(/root/cookies/cookie[@name = 'cc_session']) = ''
- or /root/env/param[@name='m_reload']
- or /root/env/param[@name='m_root'] ]">
-
- <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- </xts:block>
-
- <!-- Update the <session> element for this request. -->
- <xts:block id="buildSession" path="portal/session.xml" dependency="refreshSession" processor="XSLT" type="exec"
- condition=".[
- /root/newSession
- or /root/env/param[@name='ui']
- or /root/env/param[@name='d']
- or /root/env/param[starts-with(@name,'m_s_')]
- or /root/env/param[@name = 'resetSort'] ]"
- mandatory="false"/>
-
- <!-- Save changes to the state info in a cookie -->
- <xts:block mode="interpret" processor="XSLT" type="exec"
- id="setSession"
- path="portal/set_session.xml"
- dependency="buildSession"
- condition=".[/root/updateSession]"
- mandatory="false"/>
- <!--
- ===============================================================================================
- callMorphlet - Calls the appropriate morphlet using the passed in params which will return
- markup to be displayed or the expected results
- ===============================================================================================
- -->
- <xts:block id="callMorphlet" processor="XSLT" type="exec" dependency="initController setSession" condition=".[ /root/env/param[@name='controller_state'] != '' ]" mandatory="false">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:req-params="http://developer.cognos.com/schemas/request/params"
- exclude-result-prefixes="xsl dlgctrl xtsext req-params">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
-
- <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
- <xsl:template match="/">
- <xts:sequence>
- <dlgctrl:XTS2Request>
- <dlgctrl:target>/portal/addEntries/add_entries.xts</dlgctrl:target>
- <dlgctrl:stackName>addEntriesStack</dlgctrl:stackName>
- <req-params:param name="defaultTarget">/myinbox/add_entries_links.xts</req-params:param>
- <req-params:param name="helpWithWebRoot">true</req-params:param>
- <req-params:param name="titlePostfix"><xsl:value-of select="/root/env/param[@name='m_name']"/></req-params:param>
- <req-params:param name="defaultSearchPath">/content</req-params:param>
- <req-params:param name="showUsers">false</req-params:param>
- <req-params:param name="addEntriesUI"><xsl:value-of select="'links'"/></req-params:param>
- <req-params:param name="allowDuplicates"><xsl:value-of select="'false'"/></req-params:param>
- <req-params:param name="typeDialog">false</req-params:param>
- <req-params:param name="allowRootBrowsing">true</req-params:param>
- <req-params:param name="returnProperties">
- <req-params:property name="name"/>
- <req-params:property name="userName"/>
- <req-params:property name="storeID"/>
- <req-params:property name="searchPath"/>
- <req-params:property name="iconURI"/>
- <req-params:property name="type"/>
- </req-params:param>
- </dlgctrl:XTS2Request>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!--
- ===============================================================================================
- processReponse - Process the response from the callMorphlet block and either displays
- the markup or processes the results
- ===============================================================================================
- -->
- <xts:block
- id="processResponse"
- path="/portal/addEntries/logicsheets/process_added_entries.xslt"
- processor="XSLT"
- dependency="callMorphlet"
- type="exec"
- condition=".[ /root/env/param[@name='controller_state'] != '' ]"
- mandatory="false">
- <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- </xts:block>
-
- <xts:block id="createSystemElement" type="exec" processor="XSLT" dependency="processResponse" condition=".[/root/newEntries]" mandatory="false">
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- exclude-result-prefixes="bus xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root">
- <xts:request protocol="FILEREAD" cache="true" faultBlock="requestFault" target="./portal/system.xml"/>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- processReponse - Process the response from the callMorphlet block and either displays
- the markup or processes the results
- ===============================================================================================
- -->
- <xts:block
- id="addIcon"
- processor="XSLT"
- dependency="createSystemElement"
- type="exec"
- mode="interpret"
- condition=".[/root/newEntries]"
- mandatory="false">
- <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xsl:stylesheet version="1.0" xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" 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:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:eut="http://developer.cognos.com/schemas/xts/logicsheets/xslt/emailOptions/logicsheets/" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/" exclude-result-prefixes="xts xsl cm pf xtsext lyt dp df cf cp xos dlgctrl eut utml">
- <xsl:output method="xml" encoding="utf-8" indent="no"/>
- <xsl:key name="business-rules" match="/root/businessRules/*" use="local-name()"/>
- <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
- <xsl:key name="system-param" match="/root/system/param" use="@name"/>
- <pf:variables/>
- <pf:gen-icon/>
- <xsl:template match="/">
- <xsl:for-each select="/root/newEntries/child::*/*[local-name()='objectClass']">
- <xsl:variable name="link"><xsl:value-of select="./.."/></xsl:variable>
- <xsl:variable name="pos"><xsl:value-of select="position()"/></xsl:variable>
- <xsl:variable name="objectClass"><xsl:value-of select="."/></xsl:variable>
- <xts:sequence>
- <xts:append select="/root/newEntries/*[{$pos}]">
- <img>
- <xts:transform name="XMLEncode">
- <!-- generate the img tag with the correct icon -->
- <xsl:call-template name="gen-icon">
- <xsl:with-param name="showAction" select="false()"/>
- <xsl:with-param name="class" select="$objectClass"/>
- </xsl:call-template>
- </xts:transform>
- </img>
- </xts:append>
- </xts:sequence>
- </xsl:for-each>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!--
- ================================================================================
- render_page - send the results back
- ================================================================================
- -->
- <xts:block
- id="render_page"
- path="/myinbox/logicsheets/renderPage.xslt"
- dependency="addIcon"
- mode="output"
- processor="XSLT"
- type="exec"
- mimeType="text/html"
- condition=".[not(/root/env/param[@name='controller_state']) or /root/env/param[@name='controller_state']='']"
- mandatory="false">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
- </xts:block>
-
- <!-- Handle errors which occur when reading the system XML file. Provide default values. -->
- <xts:block id="requestFault" type="fault" processor="XML" nodelist="">
- <system>
- <param name="delimiters" d1="|" d2=":"/>
- <param name="COGNOSHome">b_action=xts.run&m=portal/main.xts</param>
- </system>
- </xts:block>
- </xts:morphlet>
|