123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2011
- 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).
- -->
- <!--
- ===============================================================================================
- USED BY FM ONLY
- ===============================================================================================
- -->
- <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: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">/portal/add_entries.xts</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">/directory</req-params:param>
- <req-params:param name="showUsers">true</req-params:param>
- <req-params:param name="addEntriesUI"><xsl:value-of select="'members'"/></req-params:param>
- <req-params:param name="allowDuplicates"><xsl:value-of select="'false'"/></req-params:param>
- <req-params:param name="typeDialog">true</req-params:param>
- <req-params:param name="fromFM">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: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>
-
- <!--
- ================================================================================
- render_page - send the results back to FM
- ================================================================================
- -->
- <xts:block id="render_page" dependency="processResponse" 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"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- 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:cm="http://developer.cognos.com/schemas/xts-cm/1/">
-
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/presentation.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/xts-cm/1/"
- exclude-result-prefixes="xsl cm xtsext">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
- <pf:variables/>
-
- <xsl:template match="/root">
- <xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text>
- <html>
- <head>
- <title>Loading Access Information</title>
- <script language="JavaScript">
- // the entries array is generated by the
- // server script, and populated with the
- // entries selected by he user in the CM wizard
- //
- function Entry()
- {
- var path;
- var type;
- var names;
- var userName;
- var displayPath;
- }
- function MultilingualName()
- {
- var lang;
- var name;
- }
- var g_vEntries = new Array();
- <xsl:for-each select="/root/newEntries/*">
- <xsl:variable name="fullPath">
- <cf:do-the-path-link>
- <cf:param name="familytree">*[local-name()='ancestors']</cf:param>
- <cf:param name="familymember">*[local-name()='defaultName']</cf:param>
- <cf:param name="onlyAncestors">true</cf:param>
- </cf:do-the-path-link>
- </xsl:variable>
-
- <xsl:variable name="i" select="position()-1"/>
- g_vEntries[<xsl:value-of select="$i"/>] = new Entry();
- <xsl:choose>
- <xsl:when test="key('env-param','storeID')='true'">
- g_vEntries[<xsl:value-of select="$i"/>].path = '<xsl:value-of select="xtsext:javascriptencode(string(*[local-name()='storeID']))"/>';
- </xsl:when>
- <xsl:otherwise>
- g_vEntries[<xsl:value-of select="$i"/>].path = '<xsl:value-of select="xtsext:javascriptencode(string(*[local-name()='searchPath']))"/>';
- </xsl:otherwise>
- </xsl:choose>
- g_vEntries[<xsl:value-of select="$i"/>].type = '<xsl:value-of select="xtsext:javascriptencode(string(*[local-name()='objectClass']))"/>';
- g_vEntries[<xsl:value-of select="$i"/>].userName = '<xsl:value-of select="xtsext:javascriptencode(string(*[local-name()='userName']))"/>';
- g_vEntries[<xsl:value-of select="$i"/>].displayPath = '<xsl:value-of select="xtsext:javascriptencode(string($fullPath))"/>';
- g_vEntries[<xsl:value-of select="$i"/>].names = new Array();
- g_vEntries[<xsl:value-of select="$i"/>].names[0] = new MultilingualName();
- g_vEntries[<xsl:value-of select="$i"/>].names[0].lang = '<xsl:value-of select="xtsext:javascriptencode(string($contentLocale))"/>';
- g_vEntries[<xsl:value-of select="$i"/>].names[0].name = '<xsl:value-of select="xtsext:javascriptencode(string(*[local-name()='defaultName']))"/>';
- </xsl:for-each>
- <![CDATA[
- // function that passes the information from the g_vEntries array
- // to the container application
- function OnPageLoaded()
- {
- var ext = window.external;
- if (!ext || (ext.Signature != "BMT-CMAccessDlg" && ext.Signatue != "TrCMAccessDlg"))
- return;
- for (var i = 0; i < g_vEntries.length; i++)
- {
- var e = g_vEntries[i];
- var nExtIndex = ext.AddEntry(e.path, e.type);
- if (-1 != nExtIndex)
- {
- for (var j = 0; j < e.names.length; j++)
- {
- ext.AddEntryName(nExtIndex, e.names[j].lang, e.names[j].name, e.userName, e.displayPath);
- }
- }
- }
- ext.OnClose(0);
- }
- ]]>
- </script>
- </head>
- <body onload="OnPageLoaded();" style="background-color:buttonface;border:0 solid #FFFFFF;overflow:auto;">
- <table width="100%" height="100%">
- <tr height="100%">
- <td align="center">
- <table>
- <tr>
- <td>
- <span style="font-family:Verdana,Tahoma,Arial;font-size:8pt;font-weight:normal;">
- Loading Access Information...
- </span>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </body>
- </html>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
-
- <!-- <xts:block id="debug" type="exec" mode="output" processor="XSLT" mimeType="text/html" dependency="render_page processResponse">
- <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>
|