| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721 | 
							- <?xml version="1.0" encoding="UTF-8"?>
 
- <!--
 
- Licensed Materials - Property of IBM
 
- IBM Cognos Products: AGS
 
- (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/portal.xml,messages/portalRL.xml,messages/AGS.xml" requiredCapability="canUseEventStudio">
 
- 	<!--
 
-     ===============================================================================================
 
-     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" requester="AGS:submit">
 
- 								<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>
 
- 	<!--
 
- 	===============================================================================================
 
- 	doFrmCommand - submit the from command (create, save, move, copy, delete)
 
- 	===============================================================================================
 
- 	-->
 
- 	<xts:block id="doFrmCommand" processor="XSLT" type="exec" dependency="getCredentials">
 
- 		<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>
 
- 						<xsl:variable name="params" select="/root/env/param"/>
 
- 						<!--xsl:variable name="credentialPath" select="/root/header/*[local-name()='biBusHeader']/*[local-name()='CAM']/*[local-name() = 'CAMCredentialPath']"/-->
 
- 						<xsl:variable name="the-credential" select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='credential']"/>
 
- 						<send:request provider="xts" faultBlock="faultHandler">
 
- 							<!--<send:request provider="xts" faultBlock="faultHandler">-->
 
- 							<xsl:element name="{/root/env/param[@name='ifrmcmd']}" namespace="http://developer.cognos.com/schemas/xts/ags/iFrmCmd/1/">
 
- 								<!-- call the template to build the env variables -->
 
- 								<xsl:call-template name="build_form_env"/>
 
- 								<!-- have to give the credential path the correct namespace too -->
 
- 								<xsl:if test="$the-credential and $the-credential/*[local-name()='searchPath'] != '' ">
 
- 									<credentialPath xmlns="http://developer.cognos.com/schemas/xts/ags/iFrmCmd/1/">
 
- 										<xsl:value-of select="$the-credential/*[local-name()='searchPath']"/>
 
- 									</credentialPath>
 
- 								</xsl:if>
 
- 							</xsl:element>
 
- 						</send:request>
 
- 					</xts:append>
 
- 					<xts:delete select="/root/env/param[starts-with( @name, 'm_t_default_')]"/>
 
- 					<!--xts:delete select="/root/env/param[starts-with( @name, 'stack_') and @name != 'stack_0']"/>
 
-                     < xts:replace select="/root/env/param[@name = 'ps_nav_op']">
 
-                         <param name="ps_nav_op">stack-down</param>
 
-                     </xts:replace -->
 
- 					<!-- Agent Name must be set -->
 
- 					<xsl:if test="/root/env/param[@name='m_p_defaultName']!=''">
 
- 						<xts:append>
 
- 							<env>
 
- 								<param name="agentName">
 
- 									<xsl:value-of select="/root/env/param[@name='m_p_defaultName']"/>
 
- 								</param>
 
- 							</env>
 
- 						</xts:append>
 
- 					</xsl:if>
 
- 				</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/ags/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"/>
 
- 	<!--
 
- 	===============================================================================================
 
- 	reload - reload the user preferences
 
- 	===============================================================================================
 
- 	-->
 
- 	<xts:block id="reload" condition=".[/root/env/param[@name='m_class'] = 'account']" mandatory="false" processor="XML" type="exec" dependency="formlogic_init">
 
- 		<xts:sequence>
 
- 			<xts:append select="/root/env">
 
- 				<param name="m_reload">userPreference</param>
 
- 			</xts:append>
 
- 		</xts:sequence>
 
- 	</xts:block>
 
- 	<!--	
 
- 	================================================================================
 
- 	encode the agent items again
 
- 	================================================================================
 
- 	-->
 
- 	<xts:block id="encodeResponseAgentDefinition" dependency="doFrmCommand" processor="XSLT" type="exec">
 
- 		<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:xtsext="xalan://com.cognos.xts.ext.XTSExt">
 
- 			<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
 
- 			<pf:serialize-xml/>
 
- 			<pf:variables/>
 
- 			<xsl:template match="/">
 
- 				<xts:sequence>
 
- 					<xsl:variable name="markup">
 
- 						<xsl:call-template name="serialize-xml">
 
- 							<xsl:with-param name="node-set" select="/root/response/agent_definition"/>
 
- 						</xsl:call-template>
 
- 					</xsl:variable>
 
- 					<xts:delete select="/root/env/param[@name='agent_response_definition_blob']"/>
 
- 					<xts:append select="/root/env">
 
- 						<param name="agent_response_definition_blob">
 
- 							<xsl:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport, '_settemplatename_encoderesponseagentdefinition_settemplateid_submit001'), xtsext:web64encode( string( $markup ), true()))"/>
 
- 						</param>
 
- 					</xts:append>
 
- 				</xts:sequence>
 
- 			</xsl:template>
 
- 		</xsl:stylesheet>
 
- 	</xts:block>
 
- 	<!--
 
- 		Verify the type of object we have a duplicate of
 
- 	-->
 
- 	<xts:block id="verifyAgentType" type="exec" mode="interpret" processor="XSLT" dependency="encodeResponseAgentDefinition formlogic_init reload" 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:xtsext="xalan://com.cognos.xts.ext.XTSExt"  xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/">
 
- 			<xsl:output method="xml" version="1.0" encoding="UTF-8"/>
 
- 			<xsl:template match="/">
 
- 				<xts:sequence>
 
- 				 <xsl:variable name="singleQuote">'</xsl:variable>
 
- 					<xts:append>
 
- 						<xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
 
- 							<send:request provider="cm" requester="AGS:submit">
 
- 								<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>
 
- 													<xsl:value-of select="/root/env/param[@name='m_path']"/>
 
- 														<xsl:text>/*[@name=</xsl:text>
 
- 													<xsl:choose>
 
- 														<xsl:when test="contains(/root/env/param[@name='agentName'], '"')">'</xsl:when>
 
- 														<xsl:otherwise>"</xsl:otherwise>
 
- 													</xsl:choose>
 
- 													<xsl:value-of select="/root/env/param[@name='agentName']"/>
 
- 													<xsl:choose>
 
- 														<xsl:when test="contains(/root/env/param[@name='agentName'], '"')">'</xsl:when>
 
- 														<xsl:otherwise>"</xsl:otherwise>
 
- 													</xsl:choose>
 
- 													<xsl:text>]</xsl:text>
 
- 												</cm:search>
 
- 												<cm:properties>
 
- 													<cm:property name="objectClass"/>
 
- 												</cm:properties>
 
- 											</cm:query>
 
- 										</cm:requests>
 
- 									</cm:query>
 
- 								</xts:transform>
 
- 							</send:request>
 
- 						</xts:transform>
 
- 					</xts:append>					
 
- 				</xts:sequence>
 
- 			</xsl:template>
 
- 		</xsl:stylesheet>
 
- 	</xts:block>
 
- 	<!--
 
- 	===============================================================================================
 
- 		Process Response
 
- 	===============================================================================================
 
- 	-->
 
- 	<xts:block id="save_redirect" dependency="verifyAgentType" mode="output" processor="XSLT" type="exec" mimeType="text/html" mandatory="false">
 
- 		<!-- 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="ags/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: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/xts-cm/1/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/" exclude-result-prefixes="xts lyt pf dp df cp cf xtsext SOAP-ENV bus cm SOAP-ENC dbg">
 
- 			<xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
 
- 			<!-- current file name -->
 
- 			<xsl:variable name="mname" select="'/submit.xts'"/>
 
- 			<!-- 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:otherwise>
 
- 						<!-- Save succeeded, hide dialog -->
 
- 						<html>
 
- 							<head>
 
- 								<script type="text/javascript" src="../ags/layout.js">//</script>
 
- 								<script type="text/javascript">
 
- 					//initialise function		
 
- 					function initialiseSubmit(){
 
- 						var cf = parent.getConfigFrame();
 
- 						with (cf) {
 
- 							//just in case
 
- 							doClosePopUp();
 
- 							hideDialogFrame();
 
-                         <xsl:if test="/root/env/param[@name='m_path']">
 
-                             cf.cfgSet("so.defaultLocation", "<xsl:value-of select="xtsext:javascriptencode(/root/env/param[@name='m_path'])"/>");
 
-                         </xsl:if>
 
-                             // Save the path 
 
-             <xsl:if test="/root/env/param[@name='path']!=''">
 
-                  <xsl:text/>if (cfgSet) cfgSet("ReportFolder","<xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='path']))"/>");<xsl:text/>
 
-             </xsl:if>
 
-                             // update the window title
 
-             <xsl:if test="/root/env/param[@name='agentName']!=''">
 
-                  <xsl:text/>if (cfgSet) cfgSet("ReportName", "<xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='agentName']))"/>");<xsl:text/>
 
-             </xsl:if>
 
-                             parent.messageIFrame.document.forms[0].agent_definition_blob.value = "<xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='agent_response_definition_blob']))"/>";							
 
-                             // we aren't dealing with a new report now 
 
-                             cfgSet("NewReport", false);
 
-                             agentHasChanged(false);
 
-                             // do the name of agent 
 
-                             setWindowTitle();
 
-                              //do the next command whatever it is
 
-                             getCommandStackManager().processCommandStack();
 
- 						}					
 
- 					}
 
- 			 </script>
 
- 							</head>
 
- 							<body onload="initialiseSubmit()"> <!--dbg:dumpxml select="/"/-->
 
- 							</body>
 
- 						</html>
 
- 					</xsl:otherwise>
 
- 				</xsl:choose>
 
- 			</xsl:template>
 
- 			<xsl:template match="/root/SoapFault">
 
- 				<xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text><dp:page>
 
- 					<dp:script>
 
- 						<script type="text/javascript" src="../ags/layout.js">//</script>
 
- 						<script type="text/javascript">
 
- 						function stringReplace(origString, valToReplace, newString){
 
- 							var strRegExp = new RegExp(); 
 
- 							strRegExp.compile(valToReplace, "g");	
 
- 							return origString.replace(strRegExp, newString);
 
- 							} 
 
- 						function saveOverwrite(){
 
- 							var cf = getConfigFrame();
 
- 							if (cf)
 
- 							{
 
- 								cf.hideDialogFrame();
 
- 								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>
 
- 							<!-- have to add the trusted Credential generation if it's not already in there -->
 
- 							<xsl:if test="not(/root/env/param[@name = 'm_sp_credential'])">
 
- 									cf.dlgSetParm("h_CAM_action", "generateTC");	
 
- 								</xsl:if>
 
- 								cf.dlgSetParm("action", "add");
 
- 								cf.dlgSetParm("overwrite", "true");
 
- 								cf.dlgSubmit();
 
- 							}
 
- 						}
 
- 						function init(){
 
- 							var cf=null;
 
- 							if (this.getConfigFrame && (cf=this.getConfigFrame())!=null && cf.showDialogFrame) {
 
- 								cf.showDialogFrame(200); 
 
-                             }
 
-                             
 
-                             //just in case
 
- 							getConfigFrame().doClosePopUp();
 
- 							
 
- 							if (document.getElementById("exists_string"))
 
- 								document.getElementById("exists_string").appendChild(document.createTextNode(stringReplace("<xts:string id="SAVE_ERROR_AGENT_EXISTS"/>", "\\^0", "<xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='m_p_defaultName']))"/>")));
 
- 						}
 
-                          
 
-                           function toggleExceptionDetailVisibility(name) {
 
-                                 var element = document.getElementById(name);
 
-                                 if(element){
 
-                                     if(element.style.display=='none'){
 
-                                         element.style.display='';
 
-                                     }else{
 
-                                         element.style.display='none';
 
-                                     }
 
-                                 }
 
-                             }
 
-                             
 
-                             /*
 
-                              * A previously saved agent has been removed from the content store. In this case
 
-                              * give the user the option to save it
 
-                              */
 
-                             function handleDeletedAgent(yesPressed) {
 
-                                 //set the agent properties 
 
-                                 var cf = parent.getConfigFrame();
 
-                                 
 
-                                 with(cf) {
 
-                                     var manager = getCommandStackManager();
 
-                                     
 
-                                     if (yesPressed) {
 
-                                         //push 'save as' onto the command stack
 
-                                         manager.getCommandStack().push("saveas()");
 
-                                     }
 
-                                     else {
 
-                                         hideDialogFrame();
 
-                                     }
 
-                                     //process command stack
 
-                                     manager.processCommandStack();
 
-                                 }
 
-                             }
 
- 						</script>
 
- 					</dp:script>
 
- 					<!-- 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="#" onclick="getConfigFrame().hideDialogFrame()">
 
- 								<dp:closeMarker/>
 
- 							</a>
 
- 						</dp:close>
 
- 					</dp:header>
 
- 					<!-- layout -->
 
- 					<lyt:layout style="1" border="no">
 
- 						<lyt:section>
 
- 							<xsl:choose>
 
- 								<!-- the agent has been deleted and it is still open in ES-->
 
- 								<xsl:when test=".//bus:exception/errorCode='cmEmptySelection'">
 
- 									<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>
 
- 												<br/>
 
- 												<xts:string id="BROKEN_AGENT_LINK_WARNING"/>
 
- 											</dp:description>
 
- 										</dp:boxSection>
 
- 									</dp:box>
 
- 								</xsl:when>
 
- 								<!-- an agent exists with the same name-->
 
- 								<xsl:when test=".//bus:exception/errorCode='cmDuplicateName'">
 
- 									<xsl:choose>
 
- 										<xsl:when test="/root/*[local-name()='queryResponse']/queryResult/item/objectClass/value='agentDefinition'">
 
- 											<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"/>
 
- 														<br/>
 
- 														<xts:string id="SAVE_ERROR_AGENT_EXISTS_QUESTION"/>
 
- 													</dp:description>
 
- 												</dp:boxSection>
 
- 											</dp:box>
 
- 										</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"/>
 
- 														<br/>
 
- 														<xts:string id="SAVE_ERROR_AGENT_OVERWRITE_QUESTION"/>
 
- 													</dp:description>
 
- 												</dp:boxSection>
 
- 											</dp:box>
 
- 										</xsl:otherwise>
 
- 									</xsl:choose>
 
- 								</xsl:when>
 
- 								<!-- an agent exists with same name but different credentials -->
 
- 								<xsl:when test=".//bus:exception/errorCode='cmNoWrite'">
 
- 									<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"/>
 
- 												<br/>
 
- 												<xsl:value-of select=".//bus:exception/bus:message"/>
 
- 											</dp:description>
 
- 										</dp:boxSection>
 
- 									</dp:box>
 
- 								</xsl:when>
 
- 								<!-- an agent exists with same name but different credentials -->
 
- 								<xsl:when test=".//bus:exception/errorCode='cmUpdateFailed1'">
 
- 									<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>
 
-     											<xsl:for-each select=".//bus:exception/bus:message">
 
-     												<xsl:value-of select="./messageString"/>
 
-     												<br/>
 
-     											</xsl:for-each>
 
- 											</dp:description>
 
- 										</dp:boxSection>
 
- 									</dp:box>
 
- 								</xsl:when>
 
- 								<xsl:otherwise>
 
- 									<dp:list>
 
- 										<dp:section>
 
- 											<dp:text>
 
- 												<xsl:text>status : </xsl:text>
 
- 												<b style="color:red">request failed</b>
 
- 												<br/>
 
- 												<xsl:text>faultcode : </xsl:text>
 
- 												<tt style="color:blue">
 
- 													<xsl:value-of select=".//SOAP-ENV:Fault/faultcode"/>
 
- 												</tt>
 
- 												<br/>
 
- 												<xsl:text>faultstring : </xsl:text>
 
- 												<tt style="color:blue">
 
- 													<xsl:value-of select=".//SOAP-ENV:Fault/faultstring"/>
 
- 												</tt>
 
- 												<br/>
 
- 												<xsl:for-each select=".//xts:exception">
 
- 													<b>xts:exception</b>
 
- 													<br/>
 
- 													<xsl:text>code </xsl:text>
 
- 													<tt style="color:blue">
 
- 														<xsl:value-of select=".//xts:exceptionCode"/>
 
- 													</tt>
 
- 													<br/>
 
- 													<xsl:text>msg </xsl:text>
 
- 													<tt style="color:blue">
 
- 														<xsl:value-of select=".//xts:exceptionMsg"/>
 
- 													</tt>
 
- 													<br/>
 
- 													<xsl:text>exception </xsl:text>
 
- 													<a href="#" onclick="toggleExceptionDetailVisibility('exception_detail_{position()}')">detail</a>
 
- 													<div id="exception_detail_{position()}" style="display:none">
 
- 														<tt style="color:blue">
 
- 															<xsl:value-of select=".//xts:exceptionDetail"/>
 
- 														</tt>
 
- 													</div>
 
- 													<br/>
 
- 												</xsl:for-each>
 
- 												<xsl:for-each select=".//bus:exception/*">
 
- 													<xsl:if test="name()!='bus:message'">
 
- 														<xsl:value-of select="name()"/>
 
- 														<xsl:text> : </xsl:text>
 
- 													</xsl:if>
 
- 													<tt style="color:blue">
 
- 														<xsl:value-of select="."/>
 
- 													</tt>
 
- 													<br/>
 
- 												</xsl:for-each>
 
- 											</dp:text>
 
- 										</dp:section>
 
- 									</dp:list>
 
- 								</xsl:otherwise>
 
- 							</xsl:choose>
 
- 						</lyt:section>
 
- 					</lyt:layout>
 
- 					<lyt:layout style="2">
 
- 						<lyt:section/>
 
- 						<lyt:section>
 
- 							<xsl:choose>
 
- 								<xsl:when test=".//bus:exception/errorCode='cmDuplicateName'">
 
- 									<xsl:choose>
 
- 										<xsl:when test="/root/*[local-name()='queryResponse']/queryResult/item/objectClass/value='agentDefinition'">
 
- 											<dp:buttonGroup>
 
- 												<df:button df:id="DIALOG_YES_BUTTON" df:style="href" df:href="#" onclick="saveOverwrite();"/>
 
- 												<df:button df:id="DIALOG_NO_BUTTON" df:style="href" df:href="#" onclick="getConfigFrame().saveas();"/>
 
- 												<df:button df:id="DIALOG_CANCEL_BUTTON" df:style="href" df:href="#" onclick="getConfigFrame().hideDialogFrame();"/>
 
- 											</dp:buttonGroup>
 
- 										</xsl:when>
 
- 										<xsl:otherwise>
 
- 											<dp:buttonGroup>
 
- 												<df:button df:id="IDS_OK" df:style="href" df:href="#" onclick="getConfigFrame().saveas();"/>
 
- 												<df:button df:id="DIALOG_CANCEL_BUTTON" df:style="href" df:href="#" onclick="getConfigFrame().hideDialogFrame();"/>
 
- 											</dp:buttonGroup>
 
- 										</xsl:otherwise>
 
- 									</xsl:choose>
 
- 								</xsl:when>
 
- 								<xsl:when test=".//bus:exception/errorCode='cmNoWrite'">
 
- 									<dp:buttonGroup>
 
- 										<df:button df:id="IDS_OK" df:style="href" df:href="#" onclick="getConfigFrame().saveas();"/>
 
- 										<df:button df:id="DIALOG_CANCEL_BUTTON" df:style="href" df:href="#" onclick="getConfigFrame().hideDialogFrame();"/>
 
- 									</dp:buttonGroup>
 
- 								</xsl:when>
 
- 								<xsl:when test=".//bus:exception/errorCode='cmEmptySelection'">
 
- 									<dp:buttonGroup>
 
- 										<df:button df:id="DIALOG_YES_BUTTON" df:style="href" df:href="#" onclick="handleDeletedAgent(true);"/>
 
- 										<df:button df:id="DIALOG_NO_BUTTON" df:style="href" df:href="#" onclick="handleDeletedAgent(false);"/>
 
- 									</dp:buttonGroup>
 
- 								</xsl:when>
 
- 								<xsl:otherwise>
 
- 									<dp:buttonGroup>
 
- 										<df:button df:id="IDS_OK" df:style="href" df:href="#" onclick="getConfigFrame().hideDialogFrame();"/>
 
- 									</dp:buttonGroup>
 
- 								</xsl:otherwise>
 
- 							</xsl:choose>
 
- 						</lyt:section>
 
- 					</lyt:layout>
 
- 				</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" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" version="1.0">
 
- 			<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
 
- 			<xsl:template match="/">
 
- 				<SoapFault>
 
- 					<xsl:copy>
 
- 						<xsl:copy-of select="/root/fault"/>
 
- 					</xsl:copy>
 
- 				</SoapFault>
 
- 			</xsl:template>
 
- 		</xsl:stylesheet>
 
- 	</xts:block>
 
- </xts:morphlet>
 
 
  |