Author: indika
Date: Wed Jan  2 01:55:57 2008
New Revision: 11744

Log:

add initial GUI for the callout mediator 


Added:
   
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/callout_mediator.js
   
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/callout_edit.xsl
   
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/callout_view.xsl
Modified:
   trunk/esb/java/modules/distribution/src/main/www/extensions/core/js.html
   
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/mediators.js
   
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/custom_mediator_includes.xsl
   
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/statistics/commonstatistics.xsl

Modified: 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js.html
==============================================================================
--- trunk/esb/java/modules/distribution/src/main/www/extensions/core/js.html    
(original)
+++ trunk/esb/java/modules/distribution/src/main/www/extensions/core/js.html    
Wed Jan  2 01:55:57 2008
@@ -40,6 +40,7 @@
 <script language="javascript" 
src="extensions/core/js/mediators/iterate_mediator.js"></script>
 <script language="javascript" 
src="extensions/core/js/mediators/cache_mediator.js"></script>
 <script language="javascript" 
src="extensions/core/js/mediators/aggregate_mediator.js"></script>
+<script language="javascript" 
src="extensions/core/js/mediators/callout_mediator.js"></script>
 <script language="javascript" 
src="extensions/core/js/mediators/property.js"></script>
 <script language="javascript" 
src="extensions/core/js/mediators/mediators.js"></script>
 <script language="javascript" src="extensions/core/js/statistics.js"></script>

Added: 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/callout_mediator.js
==============================================================================
--- (empty file)
+++ 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/callout_mediator.js
   Wed Jan  2 01:55:57 2008
@@ -0,0 +1,272 @@
+/*
+ * Copyright (c) 2006, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * This js file is for the log mediator specific UI operations
+ */
+
+
+collectdata["callout"] = function collectlogdata(mediator, validate) {
+    return collectdatatemporallyforcallout(mediator, validate);
+};
+function collectdatatemporallyforcallout(mediator, validate) {
+    var serviceURL = document.getElementById("callout_serviceURL");
+    var action = document.getElementById("callout_action");
+    var sourcexpath = document.getElementById("source_xpath");
+    var sourcekey = document.getElementById("source_key");
+    var targetxpath = document.getElementById("target_xpath");
+    var targetkey = document.getElementById("target_key");
+
+    if (serviceURL != null && serviceURL.value != "") {
+        mediator.setAttribute("serviceURL", serviceURL.value);
+
+    } else if (!validate) {
+        esbwarning("The callout serviceURL must be specified", TYPE_INFO);
+        return false;
+    }
+
+    if (action != undefined && action != null && action.value != "") {
+        mediator.setAttribute("action", action.value);
+    }
+    var chlimit = mediator.childNodes.length;
+    var sourceindex = null;
+    var targetindex = null;
+    for (var i = 0; i < chlimit; i++) {
+        var child = mediator.childNodes[i] ;
+        if (child != null && child != undefined) {
+            var name = child.nodeName;
+            if (name == "syn:source" || name == "source") {
+                sourceindex = i;
+            }
+            if (name == "syn:target" || name == "target") {
+                targetindex = i;
+            }
+        }
+    }
+    if (mediator.childNodes[sourceindex] == undefined || 
mediator.childNodes[sourceindex] == null) {
+        mediator.appendChild(createesbelement("<syn:source 
xmlns:syn='http://ws.apache.org/ns/synapse'/>"));
+    }
+    if (mediator.childNodes[targetindex] == undefined || 
mediator.childNodes[targetindex] == null) {
+        mediator.appendChild(createesbelement("<syn:target 
xmlns:syn='http://ws.apache.org/ns/synapse'/>"));
+    }
+    chlimit = mediator.childNodes.length;
+    for (var i = 0; i < chlimit; i++) {
+        var child = mediator.childNodes[i] ;
+        if (child != null && child != undefined) {
+            var name = child.nodeName;
+            if (name == "syn:source" || name == "source") {
+                sourceindex = i;
+            }
+            if (name == "syn:target" || name == "target") {
+                targetindex = i;
+            }
+        }
+    }
+    var source = mediator.childNodes[sourceindex];
+    if (source == null && !validate) {
+        esbwarning("The source must be specified", TYPE_INFO);
+        return false;
+    }
+    var target = mediator.childNodes[targetindex];
+    if (target == null && !validate) {
+        esbwarning("The target must be specified", TYPE_INFO);
+        return false;
+    }
+    if (sourcexpath != null && sourcexpath.value != "") {
+        if (source != null) {
+            source.setAttribute("xpath", sourcexpath.value);
+            source.removeAttribute("key");
+        }
+    } else if (sourcekey != null && sourcekey.value != "") {
+        if (source != null) {
+            source.setAttribute("key", sourcekey.value);
+            source.removeAttribute("xpath");
+        }
+    } else if (!validate) {
+        esbwarning("A key or XPath must be specified for the source", 
TYPE_INFO);
+        return false;
+    }
+    if (targetxpath != null && targetxpath.value != "") {
+        if (target != null) {
+            target.setAttribute("xpath", targetxpath.value);
+            target.removeAttribute("key");
+        }
+    } else if (targetkey != null && targetkey.value != "") {
+        if (target != null) {
+            target.setAttribute("key", targetkey.value);
+            target.removeAttribute("xpath");
+        }
+    } else if (!validate) {
+        esbwarning("A key or XPath must be specified for the target", 
TYPE_INFO);
+        return false;
+    }
+
+    return true;
+}
+function sourcexpath(index) {
+    var mediator = getnestedmediator(internalmodel.sequence, index);
+    collectdatatemporallyforcallout(mediator, true);
+    var chlimit = mediator.childNodes.length;
+    var chindex = null;
+    for (var i = 0; i < chlimit; i++) {
+        var child = mediator.childNodes[i] ;
+        if (child != null && child != undefined) {
+            var name = child.nodeName;
+            if (name == "syn:source" || name == "source") {
+                chindex = i;
+            }
+        }
+    }
+    if (chindex != null) {
+        var key = mediator.childNodes[chindex].getAttribute("key") ;
+        if (key != null && key != undefined) {
+            mediator.childNodes[chindex].removeAttribute("key");
+        }
+    }
+    mediator.setAttribute("source_xpath", 0);
+    mediator.removeAttribute("source_key");
+    var epdiv = document.getElementById("callout_edit_div");
+    if (epdiv != null && mediator != null) {
+        processXML(mediator, "mediators/callout_edit.xsl", epdiv);
+    }
+}
+function sourcekey(index) {
+    var mediator = getnestedmediator(internalmodel.sequence, index);
+    collectdatatemporallyforcallout(mediator, true);
+    var chlimit = mediator.childNodes.length;
+    var chindex = null;
+    for (var i = 0; i < chlimit; i++) {
+        var child = mediator.childNodes[i] ;
+        if (child != null && child != undefined) {
+            var name = child.nodeName;
+            if (name == "syn:source" || name == "source") {
+                chindex = i;
+            }
+        }
+    }
+    if (chindex != null) {
+        var key = mediator.childNodes[chindex].getAttribute("xpath") ;
+        if (key != null && key != undefined) {
+            mediator.childNodes[chindex].removeAttribute("xpath");
+        }
+    }
+    mediator.setAttribute("source_key", 0);
+    mediator.removeAttribute("source_xpath");
+    var epdiv = document.getElementById("callout_edit_div");
+    if (epdiv != null && mediator != null) {
+        processXML(mediator, "mediators/callout_edit.xsl", epdiv);
+    }
+}
+function targetxpath(index) {
+    var mediator = getnestedmediator(internalmodel.sequence, index);
+    collectdatatemporallyforcallout(mediator, true);
+    var chlimit = mediator.childNodes.length;
+    var chindex = null;
+    for (var i = 0; i < chlimit; i++) {
+        var child = mediator.childNodes[i] ;
+        if (child != null && child != undefined) {
+            var name = child.nodeName;
+            if (name == "syn:target" || name == "target") {
+                chindex = i;
+            }
+        }
+    }
+    if (chindex != null) {
+        var key = mediator.childNodes[chindex].getAttribute("key") ;
+        if (key != null && key != undefined) {
+            mediator.childNodes[chindex].removeAttribute("key");
+        }
+    }
+    mediator.setAttribute("target_xpath", 0);
+    mediator.removeAttribute("target_key");
+    var epdiv = document.getElementById("callout_edit_div");
+    if (epdiv != null && mediator != null) {
+        processXML(mediator, "mediators/callout_edit.xsl", epdiv);
+    }
+}
+function targetkey(index) {
+    var mediator = getnestedmediator(internalmodel.sequence, index);
+    collectdatatemporallyforcallout(mediator, true);
+    var chlimit = mediator.childNodes.length;
+    var chindex = null;
+    for (var i = 0; i < chlimit; i++) {
+        var child = mediator.childNodes[i] ;
+        if (child != null && child != undefined) {
+            var name = child.nodeName;
+            if (name == "syn:target" || name == "target") {
+                chindex = i;
+            }
+        }
+    }
+    if (chindex != null) {
+        var key = mediator.childNodes[chindex].getAttribute("xpath") ;
+        if (key != null && key != undefined) {
+            mediator.childNodes[chindex].removeAttribute("xpath");
+        }
+    }
+    mediator.setAttribute("target_key", 0);
+    mediator.removeAttribute("target_xpath");
+    var epdiv = document.getElementById("callout_edit_div");
+    if (epdiv != null && mediator != null) {
+        processXML(mediator, "mediators/callout_edit.xsl", epdiv);
+    }
+}
+
+function showNameSpaceEditorForTarget(pindex, attribute, inputID) {
+    var mediator = getnestedmediator(internalmodel.sequence, pindex);
+    var temp = collectdatatemporallyforcallout(mediator, true);
+    setnodepositions(mediator, pindex);
+    var chlimit = mediator.childNodes.length;
+    var position = null;
+    for (var i = 0; i < chlimit; i++) {
+        var child = mediator.childNodes[i] ;
+        if (child != null && child != undefined) {
+            var name = child.nodeName;
+            if (name == "syn:target" || name == "target") {
+                position = child.getAttribute("esb_med_pos");
+            }
+        }
+    }
+    if (position == null) {
+        return;
+    }
+    showNameSpaceEditor(position, attribute, inputID);
+}
+function showNameSpaceEditorForSource(pindex, attribute, inputID) {
+    var mediator = getnestedmediator(internalmodel.sequence, pindex);
+    var temp = collectdatatemporallyforcallout(mediator, true);
+    setnodepositions(mediator, pindex);
+    var chlimit = mediator.childNodes.length;
+    var position = null;
+    for (var i = 0; i < chlimit; i++) {
+        var child = mediator.childNodes[i] ;
+        if (child != null && child != undefined) {
+            var name = child.nodeName;
+            if (name == "syn:source" || name == "source") {
+                position = child.getAttribute("esb_med_pos");
+            }
+        }
+    }
+    if (position == null) {
+        return;
+    }
+    showNameSpaceEditor(position, attribute, inputID)
+}
+
+mediatorelementstring["callout"] = function logstring() {
+    return "<syn:callout xmlns:syn='http://ws.apache.org/ns/synapse' 
source_xpath='0' target_xpath='0'><syn:source/><syn:target/></syn:callout>";
+};
+

Modified: 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/mediators.js
==============================================================================
--- 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/mediators.js
  (original)
+++ 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/mediators.js
  Wed Jan  2 01:55:57 2008
@@ -20,7 +20,7 @@
 
 var MEDIATOR_ADMIN = "MediatorAdmin"
 
-var mediatorcategories = [{text: "Core", id: "core", submenu: {id: "coremenu", 
itemdata: [{text: "Drop", id: "drop"}, {text: "Log", id: "log"}, {text: 
"Property", id: "property"}, {text: "Send", id: "send"}, {text: "Sequence", id: 
"sequence"}, {text: "DBreport", id: "dbreport"}, {text: "DBlookup", id: 
"dblookup"}, {text: "Clone", id: "clone"}, {text: "Iterate", id: "iterate"}, 
{text: "Aggregate", id: "aggregate"}, {text: "Cache", id: "cache"}]}},
+var mediatorcategories = [{text: "Core", id: "core", submenu: {id: "coremenu", 
itemdata: [{text: "Drop", id: "drop"}, {text: "Log", id: "log"}, {text: 
"Property", id: "property"}, {text: "Send", id: "send"}, {text: "Sequence", id: 
"sequence"}, {text: "DBreport", id: "dbreport"}, {text: "Callout", id: 
"callout"}, {text: "DBlookup", id: "dblookup"}, {text: "Clone", id: "clone"}, 
{text: "Iterate", id: "iterate"}, {text: "Aggregate", id: "aggregate"}, {text: 
"Cache", id: "cache"}]}},
     {text: "Transform", id: "transform", submenu: {id: "transformmenu", 
itemdata: [{text: "Fault", id: "makefault"}, {text: "Header", id: "header"}, 
{text: "XSLT", id: "xslt"},{text: "XQuery", id: "xquery"}]}},
     {text: "Filters", id: "filters", submenu: {id: "filtersmenu", itemdata: 
[{text: "Filter", id: "filter"}, {text: "In", id: "in"}, {text: "Out", id: 
"out"}, {text: "Switch", id: "switch"}, {text: "Validate", id: "validate"}, 
{text: "Throttle", id: "throttle"}]}},
     {text: "Extension", id: "extension", submenu: {id: "extensionmenu", 
itemdata: [{text: "Class", id: "class"}, {text: "Command", id: "pojoCommand"}, 
{text: "Script", id: "script"}, {text: "Spring", id: "spring"}, {text: 
"RMSequence", id: "RMSequence"}]}}];

Added: 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/callout_edit.xsl
==============================================================================
--- (empty file)
+++ 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/callout_edit.xsl
    Wed Jan  2 01:55:57 2008
@@ -0,0 +1,228 @@
+<!--
+  ~ Copyright (c) 2006, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
+
+    <xsl:include href="commons.xsl"/>
+    <xsl:template match="syn:callout" 
xmlns:syn="http://ws.apache.org/ns/synapse";>
+        <div id="callout_edit_div">
+            <label class="content-callout">
+                <img src="extensions/core/images/callout-mediator.gif"/>
+                <xsl:text>Callout Mediator</xsl:text>
+            </label>
+            <br/>
+            <br/>
+            <div id="callout_edit" class="end-point-div">
+                <br/>
+                <table border="0" style="width: 600px;">
+                    <tbody>
+                        <tr>
+                            <td colspan="2" style="width:100px;">
+                                ServiceURL
+                                <font style='color: red;font-size: 
8pt;'>&#160;*</font>
+                            </td>
+                            <td colspan="2">
+                                <input type="text" size="40" 
id="callout_serviceURL"
+                                       class="esb-edit">
+                                    <xsl:attribute name="value">
+                                        <xsl:value-of select="@serviceURL"/>
+                                    </xsl:attribute>
+                                </input>
+                            </td>
+                        </tr>
+                        <tr>
+                            <td colspan="2" style="width:100px;">
+                                Action
+                                <font style='color: red;font-size: 
8pt;'>&#160;*</font>
+                            </td>
+                            <td colspan="2">
+                                <input type="text" size="40" 
id="callout_action"
+                                       class="esb-edit">
+                                    <xsl:attribute name="value">
+                                        <xsl:value-of select="@action"/>
+                                    </xsl:attribute>
+                                </input>
+                            </td>
+                        </tr>
+                    </tbody>
+                </table>
+                <br/>
+                <label>Source <font style='color: red;font-size: 
8pt;'>&#160;*</font></label>
+                <br/>
+                <label>Specify as :</label>
+                <xsl:element name="input">
+                    <xsl:attribute name="onClick">
+                        javascript:sourcexpath('<xsl:value-of 
select="@esb_med_pos"/>');
+                    </xsl:attribute>
+                    <xsl:attribute name="type">radio</xsl:attribute>
+                    <xsl:attribute name="name">
+                        sourcegroup
+                    </xsl:attribute>
+                    <xsl:attribute name="value">XPath</xsl:attribute>
+                    <xsl:attribute name="style">margin-left: 
3em;</xsl:attribute>
+                    <xsl:if test="syn:source/@xpath or (@source_xpath and 
@source_xpath=0)">
+                        <xsl:attribute name="checked">checked</xsl:attribute>
+                    </xsl:if>
+                </xsl:element>
+                <label>XPath</label>
+                <xsl:element name="input">
+                    <xsl:attribute name="onClick">
+                        javascript:sourcekey('<xsl:value-of 
select="@esb_med_pos"/>');
+                    </xsl:attribute>
+                    <xsl:attribute name="type">radio</xsl:attribute>
+                    <xsl:attribute name="name">
+                        sourcegroup
+                    </xsl:attribute>
+                    <xsl:attribute name="value">Key</xsl:attribute>
+                    <xsl:attribute 
name="style">margin-left:120px;</xsl:attribute>
+                    <xsl:if test="syn:source/@key or (@source_key and 
@source_key=0)">
+                        <xsl:attribute name="checked">checked</xsl:attribute>
+                    </xsl:if>
+                </xsl:element>
+                <label>Key</label>
+                <br/>
+                <xsl:if test="syn:source/@xpath or (@source_xpath and 
@source_xpath=0)">
+                    <table border="0" style="margin-left: 3em; width: 150px;">
+                        <tbody>
+                            <tr>
+                                <td>
+                                    <xsl:text>XPath</xsl:text>
+                                </td>
+                                <td>
+                                    <input type="text" class="esb-edit" 
size="40"
+                                           id="source_xpath">
+                                        <xsl:attribute name="value">
+                                            <xsl:value-of 
select="syn:source/@xpath"/>
+                                        </xsl:attribute>
+                                    </input>
+                                </td>
+                                <td>
+                                    <a title="Namespace Editor" 
class="ns_editor">
+                                        <xsl:attribute name="onclick">
+                                            
javascript:showNameSpaceEditorForSource('<xsl:value-of 
select="@esb_med_pos"/>','','');
+                                        </xsl:attribute>
+                                        
<xsl:text>&#160;&#160;&#160;&#160;</xsl:text>
+                                    </a>
+                                </td>
+                            </tr>
+                        </tbody>
+                    </table>
+                </xsl:if>
+                <xsl:if test="syn:source/@key  or (@source_key and 
@source_key=0)">
+                    <table border="0" style="margin-left: 3em; width: 150px;">
+                        <tbody>
+                            <tr>
+                                <td>
+                                    <xsl:text>Key</xsl:text>
+                                </td>
+                                <td>
+                                    <input type="text" class="esb-edit" 
size="40"
+                                           id="source_key">
+                                        <xsl:attribute name="value">
+                                            <xsl:value-of 
select="syn:source/@key"/>
+                                        </xsl:attribute>
+                                    </input>
+                                </td>
+                            </tr>
+                        </tbody>
+                    </table>
+                </xsl:if>
+                <br/>
+                <label>Target <font style='color: red;font-size: 
8pt;'>&#160;*</font></label>
+                <br/>
+                <label>Specify as :</label>
+                <xsl:element name="input">
+                    <xsl:attribute name="onClick">
+                        javascript:targetxpath('<xsl:value-of 
select="@esb_med_pos"/>');
+                    </xsl:attribute>
+                    <xsl:attribute name="type">radio</xsl:attribute>
+                    <xsl:attribute name="name">
+                        targetgroup
+                    </xsl:attribute>
+                    <xsl:attribute name="value">XPath</xsl:attribute>
+                    <xsl:attribute name="style">margin-left: 
3em;</xsl:attribute>
+                    <xsl:if test="syn:target/@xpath or (@target_xpath and 
@target_xpath=0)">
+                        <xsl:attribute name="checked">checked</xsl:attribute>
+                    </xsl:if>
+                </xsl:element>
+                <label>XPath</label>
+                <xsl:element name="input">
+                    <xsl:attribute name="onClick">
+                        javascript:targetkey('<xsl:value-of 
select="@esb_med_pos"/>');
+                    </xsl:attribute>
+                    <xsl:attribute name="type">radio</xsl:attribute>
+                    <xsl:attribute name="name">
+                        targetgroup
+                    </xsl:attribute>
+                    <xsl:attribute name="value">Key</xsl:attribute>
+                    <xsl:attribute 
name="style">margin-left:120px;</xsl:attribute>
+                    <xsl:if test="syn:target/@key or (@target_key and 
@target_key=0)">
+                        <xsl:attribute name="checked">checked</xsl:attribute>
+                    </xsl:if>
+                </xsl:element>
+                <label>Key</label>
+                <br/>
+                <xsl:if test="syn:target/@xpath or (@target_xpath and 
@target_xpath=0)">
+                    <table border="0" style="margin-left: 3em; width: 150px;">
+                        <tbody>
+                            <tr>
+                                <td>
+                                    <xsl:text>XPath</xsl:text>
+                                </td>
+                                <td>
+                                    <input type="text" class="esb-edit" 
size="40"
+                                           id="target_xpath">
+                                        <xsl:attribute name="value">
+                                            <xsl:value-of 
select="syn:target/@xpath"/>
+                                        </xsl:attribute>
+                                    </input>
+                                </td>
+                                <td>
+                                    <a title="Namespace Editor" 
class="ns_editor">
+                                        <xsl:attribute name="onclick">
+                                            
javascript:showNameSpaceEditorForTarget('<xsl:value-of 
select="@esb_med_pos"/>','','');
+                                        </xsl:attribute>
+                                        
<xsl:text>&#160;&#160;&#160;&#160;</xsl:text>
+                                    </a>
+                                </td>
+                            </tr>
+                        </tbody>
+                    </table>
+                </xsl:if>
+                <xsl:if test="syn:target/@key or (@target_key and 
@target_key=0)">
+                    <table border="0" style="margin-left: 3em; width: 150px;">
+                        <tbody>
+                            <tr>
+                                <td>
+                                    <xsl:text>Key</xsl:text>
+                                </td>
+                                <td>
+                                    <input type="text" class="esb-edit" 
size="40"
+                                           id="target_key">
+                                        <xsl:attribute name="value">
+                                            <xsl:value-of 
select="syn:target/@key"/>
+                                        </xsl:attribute>
+                                    </input>
+                                </td>
+                            </tr>
+                        </tbody>
+                    </table>
+                </xsl:if>
+            </div>
+        </div>
+    </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file

Added: 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/callout_view.xsl
==============================================================================
--- (empty file)
+++ 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/callout_view.xsl
    Wed Jan  2 01:55:57 2008
@@ -0,0 +1,114 @@
+<!--
+  ~ Copyright (c) 2006, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
+
+    <xsl:template match="syn:callout" mode="custom" priority="2"
+                  xmlns:syn="http://ws.apache.org/ns/synapse";>
+        <label class="content-callout">
+            <img src="extensions/core/images/callout-mediator.gif"/>
+            <xsl:call-template name="capitalize-first"/>
+            <xsl:text>Mediator</xsl:text>
+        </label>
+        <br/>
+        <br/>
+        <div id="common_table_content">
+            <table border="0" cellpadding="0" cellspacing="0">
+                <tbody>
+                    <tr>
+                        <th>Property</th>
+                        <th>Value</th>
+                    </tr>
+                    <tr>
+                        <td>
+                            <label class="log-attribute-name">
+                                ServiceURL
+                            </label>
+                        </td>
+                        <td>
+                            <label class="log-attribute-value">
+                                <xsl:value-of select="@serviceURL"/>
+                            </label>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>
+                            <label class="log-attribute-name">
+                                Action
+                            </label>
+                        </td>
+                        <td>
+                            <label class="log-attribute-value">
+                                <xsl:value-of select="@action"/>
+                            </label>
+                        </td>
+                    </tr>
+                    <xsl:if test="syn:source/@xpath or syn:source/@key ">
+                        <tr>
+                            <td>
+                                <label class="log-attribute-name">
+                                    Source-
+                                    <xsl:if test="syn:source/@xpath">
+                                        XPath
+                                    </xsl:if>
+                                    <xsl:if test="syn:source/@key">
+                                        Key
+                                    </xsl:if>
+                                </label>
+                            </td>
+                            <td>
+                                <label class="log-attribute-value">
+                                    <xsl:if test="syn:source/@xpath">
+                                        <xsl:value-of 
select="syn:source/@xpath"/>
+                                    </xsl:if>
+                                    <xsl:if test="syn:source/@key">
+                                        <xsl:value-of 
select="syn:source/@key"/>
+                                    </xsl:if>
+                                </label>
+                            </td>
+                        </tr>
+                    </xsl:if>
+                    <xsl:if test="syn:target/@xpath or syn:target/@key ">
+                        <tr>
+                            <td>
+                                <label class="log-attribute-name">
+                                    Target-
+                                    <xsl:if test="syn:target/@xpath">
+                                        XPath
+                                    </xsl:if>
+                                    <xsl:if test="syn:target/@key">
+                                        Key
+                                    </xsl:if>
+                                </label>
+                            </td>
+                            <td>
+                                <label class="log-attribute-value">
+                                    <xsl:if test="syn:target/@xpath">
+                                        <xsl:value-of 
select="syn:target/@xpath"/>
+                                    </xsl:if>
+                                    <xsl:if test="syn:target/@key">
+                                        <xsl:value-of 
select="syn:target/@key"/>
+                                    </xsl:if>
+                                </label>
+                            </td>
+                        </tr>
+                    </xsl:if>
+
+                </tbody>
+            </table>
+        </div>
+    </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file

Modified: 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/custom_mediator_includes.xsl
==============================================================================
--- 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/custom_mediator_includes.xsl
        (original)
+++ 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/custom_mediator_includes.xsl
        Wed Jan  2 01:55:57 2008
@@ -25,6 +25,7 @@
     <xsl:include href="target_view.xsl"/>
     <xsl:include href="cache_view.xsl"/>
     <xsl:include href="aggregate_view.xsl"/>
+    <xsl:include href="callout_view.xsl"/>
 
 
     <!-- Your custom mediator view xslt references goes here -->

Modified: 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/statistics/commonstatistics.xsl
==============================================================================
--- 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/statistics/commonstatistics.xsl
       (original)
+++ 
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/statistics/commonstatistics.xsl
       Wed Jan  2 01:55:57 2008
@@ -105,8 +105,16 @@
             <xsl:value-of select="//return[$index]/faultCount"/>
         </td>
         <td>
-            <xsl:value-of 
select="format-number(//return[$index]/avgTime,'#.##')"/>
-            ms
+            <xsl:choose>
+                <xsl:when 
test="format-number(//return[$index]/avgTime,'#.##')='NAN'">
+                    <xsl:value-of select="//return[$index]/avgTime"/>
+                    ms
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:value-of 
select="format-number(//return[$index]/avgTime,'#.##')"/>
+                    ms
+                </xsl:otherwise>
+            </xsl:choose>
         </td>
         <td>
             <xsl:choose>

_______________________________________________
Esb-java-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev

Reply via email to