123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422 |
- <?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/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" messageBase="messages/subscribe.xml,messages/portal.xml, messages/portalRL.xml" requiredCapability="canUseConditionalSubscriptions">
- <!--
- ===============================================================================================
- getCredentials - get credentials from Content Manager. This is for schedule only. If they are not there then we create
- h_CAM_action so that the credentials can be generated.
- ===============================================================================================
- -->
- <xts:block id="getCredentials" processor="XSLT" type="exec">
- <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:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <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>
- <cm:search>~/credential</cm:search>
- <cm:properties>
- <cm:property name="searchPath"/>
- </cm:properties>
- </cm:query>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- appendDefaultScheduleParams
- Block should only get executed if we haven't got schedule parameters already. We can come back here if there's an error
- like the name of the subscription has already been used.
- ===============================================================================================
- -->
- <xts:block id="appendDefaultScheduleParams" dependency="getCredentials" type="exec" mode="interpret" processor="XSLT" condition=".[not(/root/env/param[@name='m_sp_type'])]" mandatory="false">
- <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:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root/env">
- <xts:transform src="transforms/portal/schedule/generateParams.xslt" processor="XSLT">
- <schedule>
- <timeZone>
- <xsl:value-of select="$timeZone"/>
- </timeZone>
- </schedule>
- </xts:transform>
- <xts:transform src="transforms/portal/schedule/generateDefaults.xslt" processor="XSLT">
- <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
- <params>
- <timeZone>
- <xsl:value-of select="$timeZone"/>
- </timeZone>
- <contentLocale>
- <xsl:value-of select="$contentLocale"/>
- </contentLocale>
- <env>
- <xsl:copy-of select="/root/env/*"/>
- </env>
- </params>
- </xts:transform>
- <!-- and add a new one which is the periodical producer value -->
- <param name="m_sp_periodicalProducer">
- <xsl:value-of select="/root/env/param[@name='m_subData_periodical_producer']"/>
- </param>
- <!-- set the schedule credential -->
- <param name="m_sp_credential">
- <xsl:value-of select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='credential']/*[local-name()='searchPath']"/>
- </param>
- </xts:append>
- <!-- now we can alter the type to subscription -->
- <xts:append select="/root/env">
- <param name="m_sp_type">
- <xsl:text>subscription</xsl:text>
- </param>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- doFrmCommand - submit the from command (create, save, move, copy, delete)
- ===============================================================================================
- -->
- <xts:block id="doFrmCommand" processor="XSLT" type="exec" dependency="appendDefaultScheduleParams">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/root">
- <xts:sequence>
- <xts:append>
- <frmResult>
- <xsl:variable name="params" select="/root/env/param"/>
- <send:request provider="xts">
- <xsl:element name="{/root/env/param[@name='ifrmcmd']}" namespace="http://developer.cognos.com/schemas/xts/subscribe/iFrmCmd/1/">
- <!-- call the template to build the env variables -->
- <xsl:call-template name="build_form_env"/>
- </xsl:element>
- </send:request>
- </frmResult>
- </xts:append>
- <xts:delete select="/root/env/param[starts-with( @name, 'm_t_default_')]"/>
- </xts:sequence>
- </xsl:template>
- <!--
- Build the form variables which we are going to send in to XTS
- -->
- <xsl:template name="build_form_env">
- <xsl:variable name="the-credential" select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='credential']"/>
- <env xmlns="http://developer.cognos.com/schemas/xts/subscribe/iFrmCmd/1/">
- <!--xsl:if test="not($the-credential) and $the-credential/*[local-name()='searchPath'] != '' "-->
- <!--param name="h_CAM_action"><xsl:text>generateTC</xsl:text></param-->
- <!--/xsl:if-->
- <!-- copy anything in env -->
- <xsl:choose>
- <xsl:when test="/root/env/param[starts-with(@name,'m_t_default_')]">
- <xsl:for-each select="/root/env/param">
- <xsl:if test="not(@name='m_p_defaultName') and not(@name='m_p_defaultDescription') and not(@name='m_p_defaultScreenTip')">
- <param name="{@name}">
- <xsl:value-of select="."/>
- </param>
- </xsl:if>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="/root/env/param">
- <xsl:if test="not(starts-with(@name, 'checkbox_'))">
- <xsl:choose>
- <xsl:when test="not(starts-with(@name,'m_p_defaultDescription') or starts-with(@name,'m_p_defaultScreenTip'))">
- <param name="{@name}">
- <xsl:value-of select="."/>
- </param>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="(/root/env/param[@name='ifrmcmd']!='create' or (/root/env/param[@name='ifrmcmd']='create' and child::node() != ''))">
- <param name="{@name}">
- <xsl:value-of select="."/>
- </param>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- <!-- if we have a group of object from the sort to save-->
- <!-- <xsl:for-each select="/root/env/param[@name='containerSortOrder' or @name='entriesSortOrder' or @name='containerDefaultOrder' or @name='entriesDefaultOrder']">
- <objs>
- <param name="m_obj">
- <xsl:value-of select="substring-after(., ',')"/>
- </param>
- <param name="m_p_displaySequence">
- <xsl:value-of select="substring-before(., ',')"/>
- </param>
- </objs>
- </xsl:for-each> -->
- <!-- handle inputs from the multilingual property page -->
- <xsl:if test="/root/env/param[starts-with(@name, 'm_t_default_')]">
- <!--
- Determine if there is NOT a description that has a value.
- If there are none, then create an empty description so CM will clear all locale entries.
- Note: The opposite test condition would not be correct here - to see if there is
- a screenTip that has a blank value.
- -->
- <xsl:if test="not(/root/env/param[starts-with(@name, 'm_t_default_description')] != '') and not(/root/env/param[@name='pty_desc'] != '')">
- <param>
- <xsl:attribute name="name"><xsl:value-of select="'m_p_description'"/></xsl:attribute>
- </param>
- </xsl:if>
- <!--
- Determine if there is NOT a screenTip that has a value.
- If there are none, then create an empty screenTip so CM will clear all locale entries.
- Note: The opposite test condition would not be correct here - to see if there is
- a screenTip that has a blank value.
- -->
- <xsl:if test="not(/root/env/param[starts-with(@name, 'm_t_default_screenTip')] != '') and not(/root/env/param[@name='pty_scrt'] != '')">
- <param>
- <xsl:attribute name="name"><xsl:value-of select="'m_p_screenTip'"/></xsl:attribute>
- </param>
- </xsl:if>
- </xsl:if>
- <xsl:variable name="ptyn">
- <xsl:value-of select="/root/env/param[@name='pty_name']"/>
- </xsl:variable>
- <xsl:variable name="ptyd">
- <xsl:value-of select="/root/env/param[@name='pty_desc']"/>
- </xsl:variable>
- <xsl:variable name="ptys">
- <xsl:value-of select="/root/env/param[@name='pty_scrt']"/>
- </xsl:variable>
- <xsl:for-each select="/root/env/param[starts-with(@name, 'm_t_default_')]">
- <xsl:variable name="localeVal">
- <xsl:value-of select="xtsext:substringAfterLast(string(@name), '_')"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$localeVal != string(/root/env/param[@name='pty_activeLang'])">
- <!--
- Handle the case where the user has just cleared all the fields, so don't pass it along for update.
- -->
- <xsl:if test="string(/root/env/param[@name=concat('m_t_default_name_',$localeVal)]) != '' or string(/root/env/param[@name=concat('m_t_default_description_',$localeVal)]) != '' or string(/root/env/param[@name=concat('m_t_default_screenTip_',$localeVal)]) != ''">
- <xsl:if test="string(.) != ''">
- <param>
- <xsl:attribute name="name"><xsl:value-of select="concat('m_p_', xtsext:substringBeforeLast(substring-after(string(@name), 'm_t_default_'), '_'))"/></xsl:attribute>
- <xsl:attribute name="locale"><xsl:value-of select="$localeVal"/></xsl:attribute>
- <xsl:value-of select="."/>
- </param>
- </xsl:if>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <!--
- Special processing required for the property page information - in case the user has pressed ok
- when a new language is in presentation.
- -->
- <xsl:variable name="theName">
- <xsl:value-of select="xtsext:substringBeforeLast(substring-after(string(@name), 'm_t_default_'),'_')"/>
- </xsl:variable>
- <xsl:variable name="theValue">
- <xsl:choose>
- <xsl:when test="$theName='name'">
- <xsl:if test="$ptyn != ''">
- <xsl:value-of select="$ptyn"/>
- </xsl:if>
- </xsl:when>
- <xsl:when test="$theName='description'">
- <xsl:if test="$ptyd != ''">
- <xsl:value-of select="$ptyd"/>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$ptys != ''">
- <xsl:value-of select="$ptys"/>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!--
- Only create the parameter when all the values are available - otherwise they will be removed.
- -->
- <xsl:if test="$ptyn != '' or $ptyd != '' or $ptys != ''">
- <xsl:if test="$theValue != ''">
- <param>
- <xsl:attribute name="name"><xsl:value-of select="concat('m_p_',$theName)"/></xsl:attribute>
- <xsl:attribute name="locale"><xsl:value-of select="$localeVal"/></xsl:attribute>
- <xsl:value-of select="$theValue"/>
- </param>
- </xsl:if>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <!-- if we dont have m_p_path and we have m_path create m_p_path to always be consistent -->
- <xsl:if test="not(/root/env/param[@name='m_p_path']) and (/root/env/param[@name='m_path'])">
- <param name="m_p_path">
- <xsl:value-of select="/root/env/param[@name='m_path']"/>
- </param>
- </xsl:if>
- </env>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- formlogic_init - standard form logic initialization
- ===============================================================================================
- -->
- <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" dependency="doFrmCommand"/>
- <!--
- ===============================================================================================
- Process Response
- ===============================================================================================
- -->
- <!--
- ===============================================================================================
- redirect - redirect the browser
- ===============================================================================================
- -->
- <xts:block id="redirect" dependency="formlogic_init" mode="output" processor="XSLT" type="exec" mimeType="text/html">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" 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:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/" exclude-result-prefixes="xsl pf dp utml xtsext cp bus cm cml xts lyt SOAP-ENV">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:variables/>
- <xsl:template match="/">
- <xsl:choose>
- <!-- check for specific error -->
- <xsl:when test="(/root/*[local-name() = 'frmResult']/*[local-name() = 'response']/*[local-name() = 'error']/*[local-name() = 'errorCode'] = 'cmNameConflict' or /root/*[local-name() = 'frmResult']/*[local-name() = 'response']/*[local-name() = 'error']/*[local-name() = 'errorCode'] = 'cmDuplicateName' or /root/frmResult/error/errorCode = 'cmNameConflict' or /root/frmResult/error/errorCode = 'cmDuplicateName' or (/root/*[local-name() = 'frmResult']/*[local-name() = 'response']/*[local-name() = 'error']/*[local-name() = 'errorCode'] = 'cmUpdateFailed1' and contains(string(/root/*[local-name() = 'frmResult']/*[local-name() = 'response']/*[local-name() = 'error']/*[local-name() = 'errorMessage']),'CM-REQ-4024'))) or (string(/root/URLError) != '')">
- <!-- We have a duplicate name error condition. -->
- <xsl:text disable-output-escaping="yes"><!DOCTYPE html></xsl:text>
- <dp:page longTitle="$product_name">
- <dp:meta>
- <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
- <pf:meta/>
- <!-- Add standard meta tags -->
- </dp:meta>
- <form name="pform" method="post" action="{$gateway}">
- <xsl:choose>
- <xsl:when test="key('env-param', 'ifrmcmd') = 'create'">
- <!-- We ran into a duplicate name error during the copy or move -->
- <input name="m" type="hidden" value="portal/error.xts"/>
- <input name="cmdErrorResubmit" type="hidden" value="subscribe/submit.xts"/>
- <input name="cmdErrorMessage" type="hidden" value="{/root/*[local-name() = 'frmResult']/*[local-name() = 'response']/*[local-name() = 'error']/*[local-name() = 'errorMessage']}"/>
- <input name="cmdErrorCode" type="hidden" value="{/root/*[local-name() = 'frmResult']/*[local-name() = 'response']/*[local-name() = 'error']/*[local-name() = 'errorCode']}"/>
- <xsl:choose>
- <xsl:when test="key('env-param', 'm_new_class') = 'folder'">
- <input name="cmdErrorAction" type="hidden" value="rename"/>
- </xsl:when>
- <xsl:otherwise>
- <input name="cmdErrorAction" type="hidden" value="overwrite,rename"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="key('env-param', 'x_p_defaultName') != ''">
- <input name="cmdErrorNameField" type="hidden" value="x_p_defaultName"/>
- </xsl:when>
- <xsl:otherwise>
- <input name="cmdErrorNameField" type="hidden" value="m_p_defaultName"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="key('env-param', 'x_path') != ''">
- <input name="cmdErrorPath" type="hidden" value="x_path"/>
- </xsl:when>
- <xsl:otherwise>
- <input name="cmdErrorPath" type="hidden" value="m_path"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="key('env-param', 'x_new_class') != ''">
- <input name="cmdErrorClass" type="hidden" value="x_new_class"/>
- </xsl:when>
- <xsl:otherwise>
- <input name="cmdErrorClass" type="hidden" value="m_new_class"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- <xsl:for-each select="/root/env/param[@name != 'm_connection_password' and @name != 'm' and @name != 'cmdErrorMessage' and @name != 'cmdErrorCode' and @name != 'cmdErrorResubmit' and @name != 'cmdErrorNameField' and @name != 'cmdErrorAction' and @name != 'cmdErrorPath' and @name != 'cmdErrorClass']">
- <input name="{@name}" type="hidden" value="{.}"/>
- </xsl:for-each>
- </form>
- <script language="javascript">document.pform.submit();</script>
- </dp:page>
- </xsl:when>
- <!-- check for no-specific error -->
- <xsl:otherwise>
- <!-- go to the back-url if we don't have an m_return -->
- <xsl:variable name="redirect-url-fragment">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='backURL']">
- <xsl:value-of select="/root/env/param[@name='backURL']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>javascript:window.close();</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="redirect-url">
- <xsl:value-of select="$redirect-url-fragment"/>
- <xsl:if test="key('env-param','m_reload') and not(starts-with($redirect-url-fragment, 'javascript:'))">
- <xsl:text/>&m_reload=<xsl:value-of select="key('env-param','m_reload')"/>
- </xsl:if>
- </xsl:variable>
- <xsl:text disable-output-escaping="yes"><!DOCTYPE html></xsl:text>
- <dp:page longTitle="$product_name">
- <!-- this is the redirect portion of the code -->
- <dp:meta>
- <!-- Add standard meta tags -->
- <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
- <pf:meta/>
- <xsl:if test="not(starts-with($redirect-url,'javascript:'))">
- <meta http-equiv="refresh">
- <xsl:attribute name="content">0; URL=<xsl:value-of select="$redirect-url"/></xsl:attribute>
- </meta>
- </xsl:if>
- </dp:meta>
- <xsl:if test="starts-with($redirect-url,'javascript:')">
- <script language="javascript">
- window.location.href = "<xsl:value-of select="xtsext:javascriptencode(string($redirect-url))"/>";
- </script>
- </xsl:if>
- <xsl:if test="/root/frmResult/Noop">
- <script language="javascript" src="{$webcontent}/{$app}/js/cookie_jar.js"/>
- <script language="javascript">
- var sParamDelimiter = "<xsl:value-of select="xtsext:javascriptencode(string(key('system-param', 'delimiters')/@d1))"/>";
- var sNameValueDelimiter = "<xsl:value-of select="xtsext:javascriptencode(string(key('system-param', 'delimiters')/@d2))"/>";
- var sCookiePath = "<xsl:value-of select="xtsext:javascriptencode(string($cookie_path))"/>";
- var sCookieDomain = "<xsl:value-of select="xtsext:javascriptencode(string($cookie_domain))"/>";
- resetStateParam('edit');
- </script>
- </xsl:if>
- </dp:page>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|