[esb-java-dev] svn commit r218 - in esb/java/trunk/modules/distribution: . src/main/www/extensions/core src/main/www/extensions/core/js src/main/www/extensions/core/xslt

svn at wso2.com svn at wso2.com
Tue Dec 12 23:57:01 PST 2006


Author: ruwan
Date: Tue Dec 12 23:57:01 2006
New Revision: 218

Added:
   esb/java/trunk/modules/distribution/src/main/www/extensions/core/js/_sequences.js
   esb/java/trunk/modules/distribution/src/main/www/extensions/core/xslt/view_log.xsl
   esb/java/trunk/modules/distribution/src/main/www/extensions/core/xslt/view_mediator.xsl
Modified:
   esb/java/trunk/modules/distribution/pom.xml
   esb/java/trunk/modules/distribution/src/main/www/extensions/core/js.html
   esb/java/trunk/modules/distribution/src/main/www/extensions/core/js/proxyservices.js
   esb/java/trunk/modules/distribution/src/main/www/extensions/core/xslt/sequences.xsl
Log:
updating for the new wsf jars / sequence editing graphical (not completed)

Modified: esb/java/trunk/modules/distribution/pom.xml
==============================================================================
--- esb/java/trunk/modules/distribution/pom.xml	(original)
+++ esb/java/trunk/modules/distribution/pom.xml	Tue Dec 12 23:57:01 2006
@@ -106,8 +106,8 @@
                             </artifactItem>
                             <artifactItem>
                                 <groupId>org.wso2.wsf</groupId>
-                                <artifactId>statistics</artifactId>
-                                <version>${wso2wsas.admin.module.version}</version>
+                                <artifactId>wso2-wsf-statistics</artifactId>
+                                <version>${wso2wsf.version}</version>
                                 <type>mar</type>
                                 <overWrite>false</overWrite>
                                 <outputDirectory>target/temp/lib</outputDirectory>

Modified: esb/java/trunk/modules/distribution/src/main/www/extensions/core/js.html
==============================================================================
--- esb/java/trunk/modules/distribution/src/main/www/extensions/core/js.html	(original)
+++ esb/java/trunk/modules/distribution/src/main/www/extensions/core/js.html	Tue Dec 12 23:57:01 2006
@@ -12,6 +12,7 @@
 <script language="javascript" src="extensions/core/js/esb_statistics.js"></script>
 <script language="javascript" src="extensions/core/js/commons.js"></script>
 <script language="javascript" src="extensions/core/js/config.js"></script>
+<script language="javascript" src="extensions/core/js/_sequences.js"></script>
 <!--
   ~ Copyright (c) 2006, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
   ~

Added: esb/java/trunk/modules/distribution/src/main/www/extensions/core/js/_sequences.js
==============================================================================
--- (empty file)
+++ esb/java/trunk/modules/distribution/src/main/www/extensions/core/js/_sequences.js	Tue Dec 12 23:57:01 2006
@@ -0,0 +1,145 @@
+/*
+ * 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 is an experimental js for sequence editing
+ */
+
+/* Global variable to store the sequence administration service */
+var SEQUENCE_ADMIN = "SequenceAdmin";
+
+/* Global object to hold the sequence internally */
+var internalmodel = new Object();
+internalmodel.mediators = new Array();
+internalmodel.sequencename = "";
+
+/*
+ * This function will be called to graphically view the sequence specified by the sequencename
+ * and the viewsequencecallback will be executed as the callback for the service invocation
+ */
+function viewsequence (sequencename) {
+
+    // constructing the soap body to invoke the service as a string
+    var bodyxml = '<ns1:getSequence xmlns:ns1="http://org.apache.synapse/xsd">' +
+                  '<ns1:sequenceName>' + sequencename + '</ns1:sequenceName>' +
+                  '</ns1:getSequence>';
+
+    var callurl = serverURL + "/" + SEQUENCE_ADMIN + "/" + "getSequence";
+
+    // invokes the service and asign the callback for the results
+    send("getSequence", bodyxml, "", callurl, "", false, viewsequencecallback);
+}
+
+/**
+ * This is the callback for the viewsequence function which invokes the sequence admin service
+ * and this will call the viewsequencechanges function to get the html rendered
+ */
+function viewsequencecallback () {
+
+    // retrieves the sequence element
+    var sequencedata = getNodeFromPath("return", xhReq.responseXML).firstChild;
+
+    // asigns the mediator sequence to the internal model
+    internalmodel.mediators = sequencedata.childNodes;
+    // asigns the sequence name to the internal model
+    internalmodel.sequencename = sequencedata.getAttribute("name");
+
+    // this function will be called to get the html generated for the mediators in the sequencec
+    viewsequencechanges();
+}
+
+/**
+ * This will generate the html representation of the service result (sequence)
+ */
+function viewsequencechanges() {
+
+    var objdiv = document.getElementById("divSeqence");
+    objdiv.innerHTML = "";
+
+    // construct the header for the sequence view using DOM
+    var sequenceheader = document.createElement("h4");
+
+    // link to the sequence main page
+    var sequencemainlink = document.createElement("a");
+    sequencemainlink.setAttribute("href", "#");
+    sequencemainlink.setAttribute('onclick', 'javascript:showSequences(); return false;');
+    sequencemainlink.appendChild(document.createTextNode("Sequence Management"));
+    sequenceheader.appendChild(sequencemainlink);
+
+    sequenceheader.appendChild(document.createTextNode(" > "));
+
+    // heading of the sequence view
+    var sequenceheading = document.createElement("label");
+    sequenceheading.appendChild(document.createTextNode("Sequence "
+            + internalmodel.sequencename));
+    sequenceheading.setAttribute("style", "color: orange");
+    sequenceheader.appendChild(sequenceheading);
+
+    objdiv.appendChild(sequenceheader);
+
+    objdiv.appendChild(document.createElement("br"));
+
+    // generate the html for each and every child element (mediators) of the sequence
+    for(i=0; i<internalmodel.mediators.length; i++) {
+
+        var mediatordiv = document.createElement("div");
+        // call to get the mediator graphical representations loaded in to the corresponding divs
+        viewmediator(mediatordiv, internalmodel.mediators[i], i);
+
+        // appends the mediator html representations divs come from the above function
+        objdiv.appendChild(mediatordiv);
+        objdiv.appendChild(document.createElement("br"));
+    }
+
+    // hides all the other dives in the main frame and shows this div
+    showOnlyOneMain(objdiv, true);
+}
+
+/**
+ * This function is used to generate the mediator view html portions
+ */
+function viewmediator (mediatordiv, mediatornode, position) {
+
+    // getting the xslt file name for the mediator (for example: view_send.xsl for send mediator)
+    var xsltfilename = "view_" + mediatornode.localName + ".xsl";
+
+    mediatordiv.setAttribute("id", "mediatordiv" + i);
+    mediatordiv.setAttribute("style",
+            "width: 60%; border: outset lightblue; margin-left: 230px; padding-left: 10px");
+
+    // put the mediator to an internal model which is to keep the changes in editing the sequence
+    internalmodel.mediators[i] = mediatornode;
+
+    // load the div with the html generated from the mediator using the xslt file specified
+    try {
+        loadXSLT(xsltfilename, false);
+        var fragment = xsltProcessor.transformToFragment(mediatornode, document);
+        mediatordiv.innerHTML = "";
+        mediatordiv.appendChild(fragment);
+    } catch(e) {
+        try {
+            // if failed try to load in IE
+            loadXSLIE(mediatornode, xslFileName, false, mediatordiv);
+        } catch(e) {
+            // if the above xsl processing failed render the mediator as a raw styled XML fragment
+            processXML(mediatornode, "view_mediator.xsl", mediatordiv);
+        }
+    }
+//    var actionpaneldiv = document.createElement("div");
+//    actionpaneldiv.setAttribute("style", "width: 20%; align: right");
+//    mediatordiv.appendChild(actionpaneldiv);
+//    alert(new XMLSerializer().serializeToString(mediatordiv));
+}
\ No newline at end of file

Modified: esb/java/trunk/modules/distribution/src/main/www/extensions/core/js/proxyservices.js
==============================================================================
--- esb/java/trunk/modules/distribution/src/main/www/extensions/core/js/proxyservices.js	(original)
+++ esb/java/trunk/modules/distribution/src/main/www/extensions/core/js/proxyservices.js	Tue Dec 12 23:57:01 2006
@@ -15,9 +15,9 @@
  */
 
 /*
-proxyservices.js handles Proxy Services, which are eventually
-the actual services for Axis2 runtime.
-*/
+ * proxyservices.js handles Proxy Services, which are eventually
+ * the actual services for Axis2 runtime.
+ */
 
 var PROXY_SERVICES = "ProxyServiceAdmin";
 
@@ -33,7 +33,6 @@
 
     var callURL = serverURL + "/" + PROXY_SERVICES + "/" + "proxyData";
     send("proxyData", body_xml, "", callURL, "", false, showProxyServicesCallback);
-
 }
 
 function showProxyServicesCallback() {
@@ -60,7 +59,6 @@
     if (!onError()) {
         return;
     }
-
     proxy = getNodeFromPath("proxy", xhReq.responseXML);
     initProxyService();
     doingAdd = false;
@@ -74,7 +72,6 @@
 }
 
 function fillProxyService(proxy) {
-//    showStuffInNewWindow(new XMLSerializer().serializeToString(proxy));
     proxyService.name = proxy.getAttribute("name");
     var tp = proxy.getAttribute("transports");
     if(tp != null) {
@@ -99,21 +96,16 @@
             proxyService.endpoint = getAttbuteObject("endpoint", target).value;
         }
         if (target.getAttributeNode("inSequence") != null || target.getAttributeNode("outSequence") != null) {
-//            alert("sequence" + xmlSerializerToString(target));
             proxyService.target = "sequence";
             proxyService.inSequence = target.getAttribute("inSequence");
             proxyService.outSequence = target.getAttribute("outSequence");
         }
     }
-//    alert(proxyService.availabelEndpoints.length);
     var wsdl = getNodeFromPath("wsdl", proxy);
-//    showStuffInNewWindow(wsdl);
     if(wsdl != null) {
         proxyService.wsdlType = "Existing Property";
         proxyService.wsdlKey = wsdl.getAttribute("key");
     }
-
-    //    // todo:
     policies = proxy.getElementsByTagName("policy");
     for (i = 0; i < policies.length; i++) {
         proxyService.policyTypes[i] = "Existing Property";
@@ -124,7 +116,6 @@
         proxyService.paramNames[i] = properties[i].getAttribute("name");
         proxyService.paramValues[i] = properties[i].getAttribute("value");
     }
-
     if (getNodeFromPath("enableSec", proxy)) {
         proxyService.secEnabled = true;
     }
@@ -135,7 +126,6 @@
 }
 
 function showEditProxy() {
-//    addProxyServiceStep1();
     var objDiv = document.getElementById("divAddProxyService");
     var inSequenceOption = "<option>Default Sequence</option>";
     var outSequenceOption = inSequenceOption;
@@ -231,16 +221,6 @@
                      "<div class='buttonrow'><input type='button' class='styledButton' onclick='javascript:resetSecPolicy();return false;' value='Reset Policy'/></div><br/>";
     }
     var availabelPolicies = "";
-//     if (proxyService.policyTypes.length != 0) {
-//        availabelPolicies += "<table class='styled'><thead><tr><th>Policy Type</th><th>Policy Key</th></tr></thead>";
-//        for (i = 0; i < proxyService.policyTypes.length; i++) {
-//            availabelPolicies += "<tr><td>" + proxyService.policyTypes[i] + "</td><td>" + proxyService.policyValues[i] + "</td></tr>";
-//        }
-//        availabelPolicies += "</table>";
-//    } else {
-//        availabelPolicies = "<label style='width: 500px; color: brown; text-align: left'><i>Currently there are no service level policies present</i></label><br/>";
-//    }
-    // todo: this is just to show need to enhance this
     if (proxyService.policyValues.length != 0) {
         availabelPolicies += "<table class='styled'><thead><tr><th>Policy Type</th><th>Policy Key</th><th>Actions</th></tr></thead>";
         for (i = 0; i < proxyService.policyValues.length; i++) {
@@ -252,10 +232,9 @@
     } else {
         availabelPolicies = "<label style='width: 500px; color: brown; text-align: left'><i>Currently there are no service level policies present</i></label><br/>";
     }
-        availabelPolicies += "<a href='#' onclick='javascript:showAddPolicy();return false;'>Add new service policy</a>";
-        var secEnabled = "<div style='margin-left: 30px'><label style='width: 500px; text-align: left'><input type='checkbox' id='secEnabled'" + secChecked + "/>Enable WS-Security</label></div>";
-        var rmEnabled = "<div style='margin-left: 30px'><label style='width: 500px; text-align: left'><input type='checkbox' id='rmEnabled'" + rmChecked + "/>Enable WS-Reliable Messaging</label></div>";
-
+    availabelPolicies += "<a href='#' onclick='javascript:showAddPolicy();return false;'>Add new service policy</a>";
+    var secEnabled = "<div style='margin-left: 30px'><label style='width: 500px; text-align: left'><input type='checkbox' id='secEnabled'" + secChecked + "/>Enable WS-Security</label></div>";
+    var rmEnabled = "<div style='margin-left: 30px'><label style='width: 500px; text-align: left'><input type='checkbox' id='rmEnabled'" + rmChecked + "/>Enable WS-Reliable Messaging</label></div>";
     var wsdlInfo = "";
     if(proxyService.wsdlKey != null && proxyService.wsdlKey != "") {
         wsdlInfo += "<table class='styled'><thead><tr><th>Resource Type</th><th>WSDL Key</th></tr></thead>";
@@ -265,11 +244,9 @@
         wsdlInfo = "<label style='text-align: left; width: 300px'><i><font style='color: brown'>WSDL is not specified for this proxy Service</font></i></label>";
         wsdlInfo += "<br/><a href='#' onclick='javascript:showWSDLAdd(); return false;'>Specify a WSDL for this service</a>";
     }
-
-    var strHTML =   "<div id='editProxyServiceHelpDiv' style='background-color:#99cccc;position:absolute;visibility:hidden;padding:5px;z-index:600;'></div>"+
-                   "<h4><a href='#' onClick='javascript:showProxyServices(); return false;'>Proxy Services Management</a>" +
+    var strHTML = "<div id='editProxyServiceHelpDiv' style='background-color:#99cccc;position:absolute;visibility:hidden;padding:5px;z-index:600;'></div>"+
+                  "<h4><a href='#' onClick='javascript:showProxyServices(); return false;'>Proxy Services Management</a>" +
                   "</a>&nbsp;&gt;&nbsp;<font color='orange'>Edit Proxy Service</font><img src='extensions/core/images/help.gif' alt=''  onmouseover='showHelp(event,"+'editProxyServiceHelpDiv'+","+'-10'+","+'10'+")' onmouseout='hideHelp(event,"+'editProxyServiceHelpDiv'+")' /></h4></br>"+
-
                   "<fieldset style='border:none;'>" +
                   "<div id='formset'><form>" +
                   "<fieldset>" +
@@ -298,10 +275,8 @@
                   "</form>" +
                   "</div>" +
                   "</fieldset>";
-
     objDiv.innerHTML = strHTML;
     showOnlyOneMain(objDiv);
-
 }
 
 function showWSDLAdd() {
@@ -315,7 +290,6 @@
     if (proxyService.wsdlType == "Existing Property") {
         typeOptions = "<option>Registry Key</option><option>URL Source</option><option selected='true'>Existing Property</option>"
     }
-
     document.getElementById("proxyWsdl").innerHTML = "<label style='text-align: left'>Type</label><select id='wsdlType' style='width: 150px' onchange='javascript:showWSDLTypeChanges();return false;'>" + typeOptions + "</select>";
 }
 
@@ -328,7 +302,6 @@
     proxyService.policyTypes[proxyService.policyValues.length-1] = null;
     proxyService.policyTypes.length = proxyService.policyTypes.length - 1;
     proxyService.policyValues.length = proxyService.policyValues.length - 1;
-
     var availabelPolicies = "";
     if (proxyService.policyTypes.length != 0) {
         availabelPolicies += "<table class='styled'><thead><tr><th>Policy Type</th><th>Policy Key</th><th>Actions</th></tr></thead>";
@@ -341,7 +314,6 @@
         availabelPolicies = "<label style='width: 500px; color: brown; text-align: left'><i>Currently there are no service level policies present</i></label><br/>";
     }
     availabelPolicies += "<a href='#' onclick='javascript:showAddPolicy();return false;'>Add new service policy</a>";
-
     document.getElementById("policiesDiv").innerHTML = availabelPolicies;
 }
 
@@ -354,7 +326,6 @@
     proxyService.paramValues[proxyService.paramValues.length-1] = null;
     proxyService.paramNames.length = proxyService.paramNames.length - 1;
     proxyService.paramValues.length = proxyService.paramValues.length - 1;
-
     var availabelParams = "";
     if (proxyService.paramNames.length != 0) {
         availabelParams += "<table class='styled'><thead><tr><th>Parameter Name</th><th>Parameter Value</th><th>Actions</th></tr></thead>";
@@ -397,7 +368,6 @@
 function getAvailabelTransports() {
     var body_xml = '<ns1:getAvailabelTransports xmlns:ns1="http://org.apache.synapse/xsd">' +
                    '</ns1:getAvailabelTransports>';
-
     var callURL = serverURL + "/" + PROXY_SERVICES + "/" ;
     send("getAvailabelTransports", body_xml, "", callURL, "", false, getAvailabelTransportsCallback);
 }
@@ -409,7 +379,6 @@
     var tp = xhReq.responseXML.getElementsByTagName("return");
     for (i = 0; i < tp.length; i++) {
         proxyService.availabelTransports[i] = tp[i].firstChild.textContent;
-        //(new XMLSerializer()).serializeToString(tp[i].childNodes[0]);
     }
     getAvailabelSequences();
 }
@@ -429,7 +398,6 @@
     var tp = xhReq.responseXML.getElementsByTagName("return");
     for (i = 0; i < tp.length; i++) {
         proxyService.availabelSequences[i] = tp[i].firstChild.textContent;
-        //(new XMLSerializer()).serializeToString(tp[i].childNodes[0]);
     }
     getAvailabelEndpoints();
 }
@@ -437,7 +405,6 @@
 function getAvailabelEndpoints() {
     var body_xml = '<ns1:getAvailabelEndpoints xmlns:ns1="http://org.apache.synapse/xsd">' +
                    '</ns1:getAvailabelEndpoints>';
-
     var callURL = serverURL + "/" + PROXY_SERVICES + "/" ;
     send("getAvailabelEndpoints", body_xml, "", callURL, "", false, getAvailabelEndpointsCallback);
 }
@@ -449,7 +416,6 @@
     var tp = xhReq.responseXML.getElementsByTagName("return");
     for (i = 0; i < tp.length; i++) {
         proxyService.availabelEndpoints[i] = tp[i].firstChild.textContent;
-        //(new XMLSerializer()).serializeToString(tp[i].childNodes[0]);
     }
     if (doingAdd) {
         addProxyServiceStep1();
@@ -459,13 +425,11 @@
 }
 
 function addProxyServiceStep1() {
-    //    proxyService.checkedTransports.length=0;
     storeData();
     var objDiv = document.getElementById("divAddProxyService");
     var inSequenceOption = "<option>Default Sequence</option>";
     var outSequenceOption = inSequenceOption;
     var endpointOption = "<option>Select an Endpoint</option>";
-
     var sequenceChecked = "checked='true'";
     var endpointChecked = "";
     var startOnLoadChecked = " checked='true'";
@@ -480,7 +444,6 @@
         endpointChecked = "checked='true'";
         sequenceChecked = "";
     }
-
     for (i = 0; i < proxyService.availabelSequences.length; i++) {
         var inSelected = "";
         var outSelected = "";
@@ -501,10 +464,10 @@
         endpointOption = endpointOption + "<option " + selected + ">" + proxyService.availabelEndpoints[i] + "</option>";
     }
     proxyService.target = proxyService.inSequence = proxyService.outSequence = proxyService.endpoint = "";
-    var strHTML =   "<div id='addProxyServiceStepOneHelpDiv' style='background-color:#99cccc;position:absolute;visibility:hidden;padding:5px;z-index:600;'></div>"+
+    var strHTML = "<div id='addProxyServiceStepOneHelpDiv' style='background-color:#99cccc;position:absolute;visibility:hidden;padding:5px;z-index:600;'></div>"+
                   "<h4><a href='#' onClick='javascript:showProxyServices(); return false;'>Proxy Services Management</a>" +
                   "</a>&nbsp;&gt;&nbsp;<font color='orange'>Add Proxy Service</font><img src='extensions/core/images/help.gif' alt=''  onmouseover='showHelp(event,"+'addProxyServiceStepOneHelpDiv'+","+'-10'+","+'10'+")' onmouseout='hideHelp(event,"+'addProxyServiceStepOneHelpDiv'+")' /></h4></br>"+
-                    "<fieldset style='border:none;'>" +
+                  "<fieldset style='border:none;'>" +
                   "<div id='formset'><form>" +
                   "<fieldset>" +
                   "<legend style='font-size: 12'>Add Proxy Service - Step 1 of 3" +
@@ -525,7 +488,6 @@
                   "</form>" +
                   "</div>" +
                   "</fieldset>";
-
     objDiv.innerHTML = strHTML;
     showOnlyOneMain(objDiv);
     showWSDLTypeChanges();
@@ -580,7 +542,6 @@
         transports = transports + "<label style='text-align: left; margin-left: 30px'><input type='checkbox' id='transport" + i + "' value='" + proxyService.availabelTransports[i] + "' " + checked + "/>" + proxyService.availabelTransports[i].toUpperCase() + "</label>";
     }
     proxyService.checkedTransports.length = 0;
-
     var availabelParams = "";
     if (proxyService.paramNames.length != 0) {
         availabelParams += "<table class='styled'><thead><tr><th>Parameter Name</th><th>Parameter Value</th></tr></thead>";
@@ -592,7 +553,6 @@
         availabelParams = "<label style='width: 500px; color: brown; text-align: left'><i>Currently there are no service level parameters present</i></label><br/>";
     }
     availabelParams += "<a href='#' onclick='javascript:showAddParameter();return false;'>Add new service parameter</a>";
-
     var strHTML = "<div id='addProxyServiceStepTwoHelpDiv' style='background-color:#99cccc;position:absolute;visibility:hidden;padding:5px;z-index:600;'></div>"+
                   "<h4><a href='#' onClick='javascript:showProxyServices(); return false;'>Proxy Services Management</a>" +
                   "</a>&nbsp;&gt;&nbsp;<font color='orange'>Add Proxy Service</font><img src='extensions/core/images/help.gif' alt=''  onmouseover='showHelp(event,"+'addProxyServiceStepTwoHelpDiv'+","+'-10'+","+'10'+")' onmouseout='hideHelp(event,"+'addProxyServiceStepTwoHelpDiv'+")' /></h4></br>"+
@@ -614,7 +574,6 @@
                   "</form>" +
                   "</div>" +
                   "</fieldset>";
-
     objDiv.innerHTML = strHTML;
     showOnlyOneMain(objDiv);
 }
@@ -671,8 +630,6 @@
         }
         availabelPolicies += "</table>";
     }
-    //        availabelPolicies += "<a href='#' onclick='javascript:showAddPolicy();return false;'>Add new service parameter</a>";
-
     var objDiv = document.getElementById("policiesDiv");
     var strHTML = availabelPolicies + "<div id='policyDiv'><label style='text-align: left'>Policy Type</label>" +
                   "<select id='policyType' style='width: 150px' onchange='javascript:showPolicyChanges();return false;'>" +

Modified: esb/java/trunk/modules/distribution/src/main/www/extensions/core/xslt/sequences.xsl
==============================================================================
--- esb/java/trunk/modules/distribution/src/main/www/extensions/core/xslt/sequences.xsl	(original)
+++ esb/java/trunk/modules/distribution/src/main/www/extensions/core/xslt/sequences.xsl	Tue Dec 12 23:57:01 2006
@@ -71,7 +71,8 @@
                             <td>
                                 <nobr>
                                     <a href="#" id="edit_link">
-                                        <xsl:attribute name="onClick">javascript:showSequenceEditor('<xsl:value-of select="name"/>'); return false;</xsl:attribute>
+                                        <!--<xsl:attribute name="onClick">javascript:showSequenceEditor('<xsl:value-of select="name"/>'); return false;</xsl:attribute>-->
+                                        <xsl:attribute name="onClick">javascript:viewsequence('<xsl:value-of select="name"/>'); return false;</xsl:attribute>
                                         <xsl:attribute name="title">Edit Sequence <xsl:value-of select="name"/> </xsl:attribute>
                                         <xsl:attribute name="alt">Edit Sequence<xsl:value-of select="name"/></xsl:attribute>
                                         &#160;&#160;&#160;&#160;

Added: esb/java/trunk/modules/distribution/src/main/www/extensions/core/xslt/view_log.xsl
==============================================================================
--- (empty file)
+++ esb/java/trunk/modules/distribution/src/main/www/extensions/core/xslt/view_log.xsl	Tue Dec 12 23:57:01 2006
@@ -0,0 +1,25 @@
+<!--
+  ~ 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:log" xmlns:syn="http://ws.apache.org/ns/synapse">
+        <h2 style="color: blue">Log Mediator</h2>
+        <p>This will be filled with the log mediator graphical view</p><br/>
+        <span>//todo: print the functionality as a phrase</span><br/><br/><br/>
+    </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file

Added: esb/java/trunk/modules/distribution/src/main/www/extensions/core/xslt/view_mediator.xsl
==============================================================================
--- (empty file)
+++ esb/java/trunk/modules/distribution/src/main/www/extensions/core/xslt/view_mediator.xsl	Tue Dec 12 23:57:01 2006
@@ -0,0 +1,164 @@
+<!--
+  ~ 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" xmlns:syn="http://ws.apache.org/ns/synapse">
+
+    <xsl:template match="syn:*">
+        <xsl:call-template name="element-header"/>
+        <div class="indent">
+			<div class="indent">
+				<xsl:call-template name="element-start"/>
+			</div>
+			<xsl:apply-templates/>
+			<div class="indent">
+				<xsl:call-template name="element-end"/>
+			</div>
+		</div>
+        <br/>
+    </xsl:template>
+
+    <xsl:template name="element-header">
+		<h2 style="color: blue">
+            <xsl:value-of select="concat(translate(substring(local-name(.),1,1),
+            'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ'),
+            substring(local-name(.),2,string-length(local-name(.))))"/>
+        <xsl:text> Mediator</xsl:text></h2>
+    </xsl:template>
+
+    <xsl:template name="element-start">
+		<xsl:param name="class" select="'markup-element'"/>
+		<span class="markup">&lt;</span>
+		<span class="{$class}">
+			<xsl:value-of select="name(.)"/>
+		</span>
+		<xsl:apply-templates select="@*"/>
+		<!--<xsl:call-template name="namespaces"/>-->
+		<span class="markup">
+			<xsl:if test="not(node())">
+				<xsl:text> /</xsl:text>
+			</xsl:if>
+			<xsl:text>&gt;</xsl:text>
+		</span>
+	</xsl:template>
+
+    <xsl:template name="element-end">
+		<xsl:param name="class" select="'markup-element'"/>
+		<xsl:if test="node()">
+			<span class="markup">
+				<xsl:text>&lt;/</xsl:text>
+			</span>
+			<span class="{$class}">
+				<xsl:value-of select="name(.)"/>
+			</span>
+			<span class="markup">
+				<xsl:text>&gt;</xsl:text>
+			</span>
+		</xsl:if>
+	</xsl:template>
+
+    <xsl:template name="namespaces">
+		<xsl:variable name="current" select="current()"/>
+
+        <!-- Unfortunately Mozilla doesn't support the namespace axis, need to check for that and simulate declarations -->
+		<xsl:choose>
+			<xsl:when test="$supports-namespace-axis">
+				<!--
+					When the namespace axis is present (e.g. Internet Explorer), we can simulate
+					the namespace declarations by comparing the namespaces in scope on this element
+					with those in scope on the parent element.  Any difference must have been the
+					result of a namespace declaration.  Note that this doesn't reflect the actual
+					source - it will strip out redundant namespace declarations. -->
+
+				<xsl:for-each select="namespace::*[. != 'http://www.w3.org/XML/1998/namespace']">
+					<xsl:if test="not($current/parent::*[namespace::*[. = current()]])">
+						<span class="markup-namespace">
+							<xsl:text> xmlns</xsl:text>
+							<xsl:if test="name() != ''">:</xsl:if>
+							<xsl:value-of select="name()"/>
+							<xsl:text>="</xsl:text>
+						</span>
+						<span class="markup-namespace-uri">
+							<xsl:value-of select="."/>
+						</span>
+						<span class="markup-namespace">
+							<xsl:text>"</xsl:text>
+						</span>
+					</xsl:if>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<!--
+					When the namespace axis isn't supported (e.g. Mozilla), we can simulate
+					appropriate declarations from namespace elements.
+					This currently doesn't check for namespaces on attributes.
+					In the general case we can't reliably detect the use of QNames in content, but
+					in the case of schema, we know which content could contain a QName and look
+					there too.  This mechanism is rather unpleasant though, since it records
+					namespaces where they are used rather than showing where they are declared
+					(on some parent element) in the source.  Yukk!  -->
+
+				<xsl:if test="namespace-uri(.) != namespace-uri(parent::*)">
+					<span class="markup-namespace">
+						<xsl:text> xmlns</xsl:text>
+						<xsl:if test="substring-before(name(),':') != ''">:</xsl:if>
+						<xsl:value-of select="substring-before(name(),':')"/>
+						<xsl:text>="</xsl:text>
+					</span>
+					<span class="markup-namespace-uri">
+						<xsl:value-of select="namespace-uri(.)"/>
+					</span>
+					<span class="markup-namespace">
+						<xsl:text>"</xsl:text>
+					</span>
+				</xsl:if>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+    <xsl:template name="attribute">
+		<xsl:param name="value-class" select="'markup-attribute-value'"/>
+		<xsl:param name="reference"/>
+		<xsl:param name="native-attribute" select="parent::syn:* and namespace-uri(.)=''"/>
+		<xsl:text> </xsl:text>
+		<span>
+			<xsl:choose>
+				<xsl:when test="$native-attribute"><xsl:attribute name="class">markup-attribute</xsl:attribute></xsl:when>
+				<xsl:otherwise><xsl:attribute name="class">markup-extension-attribute</xsl:attribute></xsl:otherwise>
+			</xsl:choose>
+			<xsl:value-of select="name(.)"/>
+		</span>
+		<span class="markup">
+			<xsl:text>="</xsl:text>
+		</span>
+		<span class="{$value-class}">
+			<xsl:choose>
+				<xsl:when test="$reference">
+					<a href="{$reference}">
+						<xsl:value-of select="."/>
+					</a>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:value-of select="."/>
+				</xsl:otherwise>
+			</xsl:choose>
+		</span>
+		<span class="markup">
+			<xsl:text>"</xsl:text>
+		</span>
+	</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file




More information about the Esb-java-dev mailing list