123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- BI and PM: qs
- (C) Copyright IBM Corp. 2001, 2017
- 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).
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/QSRVUITextPL.xml,messages/portal.xml,messages/portalRL.xml" requiredCapability="canUseQueryStudio">
- <!--
- Do request to CM
- -->
- <xts:block id="saveQuery" mode="interpret" processor="XSLT" type="exec"> <!-- dependency="readPrompts"> -->
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- 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"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:template name="duplicate-apos">
- <xsl:param name="original"/>
- <xsl:param name="character"/>
- <xsl:choose>
- <xsl:when test="contains($original,$character)">
- <xsl:value-of select="substring-before($original,$character)"/>
- <xsl:value-of select="$character"/>
- <xsl:value-of select="$character"/>
- <xsl:call-template name="duplicate-apos">
- <xsl:with-param name="original" select="substring-after($original,$character)"/>
- <xsl:with-param name="character" select="$character"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$original"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="/">
- <xts:sequence>
- <xsl:if test="key('env-param','overwrite')='true' and key('env-param','reportType')">
- <xts:append>
- <send:request provider="warp" asText="true" soapAction="http://www.ibm.com/xmlns/prod/cognos/contentManagerService/201404/" faultBlock="faultHandler" responseEnvelope="true">
- <!-- delete query specification -->
- <cm:delete xmlns:cm="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <search xsi:type="xsd:string">
- <xsl:value-of select="xtsext:urldecode(string(key('env-param','path')))"/>/<xsl:value-of select="key('env-param','reportType')"/>[@name=<xsl:text/>
- <xsl:choose>
- <xsl:when test="contains(xtsext:urldecode(string(key('env-param','queryName'))), '"')">'</xsl:when>
- <xsl:otherwise>"</xsl:otherwise>
- </xsl:choose>
- <xsl:value-of select="xtsext:urldecode(string(key('env-param','queryName')))"/>
- <xsl:choose>
- <xsl:when test="contains(xtsext:urldecode(string(key('env-param','queryName'))), '"')">'</xsl:when>
- <xsl:otherwise>"</xsl:otherwise>
- </xsl:choose><xsl:text>]</xsl:text>
- </search>
- <options xsi:type="cm:deleteOptions">
- <force xsi:type="xsd:boolean">true</force>
- <recursive xsi:type="xsd:boolean">true</recursive>
- </options>
- </cm:delete>
- </send:request>
- </xts:append>
- </xsl:if>
- <xts:append>
- <send:request provider="warp" asText="true" soapAction="http://www.ibm.com/xmlns/prod/cognos/reportService/201404/" faultBlock="faultHandler" responseEnvelope="true">
- <xsl:choose>
- <xsl:when test="key('env-param','action')='update'">
- <!-- update query specification -->
- <xsl:choose>
- <xsl:when test="key('env-param','reportName')!=' ' and key('env-param','reportName')!=' '">
- <cm:update xmlns:cm="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
- <object xsi:type="cm:query">
- <searchPath xsi:type="bus:stringProp"><value><xsl:value-of select="xtsext:urldecode(string(key('env-param','reportFolder')))"/>/query[@name='<xsl:text/>
- <xsl:variable name="singleApos">'</xsl:variable>
- <!-- duplicate every ' -->
- <xsl:call-template name="duplicate-apos">
- <xsl:with-param name="original" select="xtsext:urldecode(string(key('env-param','reportName')))"/>
- <xsl:with-param name="character" select="$singleApos" />
- </xsl:call-template>']</value>
- </searchPath>
- <specification>
- <schemaInfo xsi:nil="true"/>
- <value xsi:type="xsd:string">
- <xsl:value-of select="key('env-param','xxSpec')"/>
- </value>
- </specification>
- </object>
- <options xsi:type="bus:updateOptions">
- <returnProperties xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:propEnum[]">
- <item xsi:type="bus:propEnum">searchPath</item>
- </returnProperties>
- </options>
- </cm:update>
- </xsl:when>
- <xsl:otherwise>
- <cm:add xmlns:cm="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
- <search xsi:type="xsd:string"><xsl:value-of select="xtsext:urldecode(string(key('env-param','reportFolder')))"/></search>
- <object xsi:type="cm:query">
- <defaultName>
- <schemaInfo xsi:nil="true"/>
- <value xsi:type="xsd:string"><xsl:value-of select="xtsext:urldecode(string(key('env-param','reportName')))"/></value>
- </defaultName>
- <specification>
- <schemaInfo xsi:nil="true"/>
- <value xsi:type="xsd:string">
- <xsl:value-of select="key('env-param','xxSpec')"/>
- </value>
- </specification>
- </object>
- <options xsi:type="cm:addOptions">
- <updateAction xsi:type="bus:updateActionEnum">update</updateAction>
- </options>
- </cm:add>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <!-- add a new query in CM -->
- <cm:add xmlns:cm="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
- <search xsi:type="xsd:string">
- <xsl:value-of select="xtsext:urldecode(string(key('env-param','path')))"/>
- </search>
- <object xsi:type="cm:query">
- <defaultName>
- <schemaInfo xsi:nil="true"/>
- <value xsi:type="xsd:string">
- <xsl:value-of select="xtsext:urldecode(string(key('env-param','queryName')))"/>
- </value>
- </defaultName>
- <defaultDescription>
- <schemaInfo xsi:nil="true"/>
- <value xsi:type="xsd:string">
- <xsl:value-of select="xtsext:urldecode(string(key('env-param','desc')))"/>
- </value>
- </defaultDescription>
- <defaultScreenTip xsi:type="cm:stringProp">
- <schemaInfo xsi:nil="true"/>
- <value xsi:type="xsd:string">
- <xsl:value-of select="xtsext:urldecode(string(key('env-param','tip')))"/>
- </value>
- </defaultScreenTip>
- <specification>
- <schemaInfo xsi:nil="true"/>
- <value xsi:type="xsd:string">
- <xsl:value-of select="key('env-param','xxSpec')"/>
- </value>
- </specification>
- </object>
- <options xsi:type="cm:addOptions">
- <updateAction xsi:type="bus:updateActionEnum">
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='overwrite']='true'">replace</xsl:when>
- <xsl:otherwise>fail</xsl:otherwise>
- </xsl:choose>
- </updateAction>
- </options>
- </cm:add>
- </xsl:otherwise>
- </xsl:choose>
- </send:request>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- Verify the type of object we have a duplicate of
- -->
- <xts:block id="verifyReportType" type="exec" mode="interpret" processor="XSLT" dependency="saveQuery" condition="/root/SoapFault" mandatory="false">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- 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"/>
- <xsl:template match="/">
- <xts:sequence>
- <xsl:variable name="singleQuote">'</xsl:variable>
- <xsl:if test="not((contains(/root/env/param[@name='queryName'], '"') or contains(/root/env/param[@name='queryName'], '%22')) and contains(/root/env/param[@name='queryName'], $singleQuote))">
- <xts:append>
- <send:request provider="warp" asText="true" soapAction="http://www.ibm.com/xmlns/prod/cognos/contentManagerService/201404/">
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
- <search xsi:type="xsd:string">
- <xsl:text/><xsl:value-of select="xtsext:urldecode(string(/root/env/param[@name='path']))"/>/*[@name=<xsl:text/>
- <xsl:choose>
- <xsl:when test="contains(xtsext:urldecode(string(/root/env/param[@name='queryName'])), '"')">'</xsl:when>
- <xsl:otherwise>"</xsl:otherwise>
- </xsl:choose>
- <xsl:value-of select="xtsext:urldecode(string(/root/env/param[@name='queryName']))"/>
- <xsl:choose>
- <xsl:when test="contains(xtsext:urldecode(string(/root/env/param[@name='queryName'])), '"')">'</xsl:when>
- <xsl:otherwise>"</xsl:otherwise>
- </xsl:choose>]<xsl:text/>
- </search>
- <properties xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="cm:propEnum[1]">
- <item xsi:type="cm:propEnum">objectClass</item>
- </properties>
- </cm:query>
- </send:request>
- </xts:append>
- </xsl:if>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- Process Response
- -->
- <xts:block id="format" type="exec" mode="output" processor="XSLT" mimeType="text/html" dependency="saveQuery verifyReportType">
- <!-- get the debug logic sheet -->
- <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
- <!-- get the new theme stuff -->
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="qs/logicsheets/dialogs.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/cm-logic.xsl"/>
- <!-- apply the form logic -->
- <xts:logicsheet path="logicsheets/formlogic.xslt"/>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" 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:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/" 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:qsdlg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/qs/dialog/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:cm="http://developer.cognos.com/schemas/bibus/3/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/" exclude-result-prefixes="xsl xts lyt pf dp df cp cf qsdlg xtsext bus cm SOAP-ENC dbg">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <!-- add any theme variables -->
- <df:variables/>
- <pf:variables/>
- <!-- start the output -->
- <xsl:template match="/root">
- <xsl:choose>
- <xsl:when test="/root/SoapFault">
- <!-- Save Failed -->
- <xsl:apply-templates select="/root/SoapFault"/>
- </xsl:when>
- <xsl:when test="/root/logonFault">
- <!-- Save Failed -->
- <xsl:apply-templates select="/root/logonFault"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- Save succeeded, hide dialog -->
- <html>
- <head>
- <script type="text/javascript">
- <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/layout.js</xsl:attribute>
- <xsl:text/>//<xsl:text/>
- </script>
- <script type="text/javascript"><![CDATA[function saveOK(){var cf=null;if (this.getConfigFrame && (cf=this.getConfigFrame())!=null && cf.hideDialogFrame) {]]><xsl:if test="/root/env/param[@name='queryName']!=''">
- <xsl:text/>if (cf.cfgSet) cf.cfgSet("ReportName", "<xsl:value-of select="xtsext:javascriptencode(xtsext:urldecode(string(/root/env/param[@name='queryName'])))"/>");<xsl:text/>
- </xsl:if>
- <xsl:text/>cf.cfgSet("NewReport", false);<xsl:text/>
- <xsl:if test="/root/env/param[@name='path']!=''">
- <xsl:text/>if (cf.cfgSet) cf.cfgSet("ReportFolder","<xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='path']))"/>");<xsl:text/>
- </xsl:if>
- <xsl:if test="/root/cm:addResponse/addResult/searchPath/value!=''">
- <xsl:text/>if (cf.cfgSet) cf.cfgSet("SearchPath", cf.cEscape("<xsl:value-of select="xtsext:javascriptencode(string(/root/cm:addResponse/addResult/searchPath/value))"/>"));<xsl:text/>
- </xsl:if>
- <xsl:if test="/root/env/param[@name='leaveAfterSave']='true'">
- <xsl:text/>if (cf.closeLink) cf.closeLink(true);<xsl:text/>
- </xsl:if>
- <xsl:if test="/root/env/param[@name='newAfterSave']='true'">
- <xsl:text/>cf.goApplicationManager.getFeatureManager().launchFeature('NewReport', ['direct']);<xsl:text/>
- </xsl:if>
- <xsl:text/>cf.cfgRemove("LAST_SAVE_DIALOG");<xsl:text/>
- <xsl:text/>cf.cfgRemove("ACTION_AFTER_SAVE");<xsl:text/>
- <xsl:text/>cf.updateReportHasChanged(false);<xsl:text/>
- <xsl:if test="not(/root/env/param[@name='newAfterSave']='true')">
- <xsl:text/>cf.setWindowTitle();<xsl:text/>
- </xsl:if>
- <xsl:text/>cf.hideDialogFrame();<xsl:text/>
- <xsl:if test="/root/env/param[@name='goBack']='true'">
- <xsl:text/>cf.window.history.back();<xsl:text/>
- </xsl:if>
- <xsl:if test="/root/env/param[@name='open']='true'">
- <xsl:text/>cf.goApplicationManager.getFeatureManager().launchFeature('OpenReport', ['continueOpen']);
- </xsl:if>
- <xsl:text/><![CDATA[}else setTimeout(this.saveOK, 100);}]]></script>
- </head>
- <body> <!--dbg:dumpxml select="/"/-->
- <script type="text/javascript">
- saveOK();
- </script>
- </body>
- </html>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="/root/logonFault" priority="1">
- <dp:page>
- <dp:script>
- <script type="text/javascript">
- <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/layout.js</xsl:attribute>
- <xsl:text/>//<xsl:text/>
- </script>
- <script type="text/javascript">
- var cf = getConfigFrame();
- cf.cfgSet("SAVE_REPORT", true);
- cf.pptFaultHandler();
- cf.hideDialogFrame();
- </script>
- </dp:script>
- </dp:page>
- </xsl:template>
- <xsl:template match="/root/SoapFault" priority="1">
- <dp:page>
- <dp:script>
- <script type="text/javascript">
- <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/layout.js</xsl:attribute>
- <xsl:text/>//<xsl:text/>
- </script>
- <script type="text/javascript">
- <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/classes/CDialogManager.js</xsl:attribute>
- <xsl:text/>//<xsl:text/>
- </script>
- <script type="text/javascript">
- <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/classes/CWindowManager.js</xsl:attribute>
- <xsl:text/>//<xsl:text/>
- </script>
- <script type="text/javascript">
- var goDialogManager = new CDialogManager();
- function stringReplace(origString, valToReplace, newString)
- {
- var strRegExp = new RegExp();
- strRegExp.compile(valToReplace, "g");
- return origString.replace(strRegExp, newString);
- }
- function saveNoOverwrite()
- {
- var cf = getConfigFrame();
- if (cf)
- {
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='leaveAfterSave']='true'">goDialogManager.getFeatureManager().launchFeature('SaveAs', new Array("leave"));</xsl:when>
- <xsl:when test="/root/env/param[@name='newAfterSave']='true'">goDialogManager.getFeatureManager().launchFeature('SaveAs', new Array("new"));</xsl:when>
- <xsl:otherwise>goDialogManager.getFeatureManager().launchFeature('SaveAs');</xsl:otherwise>
- </xsl:choose>
- }
- }
- function saveOverwrite()
- {
- var cf = getConfigFrame();
- if (cf)
- {
- cf.dlgReset();
- <xsl:for-each select="/root/env/param">
- cf.dlgSetParm("<xsl:value-of select="xtsext:javascriptencode(string(@name))"/>", "<xsl:value-of select="xtsext:javascriptencode(string(.))"/>");
- </xsl:for-each>
- <!-- Re-Caf sign the xxSpec -->
- <xsl:if test="/root/env/param[@name='xxSpec']!=''">
- cf.dlgSetParm("xxSpec", "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','xxSpec')))"/>");
- </xsl:if>
- if (document.pform.currentActionValue.value == "rename")
- {
- var newName = cf.cEscape(document.pform.err_rename.value);
- cf.dlgRemoveParm("overwrite");
- cf.dlgRemoveParm("action");
- cf.dlgRemoveParm("reportType");
- cf.dlgSetParm("queryName", newName);
- }
- else
- {
- cf.dlgSetParm("overwrite", "true");
- cf.dlgSetParm("action", "add");
- cf.dlgSetParm("reportType", "<xsl:value-of select="xtsext:javascriptencode(string(/root/cm:queryResponse/queryResult/item/objectClass/value))"/>");
- }
- cf.hideDialogFrame();
- cf.dlgSubmit(null, true);
- }
- }
- function init()
- {
- attachMouseEvents();
- var cf=null;
- if (this.getConfigFrame && (cf=this.getConfigFrame())!=null && cf.showDialogFrame)
- <xsl:choose>
- <xsl:when test="/root/cm:queryResponse/queryResult/item/objectClass/value='query' or /root/cm:queryResponse/queryResult/item/objectClass/value='report' or /root/cm:queryResponse/queryResult/item/objectClass/value='reportView' or .//bus:exception/errorCode='cmDuplicateObject'">cf.showDialogFrame(220);</xsl:when>
- <xsl:otherwise>cf.showDialogFrame(150);</xsl:otherwise>
- </xsl:choose>
- if (document.getElementById("exists_string"))
- {
- if (<xsl:choose><xsl:when test="/root/cm:queryResponse/queryResult/item/objectClass/value='query' or /root/cm:queryResponse/queryResult/item/objectClass/value='report' or /root/cm:queryResponse/queryResult/item/objectClass/value='reportView'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose>)
- document.getElementById("exists_string").appendChild(document.createTextNode(stringReplace("<xts:string id="SAVE_ERROR_REPORT_EXISTS" encode="javascript"/>", "\\^0", "<xsl:value-of select="xtsext:javascriptencode(xtsext:urldecode(string(/root/env/param[@name='queryName'])))"/>")));
- else
- {
- var errMsg = '<xts:string id="SAVE_ERROR_REPORT_EXISTS_CANNOT_REPLACE" encode="javascript"/>';
- errMsg = stringReplace(errMsg, "\\^0", "<xsl:value-of select="xtsext:javascriptencode(xtsext:urldecode(string(/root/env/param[@name='queryName'])))"/>")
- errMsg = stringReplace(errMsg, "\\^1", "<xsl:value-of select="xtsext:javascriptencode(string(/root/cm:queryResponse/queryResult/item/objectClass/value))"/>")
- document.getElementById("exists_string").appendChild(document.createTextNode(errMsg));
- }
- }
- else if (document.getElementById("bad_string"))
- {
- var tempStr = stringReplace("<xts:string id="SAVE_ERROR_BAD_NAME" encode="javascript"/>", "\\^0", "<xsl:value-of select="xtsext:javascriptencode(xtsext:urldecode(string(/root/env/param[@name='queryName'])))"/>");
- tempStr = stringReplace(tempStr,"\\^1", '"');
- tempStr = stringReplace(tempStr,"\\^2", "'");
- document.getElementById("bad_string").appendChild(document.createTextNode(tempStr));
- }
- }
- function setCurrentAction(str)
- {
- document.pform.currentActionValue.value = str;
- }
- </script>
- </dp:script>
- <form style="margin:0px" name="pform" method="POST" onsubmit="return false;">
- <input type="hidden" name="currentActionValue" value="overwrite"/>
- <table border="0" cellspacing="0" cellpadding="0" height="100%" width="100%">
- <tr>
- <td width="100%" height="0%">
- <!-- dialog header -->
- <dp:header help="false">
- <!-- header titles -->
- <dp:title>
- <xts:string id="SAVE_ERROR_TITLE"/>
- </dp:title>
- <!-- close link for the header -->
- <dp:close>
- <a href="javascript:getConfigFrame().hideDialogFrame()">
- <dp:closeMarker/>
- </a>
- </dp:close>
- </dp:header>
- </td>
- </tr>
- <tr>
- <td width="100%" height="100%" valign="top">
- <!-- layout -->
- <lyt:layout style="1" border="no">
- <lyt:section>
- <xsl:choose>
- <xsl:when test=".//bus:exception/bus:errorCode='cmDuplicateName' or .//bus:exception/bus:errorCode='cmDuplicateObject'">
- <xsl:choose>
- <xsl:when test="/root/cm:queryResponse/queryResult/item/objectClass/value='query' or /root/cm:queryResponse/queryResult/item/objectClass/value='report' or /root/cm:queryResponse/queryResult/item/objectClass/value='reportView'">
- <dp:group>
- <dp:groupItem valign="top">
- <img height="32" width="32" border="0">
- <xsl:attribute name="src">
- <xsl:value-of select="$webcontent"/>/<xsl:value-of select="$app"/>
- <xsl:text/>/images/msg_warning.gif<xsl:text/>
- </xsl:attribute>
- </img>
- </dp:groupItem>
- <dp:groupItem>
- <!-- used for alignment -->
- <dp:text/><xsl:text> </xsl:text>
- </dp:groupItem>
- <dp:groupItem valign="top">
- <dp:text nospace="nospace" wrap="wrap">
- <xts:string id="IDS_DUPLICATE_ERROR_RENAME_REPLACE_ERROR"><xts:param name="entryName"><xsl:value-of select="xtsext:urldecode(string(/root/env/param[@name='queryName']))"/></xts:param></xts:string>
- <!-- Multiple actions. Render the choices -->
- <br/>
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td class="formText">
- <input type="radio" name="currentAction" value="overwrite" checked="true" onClick="javascript:setCurrentAction('overwrite')"/>
- </td>
- <td class="formText">
- <xts:string id="IDS_DUPLICATE_ERROR_REPLACE_ENTRY_OPTION"/>
- </td>
- </tr>
- <tr>
- <td valign="top" class="formText">
- <input type="radio" name="currentAction" value="rename" onClick="javascript:setCurrentAction('rename')"/>
- </td>
- <td class="formText">
- <xts:string id="IDS_DUPLICATE_ERROR_RENAME_ENTRY_OPTION"/><br/>
- <input name="err_rename" size='45' onFocus="javascript:document.pform.currentAction[1].checked = true;setCurrentAction('rename');">
- <xsl:attribute name="value">
- <xsl:value-of select="xtsext:urldecode(string(/root/env/param[@name='queryName']))"/>
- </xsl:attribute>
- </input>
- </td>
- </tr>
- <tr>
- <td>
- <img height="5" width="1">
- <xsl:attribute name="src"><xsl:value-of select="'{$webcontent}'"/>/images/space.gif</xsl:attribute>
- </img>
- </td>
- </tr>
- <tr>
- <td colspan='2' class="formText"><xts:string id="IDS_DUPLICATE_ERROR_CONTINUE"/><br/></td>
- </tr>
- </table>
- </dp:text>
- </dp:groupItem>
- </dp:group>
- </xsl:when>
- <xsl:otherwise>
- <dp:box valign="top">
- <dp:boxSection hgap="20">
- <img width="32" height="32" align="top" hspace="10">
- <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/<xsl:value-of select="$app"/>/images/msg_warning.gif</xsl:attribute>
- </img>
- </dp:boxSection>
- <dp:boxSection>
- <dp:description>
- <div id="exists_string"/>
- </dp:description>
- </dp:boxSection>
- </dp:box>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test=".//bus:exception/bus:message/bus:messageString[starts-with(.,'CM-REQ-4244')]">
- <dp:box valign="top">
- <dp:boxSection hgap="20">
- <img width="32" height="32" align="top" hspace="10">
- <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/<xsl:value-of select="$app"/>/images/msg_warning.gif</xsl:attribute>
- </img>
- </dp:boxSection>
- <dp:boxSection>
- <dp:description>
- <div id="bad_string"/>
- </dp:description>
- </dp:boxSection>
- </dp:box>
- </xsl:when>
- <xsl:otherwise>
- <dp:list>
- <dp:section>
- <dp:text>
- <xsl:for-each select=".//bus:exception/*">
- <xsl:choose>
- <xsl:when test="name()!='bus:message'">
- <xsl:value-of select="name()"/>
- <xsl:text> : </xsl:text>
- <tt style="color:blue">
- <xsl:value-of select="."/>
- </tt>
- </xsl:when>
- <xsl:when test="name()='bus:message'">
- <xsl:for-each select="./bus:messageString">
- <br/>
- <xsl:value-of select="."/>
- </xsl:for-each>
- </xsl:when>
- </xsl:choose>
- <br/>
- </xsl:for-each>
- </dp:text>
- </dp:section>
- </dp:list>
- </xsl:otherwise>
- </xsl:choose>
- </lyt:section>
- </lyt:layout>
- </td>
- </tr>
- <tr>
- <td width="100%" height="0%">
- <dp:footer>
- <xsl:choose>
- <xsl:when test=".//bus:exception/bus:errorCode='cmDuplicateName'">
- <xsl:choose>
- <xsl:when test="/root/cm:queryResponse/queryResult/item/objectClass/value='query' or /root/cm:queryResponse/queryResult/item/objectClass/value='report' or /root/cm:queryResponse/queryResult/item/objectClass/value='reportView'">
- <df:button df:id="IDS_OK" df:style="href" df:href="javascript:saveOverwrite();" df:defaultKey="active"/>
- </xsl:when>
- <xsl:otherwise>
- <df:button df:id="IDS_OK" df:style="href" df:href="javascript:saveNoOverwrite();" df:defaultKey="active"/>
- </xsl:otherwise>
- </xsl:choose>
- <df:button df:id="DIALOG_CANCEL_BUTTON" df:style="href" df:href="javascript:getConfigFrame().hideDialogFrame();"/>
- </xsl:when>
- <xsl:otherwise>
- <df:button df:id="IDS_OK" df:style="href" df:href="javascript:saveNoOverwrite();" df:defaultKey="active"/>
- </xsl:otherwise>
- </xsl:choose>
- </dp:footer>
- </td>
- </tr>
- </table>
- </form>
- <!--dbg:dumpxml select="/"/-->
- </dp:page>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- Soap Faults handler
- -->
- <xts:block id="faultHandler" type="fault" processor="XSLT">
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" exclude-result-prefixes="xsl">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xsl:choose>
- <xsl:when test="//*[local-name()='CAM']/*[local-name()='exception']//*[local-name()='promptInfo']">
- <logonFault>timeout</logonFault>
- </xsl:when>
- <xsl:otherwise>
- <SoapFault>
- <xsl:copy>
- <xsl:copy-of select="/root/fault"/>
- </xsl:copy>
- </SoapFault>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|