123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: AGS
- (C) Copyright IBM Corp. 2005, 2018
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:agsarg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/arguments/" xmlns:xtscm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:out="dummy-uri" xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/" 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:ags="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/ags/"
- xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:agsad="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/agentDefinition/" xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" xmlns:agsdlg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/dialog/" xmlns:req-params="http://developer.cognos.com/schemas/request/params" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" exclude-result-prefixes="agsarg xtscm xsi cf bus pf xtsext lyt dp df cp cm agsad utml agsdlg req-params xts xos ags">
- <xsl:output method="xml" encoding="UTF-8" indent="no"/>
- <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
- <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
- <!--pf:variables/>
- <pf:serialize-xml/-->
- <!-- start the output -->
- <xsl:template match="agsarg:arguments">
- <xsl:variable name="colheader1">
- <xsl:choose>
- <xsl:when test="./displayedPage = 'sql'">20%</xsl:when>
- <xsl:otherwise>25%</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="colheader2">
- <xsl:choose>
- <xsl:when test="./displayedPage = 'sql'">10%</xsl:when>
- <xsl:otherwise>15%</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="colheader3">
- <xsl:choose>
- <xsl:when test="./displayedPage = 'sql'">15%</xsl:when>
- <xsl:otherwise>20%</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="colheader4">
- <xsl:choose>
- <xsl:when test="./displayedPage = 'sql'">35%</xsl:when>
- <xsl:otherwise>40%</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <dp:list width="100%" section3_align="right">
- <dp:section width="100%">
- <dp:label>
- <xts:string id="DIALOG_SQL_BODY_LABEL"/>
- </dp:label>
- <dp:text align="right">
- <out:if test="count(/root/parametersDisplay/parameter)>0">
- <xts:string align="right" id="IDS_ENTRIES"/>1 - <out:value-of select="count(/root/parametersDisplay/parameter)"/>
- </out:if>
- </dp:text>
- </dp:section>
- </dp:list>
- <!-- taskParameters is stored in here too but as an updated mirror of taskParameters
- this is because we must capture them in the parent page and update them here
- so that if you move off the page quickly..... you dont loose the saved task parameter values-->
- <input type="hidden" id="updatedTaskParameters" name="updatedTaskParameters">
- <out:attribute name="value">
- <out:value-of select="/root/env/param[@name='taskParameters']"/>
- </out:attribute>
- </input>
- <cp:table name="parameterTable" width="100%" showEmptyMsg="true" iterate="/root/parametersDisplay/parameter">
- <cp:tableHeader>
-
- <cp:columnHeader width="1%"/>
-
- <cp:columnHeader width="{$colheader1}">
- <xts:string id="DIALOG_SQL_ARG_NAME"/>
- </cp:columnHeader>
- <cp:columnHeader width="{$colheader2}">
- <xts:string id="DIALOG_SQL_ARG_TYPE"/>
- </cp:columnHeader>
- <xsl:if test="./displayedPage = 'sql'">
- <cp:columnHeader width="20%">
- <xts:string id="DIALOG_SQL_ARG_FORMAT"/>
- </cp:columnHeader>
- </xsl:if>
- <cp:columnHeader width="{$colheader3}">
- <xts:string id="DIALOG_SQL_ARG_METHOD"/>
- </cp:columnHeader>
- <cp:columnHeader width="{$colheader4}">
- <xts:string id="DIALOG_SQL_ARG_VALUE"/>
- </cp:columnHeader>
- </cp:tableHeader>
- <cp:tableContent style="linedRows">
- <cp:common-render-variables>
- <out:variable name="quote">'</out:variable>
- <out:variable name="paramName">
- <out:choose>
- <out:when test="contains(@value, '?')">
- <out:value-of select="substring-before(substring-after(@value, '?'),'?')"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="@name"/>
- </out:otherwise>
- </out:choose>
- </out:variable>
- <out:variable name="drop_zone_name" select="concat('pv_dz_', $paramName, '_pv_dz')"/>
- <out:variable name="ndrop_zone_name" select="concat('pv_ndz_', $paramName, '_pv_ndz')"/>
- <out:variable name="selectionName" select="concat('pv_cb_',$paramName,'_pv_cb')"/>
- <out:variable name="literalDiv" select="concat('literalDiv', position())"/>
- <out:variable name="modelDiv" select="concat('modelDiv', position())"/>
- <out:variable name="selection">
- <out:choose>
- <!-- If both are there then model takes over.-->
- <out:when test="@modelValue">
- <modelSelected>selected</modelSelected>
- <displayLiteral>display:none;</displayLiteral>
- <displayModel>display:block;</displayModel>
- </out:when>
- <out:otherwise>
- <literalSelected>selected</literalSelected>
- <displayModel>display:none;</displayModel>
- <displayLiteral>display:block;</displayLiteral>
- </out:otherwise>
- </out:choose>
- <!--item><out:value-of select="/root/env/param[@name=$drop_zone_name]"/></item>
- <literal><out:value-of select="/root/env/param[@name=$ndrop_zone_name]"/></literal-->
- <item>
- <out:value-of select="@modelValue"/>
- </item>
- <literal>
- <out:choose>
- <out:when test="./displayedPage = 'sql' and @sqlCredentialValue != ''">
- <out:value-of select="@sqlCredentialValue"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="@literalValue"/>
- </out:otherwise>
- </out:choose>
- </literal>
- </out:variable>
- </cp:common-render-variables>
-
- <out:choose>
- <out:when test="/root/displayedPage = 'web' and @simplejavatype = 'false'">
- <!--cp:columnContent>
- <out:value-of select="@caption"/>
- </cp:columnContent>
- <cp:columnContent/>
- <cp:columnContent/>
- <cp:columnContent/>
- <cp:columnContent/-->
- <xsl:call-template name="doParameter"/>
- </out:when>
- <out:otherwise>
-
- <cp:columnContent/>
-
- <cp:columnContent>
- <out:value-of select="@name"/>
- </cp:columnContent>
- <cp:columnContent>
- <out:value-of select="@type"/>
- </cp:columnContent>
- <xsl:if test="./displayedPage = 'sql'">
- <cp:columnContent>
- <out:value-of select="@format"/>
- </cp:columnContent>
- </xsl:if>
- <cp:columnContent>
- <select name="{'{$selectionName}'}" id="{'{$selectionName}'}" onchange="toggleDiv({'{position() - 1}'})">
- <out:if test="@disabled='true'">
- <out:attribute name="disabled">
- <out:value-of select="@disabled"/>
- </out:attribute>
- </out:if>
- <option value="1">
- <!-- select this option is the value of the select is the value of the option -->
- <out:if test="$selection/modelSelected">
- <out:attribute name="{'{$selection/modelSelected}'}"/>
- </out:if>
- <xts:string id="DIALOG_PARAMETER_USE_ITEM"/>
- </option>
- <option value="2">
- <out:if test="$selection/literalSelected">
- <out:attribute name="{'{$selection/literalSelected}'}"/>
- </out:if>
- <xts:string id="DIALOG_PARAMETER_USE_VALUE"/>
- </option>
- </select>
- <img height="15" width="5" border="0" src="{'{$webcontent}'}/images/space.gif"/>
- </cp:columnContent>
- <cp:columnContent>
- <div id="{'{$literalDiv}'}" name="{'{$literalDiv}'}" style="{'{$selection/displayLiteral}'}">
- <input type="text" id="{{$ndrop_zone_name}}" name="{{$ndrop_zone_name}}" onblur="validateType('{{@type}}', this.value)" value="{'{$selection/literal}'}">
- <out:if test="@disabled='true'">
- <out:attribute name="disabled">
- <out:value-of select="@disabled"/>
- </out:attribute>
- </out:if>
- </input>
- </div>
- <div id="{'{$modelDiv}'}" name="{'{$modelDiv}'}" style="{'{$selection/displayModel}'}">
- <agsdlg:insertButton targetId="{'{$drop_zone_name}'}" value="{'{@modelValue}'}">
- <input type="text" width="80%" oncontextmenu="event.cancelBubble=true;event.returnValue=false;return false;" closePrevious="true" onKeyPress="event.cancelBubble=true;event.returnValue=false;return false;" onblur="event.cancelBubble=true;event.returnValue=false;return false;" onkeydown="event.cancelBubble=true;event.returnValue=false;return false;" name="{'{$drop_zone_name}'}" id="{'{$drop_zone_name}'}" value="{'{$selection/item}'}">
- <out:if test="@disabled='true'">
- <out:attribute name="disabled">
- <out:value-of select="@disabled"/>
- </out:attribute>
- </out:if>
- </input>
- </agsdlg:insertButton>
- </div>
- </cp:columnContent>
- </out:otherwise>
- </out:choose>
- </cp:tableContent>
- </cp:table>
- </xsl:template>
- <!-- kkm -->
- <xsl:template name="doParameter">
- <!--td> <out:value-of select="@caption"/> </td-->
- <!--div>
- <table><tr><td>
- hello
- </td></tr></table>
- </div-->
-
- <tr>
- <td><img id="{'{@name}'}_button" height="9" width="9" border="0" src="../ags/images/expand_minus.gif" onclick="hideComplex('{'{@name}'}')"/></td>
- <td/>
- <td height="10" class="tableText" nowrap="true" ><out:value-of select="@caption"/></td></tr>
- <tr>
- <td/>
- <td colspan="8">
- <div id="{'{@name}'}_id" style="width:auto;display:inline">
-
- <cp:table name="subParameterTable" width="100%" showEmptyMsg="true" iterate="./parameter">
- <cp:tableHeader>
- <!--cp:columnHeader width="20%">
- <out:value-of select="@caption"/>
- </cp:columnHeader-->
- <!--cp:columnHeader width="20%">
- <xts:string id="DIALOG_SQL_ARG_TYPE"/>
- </cp:columnHeader>
- <xsl:if test="/root/displayedPage = 'sql'">
- <cp:columnHeader width="20%">
- <xts:string id="DIALOG_SQL_ARG_FORMAT"/>
- </cp:columnHeader>
- </xsl:if>
- <cp:columnHeader width="20%">
- <xts:string id="DIALOG_SQL_ARG_METHOD"/>
- </cp:columnHeader>
- <cp:columnHeader width="20%">
- <xts:string id="DIALOG_SQL_ARG_VALUE"/>
- </cp:columnHeader-->
- </cp:tableHeader>
- <cp:tableContent>
- <cp:common-render-variables>
- <out:variable name="quote1">'</out:variable>
- <out:variable name="paramName1">
- <out:choose>
- <out:when test="contains(@value, '?')">
- <out:value-of select="substring-before(substring-after(@value, '?'),'?')"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="@name"/>
- </out:otherwise>
- </out:choose>
- </out:variable>
- <out:variable name="drop_zone_name1" select="concat('pv_dz_', $paramName,'/',$paramName1, '_pv_dz')"/>
- <out:variable name="ndrop_zone_name1" select="concat('pv_ndz_', $paramName,'/', $paramName1, '_pv_ndz')"/>
- <out:variable name="selectionName1" select="concat('pv_cb_', $paramName,'/', $paramName1,'_pv_cb')"/>
- <out:variable name="literalDiv1" select="concat('literalDiv', position())"/>
- <out:variable name="modelDiv1" select="concat('modelDiv', position())"/>
- <out:variable name="selection1">
- <out:choose>
- <!-- If both are there then model takes over.-->
- <out:when test="@modelValue">
- <modelSelected>selected</modelSelected>
- <displayLiteral>display:none;</displayLiteral>
- <displayModel>display:block;</displayModel>
- </out:when>
- <out:otherwise>
- <literalSelected>selected</literalSelected>
- <displayModel>display:none;</displayModel>
- <displayLiteral>display:block;</displayLiteral>
- </out:otherwise>
- </out:choose>
- <!--item><out:value-of select="/root/env/param[@name=$drop_zone_name]"/></item>
- <literal><out:value-of select="/root/env/param[@name=$ndrop_zone_name]"/></literal-->
- <item>
- <out:value-of select="@modelValue"/>
- </item>
- <literal>
- <out:choose>
- <out:when test="/root/displayedPage = 'sql' and @sqlCredentialValue != ''">
- <out:value-of select="@sqlCredentialValue"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="@literalValue"/>
- </out:otherwise>
- </out:choose>
- </literal>
- </out:variable>
- </cp:common-render-variables>
-
- <cp:columnContent width="25%">
- <out:value-of select="@name"/>
- </cp:columnContent>
-
- <cp:columnContent width="14%">
- <out:value-of select="@type"/>
- </cp:columnContent>
-
- <xsl:if test="/root/displayedPage = 'sql'">
- <cp:columnContent>
- <out:value-of select="@format"/>
- </cp:columnContent>
- </xsl:if>
- <cp:columnContent width="20%">
- <select name="{'{$selectionName1}'}" id="{'{$selectionName1}'}" onchange="toggleDiv({'{position() - 1}'})">
- <out:if test="@disabled='true'">
- <out:attribute name="disabled">
- <out:value-of select="@disabled"/>
- </out:attribute>
- </out:if>
- <option value="1">
- <!-- select this option is the value of the select is the value of the option -->
- <out:if test="$selection1/modelSelected">
- <out:attribute name="{'{$selection1/modelSelected}'}"/>
- </out:if>
- <xts:string id="DIALOG_PARAMETER_USE_ITEM"/>
- </option>
- <option value="2">
- <out:if test="$selection1/literalSelected">
- <out:attribute name="{'{$selection/literalSelected}'}"/>
- </out:if>
- <xts:string id="DIALOG_PARAMETER_USE_VALUE"/>
- </option>
- </select>
- <img height="15" width="5" border="0" src="{'{$webcontent}'}/images/space.gif"/>
- </cp:columnContent>
- <cp:columnContent>
- <div id="{'{$literalDiv1}'}" name="{'{$literalDiv1}'}" style="{'{$selection1/displayLiteral}'}">
- <input type="text" id="{{$ndrop_zone_name1}}" name="{{$ndrop_zone_name1}}" onblur="validateType('{{@type}}', this.value)" value="{'{$selection1/literal}'}">
- <out:if test="@disabled='true'">
- <out:attribute name="disabled">
- <out:value-of select="@disabled"/>
- </out:attribute>
- </out:if>
- </input>
- </div>
- <div id="{'{$modelDiv1}'}" name="{'{$modelDiv1}'}" style="{'{$selection1/displayModel}'}">
- <agsdlg:insertButton targetId="{'{drop_zone_name1}'}" value="{'{@modelValue}'}">
- <input type="text" width="80%" oncontextmenu="event.cancelBubble=true;event.returnValue=false;return false;" closePrevious="true" onKeyPress="event.cancelBubble=true;event.returnValue=false;return false;" onblur="event.cancelBubble=true;event.returnValue=false;return false;" onkeydown="event.cancelBubble=true;event.returnValue=false;return false;" id="{'{$drop_zone_name1}'}" name="{'{$drop_zone_name1}'}" value="{'{$selection1/item}'}">
- <out:if test="@disabled='true'">
- <out:attribute name="disabled">
- <out:value-of select="@disabled"/>
- </out:attribute>
- </out:if>
- </input>
- </agsdlg:insertButton>
- </div>
- </cp:columnContent>
- </cp:tableContent>
- </cp:table>
- </div>
- </td></tr>
- </xsl:template>
-
- <xsl:template match="agsarg:argumentsScript">
- <script type="text/javascript" src="{'{$webcontent}/{$app}/js/utilities.js'}"/>
- <script type="text/javascript" src="../ags/dragDropHandler.js"/>
-
- <script type="text/javascript">
- var literal_v_model = new Array();
- function hideComplex(divId){
- var theDiv = document.getElementById(divId+'_id');
- var theButton = document.getElementById(divId+'_button');
-
- theDiv.setAttribute("style", "z-index:100");
- if(theDiv.style.display == "none")
- {
- theDiv.style.display = "inline"
- theButton.src="../ags/images/expand_minus.gif";
- }else{
- // theDiv.style.display='hidden';
- theDiv.style.display = "none";
- theButton.src="../ags/images/expand_plus.gif";
- }
- }
- function initPromptPage(parameterArray)
- {
- <out:choose>
- <out:when test="/root/parametersDisplay/parameter">
- <out:for-each select="/root/parametersDisplay/parameter">
- <out:variable name="param_namekk">
- <out:choose>
- <out:when test="contains(@value, '?')">
- <out:value-of select="substring-before(substring-after(@value, '?'),'?')"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="@name"/>
- </out:otherwise>
- </out:choose>
- </out:variable>
-
-
- <out:choose>
-
- <out:when test="@simplejavatype = 'false' and not($param_namekk='parameters')">
- <out:for-each select="./parameter">
- <out:variable name="param_name1">
- <out:value-of select="concat($param_namekk,'/',@name)"/>
- </out:variable>
- literal_v_model.push(new LiteralModelManager('<out:value-of select="xtsext:javascriptencode(string($param_name1))"/>', '<out:value-of select="position()"/>'));
- </out:for-each>
-
- </out:when>
- <out:otherwise>
- <out:variable name="param_name">
- <out:choose>
- <out:when test="contains(@value, '?')">
- <out:value-of select="substring-before(substring-after(@value, '?'),'?')"/>
- </out:when>
- <out:otherwise>
- <out:value-of select="@name"/>
- </out:otherwise>
- </out:choose>
- </out:variable>
- literal_v_model.push(new LiteralModelManager('<out:value-of select="xtsext:javascriptencode(string($param_name))"/>', '<out:value-of select="position()"/>'));
- </out:otherwise>
- </out:choose>
-
- </out:for-each>
- </out:when>
- <out:otherwise>
- for(var i = 0; parameterArray!=null && i < parameterArray.length; i++){
- literal_v_model.push(new LiteralModelManager(parameterArray[i].sqlValue, i + 1));
- }
- </out:otherwise>
- </out:choose>
-
- var dropZones = new Array();
- var dropZone;
- for(var i = 0; i < literal_v_model.length; i++){
- dropZone = new DropZone(literal_v_model[i].getDropZoneName(),"","",'true',"<out:value-of select="/root/req-params:requestParams/req-params:param[@name='tabSelectedID']"/>",true);
- droppy.registerDropZoneObject(dropZone);
- dropZones.push(dropZone);
- // define a function which is going to handle the data from the drop
- //droppy.registerPreEventHandler(literal_v_model[i].getDropZoneName(),"ondrop", clearBeforeDrop);
- //droppy.registerPreEventHandler(literal_v_model[i].getDropZoneName(),"ondrop", checkBeforeDrop);
- }
-
- //pass the group to a listener in case number of members dynamically changes
- //droppy.registerDropZoneGroup(dropZones, "{key('request-param','resultNode')}");
- droppy.registerDropZoneGroup(dropZones, "<out:value-of select="/root/req-params:requestParams/req-params:param[@name='tabSelectedID']"/>");
- }
- /*
- // only the last item dropped visible but previous selections left in the agent tree
- function clearBeforeDrop()
- {
- //the id is a global generated by the drag drop handler before this method is called
- //and is the correct id for whatever dropzone is being used
- droppy.setDropZoneValue("");
- }
- */
- /* This is to validate the type that is passed to the storeprocedure
- as the validation has not been turned on from server side. his method should
- be ignored once the validation has been turned */
- function validateType(type, value) {
- <out:variable name="wrongSqlDataType">
- <xts:string id="DIALOG_SQL_WRONG_SQL_TYPE"/>
- </out:variable>
- if(value){
- if(type == 'int32' || type == 'int') {
- var intValue = parseInt(value);
- if(isNaN(intValue)) {
- alert('<out:value-of select="xtsext:javascriptencode(string($wrongSqlDataType))"/>');
- this.focus();
- }
- }
- else if (type == 'float64' || type == 'float32') {
- var floatValue = parseFloat(value);
- if( isNaN(floatValue)) {
- alert('<out:value-of select="xtsext:javascriptencode(string($wrongSqlDataType))"/>');
- this.focus();
- }
- }
- /*else if (type =='dateTime' || type =='datetime') {
- // we should leave date validation to the server components
- var date = new Date(value);
- if( isNaN(date)){
- alert('<out:value-of select="xtsext:javascriptencode(string($wrongSqlDataType))"/>');
- this.focus();
- }
- }*/
- }
- }
-
- /*
- this is called afetr the asynch get parameters html is injected into the waiting div
- the asynch getParametersResponse has an updated value for taskParameters that must
- be used to change the original value that is stored in the parent page.
- */
- function initInjectedHtml(){
-
- var cf = parent.getConfigFrame();
-
- cf.showDialogFrame(0);
-
- if(document.pform.updatedTaskParameters){
- var tps = document.getElementById('taskParameters');
- var utps = document.getElementById('updatedTaskParameters');
-
- //update the real task parameters
- if (tps && utps) {
- tps.value = utps.value;
- utps.parentNode.removeChild(utps);
- }
-
- //update the event handlers
-
- cf.attachHandlers(document.forms);
- }
- }
-
- function validatePromptPage()
- {
- return true;
- }
-
- function toggleDiv(position)
- {
- literal_v_model[position].toggleDiv();
- }
-
- function argumentsLeavingDialog(){
- //clean up literal values lurking behind a model item
- for(var i = 0; i < literal_v_model.length; i++){
- literal_v_model[i].clearUpOldLiterals();
- }
- }
-
- function LiteralModelManager(param_name, position){
- this.param_name = param_name;
- this.position = position;
- }
- LiteralModelManager.prototype.getDropZoneName = function(){
- return 'pv_dz_' + this.param_name + '_pv_dz';
- }
- LiteralModelManager.prototype.getDropZoneDivName = function(){
- return 'modelDiv' + this.position;
- }
- LiteralModelManager.prototype.getLiteralInputDivName = function(){
- return 'literalDiv' + this.position;
- }
- LiteralModelManager.prototype.getLiteralInputName = function(){
- return 'pv_ndz_' + this.param_name + '_pv_ndz';
- }
- LiteralModelManager.prototype.getSelectionName = function(){
- return 'pv_cb_' + this.param_name + '_pv_cb';
- }
- LiteralModelManager.prototype.toggleDiv = function()
- {
- var displayName;
- var hideName;
-
- if(document.getElementById(this.getDropZoneDivName()).style.display == 'none')
- {
- displayName = this.getDropZoneDivName();
- hideName = this.getLiteralInputDivName();
- }
- else
- {
- displayName = this.getLiteralInputDivName();
- hideName = this.getDropZoneDivName();
- //model item div is being hidden, clear it
- droppy.setDropZoneValue("",this.getDropZoneName());
- }
-
- document.getElementById(displayName).style.display='block';
- document.getElementById(hideName).style.display='none';
- }
- LiteralModelManager.prototype.clearUpOldLiterals = function(){
- var literal_input = document.getElementById(this.getLiteralInputName());
- var literal_div = document.getElementById(this.getLiteralInputDivName());
- if(literal_div && literal_input){
- if(literal_div.style.display == 'none'){
- //its hidden... clear it
- literal_input.value = "";
- }
- }else{
- //alert("cant find " + this.getLiteralInputName() + " or " + this.getLiteralInputDivName());
- }
- }
- </script>
- </xsl:template>
- <!--
- * - This next template is required to copy all other elements into the result.
- -->
- <xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
|