123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ASV
- (C) Copyright IBM Corp. 2005, 2015
- 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/subscribe.xml,messages/portal.xml,messages/portalRL.xml" resolverBase="prompting" includeConfig="true">
- <!--
- Normal formlogic predicate
- -->
- <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="logicsheets/formlogic_init.xslt"/>
- <!--
- ================================================================================
- If the CM roots (personal/public) have not been determined (i.e. exist in the session) then get them
- ===============================================================================================
- -->
- <xts:block id="getRootNames" path="portal/cmroots.xml" condition=".[not(/root/session/param[@name = 'e_proot'])]" processor="XSLT" type="exec" mandatory="false">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- </xts:block>
- <!--
- ================================================================================
- Load default root map for CM objects
- ===============================================================================================
- -->
- <xts:block id="getRootMap" type="exec" mode="input" processor="XML" path="/portal/uiExtensions.xml" mandatory="false">
- <xts:logicsheet path="/logicsheets/uiobjects/uiobjects_roots.xslt"/>
- </xts:block>
- <!--
- ===============================================================================================
- Query for the default destination container
- ===============================================================================================
- -->
- <xts:block id="getContent" processor="XSLT" type="exec" dependency="formlogic_init getRootNames getRootMap">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <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:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <!-- most of these have to be redefined -->
- <xsl:variable name="usePath">
- <xsl:choose>
- <xsl:when test="string(/root/env/param[@name='so.searchPath'])!=''">
- <xsl:value-of select="/root/env/param[@name='so.searchPath']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/root/env/param[@name='m_subData_newsitem_path']"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="path">
- <xsl:choose>
- <xsl:when test="$usePath != '' ">
- <xsl:value-of select="$usePath"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat(/root/session/param[@name='e_hp'], '/folder')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xts:sequence>
- <!-- get some new stuff -->
- <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>
- <xsl:value-of select="$path"/>
- </cm:search>
- <cm:properties>
- <cm:property name="defaultName"/>
- <cm:property name="searchPath"/>
- <cm:property name="ancestors"/>
- <cm:property name="permissions"/>
- <cm:property name="storeID"/>
- </cm:properties>
- </cm:query>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:append>
- <xts:delete select="/root/env/param[contains(string(@name),'pagerfrom')]"/>
- <xts:delete select="/root/env/param[contains(string(@name),'pagerto')]"/>
- <xts:delete select="/root/env/param[@name='pageitem']"/>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- genMarkup -
- ===============================================================================================
- -->
- <xts:block id="genMarkup" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="getContent">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/templates.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:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xts="http://developer.cognos.com/schemas/xts/" 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/" xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" exclude-result-prefixes="xsl cf cp pf df dp lyt cm cml utml xts xtsext">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
- <xsl:variable name="mname" select="'conditional_newsitem.xts'"/>
- <xsl:variable name="spacer">
- <img height="10" width="10">
- <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute>
- </img>
- </xsl:variable>
- <xsl:template match="/root">
- <!-- SEC_INFO hasTask is not javascript encoded, it is always a boolean value true|false-->
- <xsl:variable name="hasTask">
- <xsl:choose>
- <xsl:when test="key('env-param','selected_path') != ''">
- <xsl:text>true</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>false</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="title">
- <xts:string id="IDS_CUSTSUB_NEWSOPTIONS_TITILE"/>
- </xsl:variable>
- <xsl:variable name="browserTitle">
- <xts:string id="IDS_CUSTSUB_NEWSOPTIONS_BROWSER_TITLE"/>
- </xsl:variable>
- <xsl:variable name="pageDescription">
- <xts:string id="IDS_CUSTSUB_NEWSOPTIONS_DESC"/>
- </xsl:variable>
- <!-- The object type we are about to create -->
- <xsl:variable name="new-class" select="'folder'"/>
- <xsl:variable name="fullTask">
- <xsl:value-of select="$new-class"/>.es<xsl:text/>
- </xsl:variable>
- <!-- Current destination folder. -->
- <xsl:variable name="usePath">
- <xsl:choose>
- <xsl:when test="string(/root/env/param[@name='so.searchPath'])!=''">
- <xsl:value-of select="/root/env/param[@name='so.searchPath']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="string(/root/env/param[@name='m_subData_newsitem_path'])"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="path">
- <xsl:choose>
- <xsl:when test="$usePath!=''">
- <xsl:if test="$usePath != '/content' ">
- <xsl:choose>
- <xsl:when test="not(starts-with($usePath,'storeID'))">
- <xsl:value-of select="$usePath"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="cm:queryResponse/cm:queryReply[1]/*/cm:searchPath"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat(key('session-param', 'e_hp'), '/folder')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- Determine if we can write to the currently selected folder. -->
- <xsl:variable name="canWrite" select="contains(cm:queryResponse/cm:queryReply[1]/*/cm:permissions, 'write') and contains(cm:queryResponse/cm:queryReply[1]/*/cm:permissions, 'traverse')"/>
- <!-- Determine if the current path points to the personal folder space (We need a session element to make this determination) -->
- <xsl:variable name="isPersonalPath" select="starts-with($path, '~') or ( key('session-param', 'e_hp') and starts-with($path, key('session-param', 'e_hp')) )"/>
- <xsl:variable name="isAdminPath" select="/root/cm:queryResponse/cm:queryReply[1]/*/cm:objectClass = 'adminFolder'"/>
- <!-- If the current path leads to the personal folder space OR the object we are creating does not belong in the main portal content space then do not show the option to place the new entry in "My Folders" -->
- <xsl:variable name="showMyFoldersChoice" select="not($isPersonalPath) and not($isAdminPath)"/>
- <xsl:text disable-output-escaping="yes"><!DOCTYPE html></xsl:text>
- <dp:page>
- <dp:meta>
- <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
- <meta name="Copyright" content="Copyright (C) 2008 Cognos Incorporated. All Rights Reserved."/>
- <meta name="Trademark" content="Cognos and the Cognos logo are trademarks of Cognos Incorporated."/>
- <title>
- <xsl:value-of select="$title"/>
- </title>
- </dp:meta>
- <dp:script>
- <script type="text/javascript">
- function closePopup() {
- if (parent && parent.doClosePopUp)
- parent.doClosePopUp();
- else
- window.close();
- }
- </script>
- <script language="javascript" src="{$webcontent}/{$app}/js/utilities.js"/>
- <!-- Help system -->
- <pf:help context="HID_MY_WATCH_ITEMS"/>
- </dp:script>
- <utml:form name="pform" method="post" action="{$gateway}">
- <input type="hidden" name="ui.backURL" value="{/root/env/param[@name='backURL']}"/>
- <!-- this defines the form command operation to be performed when all the collected properties are submitted... -->
- <utml:input type="hidden" name="ifrmcmd" value="create" utml:update="false"/>
- <utml:input type="hidden" name="so.select" utml:update="false">
- <utml:value>
- <xsl:value-of select="$fullTask"/>
- </utml:value>
- </utml:input>
- <utml:input type="hidden" name="so.return.m" utml:update="false">
- <utml:value>
- <xsl:value-of select="concat('subscribe/', $mname)"/>
- </utml:value>
- </utml:input>
- <utml:input name="so.defaultLocation" type="hidden">
- <xsl:attribute name="value"><xsl:value-of select="$path"/></xsl:attribute>
- </utml:input>
- <dp:header>
- <!-- header titles-->
- <dp:title>
- <xsl:value-of select="$browserTitle"/>
- </dp:title>
- <dp:description>
- <xsl:value-of select="$pageDescription"/>
- </dp:description>
- <dp:close>
- <xsl:choose>
- <xsl:when test="(/root/env/param[@name = 'ps_nav_stack']) and not(/root/env/param[@name = 'ps_nav_stack'] = '') ">
- <utml:a utml:op="stack-down">
- <xsl:attribute name="onClick">javascript:resetPageState()</xsl:attribute>
- <dp:closeMarker/>
- </utml:a>
- </xsl:when>
- <xsl:otherwise>
- <a href="{/root/env/param[@name = 'backURL']}">
- <xsl:attribute name="onClick">javascript:resetPageState()</xsl:attribute>
- <dp:closeMarker/>
- </a>
- </xsl:otherwise>
- </xsl:choose>
- </dp:close>
- </dp:header>
- <lyt:layout style="1">
- <lyt:section>
- <dp:list>
- <dp:section>
- <dp:label>
- <label for="m_subData_newsitem_headline">
- <xts:string id="IDS_CUSTSUB_NEWSOPTIONS_HEADLINE"/>
- </label>
- </dp:label>
- </dp:section>
- <dp:section>
- <utml:textarea id="m_subData_newsitem_headline" name="m_subData_newsitem_headline" style="width:300px; height:50px;overflow:hidden"/>
- </dp:section>
- <dp:section>
- <img height="5" width="1">
- <xsl:attribute name="src"><xsl:value-of select="'{$webcontent}'"/>/images/space.gif</xsl:attribute>
- </img>
- </dp:section>
- </dp:list>
- </lyt:section>
- <lyt:section>
- <dp:list>
- <dp:section>
- <dp:label>
- <label for="m_subData_newsitem_screentip">
- <xts:string id="IDS_CUSTSUB_NEWSOPTIONS_SCREENTIP"/>
- </label>
- </dp:label>
- </dp:section>
- <dp:section>
- <utml:textarea id="m_subData_newsitem_screentip" name="m_subData_newsitem_screentip" style="width:300px; height:50px;overflow:hidden"/>
- </dp:section>
- <dp:section>
- <img height="5" width="1">
- <xsl:attribute name="src"><xsl:value-of select="'{$webcontent}'"/>/images/space.gif</xsl:attribute>
- </img>
- </dp:section>
- </dp:list>
- </lyt:section>
- <lyt:section>
- <dp:list>
- <dp:section>
- <dp:label>
- <label for="m_subData_newsitem_text">
- <xts:string id="IDS_CUSTSUB_NEWSOPTIONS_TEXT"/>
- </label>
- </dp:label>
- </dp:section>
- <dp:section>
- <utml:textarea id="m_subData_newsitem_text" name="m_subData_newsitem_text" style="width:300px; height:50px;overflow:hidden"/>
- </dp:section>
- <dp:section>
- <img height="5" width="1">
- <xsl:attribute name="src"><xsl:value-of select="'{$webcontent}'"/>/images/space.gif</xsl:attribute>
- </img>
- </dp:section>
- </dp:list>
- </lyt:section>
- </lyt:layout>
- <!-- Path / Destination folder -->
- <!-- =============================================================================== -->
- <lyt:layout style="1" joinSection="yes">
- <lyt:section>
- <dp:list>
- <dp:section>
- <dp:label>
- <xts:string id="IDS_CUSTSUB_NEWSOPTIONS_LOCATION"/>
- </dp:label>
- </dp:section>
- <dp:section wrap="wrap">
- <div id="path" style="padding:0px; display:none; ">
- <xsl:choose>
- <xsl:when test="$canWrite">
- <dp:text valign="top" wrap="wrap">
- <xsl:variable name="rootPath">
- <xsl:choose>
- <xsl:when test="$isPersonalPath">
- <xsl:value-of select="concat(key('session-param', 'e_hp'), '/folder')"/>
- </xsl:when>
- <xsl:when test="starts-with($path, '/content')">
- <xsl:value-of select="$defaultContentRoot"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <cf:do-the-path-link>
- <cf:param name="familytree">cm:queryResponse/cm:queryReply[1]/*/cm:ancestors</cf:param>
- <cf:param name="familymember">cm:queryResponse/cm:queryReply[1]/*/cm:defaultName</cf:param>
- <cf:param name="home">
- <xsl:value-of select="$rootPath"/>
- </cf:param>
- </cf:do-the-path-link>
- </dp:text>
- </xsl:when>
- <xsl:otherwise>
- <dp:inactiveText>
- <i>
- <xts:string id="IDS_NONE"/>
- </i>  </dp:inactiveText>
- </xsl:otherwise>
- </xsl:choose>
- </div>
- </dp:section>
- <dp:section wrap="wrap">
- <div id="myfolder" style="padding:0px; display:none; ">
- <xsl:choose>
- <xsl:when test="key('session-param', 'e_mroot') != ''">
- <dp:text>
- <xsl:value-of select="key('session-param', 'e_mroot')"/>
- </dp:text>
- </xsl:when>
- <xsl:otherwise>
- <dp:inactiveText>
- <i>
- <xts:string id="IDS_NONE"/>
- </i>  </dp:inactiveText>
- </xsl:otherwise>
- </xsl:choose>
- </div>
- </dp:section>
- <dp:section>
- <dp:group>
- <dp:groupItem valign="top">
- <utml:a utml:op="maintain">
- <utml:target>
- <xsl:value-of select="$app"/>/select/select.xts<xsl:text/>
- </utml:target>
- <xsl:attribute name="onclick">javascript:resetPageState()</xsl:attribute>
- <xsl:attribute name="style">font-size:143%</xsl:attribute>
- <xsl:text/>
- <xts:string id="IDS_SELECT_ANOTHER_FOLDER"/>
- <xsl:text/>
- </utml:a>
- </dp:groupItem>
- <xsl:if test="not($isAdminPath)">
- <dp:groupItem valign="top">
- <img height="1" width="10" border="0">
- <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute>
- </img>
- <xsl:text/>
- <a href="#">
- <xsl:text/>
- <xsl:attribute name="onclick">javascript:changeSelection('myfolder')</xsl:attribute>
- <xsl:attribute name="style">font-size:143%</xsl:attribute>
- <xsl:text/>
- <xts:string id="IDS_SELECT_MY_FOLDERS"/>
- <xsl:text/>
- </a>
- <xsl:text/>
- </dp:groupItem>
- </xsl:if>
- </dp:group>
- </dp:section>
- </dp:list>
- <utml:input name="m_subData_newsitem_path" type="hidden">
- <xsl:attribute name="value"><xsl:value-of select="$path"/></xsl:attribute>
- </utml:input>
- </lyt:section>
- </lyt:layout>
- <script language="javascript">
-
- function clearSelect()
- {
- if (document.pform.elements['so.searchPath']) {
- document.pform.elements['so.searchPath'].value = '';
- }
- }
-
- function changeSelection(divName)
- {
- var pathdiv = document.getElementById('path');
- var mfdiv = document.getElementById('myfolder');
- switch (divName)
- {
- case "path":
- {
- mfdiv.style.display = "none";
- pathdiv.style.display = "";
- break;
- }
- case "myfolder":
- {
- mfdiv.style.display = "";
- pathdiv.style.display = "none";
- setMyFolder();
- break;
- }
- }
- }
- function setMyFolder()
- {
- setStateValue("mfst",1);
- document.pform["so.defaultLocation"].value = document.pform.m_subData_newsitem_path.value="<xsl:value-of select="xtsext:javascriptencode(key('session-param','e_mrootpath'))"/>";
- }
- function resetPageState()
- {
- <!-- Clear the cookie value mfst -->
- clearSessionEntry('mfst');
- }
- </script>
- <script language="javascript">
- var mf = getSessionValue("mfst");
- if ( mf !=null && mf != "" )
- {
- if( mf == 1 ) {
- document.getElementById('myfolder').style.display = "";
- document.getElementById('path').style.display = "none";
- setMyFolder(); //Make sure the path is set to My Folders when the myfolder div is visible.
- }
- else {
- document.getElementById('path').style.display = "";
- document.getElementById('myfolder').style.display = "none";
- }
- } else
- {
- <xsl:choose>
- <xsl:when test="$path!=''">
- document.getElementById('path').style.display = "";
- document.getElementById('myfolder').style.display = "none";
- setStateValue("mfst",0);
- </xsl:when>
- <xsl:otherwise>
- document.getElementById('myfolder').style.display = "";
- document.getElementById('path').style.display = "none";
- setStateValue("mfst",1);
- setMyFolder(); //Make sure the path is set to My Folders when the myfolder div is visible.
- </xsl:otherwise>
- </xsl:choose>
- }
- </script>
- <dp:footer>
- <df:button df:id="IDS_OK" df:style="drop" onClick="javascript:resetPageState(); clearSelect(); "/>
- <df:button df:id="IDS_CANCEL" df:style="pop" onClick="javascript:resetPageState();"/>
- </dp:footer>
- </utml:form>
- </dp:page>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- debug - special debug block for nested requests
- ===============================================================================================
- -->
- <xts:block id="debug" type="exec" processor="XSLT" mimeType="text/html" dependency="genMarkup" condition=".[/root/session/param[@name='debug']='1']" mandatory="false">
- <!-- 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>
|