Author: rajika Date: Tue Mar 17 23:55:18 2009 New Revision: 32198 URL: http://wso2.org/svn/browse/wso2?view=rev&revision=32198
Log: Fixed stats problem Modified: branches/esb/java/2.0.1/carbon-components/endpoint/org.wso2.carbon.endpoint.ui/src/main/resources/web/endpoints/AddressEndpoint.jsp branches/esb/java/2.0.1/carbon-components/endpoint/org.wso2.carbon.endpoint.ui/src/main/resources/web/endpoints/failover.jsp branches/esb/java/2.0.1/carbon-components/endpoint/org.wso2.carbon.endpoint.ui/src/main/resources/web/endpoints/index.jsp Modified: branches/esb/java/2.0.1/carbon-components/endpoint/org.wso2.carbon.endpoint.ui/src/main/resources/web/endpoints/AddressEndpoint.jsp URL: http://wso2.org/svn/browse/wso2/branches/esb/java/2.0.1/carbon-components/endpoint/org.wso2.carbon.endpoint.ui/src/main/resources/web/endpoints/AddressEndpoint.jsp?rev=32198&r1=32197&r2=32198&view=diff ============================================================================== --- branches/esb/java/2.0.1/carbon-components/endpoint/org.wso2.carbon.endpoint.ui/src/main/resources/web/endpoints/AddressEndpoint.jsp (original) +++ branches/esb/java/2.0.1/carbon-components/endpoint/org.wso2.carbon.endpoint.ui/src/main/resources/web/endpoints/AddressEndpoint.jsp Tue Mar 17 23:55:18 2009 @@ -65,41 +65,7 @@ <script type="text/javascript"> - /* - var queryString = window.top.location.search.substring(1); - function getParameter () { - // Add "=" to the parameter name (i.e. parameterName=value) - var parameterName = "endpointName"; - parameterName = parameterName + "="; - if ( queryString.length > 0 ) { - // Find the beginning of the string - begin = queryString.indexOf ( parameterName ); - // If the parameter name is not found, skip it, otherwise return the value - if ( begin != -1 ) { - // Add the length (integer) to the beginning - begin += parameterName.length; - // Multiple parameters are separated by the "&" sign - end = queryString.indexOf ( "&" , begin ); - if ( end == -1 ) { - end = queryString.length; - } - // Return the string - return unescape ( queryString.substring ( begin, end ) ); - } - // Return "null" if no parameter has been found - return "null"; - } - return "null"; - } - - - function endPointName(){ - - - return document.getElementById('addname').value; - - } - */ + function ValidateForm(form) { <% String epMode = (String)session.getAttribute("epMode"); Modified: branches/esb/java/2.0.1/carbon-components/endpoint/org.wso2.carbon.endpoint.ui/src/main/resources/web/endpoints/failover.jsp URL: http://wso2.org/svn/browse/wso2/branches/esb/java/2.0.1/carbon-components/endpoint/org.wso2.carbon.endpoint.ui/src/main/resources/web/endpoints/failover.jsp?rev=32198&r1=32197&r2=32198&view=diff ============================================================================== --- branches/esb/java/2.0.1/carbon-components/endpoint/org.wso2.carbon.endpoint.ui/src/main/resources/web/endpoints/failover.jsp (original) +++ branches/esb/java/2.0.1/carbon-components/endpoint/org.wso2.carbon.endpoint.ui/src/main/resources/web/endpoints/failover.jsp Tue Mar 17 23:55:18 2009 @@ -25,70 +25,73 @@ <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar" prefix="carbon" %> <fmt:bundle basename="org.wso2.carbon.endpoints.ui.i18n.Resources"> - <carbon:breadcrumb - label="failover.endpoint" - resourceBundle="org.wso2.carbon.endpoints.ui.i18n.Resources" - topPage="false" - request="<%=request%>" /> +<carbon:breadcrumb + label="failover.endpoint" + resourceBundle="org.wso2.carbon.endpoints.ui.i18n.Resources" + topPage="false" + request="<%=request%>"/> <div> - <link type="text/css" rel="stylesheet" href="css/menu.css"/> - <link type="text/css" rel="stylesheet" href="css/style.css"/> +<link type="text/css" rel="stylesheet" href="css/menu.css"/> +<link type="text/css" rel="stylesheet" href="css/style.css"/> - <!-- Dependencies --> - <script type="text/javascript" src="yui/build/yahoo-dom-event/yahoo-dom-event.js"></script> - <script type="text/javascript" src="yui/build/container/container_core-min.js"></script> - - - <!-- Connection handling lib --> - <script type="text/javascript" src="yui/build/yahoo/yahoo-min.js"></script> - <script type="text/javascript" src="yui/build/event/event-min.js"></script> - <script type="text/javascript" src="yui/build/connection/connection-min.js"></script> - <script type="text/javascript" src="../resources/js/resource_util.js"></script> - <!-- Source File --> +<!-- Dependencies --> +<script type="text/javascript" src="yui/build/yahoo-dom-event/yahoo-dom-event.js"></script> +<script type="text/javascript" src="yui/build/container/container_core-min.js"></script> + + +<!-- Connection handling lib --> +<script type="text/javascript" src="yui/build/yahoo/yahoo-min.js"></script> +<script type="text/javascript" src="yui/build/event/event-min.js"></script> +<script type="text/javascript" src="yui/build/connection/connection-min.js"></script> +<script type="text/javascript" src="../resources/js/resource_util.js"></script> +<!-- Source File --> - <script type="text/javascript" src="yui/build/menu/menu-min.js"></script> +<script type="text/javascript" src="yui/build/menu/menu-min.js"></script> + <% + +String payload = "null"; +String epname = null; +String payloadFromSrc = null; +String epMode = null; +OMElement ele = null; +epname = request.getParameter("epName"); +if((payload = request.getParameter("xmlpayload"))!=null){ + if ((epMode = (String) session.getAttribute("epMode")) != null && "anon".equals(epMode)) { + // came to this page from source view so we have the xmlpayload, but still we are in anon mode + // adds the dummy name, i.e. anonymous + try { + payload = EndpointAdminClient.getAnonEpXMLwithName(payload); + } catch (XMLStreamException e) { + // todo - handle error + } + } + payloadFromSrc = formatXML(payload); + try{ + ele = AXIOMUtil.stringToOM(payloadFromSrc); + } + catch(XMLStreamException e){ + + } + try{ + FailoverEndpoint ep = (FailoverEndpoint) EndpointFactory.getEndpointFromElement(ele,false); + epname = ep.getName(); + OMElement eleFromEp = EndpointSerializer.getElementFromEndpoint(ep); + + payload = formatXML(eleFromEp.toString()); + } + catch(Exception e){ + String errMsg = e.getMessage(); + String dspMsg = errMsg.replaceAll("\\'",""); + + %> +<script type="text/javascript"> + jQuery(document).ready(function() { + CARBON.showErrorDialog('<%=dspMsg%>'); + }); +</script> <% - String payload = "null"; - String epname = null; - String payloadFromSrc = null; - String epMode = null; - OMElement ele = null; - epname = request.getParameter("epName"); - if((payload = request.getParameter("xmlpayload"))!=null){ - if ((epMode = (String) session.getAttribute("epMode")) != null && "anon".equals(epMode)) { - // came to this page from source view so we have the xmlpayload, but still we are in anon mode - // adds the dummy name, i.e. anonymous - try { - payload = EndpointAdminClient.getAnonEpXMLwithName(payload); - } catch (XMLStreamException e) { - // todo - handle error - } - } - payloadFromSrc = formatXML(payload); - try{ - ele = AXIOMUtil.stringToOM(payloadFromSrc); - } - catch(XMLStreamException e){ - } - try{ - FailoverEndpoint ep = (FailoverEndpoint) EndpointFactory.getEndpointFromElement(ele,false); - epname = ep.getName(); - OMElement eleFromEp = EndpointSerializer.getElementFromEndpoint(ep); - - payload = formatXML(eleFromEp.toString()); - } - catch(Exception e){ - String errMsg = e.getMessage(); - String dspMsg = errMsg.replaceAll("\\'",""); - %> - <script type="text/javascript"> - jQuery(document).ready(function(){ - CARBON.showErrorDialog('<%=dspMsg%>'); - }); - </script> - <% payload="null"; } } else if ((epMode = (String) session.getAttribute("epMode")) != null && "anon".equals(epMode)) { @@ -109,8 +112,10 @@ // out.println(payload); } } + %> <%! + String formatXML(String xml) { String afterReplace = ""; Pattern p; @@ -121,171 +126,196 @@ return afterReplace.trim(); } + %> - <script type="text/javascript"> +<script type="text/javascript"> - var payload = '<%=payload%>'; - function cancelData() { - <% - String anonEpOriginator; - if ((anonEpOriginator = (String)session.getAttribute("anonOriginator")) != null - && !"".equals(anonEpOriginator)) {%> - window.location.href = '<%=anonEpOriginator%>?cancelled=true'; - <%} else {%> - window.location.href = 'index.jsp'; - <%}%> - } - - </script> - <!-- Local files --> - <script type="text/javascript" src="js/forms.js"></script> - <script type="text/javascript" src="js/ep_common.js"></script> - <script type="text/javascript" src="js/endpoint.js"></script> - <script type="text/javascript" src="js/validation.js"></script> - <script type="text/javascript" src="js/tabs.js"></script> - - <script type="text/javascript"> - - YAHOO.util.Event.onDOMReady(init); - function init() { - initEndpoints(); - if ('<%=epMode%>' != null && '<%=epMode%>' == 'anon') { - // we are in anon mode - document.getElementById('epNameLabel').style.display='none'; - document.getElementById('mainName').style.display='none'; - // sets the dummy name, i.e. anonymous - document.getElementById('mainName').value='anonymous'; - } else { - // we are in normal mode - showHideTreeBasedOnName(); - if (document.getElementById('mainName').value == "") { - document.getElementById('treePane').style.display = "none"; - } + var payload = '<%=payload%>'; + function cancelData() { + <% +String anonEpOriginator; +if ((anonEpOriginator = (String)session.getAttribute("anonOriginator")) != null + && !"".equals(anonEpOriginator)) {%> + window.location.href = '<%=anonEpOriginator%>?cancelled=true'; + <%} else {%> + window.location.href = 'index.jsp'; + <%}%> + } + +</script> +<!-- Local files --> +<script type="text/javascript" src="js/forms.js"></script> +<script type="text/javascript" src="js/ep_common.js"></script> +<script type="text/javascript" src="js/endpoint.js"></script> +<script type="text/javascript" src="js/validation.js"></script> +<script type="text/javascript" src="js/tabs.js"></script> + +<script type="text/javascript"> + + YAHOO.util.Event.onDOMReady(init); + function init() { + initEndpoints(); + if ('<%=epMode%>' != null && '<%=epMode%>' == 'anon') { + // we are in anon mode + document.getElementById('epNameLabel').style.display = 'none'; + document.getElementById('mainName').style.display = 'none'; + // sets the dummy name, i.e. anonymous + document.getElementById('mainName').value = 'anonymous'; + } else { + // we are in normal mode + showHideTreeBasedOnName(); + if (document.getElementById('mainName').value == "") { + document.getElementById('treePane').style.display = "none"; } } + } - function saveData() { - if ('<%=epMode%>' != null && '<%=epMode%>' == 'anon') { - // anon mode saving - if (!doValidation()) { - window.location = "#"; - return; - } - var newDoc = cleanIds(); - document.failoverAnonHandlerForm.anonEpXML.value = xmlToString(newDoc); - document.failoverAnonHandlerForm.action = "anonEpHandler.jsp"; - document.failoverAnonHandlerForm.submit(); - } else { - trigerSave('failoverEndpointCaller-ajaxprocessor.jsp'); + function saveData() { + if ('<%=epMode%>' != null && '<%=epMode%>' == 'anon') { + // anon mode saving + if (!doValidation()) { + window.location = "#"; + return; } + var newDoc = cleanIds(); + document.failoverAnonHandlerForm.anonEpXML.value = xmlToString(newDoc); + document.failoverAnonHandlerForm.action = "anonEpHandler.jsp"; + document.failoverAnonHandlerForm.submit(); + } else { + trigerSave('failoverEndpointCaller-ajaxprocessor.jsp'); } + } - function srcView(){ - document.failoverForm.payload.value= checkDesign(); - document.failoverForm.action='failoverSourceView.jsp'; - document.failoverForm.submit(); + function srcView() { + document.failoverForm.payload.value = checkDesign(); + document.failoverForm.action = 'failoverSourceView.jsp'; + document.failoverForm.submit(); + } + + function showHideTreeBasedOnName() { + var name = document.getElementById('mainName').value; + if (name != "") { + document.getElementById('treePane').style.display = ""; + if (doValidation('true'))selectNode("failover.0"); + } else { + document.getElementById('treePane').style.display = "none"; + document.getElementById('endpointDesign').style.display = "none"; } + } +</script> - function showHideTreeBasedOnName() { - var name = document.getElementById('mainName').value; - if (name != "") { - document.getElementById('treePane').style.display = ""; - if (doValidation('true'))selectNode("failover.0"); - } else { - document.getElementById('treePane').style.display = "none"; - document.getElementById('endpointDesign').style.display = "none"; - } - } - </script> +<div id="middle"> - <div id="middle"> + <h2><fmt:message key="failover.endpoint"/></h2> - <h2><fmt:message key="failover.endpoint"/></h2> -<div id="workArea"> - <table class="styledLeft"> -<thead> - <tr> - <th> - <span style="float: left; position: relative; margin-top: 2px;"><fmt:message key="design.view.of.the.failover.group"/></span> - <a href="#" onclick="srcView();" class="icon-link" style="background-image: url(images/source-view.gif);" ><fmt:message key="switch.to.source.view"/></a> -</th> - </tr> -</thead> -<tr><td> - - <form action="" name="failoverAnonHandlerForm" method="POST"> - <input type="hidden" name="anonEpXML"/> - </form> - <form action="" method="POST" name="failoverForm"> - <input type="hidden" name="payload"/> - </form> -<table class="normal" cellspacing="0" width="100%" style="margin-top:5px"><tr><td> - <div class="error-message" id="errorDiv" style="display:none;"></div> - <div class="input-area"> - <label id="epNameLabel"><fmt:message key="endpoint.name"/> <span class="required">*</span></label> - <%if (epname != null && (!(epname.equalsIgnoreCase(""))) && (request.getParameter("xmlpayload")==null)) {%> - <input type="text" class="textbox" id="mainName" value="<%=epname%>" readonly="readonly" style="background-color:lightgray;"/> - <%}else if(epname!=null && (request.getParameter("xmlpayload")!=null)){%> - <input type="text" class="textbox" id="mainName" value="<%=epname%>" onkeypress="return validateText(event);" onkeyup="showHideTreeBasedOnName();"/> - <%} else {%> - <input type="text" class="textbox" id="mainName" onkeypress="return validateText(event);" onkeyup="showHideTreeBasedOnName();"/> - <%}%> - </div> -</td> -</tr> -<tr> -<td> - <div class="treePane" id="treePane" style="height: 300px; overflow: auto; width: auto; border: 1px solid rgb(204, 204, 204);position:relative;"> - <ul class="root-list" id="failoverTree"> - <li> - <div class="endpoints" id="failover.0"> - <a class="root-endpoint">root</a> - <div class="sequenceToolbar" style="width: 100px;"> - <div> - <a class="addChildStyle">Add Endpoint</a> - </div> - </div> - </div> - </li> - </ul> - </div> -</td> -</tr> -</table> - <%-- - <ul class="tabPane"> - <li class="selected" onclick="checkSource();makeSelected(this,'endpoint')">Design</li> - <li onclick="checkDesign();makeSelected(this,'endpoint')">Source</li> - </ul>--%> - <div id="endpointDesign"> - <table class="normal" width="100%"> - <tr> - <td> - <table class="styledLeft" cellspacing="0" style="margin-left: 0px;"> - <tr> - <td class="middle-header" > - <span style="float:left; position:relative; margin-top:2px;"><fmt:message key="design.view.of.the.endpoint"/></span></a> - </td> - </tr> - <tr> - <td style="padding: 0px !important;"> - <div id="info" class="tabPaneContentMain"></div> - </td> - </tr> - </table> - </td> - </tr> - </table> - </div> - - <div id="registryBrowser" style="display:none;"></div> -</td></tr> -<tr><td class="buttonRow"> - <input type="button" onclick="saveData();" id="saveButton" value="<fmt:message key="save"/>" class="button"/> -  <input type="button" onclick="cancelData();" value="<fmt:message key="cancel"/>" class="button"/> -</td> -</tr> -</table> + <div id="workArea"> + <table class="styledLeft"> + <thead> + <tr> + <th> + <span style="float: left; position: relative; margin-top: 2px;"><fmt:message + key="design.view.of.the.failover.group"/></span> + <a href="#" onclick="srcView();" class="icon-link" + style="background-image: url(images/source-view.gif);"><fmt:message + key="switch.to.source.view"/></a> + </th> + </tr> + </thead> + <tr> + <td> + + <form action="" name="failoverAnonHandlerForm" method="POST"> + <input type="hidden" name="anonEpXML"/> + </form> + <form action="" method="POST" name="failoverForm"> + <input type="hidden" name="payload"/> + </form> + <table class="normal" cellspacing="0" width="100%" style="margin-top:5px"> + <tr> + <td> + <div class="error-message" id="errorDiv" + style="display:none;"></div> + <div class="input-area"> + <label id="epNameLabel"><fmt:message key="endpoint.name"/> <span + class="required">*</span></label> + <%if (epname != null && (!(epname.equalsIgnoreCase(""))) && (request.getParameter("xmlpayload") == null)) {%> + <input type="text" class="textbox" id="mainName" + value="<%=epname%>" readonly="readonly" + style="background-color:lightgray;"/> + <%} else if (epname != null && (request.getParameter("xmlpayload") != null)) {%> + <input type="text" class="textbox" id="mainName" + value="<%=epname%>" + onkeypress="return validateText(event);" + onkeyup="showHideTreeBasedOnName();"/> + <%} else {%> + <input type="text" class="textbox" id="mainName" + onkeypress="return validateText(event);" + onkeyup="showHideTreeBasedOnName();"/> + <%}%> + </div> + </td> + </tr> + <tr> + <td> + <div class="treePane" id="treePane" + style="height: 300px; overflow: auto; width: auto; border: 1px solid rgb(204, 204, 204);position:relative;"> + <ul class="root-list" id="failoverTree"> + <li> + <div class="endpoints" id="failover.0"> + <a class="root-endpoint">root</a> + + <div class="sequenceToolbar" style="width: 100px;"> + <div> + <a class="addChildStyle">Add Endpoint</a> + </div> + </div> + </div> + </li> + </ul> + </div> + </td> + </tr> + </table> + <%-- + <ul class="tabPane"> + <li class="selected" onclick="checkSource();makeSelected(this,'endpoint')">Design</li> + <li onclick="checkDesign();makeSelected(this,'endpoint')">Source</li> + </ul>--%> + <div id="endpointDesign"> + <table class="normal" width="100%"> + <tr> + <td> + <table class="styledLeft" cellspacing="0" + style="margin-left: 0px;"> + <tr> + <td class="middle-header"> + <span style="float:left; position:relative; margin-top:2px;"><fmt:message + key="design.view.of.the.endpoint"/></span></a> + </td> + </tr> + <tr> + <td style="padding: 0px !important;"> + <div id="info" class="tabPaneContentMain"></div> + </td> + </tr> + </table> + </td> + </tr> + </table> + </div> + + <div id="registryBrowser" style="display:none;"></div> + </td> + </tr> + <tr> + <td class="buttonRow"> + <input type="button" onclick="saveData();" id="saveButton" + value="<fmt:message key="save"/>" class="button"/> +  <input type="button" onclick="cancelData();" + value="<fmt:message key="cancel"/>" class="button"/> + </td> + </tr> + </table> </div> </div> </fmt:bundle> \ No newline at end of file Modified: branches/esb/java/2.0.1/carbon-components/endpoint/org.wso2.carbon.endpoint.ui/src/main/resources/web/endpoints/index.jsp URL: http://wso2.org/svn/browse/wso2/branches/esb/java/2.0.1/carbon-components/endpoint/org.wso2.carbon.endpoint.ui/src/main/resources/web/endpoints/index.jsp?rev=32198&r1=32197&r2=32198&view=diff ============================================================================== --- branches/esb/java/2.0.1/carbon-components/endpoint/org.wso2.carbon.endpoint.ui/src/main/resources/web/endpoints/index.jsp (original) +++ branches/esb/java/2.0.1/carbon-components/endpoint/org.wso2.carbon.endpoint.ui/src/main/resources/web/endpoints/index.jsp Tue Mar 17 23:55:18 2009 @@ -272,10 +272,14 @@ <td><%=endpointNames[end.getType()]%> </td> <% - // try reading from the session, if fails try from the back end service - if ((session.getAttribute(end.getName() + endpointNames[end.getType()]) != null && - (((String) session.getAttribute(end.getName() + endpointNames[end.getType()])).equalsIgnoreCase("enabled"))) - || end.getEnableStatistics()) { + // display stats only for Address Endpoints and WSDL endpoints + if (endpointNames[end.getType()].equals("Address Endpoint") || + endpointNames[end.getType()].equals("WSDL Endpoint")) { + // try reading from the session, if fails try from the back end service + if ((session.getAttribute(end.getName() + endpointNames[end.getType()]) != null && + (((String) session.getAttribute(end.getName() + endpointNames[end.getType()])).equalsIgnoreCase("enabled"))) + || end.getEnableStatistics()) { + %> <td style="border-right:none;border-left:none;width:200px"> <div class="inlineDiv"> @@ -318,7 +322,14 @@ </div> </td> - <%} %> + <% + } + } else { %> + <td style="border-right:none;border-left:none;width:200px"> + <div class="inlineDiv"><div></div></div> + </td> + <%} + %> <td style="border-left:none;border-right:none;width:100px"> <div class="inlineDiv"> <a onclick="editRow(this.parentNode.parentNode.parentNode.rowIndex)" href="#" _______________________________________________ Esb-java-dev mailing list [email protected] https://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev
