| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686 | 
							- <?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/" messageBase="messages/AGS.xml,messages/portal.xml, messages/portalRL.xml" resolverBase="prompting" includeConfig="true" requiredCapability="canUseEventStudio,canUseScheduling">
 
-     <!--
 
- 	===============================================================================================
 
- 	formlogic_init - standard form logic initialization
 
- 	===============================================================================================
 
- 	-->
 
-     <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt"/>
 
-     <!--
 
-         ===============================================================================================
 
-         execute-method - 
 
-         ===============================================================================================
 
-     -->
 
- 	<xts:block id="execute-method" dependency="formlogic_init" processor="XSLT" type="exec" condition=".[/root/env/param[@name='method'] and /root/env/param[@name='method']!='']" mandatory="false">
 
- 		<xts:logicsheet path="logicsheets/buslogic.xslt"/>
 
- 		<xsl:stylesheet  version="1.0"
 
- 				xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
 
- 				xmlns:prompt="http://developer.cognos.com/schemas/xts/portal/iPrompting/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:key name="env-param" match="/root/env/param" use="@name"/>
 
- 			<xsl:template match="/">
 
- 				<xts:sequence>
 
- 					<xts:append>
 
- 						<promptRequest>
 
- 							<send:request provider="xts" option="xml-multipart">
 
- 								<xsl:choose>
 
- 									<xsl:when test="key('env-param', 'method') = 'edit' ">
 
- 										<prompt:collect>
 
- 											<returnMorphlet>ags/scheduleController.xts</returnMorphlet>
 
- 											<ps_nav_op>maintain</ps_nav_op>
 
- 											<runAsync>true</runAsync>
 
- 											<reportSpec><xsl:value-of select="key('env-param', 'agentReportSpec')"/></reportSpec>
 
- 										</prompt:collect>
 
- 									</xsl:when>
 
- 									<xsl:otherwise>
 
- 										<xsl:element name="{key('env-param', 'method')}" namespace="http://developer.cognos.com/schemas/xts/portal/iPrompting/1/">
 
- 											<returnMorphlet>ags/scheduleController.xts</returnMorphlet>
 
- 											<ps_nav_op>maintain</ps_nav_op>										
 
- 										</xsl:element>
 
- 									</xsl:otherwise>
 
- 								</xsl:choose>
 
- 							</send:request>
 
- 						</promptRequest>
 
- 					</xts:append>
 
- 				</xts:sequence>
 
- 			</xsl:template>
 
- 		</xsl:stylesheet>
 
- 	</xts:block>
 
-     <!--
 
-         ===============================================================================================
 
-         check-state - 
 
-         ===============================================================================================
 
-     -->
 
-     <xts:block id="check-state" path="/portal/iPrompting/logicsheets/check-state.xslt" processor="XSLT" type="exec" dependency="execute-method" mandatory="false">
 
- 	<xts:logicsheet path="logicsheets/portal.xsl"/>
 
- 	<xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>		
 
-     </xts:block>
 
-     <!--
 
- 	===============================================================================================
 
- 	appendAgentDefinitionBlob - Append the AgentDefinition blob here so we can create the tasks.
 
- 	===============================================================================================
 
-     -->
 
-     <xts:block id="appendAgentDefinitionBlob" dependency="check-state" processor="XSLT" type="exec" condition=".[/root/env/param[@name = 'agent_definition_blob'] and /root/env/param[@name = 'agent_definition_blob'] !='' and /root/view='properties']" mandatory="false">
 
-         <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
 
-         <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
 
-             xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xtsext">
 
-             <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
 
-             <xsl:template match="/">
 
-                 <xts:sequence>
 
-                     <xts:append select="/root">
 
-                         <xsl:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap_settemplatename_decodeagentdefinition_settemplateid_dialogadapter001', string( /root/env/param[@name = 'agent_definition_blob'])), true() )" disable-output-escaping="yes"/>
 
-                     </xts:append>
 
-                 </xts:sequence>
 
-             </xsl:template>
 
-         </xsl:stylesheet>
 
-     </xts:block>
 
-     
 
-      <!--
 
- 	===============================================================================================
 
- 		Main content request	
 
- 	===============================================================================================
 
- 	-->
 
-     <xts:block id="getContent" processor="XSLT" type="exec" dependency="appendAgentDefinitionBlob" condition=".[(count(/root/agent_definition/items/item) > 0 and /root/env/param[@name = 'agent_definition_blob'] and /root/env/param[@name = 'agent_definition_blob'] != ''  and /root/view='properties')]"  mandatory="false">
 
-         <xts:logicsheet path="logicsheets/presentation/dialog/templates.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: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/" xmlns:dt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/templates/" 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:key name="env-param" match="/root/env/param" use="@name"/>
 
-             <xsl:template match="/">
 
-                 <xts:sequence>
 
-                     <xts:append>
 
-                         <contentResponse>
 
-                             <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>
 
-                                                 <!--xsl:for-each select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']//*[local-name()='taskObject']//*[local-name()='searchPath' and text()]"-->
 
-                                                 <xsl:for-each select="/root/agent_definition/items/item">
 
-                                                     <xsl:choose>
 
-                                                         <xsl:when test="./targetStoreID[text()]">
 
-                                                             <cm:query>
 
-                                                                 <cm:search>
 
-                                                                     <!-- The path of the actual object-->
 
-                                                                     <xsl:value-of select="./targetStoreID"/>
 
-                                                                 </cm:search>
 
-                                                                 <cm:properties>
 
-                                                                     <cm:property name="defaultName"/>
 
-                                                                     <cm:property name="defaultOutputFormat"/>
 
-                                                                     <cm:property name="searchPath"/>
 
-                                                                     <cm:property name="storeID"/>
 
-                                                                     <cm:property name="uri"/>
 
-                                                                     <cm:property name="base"/>
 
-                                                                     <cm:property name="modificationTime"/>
 
-                                                                     <cm:property name="format"/>
 
-                                                                     <cm:property name="contentLocale"/>
 
-                                                                     <cm:property name="defaultScreenTip"/>
 
-                                                                     <cm:property name="permissions"/>
 
-                                                                     <cm:property name="usage"/>
 
-                                                                     <cm:property name="target"/>
 
-                                                                     <cm:property name="disabled"/>
 
-                                                                     <cm:property name="ancestors"/>
 
-                                                                 </cm:properties>
 
-                                                             </cm:query>
 
-                                                         </xsl:when>
 
-                                                         <xsl:otherwise>
 
-                                                             <cm:query>
 
-                                                                 <cm:search>
 
-                                                                     <!-- Create a dummy query so that we make sure the response count matchs for each item-->
 
-                                                                     <xsl:text>~</xsl:text>
 
-                                                                 </cm:search>
 
-                                                                 <cm:properties/>
 
-                                                             </cm:query>
 
-                                                         </xsl:otherwise>
 
-                                                     </xsl:choose>
 
-                                                 </xsl:for-each>
 
-                                             </cm:requests>
 
-                                         </cm:query>
 
-                                     </xts:transform>
 
-                                 </send:request>
 
-                             </xts:transform>
 
-                         </contentResponse>
 
-                     </xts:append>
 
-                 </xts:sequence>
 
-             </xsl:template>
 
-         </xsl:stylesheet>
 
-     </xts:block>
 
-     <!--
 
- 	===============================================================================================
 
- 	createTasksResponse - This block will merge the response form the getContent block with the agent_definitions items.
 
-                                         For the tasks that do not have a selected object we generate a dummy name and type.
 
- 	===============================================================================================
 
-     -->
 
-     <xts:block id="createTasksResponse" dependency="getContent" processor="XSLT" type="exec" condition=".[(/root/env/param[@name = 'agent_definition_blob'] and /root/env/param[@name = 'agent_definition_blob'] != ''  and /root/view='properties')]" mandatory="false">
 
-         <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
 
-         <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
 
-             xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xtsext">
 
-             <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
 
-             
 
-             <xsl:key name="env-param" match="/root/env/param" use="@name"/>
 
-             
 
-             <xsl:template match="/">
 
-                 <xts:sequence>
 
-                     <xts:append select="/root">
 
-                         <xsl:call-template name="process"/>
 
-                     </xts:append>
 
-                 </xts:sequence>
 
- 				<xts:sequence>
 
- 					<xts:delete select="/root/env/param[@name='pagerfromtasks']"/>
 
- 					<xts:delete select="/root/env/param[@name='pagertotasks']"/>
 
- 					<xts:delete select="/root/env/param[@name='pagerfrom_dtasks']"/>
 
- 					<xts:delete select="/root/env/param[@name='pagerto_dtasks']"/>
 
- 				</xts:sequence>
 
-             </xsl:template>
 
-             
 
-              <xsl:template name="process">
 
-              
 
- 				<xsl:variable name="userPrefs" select="/root/session/param"/>					
 
- 				<xsl:variable name="userPrefsDefault" select="/root/system/param[@name='defaultPortalPreferences']"/>
 
- 				
 
- 				<xsl:variable name="maxObjects">
 
- 					<xsl:choose>
 
- 						<xsl:when test="string(key('env-param','m_pagertotasks')) !='' and string(key('env-param','m_pagerfromtasks')) !=''">
 
- 							<xsl:value-of select="(key('env-param','m_pagertotasks') - key('env-param','m_pagerfromtasks')) + 1"/>
 
- 						</xsl:when>
 
- 						<xsl:when test="$userPrefs[@name='linesPerPage']!=''">
 
- 							<xsl:value-of select="$userPrefs[@name='linesPerPage']"/>
 
- 						</xsl:when>
 
- 						<xsl:otherwise>
 
- 							<xsl:value-of select="userPrefsDefault/pref[@name='lines']"/>
 
- 						</xsl:otherwise>
 
- 					</xsl:choose>
 
- 				</xsl:variable>
 
- 						
 
- 				<xsl:variable name="skipObjects">
 
- 					<xsl:choose>
 
- 						<xsl:when test="key('env-param','m_pagerfromtasks') and key('env-param','m_pagerfromtasks')!=''">
 
- 							<xsl:value-of select="key('env-param','m_pagerfromtasks')-1"/>
 
- 						</xsl:when>
 
- 						<xsl:when test="key('env-param','m_taskssection')!=''">
 
- 							<xsl:choose>
 
- 								<xsl:when test="key('env-param','m_taskssection')!='-1'">
 
- 									<xsl:value-of select="(key('env-param','m_taskssection') -1)"/>
 
- 								</xsl:when>
 
- 								<xsl:otherwise>
 
- 									<xsl:value-of select="($maxObjects) * -1"/>
 
- 								</xsl:otherwise>
 
- 							</xsl:choose>
 
- 						</xsl:when>
 
- 						<xsl:otherwise>0</xsl:otherwise>
 
- 					</xsl:choose>
 
- 				</xsl:variable>
 
-    
 
- 				<xsl:variable name="start_pos">
 
-                     <xsl:value-of select="number($skipObjects)+1"/>
 
- 				</xsl:variable>
 
- 				
 
- 				<xsl:variable name="end_pos">
 
-                     <xsl:value-of select="number($start_pos)+number($maxObjects)"/>
 
- 				</xsl:variable>
 
- 				
 
-                 <queryResponse xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
 
-                     <xsl:if test="boolean(/root/agent_definition/items/item)">
 
-                         <queryReply>
 
- 							<xsl:if test="boolean(/root/agent_definition/agentParameters/*)">
 
- 								<!-- take a copy of the agent parameters. Those are the ones stored under the report-->
 
- 								<xsl:copy-of select="/root/agent_definition/agentParameters/*"/>
 
- 							</xsl:if>
 
-                             <xsl:for-each select="/root/agent_definition/items/item">
 
-                                 <xsl:variable name="index" select="position()"/>
 
-                                 <xsl:if test="position() >= number($start_pos) and position() <= number($end_pos)">
 
- 									<agentTaskDefinition>
 
- 										<objectClass>agentTaskDefinition</objectClass>
 
- 										<searchPath type="cm:stringProp"><xsl:value-of select="./id"/></searchPath>
 
- 										<displaySequence type="cm:nonNegativeIntegerProp"><xsl:value-of select="$index"/></displaySequence>
 
- 										<taskObject type="cm:baseClassArrayProp">
 
- 											<!-- Copy contents of call to CM -->
 
- 											<xsl:choose>
 
- 												<!-- it's possible that we don't have access to the object in which case the query doesn't return anything - so just add default info -->
 
- 												<xsl:when test="./targetStoreID != '' and /root/*[local-name()='contentResponse']//*[local-name()='queryReply'][position()=$index]/*">
 
- 													<xsl:copy-of select="/root/*[local-name()='contentResponse']//*[local-name()='queryReply'][position()=$index]/*"/>
 
- 												</xsl:when>
 
- 												<xsl:otherwise>
 
- 													<xsl:variable name="objectType">
 
- 														<xsl:call-template name="getType">
 
- 															<xsl:with-param name="type"><xsl:value-of select="./type"/></xsl:with-param>
 
- 														</xsl:call-template>
 
- 													</xsl:variable>
 
- 													<xsl:element name="{$objectType}">
 
- 														<!-- Copy contents of call to CM -->
 
- 														<objectClass><xsl:value-of select="$objectType"/></objectClass>
 
- 														<defaultName type="cm:tokenProp"><xsl:value-of select="./name"/></defaultName>
 
- 													</xsl:element>
 
- 												</xsl:otherwise>
 
- 											</xsl:choose>
 
- 										</taskObject>
 
- 										<position><xsl:value-of select="number(position()) -1"/></position>
 
- 									</agentTaskDefinition>
 
-                                 </xsl:if>
 
-                             </xsl:for-each>
 
-                         </queryReply>
 
-                     </xsl:if>
 
-                 </queryResponse>
 
-             </xsl:template>
 
-                 
 
-              <!-- only build the appropriate type for items which might not be saved - ie are created as part of the agent -->
 
-             <xsl:template name="getType">
 
-                 <xsl:param name="type"/>
 
-                 <xsl:choose>
 
-                     <xsl:when test="$type = 'message'">
 
-                         <xsl:text>memo</xsl:text>
 
-                     </xsl:when>
 
-                     <xsl:when test="$type='sql'">
 
-                         <xsl:text>storedProcedureTask</xsl:text>
 
-                     </xsl:when>
 
-                     <xsl:when test="$type='web'">
 
-                         <xsl:text>webServiceTask</xsl:text>
 
-                     </xsl:when>
 
-                     <xsl:when test="$type = 'url'">
 
-                         <!-- Need to do be a bit smarter here in order to get the shortcutRSSTask or the urlRSSTask - although it doesn't really matter
 
-                                seeing as the only thing the type is used for is to display the icon - and the icon's are the same for both -->
 
-                         <xsl:text>shortcutRSSTask</xsl:text>
 
-                     </xsl:when>
 
-                     <!-- all the following mappings are needed if we don't have access to the item - we can build a type from the agentDefinition -->
 
-                     <xsl:when test="$type = 'report'">
 
-                         <xsl:text>report</xsl:text>
 
-                     </xsl:when>
 
-                     <xsl:when test="$type = 'agent'">
 
-                         <xsl:text>agentDefinition</xsl:text>
 
-                     </xsl:when>
 
-                     <xsl:when test="$type = 'job'">
 
-                         <xsl:text>jobDefinition</xsl:text>
 
-                     </xsl:when>
 
-                     <xsl:when test="$type = 'import'">
 
-                         <xsl:text>importDeployment</xsl:text>
 
-                     </xsl:when>
 
-                     <xsl:when test="$type = 'export'">
 
-                         <xsl:text>exportDeployment</xsl:text>
 
-                     </xsl:when>
 
-                     <xsl:when test="$type = 'content'">
 
-                         <xsl:text>contentTask</xsl:text>
 
-                     </xsl:when>
 
-                     <xsl:when test="$type = 'metric'">
 
-                         <xsl:text>metricsMaintenanceTask</xsl:text>
 
-                     </xsl:when>
 
-                     <xsl:when test="$type = 'planningMacro'">
 
-                         <xsl:text>planningMacroTask</xsl:text>
 
-                     </xsl:when>
 
-                     <xsl:when test="$type = 'index'">
 
-                         <xsl:text>indexUpdateTask</xsl:text>
 
-                     </xsl:when>
 
-                     <xsl:when test="$type = 'migration'">
 
-                         <xsl:text>migrationTask</xsl:text>
 
-                     </xsl:when>
 
-                     <xsl:when test="$type = 'approval' or $type='notification' ">
 
-                         <xsl:text>humanTask</xsl:text>
 
-                     </xsl:when>
 
-                 </xsl:choose>
 
-             </xsl:template>
 
-         </xsl:stylesheet>
 
-     </xts:block>
 
-     
 
-     <!--
 
- 	===============================================================================================
 
- 	appendAgentDefinitionBlob - Append the AgentDefinition blob here so we can create the tasks.
 
- 	===============================================================================================
 
-     -->
 
-     <xts:block id="appendQueryResponse" dependency="createTasksResponse" processor="XSLT" type="exec" condition=".[(/root/env/param[@name = 'agent_definition_blob'] and /root/env/param[@name = 'agent_definition_blob'] != '' and /root/view='properties' )]" mandatory="false">
 
-         <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
 
-         <xts:logicsheet path="logicsheets/portal.xsl"/>
 
-         <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
 
-             xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" 
 
-             xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
 
-             xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
 
-             exclude-result-prefixes="xsl xtsext cm pf">
 
-             <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="builtResponse">
 
-                         <xsl:call-template name="serialize-xml">
 
-                             <xsl:with-param name="node-set" select="/root/cm:queryResponse"/>
 
-                         </xsl:call-template>
 
-                     </xsl:variable>
 
-                     <!-- Delete any existing query responses -->
 
-                     <xts:delete select="/root/env/param[@name='queryResponse']"/>
 
-                     <xts:append select="/root/env">
 
-                         <param name="queryResponse">
 
-                             <xsl:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport, '_settemplatename_encodeagentdefinition_settemplateid_dialogadapter003'), xtsext:web64encode( string( $builtResponse ), true()))"/>
 
-                         </param>
 
-                     </xts:append>
 
-                 </xts:sequence>
 
-             </xsl:template>
 
-         </xsl:stylesheet>
 
-     </xts:block>
 
-     
 
-     <!--
 
- 	===============================================================================================
 
- 	initController - The first time this morphlet gets executed, set the controller_state to
 
- 	schedule|markup to display the schedule
 
- 	===============================================================================================
 
-     -->
 
-     <xts:block id="initController" dependency="appendQueryResponse" processor="XSLT" type="exec" condition=".[(not(/root/env/param[@name='controller_state']) or /root/env/param[@name='controller_state']='' and /root/view='properties') ]" mandatory="false">
 
-         <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
 
-         <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
 
-             xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xtsext">
 
-             <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
 
-             <xsl:template match="/">
 
-                 <xts:sequence>
 
-                     <!-- make sure we start up nicely -->
 
-                     <xts:delete select="/root/env/param[not( @name='queryResponse' or starts-with(@name,'AgentTask') or @name='agent_definition_blob' or @name='agentReportSpec' or @name='scheduleParameters' or @name='m' or @name='b_action' or @name='m_path' or @name='cafcontextid' or @name='ui.routingServerGroup' or starts-with(@name,'ps_nav') or starts-with(@name, 'stack'))]"/>
 
-                     <!-- make this generic - we either have no controller_state - that would prefered or we have an empty one -->
 
-                     <xts:append select="/root/env">
 
-                         <param name="controller_state">schedule|markup</param>
 
-                     </xts:append>
 
-                     <xts:delete select="/root/agent_definition"/>
 
-                 </xts:sequence>
 
-             </xsl:template>
 
-         </xsl:stylesheet>
 
-     </xts:block>
 
-     
 
-     <!--
 
- 	===============================================================================================
 
- 	callMorphlet - Calls the right wizard page depending on the controller_state information
 
- 	===============================================================================================
 
- 	-->
 
-     <xts:block id="callMorphlet" processor="XSLT" dependency="initController" type="exec" condition=".[ (/root/env/param[@name='controller_state'] = 'schedule|markup' or /root/env/param[@name='controller_state'] = 'schedule|finished') and /root/view='properties']" mandatory="false">
 
-         <xts:logicsheet path="logicsheets/portal.xsl"/>
 
-         <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
 
-         <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:req-params="http://developer.cognos.com/schemas/request/params" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" exclude-result-prefixes="xsl dlgctrl xtsext req-params pf">
 
-             <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
 
-             <!-- add any theme variables -->
 
-             <pf:variables/>
 
-             <xsl:template match="/">
 
-                 <xts:sequence>
 
-                     <!-- set schedule -->
 
-                     <dlgctrl:XTS2Request>
 
-                         <dlgctrl:stackName>scheduleStack</dlgctrl:stackName>
 
-                         <dlgctrl:target>/ags/setSchedule.xts</dlgctrl:target>
 
-                         <req-params:param name="titlePrefix">
 
-                             <xts:string id="NEW_AGENT_SCHEDULE_TITLE"/>
 
-                         </req-params:param>
 
-                         <req-params:param name="titlePostfix">
 
-                             <xts:string id="NEW_AGENT_WIZARD_TITLE"/>
 
-                         </req-params:param>
 
-                         <req-params:param name="scheduleParameters">
 
-                             <xsl:value-of select="/root/env/param[@name='scheduleParameters']"/>
 
-                         </req-params:param>
 
-                         <req-params:param name="ui.routingServerGroup">
 
-                             <xsl:value-of select="/root/env/param[@name='ui.routingServerGroup']"/>
 
-                         </req-params:param>
 
-                         <req-params:param name="cancelURL">
 
-                             <xsl:value-of select="concat($gateway,'?m=ags/ags.xts')"/>
 
-                         </req-params:param>
 
-                         <req-params:param name="inWizard">false</req-params:param>
 
-                     </dlgctrl:XTS2Request>
 
-                 </xts:sequence>
 
-             </xsl:template>
 
-         </xsl:stylesheet>
 
-     </xts:block>
 
-     <!--
 
- 	===============================================================================================
 
- 	processFirstResponse - process the resut returned by the callMorphlet block
 
- 	===============================================================================================
 
- 	-->
 
-     <xts:block id="processFirstResponse" processor="XSLT" dependency="callMorphlet" type="exec" condition=".[(/root/env/param[@name='controller_state'] = 'schedule|markup' or /root/env/param[@name='controller_state'] = 'schedule|finished') and /root/view='properties']" mandatory="false">
 
-         <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
 
-         <xts:logicsheet path="logicsheets/portal.xsl"/>
 
-         <xsl:stylesheet version="1.0" 
 
-         xmlns:req-params="http://developer.cognos.com/schemas/request/params" 
 
-         xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
 
-         xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/" 
 
-         xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" 
 
-         xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
 
-         exclude-result-prefixes="xsl dlgctrl xtsext xts pf">
 
-             <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
 
-             <pf:variables/>
 
-             <xsl:variable name="current_state" select="/root/env/param[@name='controller_state']"/>
 
-             <xsl:template match="/">
 
-                 <xts:sequence>
 
-                     <dlgctrl:processXTS2Response>
 
-                         <dlgctrl:stackName>scheduleStack</dlgctrl:stackName>
 
-                         <!-- display the markup -->
 
-                         <dlgctrl:mode match="markup">
 
-                             <xts:append select="/root/output">
 
-                                 <xts:transform src="ags/transforms/display_markup_page.xslt" processor="XSLT" option="part" mimeType="text/html">
 
-                                     <xts:param name="messageBase">/messages/portal.xml</xts:param>
 
-                                     <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
 
-                                     <root>
 
-                                         <xts:transform name="XMLDecode">
 
-                                             <dlgctrl:morphletResponse/>
 
-                                         </xts:transform>
 
-                                         <xsl:copy-of select="/root/http"/>
 
-                                         <xsl:copy-of select="/root/env"/>
 
-                                         <xsl:copy-of select="/root/system"/>
 
-                                         <xsl:copy-of select="/root/user"/>
 
-                                     </root>
 
-                                 </xts:transform>
 
-                             </xts:append>
 
-                         </dlgctrl:mode>
 
-                         <dlgctrl:mode match="scheduleParameters">
 
-                             <xts:delete select="/root/env/param[@name='scheduleParameters']"/>
 
-                             <xts:append select="/root/env">
 
-                                 <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
 
-                                     <param name="scheduleParameters">
 
-                                         <passport>
 
-                                             <xsl:value-of select="$passport"/>
 
-                                         </passport>
 
-                                         <markup>
 
-                                             <xts:transform name="XMLEncode">
 
-                                                 <dlgctrl:morphletResponse/>
 
-                                             </xts:transform>
 
-                                         </markup>
 
-                                     </param>
 
-                                 </xts:transform>
 
-                                 <xsl:copy-of select="/root/env/param[@name='controller_state']"/>
 
-                             </xts:append>
 
-                         </dlgctrl:mode>
 
-                     </dlgctrl:processXTS2Response>
 
-                     <xts:delete select="/root/*[local-name()='morphletResponse']"/>
 
-                 </xts:sequence>
 
-             </xsl:template>
 
-         </xsl:stylesheet>
 
-     </xts:block>
 
-     <!--
 
- 	===============================================================================================
 
- 	displayMarkup - display the markup returned from getMarkup
 
- 	===============================================================================================
 
- 	-->
 
-     <xts:block id="displayMarkup" processor="XSLT" dependency="processFirstResponse" type="exec" condition=".[/root/env/param[@name='controller_state'] != '' and /root/env/param[@name='controller_state'] != 'schedule|finished' and /root/view='properties']" mandatory="false">
 
-         <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
 
-         <xts:logicsheet path="logicsheets/portal.xsl"/>
 
-         <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl dlgctrl xtsext xts">
 
-             <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
 
-             <xsl:variable name="current_state" select="/root/env/param[@name='controller_state']"/>
 
-             <xsl:template match="/">
 
-                 <xts:sequence>
 
-                     <dlgctrl:processXTS2Response>
 
-                         <dlgctrl:stackName>scheduleStack</dlgctrl:stackName>
 
-                         <!-- display the markup -->
 
-                         <dlgctrl:mode match="markup">
 
-                             <xts:append select="/root/output">
 
-                                 <xts:transform src="ags/transforms/display_markup_page.xslt" processor="XSLT" option="part" mimeType="text/html">
 
-                                     <xts:param name="messageBase">/messages/portal.xml</xts:param>
 
-                                     <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
 
-                                     <root>
 
-                                         <xts:transform name="XMLDecode">
 
-                                             <dlgctrl:morphletResponse/>
 
-                                         </xts:transform>
 
-                                         <xsl:copy-of select="/root/http"/>
 
-                                         <xsl:copy-of select="/root/env"/>
 
-                                         <xsl:copy-of select="/root/system"/>
 
-                                         <xsl:copy-of select="/root/user"/>
 
-                                     </root>
 
-                                 </xts:transform>
 
-                             </xts:append>
 
-                         </dlgctrl:mode>
 
-                     </dlgctrl:processXTS2Response>
 
-                 </xts:sequence>
 
-             </xsl:template>
 
-         </xsl:stylesheet>
 
-     </xts:block>
 
-     
 
-     <!--
 
- 	===============================================================================================
 
- 	displayMarkup - display the markup returned from getMarkup
 
- 	===============================================================================================
 
- 	-->
 
-     <!--xts:block id="copyResult" mode="output" processor="XSLT" dependency="displayMarkup" type="exec" condition=".[ /root/env/param[@name='controller_state'] != '' and /root/env/param[@name='controller_state'] = 'schedule|finished']" mandatory="false">
 
-         <xts:logicsheet path="logicsheets/portal.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"/>
 
-         <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
 
-             xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
 
-             xmlns:xts="http://developer.cognos.com/schemas/xts/"
 
-             xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
 
-             xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
 
-             xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
 
-             exclude-result-prefixes="xsl dp xts pf df xtsext"-->
 
- 			
 
- 		<!-- add any theme variables -->
 
- 		<!--pf:variables/>
 
-             <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
 
-             <xsl:variable name="scheduleParameters"><xsl:value-of select="/root/env/param[@name='scheduleParameters']"/></xsl:variable>
 
-             <xsl:template match="/">
 
-             	<xsl:text disable-output-escaping="yes"><!DOCTYPE html></xsl:text>
 
-                 <dp:page>
 
-                     <dp:meta>
 
-                     	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
 
-                     </dp:meta>
 
-                     <script type="text/javascript" src="../ags/layout.js">//</script>
 
-                     <script type="text/javascript" src="../ags/cmd.js">//</script>
 
-                     <script type="text/javascript">
 
-                         function init() {
 
-                             var frm = document.messageIFrame.pform;
 
-                             
 
-                             if (frm != null) {
 
-                                 if (frm.AgentTask-schedule = null) {
 
-                                     frm.appendChild(createHiddenInput(frm , "AgentTask-schedule", ""));
 
-                                 }
 
-                                 frm.AgentTask-schedule.value = '<xsl:value-of select="$scheduleParameters"/>';
 
-                             }
 
-                            getConfigFrame().hideDialogFrame();
 
-                        }
 
-                     </script>
 
-                 </dp:page>
 
-             </xsl:template>
 
-         </xsl:stylesheet>
 
-     </xts:block-->
 
-   	<!--
 
-     ===============================================================================================
 
-     decodeScheduleParameters - decode and append the Schedule parameters.
 
-     ===============================================================================================
 
-     -->
 
- 	<xts:block id="decodeScheduleParameters" type="exec" mode="interpret" processor="XSLT" dependency="displayMarkup" condition=".[/root/env/param[@name='controller_state'] != '' and /root/env/param[@name='controller_state'] = 'schedule|finished' and /root/view='properties']" mandatory="false">
 
- 		<!-- portal specific information-->
 
- 		<xts:logicsheet path="logicsheets/portal.xsl"/>
 
- 		<!-- Dialog specific logicsheets -->
 
- 		<xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
 
- 		<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:form="http://developer.cognos.com/schemas/xts/ags/iFrmCmd/1/" exclude-result-prefixes="form xtsext">
 
- 			<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
 
- 			<xsl:template match="/">
 
- 				<xts:sequence>
 
- 					<xts:append>
 
- 						<xts:transform name="XMLDecode">
 
- 							<xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap_settemplatename_scheduleController_settemplateid_save001',string(/root/env/param[@name='scheduleParameters'])), true())"/>
 
- 						</xts:transform>
 
- 					</xts:append>
 
- 				</xts:sequence>
 
- 			</xsl:template>
 
- 		</xsl:stylesheet>
 
- 	</xts:block>
 
- 	<!--
 
- 	===============================================================================================
 
- 	render-page: Proxy display and redirect to dialogAdapter
 
- 	===============================================================================================
 
- 	-->
 
- 	<xts:block id="renderPage" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="decodeScheduleParameters" condition=".[/root/env/param[@name='controller_state'] != '' and /root/env/param[@name='controller_state'] = 'schedule|finished' and /root/view='properties']">
 
- 		<!-- portal specific information -->
 
- 		<xts:logicsheet path="logicsheets/portal.xsl"/>
 
- 		<!-- Get the new theme logicsheets. -->
 
- 		<xts:logicsheet path="logicsheets/presentation/dialog/presentation.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:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="utml dp pf xtsext">
 
- 			<xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
 
- 			<!-- add any theme variables -->
 
- 			<pf:variables/>
 
- 			<xsl:variable name="scheduleParameters">
 
- 				<xsl:value-of select="/root/env/param[@name='scheduleParameters']"/>
 
- 			</xsl:variable>
 
- 			<xsl:template match="/">
 
- 				<xsl:text disable-output-escaping="yes"><!DOCTYPE html></xsl:text>
 
- 				<dp:page>
 
- 					<dp:meta>
 
-                     	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
 
-                     </dp:meta>
 
- 					<dp:script>
 
- 						<script type="text/javascript" src="../ags/layout.js">//</script>
 
- 						<script type="text/javascript" src="../ags/cmd.js">//</script>
 
- 						<script type="text/javascript">
 
-                             function init() {
 
-                                 var msgFrame = getMessageIFrame();
 
-                                 if (msgFrame != null) {
 
-                                     var elmnt = msgFrame.document.getElementById("AgentTask-schedule");
 
-                                     if (elmnt == null) {
 
-                                         elmnt = createHiddenInput(msgFrame.document, "AgentTask-schedule", "");
 
-                                         msgFrame.document.pform.appendChild(elmnt);
 
-                                     }
 
-                                     elmnt.value = '<xsl:value-of select="$scheduleParameters"/>';
 
-                                     // This is called each time when there are any changes in schedule to change the schedule icon for 
 
-                                     // schedule the agent task in  the UI .
 
-                                    parent.toggleScheduleState(<xsl:value-of select="/root/scheduleParameters/item/active/value"/>, false);
 
-                                 }
 
-                                getConfigFrame().hideDialogFrame();
 
-                                
 
-                            }
 
-                         </script>
 
- 					</dp:script>
 
- 				</dp:page>
 
- 			</xsl:template>
 
- 		</xsl:stylesheet>
 
- 	</xts:block>
 
-     
 
-     <!--
 
- 	===============================================================================================
 
- 	debug - display debug information
 
- 	===============================================================================================
 
- 	-->
 
-     <xts:block id="debug" dependency="displayMarkup" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
 
-         <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>
 
 
  |