123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: AGS
- (C) Copyright IBM Corp. 2005, 2009
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xts:morphlet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml,messages/portalRL.xml,messages/AGS.xml" requiredCapability="canUseEventStudio">
- <!--
- ================================================================================
- decode the agent definition blob
- ===============================================================================================
- -->
- <xts:block id="decodeAgentDefinition" processor="XSLT" type="exec" condition=".[not(/root/env/param [@name='controller_state']) or /root/env/param[@name='controller_state']='']" mandatory="false">
- <xts:logicsheet path="logicsheets/presentation/dialog/templates.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <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" exclude-result-prefixes="xsl xtsext xts">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xsl:if test="/root/env/param[@name = 'agent_definition_blob']">
- <xts:append select="/root">
- <!-- unwrap the puppy-->
- <xsl:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap_settemplatename_decodeagentdefinition_settemplateid_leavingags', string( /root/env/param[@name = 'agent_definition_blob'])), true() )" disable-output-escaping="yes"/>
- </xts:append>
- </xsl:if>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- Check that the agent exists in content manager
- ===============================================================================================
- -->
- <xts:block id="checkAgentExists" processor="XSLT" type="exec" dependency="decodeAgentDefinition" condition=".[/root/agent_definition/agentDefinition]" mandatory="false">
- <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/"
- exclude-result-prefixes="xsl xtsext cml send">
- <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:leavingAGS">
- <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/agent_definition/agentDefinition"/></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:append select="root/env">
- <param name="agentSearchPath">
- <xts:transform name="XMLEncode">
- <xts:queryValue select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply']/*[local-name()='agentDefinition']/*[local-name()='searchPath']"/>
- </xts:transform>
- </param>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="page" dependency="checkAgentExists" type="exec" mode="output" processor="XSLT" mimeType="text/html">
- <!-- 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="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:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- exclude-result-prefixes="xsl xts lyt pf dp df cp cf dbg xtsext">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <!-- add any theme variables -->
- <df:variables/>
- <pf:variables/>
- <!--check the search path for this agent, if it does not exist then the agent may have been delete
- agentLinkBroken has a value of true or false only
- SEC_INFO agentLinkBroken is not javascript encoded, it is always a boolean value true|false
- -->
- <xsl:variable name="agentLinkBroken">
- <xsl:value-of select="/root/env/param[@name='agentSearchPath']=''"/>
- </xsl:variable>
- <!-- start the output -->
- <xsl:template match="/root">
- <xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text><dp:page>
- <dp:script>
- <meta name="Copyright" content="Copyright (C) 2008 Cognos Incorporated. All Rights Reserved."/>
- <meta name="Trademark" content="Cognos and the Cognos logo are trademarks of Cognos Incorporated."/>
- <script type="text/javascript" src="../qs/layout.js">//</script>
- <script type="text/javascript">
- function yesNoSave(bSave) {
- var cf = parent.getConfigFrame();
- cf.hideDialogFrame();
- if (bSave) {
- // Find whether to save or saveAs
- var saveCommands = cf.getSaveCommandStack();
- var currentStack = cf.getCommandStackManager().getCommandStack();
- var newStack = currentStack.concat(saveCommands);
-
- //add the appropriate cmds to get a save done
- cf.getCommandStackManager().setCommandStack(newStack);
- }
- //get on with the next command
- cf.getCommandStackManager().processCommandStack();
- // This is called each time we leave the saved agent to change the schedule icon for
- // schedule the agent task to default.
- parent.toggleScheduleState(null, true);
- }
-
- function cancel(){
- var cf = parent.getConfigFrame();
- cf.getCommandStackManager().getCommandStack().clear();
- cf.hideDialogFrame();
- }
-
- //check if the agent has been saved and that the agent link has been broken. If any
- //of these conditions are true then popup the 'save' dialog
- function init() {
- var agentLinkBroken = <xsl:value-of select="string($agentLinkBroken)"/>;
- var cf = parent.getConfigFrame();
-
- with(cf) {
- var mgr = getCommandStackManager();
- //alert('leavingAGS: new agent:'+cfgGet("NewReport")+', link broken?:'+agentLinkBroken+', agent changed?:'+hasAgentChanged());
- //check if this agent has a broken link, 'NewReport' means that the agent is new
- if(cfgGet("NewReport")==false && agentLinkBroken) {
- //fire the save command, the save template will automatically detect a broken link and show a warning dialog followed by a 'save as' dialog
- var saveCommands = mgr.createCommandStack("checkCAF()","commandStackHideDialogFrame()","calcAgentState()","getSaveValidateMessages()", "displayValidateMessages()", 'save()');
- var currentStack = mgr.getCommandStack();
- var newStack = currentStack.concat(saveCommands);
- //add the appropriate cmds to get a save done
- mgr.setCommandStack(newStack);
- //get on with the next command
- mgr.processCommandStack();
- }
- //show the warning informing the user that the agent has changed in some way
- else if (hasAgentChanged()) {
- showDialogFrame(160);
- }
- //just get on with the next command
- else {
- mgr.processCommandStack();
- parent.toggleScheduleState(null, true);
- }
- }
- }
- </script>
- </dp:script>
- <form name="f" method="POST">
- <!-- dialog header -->
- <dp:header help="false">
- <!-- header titles -->
- <dp:title>
- <xsl:choose>
- <xsl:when test="/root/env/param[@name='newAfterSave']">
- <xts:string id="SAVE_ERROR_TITLE"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="EXIT"/>
- </xsl:otherwise>
- </xsl:choose>
- </dp:title>
- <!-- close link for the header -->
- <dp:close>
- <a href="#" onclick="cancel()">
- <dp:closeMarker/>
- </a>
- </dp:close>
- <!-- description (hint text) -->
- <dp:description/>
- </dp:header>
- <!-- layout -->
- <lyt:layout style="1" border="no">
- <lyt:section>
- <!-- the agent has not been saved-->
- <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>
- <xts:string id="AGENT_MODIFIED"/><br/><br/>
- <xts:string id="SAVE_AGENT_QUESTION"/>
- </dp:description>
- </dp:boxSection>
- </dp:box>
- </lyt:section>
- </lyt:layout>
- <lyt:layout style="1">
-
- <lyt:section>
- <dp:buttonGroup>
- <df:button df:id="DIALOG_YES_BUTTON" df:style="href" df:href="#" onclick="yesNoSave(true);"/>
- <df:button df:id="DIALOG_NO_BUTTON" df:style="href" df:href="#" onclick="yesNoSave(false);"/>
- <df:button df:id="DIALOG_CANCEL_BUTTON" df:style="href" df:href="#" onclick="cancel();"/>
- </dp:buttonGroup>
- </lyt:section>
- <lyt:section/>
- </lyt:layout>
- </form>
- </dp:page>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|