123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415 |
- <?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).
- -->
- <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:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/"
- 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:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
- xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
- xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
- xmlns:out="dummy-uri"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:mvc="http://developer.cognos.com/schemas/xts/mvc">
-
- <xsl:output method="xml" encoding="UTF-8" indent="no"/>
- <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
-
- <xsl:template match="mvc:launchable">
- <xsl:variable name="mode" select="@mode"/>
-
- <!-- starting folder -->
- <out:variable name="startingFolder">
- <out:choose>
- <out:when test="string(/root/env/param[@name='so.searchPath2']) != ''">
- <out:value-of select="/root/env/param[@name='so.searchPath2']"/>
- </out:when>
- <out:when test="string(/root/env/param[@name='m_p_RCRstartingFolder']) != ''">
- <out:value-of select="/root/env/param[@name='m_p_RCRstartingFolder']"/>
- </out:when>
- <out:when test="/root/*[local-name()='specification']/*[local-name()='param'][@name='startingFolder']">
- <out:value-of select="/root/*[local-name()='specification']/*[local-name()='param'][@name='startingFolder']"/>
- </out:when>
- </out:choose>
- </out:variable>
-
- <script language="javascript">
- var startingFolder = "<out:value-of select="xtsext:javascriptencode($startingFolder)"/>";
-
- function browse() {
- var f = document.createElement("form");
- f.setAttribute("name", "browseForm");
- f.setAttribute("action", "<out:value-of select="xtsext:javascriptencode($mvc-remote-gateway)"/>");
- f.setAttribute("method", "POST");
-
- var paramArray = {
- "b_action" : "xts.run",
- "m" : "portal/select/select.xts",
- "so.return.gateway" : "<out:value-of select="xtsext:javascriptencode(string(/root/configProps/param[@name='cps']/property[@name='gateway']))"/>",
- "so.return.m" : "<out:value-of select="concat($app, '/', $mname)"/>",
- "so.select" : "remote_content",
- "so.defaultLocation" : document.pform.m_p_RCRstartingFolder.value
- };
-
- for (j in paramArray) {
- var input = document.createElement("input");
- input.setAttribute("type", "hidden");
- input.setAttribute("name", j);
- input.setAttribute("value", paramArray[j]);
- f.appendChild(input);
- }
-
- var packedEnv = document.createElement("input");
- packedEnv.setAttribute("type", "hidden");
- packedEnv.setAttribute("name", "packed-remoteBrowseEnv");
- packedEnv.setAttribute("value", '<out:value-of select="xtsext:javascriptencode(/root/packed-remoteBrowseEnv)"/>');
- f.appendChild(packedEnv);
-
- document.body.appendChild(f);
- f.submit();
-
- document.body.removeChild(f);
- f = null;
- }
-
- function validate() {
- if (startingFolder == '') {
- alert("<xts:string id="IDS_PROP_ERR_MVC_NO_STARTINGFOLDER" encode="javascript"/>");
- return false;
- }
- return true;
- }
- </script>
-
- <out:variable name="launchableType">
- <out:choose>
- <out:when test="/root/env/param[@name='m_p_launchableType'] != ''">
- <out:value-of select="/root/env/param[@name='m_p_launchableType']"/>
- </out:when>
- <xsl:if test="$mode = 'properties'">
- <out:when test="$obj/cm:launchableType">
- <out:value-of select="$obj/cm:launchableType"/>
- </out:when>
- </xsl:if>
- <out:otherwise>
- <out:text/>application/vnd.ibm.cognos.instance<out:text/>
- </out:otherwise>
- </out:choose>
- </out:variable>
-
- <dp:description>
- <xts:string id="IDS_MVC_LAUNCHABLE_INTRO"/>
- </dp:description>
-
- <lyt:layout style="1">
- <lyt:section>
-
- </lyt:section>
- <lyt:section>
- <utml:input name="m_p_launchableType" value="application/vnd.ibm.cognos.instance" type="hidden"/>
-
- <dp:list>
- <dp:section>
- <dp:label><xts:string id="IDS_MVC_LAUNCHABLE_STARTINGFOLDER"/></dp:label>
- </dp:section>
- <dp:section wrap="wrap">
- <div>
- <out:choose>
- <out:when test="$startingFolder != ''">
- <span><out:value-of select="$startingFolder"/></span>
- </out:when>
- <out:otherwise>
- <dp:inactiveText><i><xts:string id="IDS_NONE"/></i>  </dp:inactiveText>
- </out:otherwise>
- </out:choose>
-
- <input type="hidden" name="m_p_RCRstartingFolder" value="{'{$startingFolder}'}"/>
- </div>
- </dp:section>
- <dp:section>
- <!-- Browse button to select a starting folder -->
- <out:if test="not($readOnly)">
- <a href="javascript:browse();">
- <xts:string id="IDS_MVC_LAUNCHABLE_STARTINGFOLDER_BROWSE"/>
- </a>
- </out:if>
- </dp:section>
- </dp:list>
- </lyt:section>
- </lyt:layout>
- </xsl:template>
-
- <!-- MVC - template to render the UI to prompt user to link to their remote My Folder contents -->
- <xsl:template match="mvc:remotePersonalRCRCreation">
- <div id="id_mvcPersonalRCR" style="display:none;position:absolute;z-index:33" height="0" width="0">
- <out:attribute name="onclick">
- <out:choose>
- <out:when test="$browser = 'ie'">event.cancelBubble='true';</out:when>
- <out:otherwise>event.stopPropagation();</out:otherwise>
- </out:choose>
- </out:attribute>
- <table border="0" width="1px" cellpadding="0" cellspacing="0">
- <tr>
- <td>
- <table border="0" width="100%" cellpadding="0" cellspacing="0" class="dialogHeader">
- <tr>
- <td width="100%" valign="middle">
- <span class="dialogHeaderTitle"><xts:string id="IDS_MVC_CONTENT_REFERENCE_REMOTEMYFOLDER_NAME"/></span>
- </td>
- <td valign="middle" class="dialogHeaderLink">
- <a class="dialogHeaderLinkColor" href="javascript:help()" onmouseover="window.status='';return true;" onmouseout="window.status='';return true;"><xts:string id="IDS_HELP"/></a>
- </td>
- <td valign="middle" style="padding-right:3px;">
- <a id="IDS_CLOSE" href="#" onclick="javascript:mvcClosePersonalRCRDialog();" onmouseover="window.status='';return true;" onmouseout="window.status='';return true;">
- <img height="16" width="16" border="0" src="{'{$skin_images}'}close.gif" class="dialogClose" onmouseover="this.className = 'dialogCloseOver'" onmouseout="this.className = 'dialogClose'" onmouseup="this.className = 'dialogClose'" title="Close"/>
- </a>
- </td>
- </tr>
- </table>
- <table border="0" width="100%" cellpadding="0" cellspacing="0" class="dialogWindowPopup">
- <tr>
- <td colspan="2" class="body_dialog_modal" align="left">
- <table border="0" cellpadding="0" cellspacing="0" width="100%">
- <tr>
- <td height="10" width="100%">
- <img alt="" title="" height="10" width="1" src="{'{$webcontent}'}/images/space.gif"/>
- </td>
- </tr>
- </table>
- <table border="0" cellspacing="0" cellpadding="3" width="100%">
- <tr>
- <td height="1" width="1">
- <img alt="" title="" width="1" height="1" src="{'{$webcontent}'}/images/space.gif"/>
- </td>
- <td width="100%">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td class="formText"><xts:string id="IDS_MVC_CONTENT_REFERENCE_REMOTEMYFOLDER_DESC"/></td>
- </tr>
- <tr>
- <td class="formText"> </td>
- </tr>
- <tr>
- <td class="formText">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td class="formLabel"><xts:string id="IDS_NEW_NAME"/></td>
- </tr>
- <tr>
- <td class="formText">
- <script language="javascript"/>
- <form name="mvcForm">
- <input type="text" name="mvc_name" value="" size="70" maxlength="256">
- <out:attribute name="onkeypress">
- <out:text/>if (event.keyCode == 13) {return mvcCreatePersonalRCREntry();} else if (event.keyCode == 27) {mvcClosePersonalRCRDialog(); return false;}<out:text/>
- </out:attribute>
- </input>
- </form>
- </td>
- </tr>
- <tr>
- <td>
- <img alt="" title="" height="5" width="1" src="{'{$webcontent}'}/images/space.gif"/>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <table width="100%" border="0" cellpadding="0" cellspacing="0" class="dialogButtonBar">
- <tr>
- <td width="2" valign="middle">
- <img alt="" title="" width="2" src="{'{$webcontent}'}/images/space.gif"/>
- </td>
- <td valign="middle">
- <table border="0" cellpadding="1" cellspacing="0">
- <tr>
- <td>
- <table cellpadding="0" cellspacing="0" onmouseover="this.className = 'commandButtonOver'" onmouseout="this.className = 'commandButton'" onmousedown="this.className = 'commandButtonDown'" class="commandButton" style="padding-right:10px; padding-left:10px; padding-top:2px; padding-bottom:3px;">
- <tr>
- <td valign="middle" align="center" id="btnAnchorWide">
- <a id="IDS_OK" href="#" onclick="return mvcCreatePersonalRCREntry();" onmouseover="window.status='';return true;" onmouseout="window.status='';return true;"><xts:string id="IDS_OK"/></a>
- </td>
- </tr>
- </table>
- </td>
- <td>
- <img alt="" title="" height="1" width="10" src="{'{$webcontent}'}/images/space.gif"/>
- </td>
- <td>
- <table cellpadding="0" cellspacing="0" onmouseover="this.className = 'commandButtonOver'" onmouseout="this.className = 'commandButton'" onmousedown="this.className = 'commandButtonDown'" class="commandButton" style="padding-right:10px; padding-left:10px; padding-top:2px; padding-bottom:3px;">
- <tr>
- <td valign="middle" align="center" id="btnAnchor">
- <a id="IDS_CANCEL" href="#" onclick="javascript:mvcCancelPersonalRCRDialog();" onmouseover="window.status='';return true;" onmouseout="window.status='';return true;"><xts:string id="IDS_CANCEL"/></a>
- </td>
- </tr>
- </table>
- </td>
- <td>
- <img alt="" title="" height="1" width="10" src="{'{$webcontent}'}/images/space.gif"/>
- </td>
- </tr>
- </table>
- </td>
- <td width="100%"></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </div>
-
- <script language="javascript">
- function getPersonalRCRContainer() {
- return document.getElementById('id_mvcPersonalRCR');
- }
-
- function mvcCancelPersonalRCRDialog() {
- mvcClosePersonalRCRDialog();
- }
-
- function mvcClosePersonalRCRDialog() {
- getPersonalRCRContainer().style.display = "none";
- }
-
- function mvcSetFocus() {
- document.mvcForm.mvc_name.focus();
- }
-
- function validate() {
- if (document.mvcForm.mvc_name.value == '') {
- <out:variable name="errmsg">
- <out:variable name="label"><xts:string id="IDS_NEW_NAME" encode="javascript"/></out:variable>
- <xts:string id="IDS_ERR_MANDATORY" encode="javascript">
- <xts:param name="field"><out:value-of select="$label"/></xts:param>
- </xts:string>
- </out:variable>
- alert("<out:value-of select="$errmsg"/>");
- mvcSetFocus();
- return false;
- }
- return true;
- }
-
- function mvcCreatePersonalRCREntry() {
- if (validate()) {
- var cmdForm = document.<out:value-of select="$cmd-form"/>;
- cmdForm.m.value = "<out:value-of select="$app"/>/submit.xts";
- cmdForm.ifrmcmd.value = "create";
- cmdForm.m_obj.value = "~/folder";
- cmdForm.m_class.value = "launchable";
- cmdForm.backURL.value = "<out:value-of select="xtsext:javascriptencode(string($back-url))"/>";
-
- cmdForm.m_new_class.value = "launchable";
- var input = document.createElement("input");
- input.setAttribute("type", "hidden");
- input.setAttribute("name", "m_p_RCRstartingFolder");
- input.setAttribute("value", "~/folder");
- cmdForm.appendChild(input);
-
- input = document.createElement("input");
- input.setAttribute("type", "hidden");
- input.setAttribute("name", "m_p_launchableType");
- input.setAttribute("value", "application/vnd.ibm.cognos.instance");
- cmdForm.appendChild(input);
-
- input = document.createElement("input");
- input.setAttribute("type", "hidden");
- input.setAttribute("name", "m_p_defaultName");
- input.setAttribute("value", document.mvcForm.mvc_name.value);
- cmdForm.appendChild(input);
- cmdForm.submit();
- }
-
- return false;
- }
-
- function mvcShowPersonalRCRDialog() {
- var div = getPersonalRCRContainer();
- if (div != null) {
- div.style.display = "";
- mvcResizePersonalRCRDialog();
- mvcSetFocus();
- }
- }
-
- function mvcResizePersonalRCRDialog() {
- var div = getPersonalRCRContainer();
- div.style.top = (document.body.clientHeight - div.offsetHeight) * 0.35;
- div.style.left = (document.body.clientWidth - div.offsetWidth) / 2;
- }
-
- <!-- Register to close the dialog -->
- if (document.addEventListener) {
- document.addEventListener("click", mvcClosePersonalRCRDialog, false);
- } else if (document.attachEvent) {
- document.attachEvent("onclick", mvcClosePersonalRCRDialog);
- }
-
- <!-- Register to resize the dialog -->
- if (document.addEventListener) {
- window.addEventListener("resize", mvcResizePersonalRCRDialog, false);
- } else if (document.attachEvent) {
- window.attachEvent("onresize", mvcResizePersonalRCRDialog);
- }
- </script>
- </xsl:template>
-
- <xsl:template match="mvc:build-specification-xml">
- <out:template name="build-specification-xml">
- <out:param name="gateway" select="''"/>
- <out:param name="webcontent" select="''"/>
- <out:param name="startingFolder" select="''"/>
-
- <out:variable name="version" select="'1.0'"/>
- <out:variable name="specification">
- <specification version="{'{$version}'}">
- <param name="gateway"><out:value-of select="$gateway"/></param>
- <param name="webcontent"><out:value-of select="$webcontent"/></param>
- <param name="startingFolder"><out:value-of select="$startingFolder"/></param>
- </specification>
- </out:variable>
-
- <out:variable name="specification-encoded">
- <out:call-template name="serialize-xml">
- <out:with-param name="node-set" select="$specification"/>
- </out:call-template>
- </out:variable>
-
- <out:value-of select="$specification-encoded"/>
- </out:template>
- </xsl:template>
-
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
|