[wsas-java-dev] svn commit r2499 - in
trunk/wsas/java/modules/www/extensions/core: js xslt
svn at wso2.org
svn at wso2.org
Fri May 11 08:40:47 PDT 2007
Author: saminda
Date: Fri May 11 08:40:33 2007
New Revision: 2499
Modified:
trunk/wsas/java/modules/www/extensions/core/js/tracer.js
trunk/wsas/java/modules/www/extensions/core/xslt/tracer.xsl
Log:
Update to tracing. TODO some code still in maintainance, will fix it ASAP
Modified: trunk/wsas/java/modules/www/extensions/core/js/tracer.js
==============================================================================
--- trunk/wsas/java/modules/www/extensions/core/js/tracer.js (original)
+++ trunk/wsas/java/modules/www/extensions/core/js/tracer.js Fri May 11 08:40:33 2007
@@ -89,6 +89,7 @@
clearTracer();
}
+//TODO starting point
function viewTracer(thisObj,index) {
if (thisObj && index) {
@@ -96,12 +97,12 @@
gatherHistoryObject(thisObj.id, index);
}
- var body_xml = '<req:getLastMessagesRequest xmlns:req="http://org.apache.axis2/xsd">\n' +
- '<messages>1</messages>\n' +
+ var body_xml = '<req:getMessages xmlns:req="http://org.apache.axis2/xsd">\n' +
+ '<numberOfMessages>30</numberOfMessages>\n' +
'<filter></filter>\n'+
- '</req:getLastMessagesRequest>\n';
+ '</req:getMessages>\n';
- var callURL = serverURL + "/" + "wso2tracer" ;
+ var callURL = serverURL + "/" + "wso2tracerA" ;
send("getLastMessages", body_xml, "", callURL, "", false, viewTracerCallback);
}
@@ -111,25 +112,22 @@
}
callbackhelper("tracer.xsl", document.getElementById("divTracer"));
// setting monitor setting
- loadMonitorSetting();
+// loadMonitorSetting();
// loadTracerListComboBox(document.getElementById('tracerSelectBox'));
}
-// this is a call through tracer.xslt
+// this is a call through tracer.xslt TODO Fix this
function traceMessage(valueObject) {
// var tracerName = valueObject.value;
- var tracerName = valueObject[valueObject.selectedIndex].text;
- if (tracerName == null) {
- tracerName = valueObject[valueObject.selectedIndex].value;
- }
- var startIndex = tracerName.indexOf(']');
- var service_id = tracerName.substring(startIndex + 1, tracerName.indexOf('#'));
- var opStartIndex = tracerName.indexOf('#');
- var operation_name = tracerName.substring(opStartIndex + 1, tracerName.indexOf('<'));
- var msStartIndex = tracerName.indexOf('<');
- var message_sequence = tracerName.substring(msStartIndex + 1, tracerName.indexOf('>'));
+ var value = valueObject[valueObject.selectedIndex].value;
+
+ var splitValues = value.split("-");
+
+ alert(splitValues);
+
+ return;
var body_xml = '<req:getMessageRequest xmlns:req="http://org.apache.axis2/xsd">\n' +
'<serviceId>' + service_id + '</serviceId>\n' +
@@ -311,7 +309,7 @@
if (checkboxBoolean) {
textObj.disabled = false;
}else {
- textObj.disabled = true; //TODO refresh the logic
+ textObj.disabled = true;
isFilteringActive = false;
loadTracerListComboBox(document.getElementById('tracerSelectBox'));
}
Modified: trunk/wsas/java/modules/www/extensions/core/xslt/tracer.xsl
==============================================================================
--- trunk/wsas/java/modules/www/extensions/core/xslt/tracer.xsl (original)
+++ trunk/wsas/java/modules/www/extensions/core/xslt/tracer.xsl Fri May 11 08:40:33 2007
@@ -1,179 +1,221 @@
-<xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
- <xsl:template match="*">
- <fieldset style="border:none;">
- <h2>SOAP Tracer</h2>
- <div id="formset">
- <form>
- <fieldset>
- <legend>SOAP Tracer</legend>
- <xsl:call-template name="starter"/>
- </fieldset>
- </form>
- <xsl:call-template name="filter"/>
- <form>
- <fieldset>
- <legend>SOAP Tracer Results</legend>
- <xsl:call-template name="soapTracerContentDivTemplate"/>
- <xsl:call-template name="extraSOAPTracerSettingTemplate"/>
- <xsl:call-template name="extraSOAPTracerSettingTemplate"/>
- </fieldset>
- </form>
- </div>
- </fieldset>
- </xsl:template>
-
- <xsl:template name="starter">
- <div id="soapTracingDiv">
- <label>SOAP Tracing</label>
- <select tabindex="1">
- <xsl:attribute name="id">monitorSettingCombo</xsl:attribute>
- <xsl:attribute name="onchange">javascript:setMonitoring(this);return false;</xsl:attribute>
- </select>
- </div>
- </xsl:template>
-
- <xsl:template name="soapTracerContentDivTemplate">
- <div id="soapTracerContentDiv" style="display:none;">
- <div>
- <table>
- <tr>
- <td>
- <div>
- <b>Select SOAP Message To View</b>
- </div>
- <div>
- <select id="tracerSelectBox" tabindex="2">
- <xsl:attribute name="onChange">javascript:traceMessage(document.getElementById('tracerSelectBox')); return false;</xsl:attribute>
- <xsl:attribute name="size">5</xsl:attribute>
- <xsl:attribute name="multiple">false</xsl:attribute>
- </select>
- </div>
-
- </td>
- </tr>
- </table>
+
+ <xsl:template match="ns:getMessagesResponse" xmlns:ns="http://org.apache.axis2/xsd">
+ <fieldset style="border:none;">
+ <h2>SOAP Tracer</h2>
+ <div id="formset">
+ <xsl:apply-templates select="return/flag" mode="flagSetting"/>
+ <xsl:apply-templates select="return/flag" mode="filterSetting"/>
+ <xsl:apply-templates select="return/flag" mode="information"/>
</div>
- <div>
- <table>
- <tr>
- <td>
- <div>
- <b>SOAP Message - Request</b>
- </div>
- <div>
- <textarea id="txtAreaReceive" cols="80" rows="15"></textarea>
- </div>
- </td>
- <td>
- <nobr>
-   
- <a href="#" id="tracer_zoom_out_link_1" class="zoom_out_link">
- <xsl:attribute name="onClick">javascript:shrinkRequestTextBox();return false;</xsl:attribute>
- <xsl:attribute name="title">Shrink Request TextBox</xsl:attribute>
- <xsl:attribute name="alt">Remove</xsl:attribute>
-     
- </a>
- </nobr>
- </td>
- </tr>
- <tr>
- <td>
- <div>
- <b>SOAP Message - Response</b>
- </div>
- <div>
- <textarea id="txtAreaSend" cols="80" rows="15"></textarea>
- </div>
- </td>
- <td>
- <nobr>
-   
- <a href="#" id="tracer_zoom_out_link_2" class="zoom_out_link">
- <xsl:attribute name="onClick">javascript:shrinkResponseTextBox();return false;</xsl:attribute>
- <xsl:attribute name="title">Shrink Response TextBox</xsl:attribute>
- <xsl:attribute name="alt">Remove</xsl:attribute>
-     
- </a>
- </nobr>
- </td>
- </tr>
- </table>
- </div>
- </div>
-
- </xsl:template>
-
- <xsl:template name="extraSOAPTracerSettingTemplate">
- <div id="soapTracerNoMessagesDiv" style="display:none;">
- <table>
- <tr>
- <td>    </td>
- <td>
- <h4>No SOAP messages in the Tracer's buffer.</h4>
- </td>
- </tr>
- </table>
- </div>
- <div id="soapTracerTurnedOffDiv" style="display:none;">
- <table>
- <tr>
- <td>    </td>
- <td>
- <h4>SOAP Tracer has been turned off.</h4>
- </td>
- </tr>
- </table>
- </div>
- <div id="soapFilterResultsDivId" style="display:none;">
- <table>
- <tr>
- <td>    </td>
- <td>
- <h4>No SOAP messages found after applying the filter</h4>
- </td>
- </tr>
- </table>
- </div>
+ </fieldset>
+
</xsl:template>
- <!--TODO Fill the finding code -->
- <xsl:template name="filter">
+ <xsl:template match="flag" mode="flagSetting">
+ <xsl:variable name="flagv" select="."/>
<form>
- <xsl:attribute name="action">#</xsl:attribute>
- <xsl:attribute name="method">POST</xsl:attribute>
- <xsl:attribute name="id">filterForm</xsl:attribute>
+ <fieldset>
+ <legend>SOAP Tracing</legend>
+ <div>
+ <label>SOAP Tracing</label>
+ <select>
+ <xsl:attribute name="id">monitorSettingCombo</xsl:attribute>
+ <xsl:attribute name="onchange">javascript:setMonitoring(this);return false;</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="$flagv='ON'">
+ <option value='ON'>ON</option>
+ <option value='OFF'>OFF</option>
+ </xsl:when>
+ <xsl:otherwise>
+ <option value='OFF'>OFF</option>
+ <option value='ON'>ON</option>
+ </xsl:otherwise>
+ </xsl:choose>
+ </select>
+ </div>
+ </fieldset>
+ </form>
+ </xsl:template>
+
+ <xsl:template match="flag" mode="filterSetting">
+ <xsl:variable name="flagv" select="."/>
+ <xsl:choose>
+ <xsl:when test="$flagv='ON'">
+ <form>
+ <fieldset>
+ <legend>Filter</legend>
+ <div>
+ <span>
+ <input>
+ <xsl:attribute name="type">checkbox</xsl:attribute>
+ <xsl:attribute name="id">filterCheckboxId</xsl:attribute>
+ <xsl:attribute name="onClick">javascript:filterEnabledDisabled(this.checked,document.getElementById("filterTextId"));return true;</xsl:attribute>
+ </input>
+ Mask
+ <input>
+ <xsl:attribute name="type">text</xsl:attribute>
+ <xsl:attribute name="id">filterTextId</xsl:attribute>
+ <xsl:attribute name="size">50</xsl:attribute>
+ <xsl:attribute name="DISABLED">false</xsl:attribute>
+ </input>
+ <input>
+ <xsl:attribute name="type">submit</xsl:attribute>
+ <xsl:attribute name="value">Find</xsl:attribute>
+ <xsl:attribute name="id">filterFindId</xsl:attribute>
+ <xsl:attribute name="onClick">javascript:findMaskedObjects(document.getElementById("filterTextId").value);return false;</xsl:attribute>
+ </input>
+ </span>
+ </div>
+ </fieldset>
+ </form>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="flag" mode="information">
+ <xsl:variable name="flagv" select="."/>
+ <xsl:variable name="emptyv" select="../empty"/>
+ <form>
<fieldset>
- <legend>Filter</legend>
- <span>
- <input>
- <xsl:attribute name="type">checkbox</xsl:attribute>
- <xsl:attribute name="id">filterCheckboxId</xsl:attribute>
- <xsl:attribute name="onClick">javascript:filterEnabledDisabled(this.checked,document.getElementById("filterTextId"));return true;</xsl:attribute>
- </input>
- Mask
- <input>
- <xsl:attribute name="type">text</xsl:attribute>
- <xsl:attribute name="id">filterTextId</xsl:attribute>
- <xsl:attribute name="size">50</xsl:attribute>
- <xsl:attribute name="DISABLED">false</xsl:attribute>
- </input>
- <input>
- <xsl:attribute name="type">submit</xsl:attribute>
- <xsl:attribute name="value">Find</xsl:attribute>
- <xsl:attribute name="id">filterFindId</xsl:attribute>
- <xsl:attribute name="onClick">javascript:findMaskedObjects(document.getElementById("filterTextId").value);return false;</xsl:attribute>
- </input>
- </span>
+ <legend>Information</legend>
+ <xsl:choose>
+ <xsl:when test="$flagv='ON'">
+ <xsl:choose>
+ <xsl:when test="$emptyv='true'">
+ <div>
+ <table>
+ <tr>
+ <td>    </td>
+ <td>
+ <h4>No SOAP messages in the Tracer's buffer.</h4>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </xsl:when>
+ <xsl:otherwise>
+ <div>
+ <xsl:attribute name="id">informationDivId</xsl:attribute>
+ <table>
+ <tr>
+ <td>
+ <div>
+ <b>Select SOAP Message To View</b>
+ </div>
+ <div>
+ <select id="tracerSelectBox">
+ <xsl:attribute name="onChange">javascript:traceMessage(this); return false;</xsl:attribute>
+ <xsl:attribute name="size">5</xsl:attribute>
+ <xsl:attribute name="multiple">false</xsl:attribute>
+ <!-- TODO message goes here-->
+ <xsl:apply-templates select="../messageInfo"/>
+ </select>
+ </div>
+
+ </td>
+ </tr>
+ </table>
+
+ <xsl:call-template name="showMessage">
+ <xsl:with-param name="requestv" select="../lastMessage/request"/>
+ <xsl:with-param name="responsev" select="../lastMessage/response"/>
+ </xsl:call-template>
+ </div>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- OFF -->
+ <div>
+ <table>
+ <tr>
+ <td>    </td>
+ <td>
+ <h4>SOAP Tracer has been turned off.</h4>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </xsl:otherwise>
+ </xsl:choose>
</fieldset>
-
</form>
+ </xsl:template>
+
+
+ <xsl:template name="showMessage">
+ <xsl:param name="requestv"/>
+ <xsl:param name="responsev"/>
+ <table>
+ <tr>
+ <td>
+ <div>
+ <b>SOAP Message - Request</b>
+ </div>
+ <div>
+ <textarea>
+ <xsl:attribute name="id">txtAreaReceive</xsl:attribute>
+ <xsl:attribute name="cols">80</xsl:attribute>
+ <xsl:attribute name="rows">15</xsl:attribute>
+ <xsl:value-of select="$requestv"/>
+ </textarea>
+ </div>
+ </td>
+ <td>
+ <nobr>
+   
+ <a href="#" id="tracer_zoom_out_link_1" class="zoom_out_link">
+ <xsl:attribute name="onClick">javascript:shrinkRequestTextBox();return false;</xsl:attribute>
+ <xsl:attribute name="title">Shrink Request TextBox</xsl:attribute>
+ <xsl:attribute name="alt">Remove</xsl:attribute>
+     
+ </a>
+ </nobr>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <div>
+ <b>SOAP Message - Response</b>
+ </div>
+ <div>
+ <textarea>
+ <xsl:attribute name="id">txtAreaSend</xsl:attribute>
+ <xsl:attribute name="cols">80</xsl:attribute>
+ <xsl:attribute name="rows">15</xsl:attribute>
+ <xsl:value-of select="$responsev"/>
+ </textarea>
+ </div>
+ </td>
+ <td>
+ <nobr>
+   
+ <a href="#" id="tracer_zoom_out_link_2" class="zoom_out_link">
+ <xsl:attribute name="onClick">javascript:shrinkResponseTextBox();return false;</xsl:attribute>
+ <xsl:attribute name="title">Shrink Response TextBox</xsl:attribute>
+ <xsl:attribute name="alt">Remove</xsl:attribute>
+     
+ </a>
+ </nobr>
+ </td>
+ </tr>
+ </table>
+ </xsl:template>
+
+ <xsl:template match="messageInfo">
+ <xsl:variable name="value"><xsl:value-of select="serviceId"/>-<xsl:value-of select="operationName"/>-<xsl:value-of select="messageSequence"/></xsl:variable>
+ <xsl:variable name="textv">[<xsl:value-of select="timestamp"/>]<xsl:value-of select="serviceId"/>#<xsl:value-of select="operationName"/><<xsl:value-of select="messageSequence"/>></xsl:variable>
+ <option value='OFF'>
+ <xsl:attribute name="value"><xsl:value-of select="$value"/></xsl:attribute>
+ <xsl:value-of select="$textv"/>
+ </option>
</xsl:template>
-</xsl:stylesheet>
+</xsl:stylesheet>
\ No newline at end of file
More information about the Wsas-java-dev
mailing list