[wsas-java-dev] svn commit r2581 - in
trunk/wsas/java/modules/www/extensions/core: js xslt
svn at wso2.org
svn at wso2.org
Mon May 14 02:48:04 PDT 2007
Author: saminda
Date: Mon May 14 02:47:47 2007
New Revision: 2581
Modified:
trunk/wsas/java/modules/www/extensions/core/js/tracer.js
trunk/wsas/java/modules/www/extensions/core/xslt/tracer.xsl
Log:
Completely fixed tracer
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 Mon May 14 02:47:47 2007
@@ -5,14 +5,7 @@
var txtAreaSendBoolean = false;
var txtAreaReceiveBoolean = false;
-var m_updateDiv;
-
/* For Monitoring Status */
-var monitoringStatus = 'OFF';
-
-/*For Message filter*/
-var isFilteringActive = false;
-
function setMonitoring(obj) {
@@ -27,30 +20,6 @@
send("setMonitoring", body_xml, "", callURL, "", false, viewTracerCallback);
}
-function setMonitoringCallback() {
- if (!onError()) {
- return;
- }
- cursorWait();
- setTimeout("showsetMonitoringCompleteMsg()", 1000);
-}
-
-function showsetMonitoringCompleteMsg() {
- cursorClear();
- if (monitoringStatus == 'ON') {
- alertMessage("SOAP tracing turned on.<br/><br/>" +
- "<b>WARNING:</b> Turning this ON will have a performance hit, " +
- "since all SOAP messages will be always completely built " +
- "(i.e. deferred building will not be done) " +
- "and stored in the database by WSO2 WSAS hence this option" +
- " should be used with caution.");
- }else{
- alertMessage("SOAP message monitoring turned OFF.");
- }
- clearTracer();
-}
-
-//TODO starting point
function viewTracer(thisObj,index) {
if (thisObj && index) {
@@ -96,8 +65,12 @@
if (!onError()) {
return;
}
- transformationWithoutHistory("tracer.xsl", document.getElementById("informationMainTableDivId"));
- document.getElementById('informationMainDivId').style.display = 'inline';
+ transformationWithoutHistoryShowingAllDivs("tracer.xsl", document.getElementById("informationMainTableDivId"));
+}
+
+function transformationWithoutHistoryShowingAllDivs(xslFile, objDiv) {
+ var data = getBody(xhReq.responseXML);
+ processXML(data, xslFile, objDiv);
}
function shrinkRequestTextBox() {
@@ -138,47 +111,40 @@
}
}
-function loadTracerListComboBox(_updateDiv) {
- _updateDiv.innerHTML = "";
- m_updateDiv = _updateDiv;
-
- var body_xml = '<req:getLastMessagesRequest xmlns:req="http://org.apache.axis2/xsd">\n' +
- '<messages>30</messages>\n' +
- '<filter></filter>\n'+
- '</req:getLastMessagesRequest>\n';
-
- var callURL = serverURL + "/" + "wso2tracer" ;
- send("getLastMessages", body_xml, "", callURL, "", false, loadTracerListCallback);
-}
-
+//TODO Fix me
function filterEnabledDisabled(checkboxBoolean,textObj) {
if (checkboxBoolean) {
textObj.disabled = false;
}else {
textObj.disabled = true;
- isFilteringActive = false;
- loadTracerListComboBox(document.getElementById('tracerSelectBox'));
+ viewTracer();
}
}
-
+//TODO fix me
function findMaskedObjects(findValue) {
- document.getElementById('tracerSelectBox').innerHTML= "";
- m_updateDiv = document.getElementById('tracerSelectBox');
if (findValue != null && findValue.length == 0) {
alertMessage("Please use a string to filter");
- return;
+ return false;
}
- isFilteringActive = true;
-
- var body_xml = '<req:getLastMessagesRequest xmlns:req="http://org.apache.axis2/xsd">\n' +
- '<messages>30</messages>\n' +
+ var body_xml = '<req:getMessagesRequest xmlns:req="http://org.apache.axis2/xsd">\n' +
+ '<numberOfMessages>30</numberOfMessages>\n' +
'<filter>'+findValue+'</filter>\n'+
- '</req:getLastMessagesRequest>\n';
+ '</req:getMessagesRequest>\n';
var callURL = serverURL + "/" + "wso2tracer" ;
- send("getLastMessages", body_xml, "", callURL, "", false, loadTracerListCallback);
+ send("getMessages", body_xml, "", callURL, "", false, findMaskedObjectsCallback);
}
+function findMaskedObjectsCallback() {
+ if (!onError()) {
+ return;
+ }
+ transformationWithoutHistoryShowingAllDivs("tracer.xsl", document.getElementById("divTracer"));
+
+}
+
+
+
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 Mon May 14 02:47:47 2007
@@ -43,35 +43,55 @@
<xsl:template match="flag" mode="filterSetting">
<xsl:variable name="flagv" select="."/>
+ <xsl:variable name="filterStringv" select="../filterString"/>
+ <xsl:variable name="filterv" select="../filter"/>
+ <xsl:variable name="emptyv" select="../empty"/>
+ <xsl:variable name="messageInfoCount" select="count(../messageInfo)"/>
+ <xsl:comment><xsl:value-of select="$messageInfoCount"/></xsl:comment>
<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 test="$flagv='ON' and not($emptyv='true')">
+ <xsl:if test="$messageInfoCount > 1">
+ <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>
+ <xsl:choose>
+ <xsl:when test="$filterv='true'">
+ <xsl:attribute name="checked">false</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </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:choose>
+ <xsl:when test="$filterv='true'">
+ <xsl:attribute name="value"><xsl:value-of select="$filterStringv"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="DISABLED">true</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </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:if>
</xsl:when>
</xsl:choose>
</xsl:template>
@@ -79,89 +99,108 @@
<xsl:template match="flag" mode="information">
<xsl:variable name="flagv" select="."/>
<xsl:variable name="emptyv" select="../empty"/>
+ <xsl:variable name="filterv" select="../filter"/>
<form>
<fieldset>
<legend>Information</legend>
- <xsl:choose>
- <xsl:when test="$flagv='ON'">
- <xsl:choose>
- <xsl:when test="$emptyv='true'">
- <div>
- <table>
- <tr>
- <td>    </td>
- <td>
- <span>
- <ol>
- <li><h4>SOAP tracing turned on</h4></li>
- <li><h4>No SOAP messages in the Tracer's buffer.</h4></li>
- <li><h4>Use 'Filter' to mask messages on simple string comparison on request.<br/>
- Check the mask to enable Filtering.
- </h4></li>
- <li><b>WARNING:</b> <br/>
- <h5>
- Turning this ON will have a performance hit since all SOAP messages will be always completely built <br/>
- (i.e. deferred building will not be done) and stored in the database by WSO2 WSAS hence this option <br/>
- should be used with caution.
- </h5>
- </li>
- </ol>
- </span>
-
- </td>
- </tr>
- </table>
- </div>
- </xsl:when>
- <xsl:otherwise>
- <div>
- <xsl:attribute name="id">informationMainDivId</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>
- </div>
- <div>
- <xsl:attribute name="id">informationMainTableDivId</xsl:attribute>
- <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>
+ <div>
+ <xsl:attribute name="id">informationMainDivId</xsl:attribute>
+
+ <xsl:choose>
+ <xsl:when test="$flagv='ON'">
+ <xsl:choose>
+ <xsl:when test="$emptyv='true'">
+ <xsl:choose>
+ <xsl:when test="$filterv='true'">
+ <div>
+ <table>
+ <tr>
+ <td>    </td>
+ <td>
+ <h4>No message found after applying the filter</h4>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </xsl:when>
+ <xsl:otherwise>
+ <div>
+ <table>
+ <tr>
+ <td>    </td>
+ <td>
+ <span>
+ <ol>
+ <li><h4>SOAP tracing turned on</h4></li>
+ <li><h4>No SOAP messages in the Tracer's buffer.</h4></li>
+ <li><h4>Use 'Filter' to mask messages on simple string comparison on request.<br/>
+ Check the mask to enable Filtering.
+ </h4></li>
+ <li><b>WARNING:</b> <br/>
+ <h5>
+ Turning this ON will have a performance hit since all SOAP messages will be always completely built <br/>
+ (i.e. deferred building will not be done) and stored in the database by WSO2 WSAS hence this option <br/>
+ should be used with caution.
+ </h5>
+ </li>
+ </ol>
+ </span>
+
+ </td>
+ </tr>
+ </table>
+ </div>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <div>
+ <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>
+ </div>
+ <div>
+ <xsl:attribute name="id">informationMainTableDivId</xsl:attribute>
+ <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>
+ </div>
</fieldset>
</form>
</xsl:template>
More information about the Wsas-java-dev
mailing list