Author: keith
Date: Wed Jun  4 00:38:39 2008
New Revision: 17893
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=17893

Log:
Not showing the http transport when the server.xml states that http is not 
allowed


Modified:
   trunk/mashup/java/modules/www/mashup.jsp

Modified: trunk/mashup/java/modules/www/mashup.jsp
URL: 
http://wso2.org/svn/browse/wso2/trunk/mashup/java/modules/www/mashup.jsp?rev=17893&r1=17892&r2=17893&view=diff
==============================================================================
--- trunk/mashup/java/modules/www/mashup.jsp    (original)
+++ trunk/mashup/java/modules/www/mashup.jsp    Wed Jun  4 00:38:39 2008
@@ -15,6 +15,7 @@
 --%>
 <%@ page errorPage="error.jsp" %>
 <%@ page import="org.apache.axis2.description.TransportInDescription" %>
+<%@ page import="org.apache.axis2.util.JavaUtils" %>
 <%@ page import="org.wso2.mashup.MashupConstants" %>
 <%@ page import="org.wso2.mashup.utils.MashupUtils" %>
 <%@ page import="org.wso2.mashup.utils.QueryResults" %>
@@ -29,6 +30,7 @@
 <%@ page import="java.util.ResourceBundle" %>
 <%@ page import="org.wso2.wsas.ServerManager" %>
 <%@ page import="java.net.URL" %>
+<%@ page import="org.wso2.utils.ServerConfiguration" %>
 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
 
 <!--Required to keep a user logged in if 'Remember Me' option is selected-->
@@ -63,9 +65,7 @@
         response.sendRedirect("faulty_mashup.jsp?path=" + path);
     }
 
-    // Creating an HTTP version of the current URL to be used when required
-    String httpUrl =
-            new URL("http", request.getServerName(), 
ServerManager.getInstance().getHttpPort(), "").toString();
+    String httpUrl = MashupUtils.getServerURL(request.getServerName());
 
 
 %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
@@ -568,24 +568,30 @@
                 Iterator availableTransports = 
MashupUtils.getAvailableAxisTransports().values().iterator();
                 TransportInDescription currentTransport;
                 int transportCount = 0;
+                    ServerConfiguration serverConfig = 
ServerConfiguration.getInstance();
+                String allowHttpAccess = 
serverConfig.getFirstProperty("Management.AllowHTTPAccess");
+                     boolean allowHttp = 
JavaUtils.isFalseExplicitly(allowHttpAccess);
                 while(availableTransports.hasNext()){
                     currentTransport = 
(TransportInDescription)availableTransports.next();
-                    if(MashupUtils.isTransportExposed(mashupServiceName, 
currentTransport.getName())){
-                       %>
-                         <li>
-                           <div id="transport_<%=transportCount%>">
-                               <b><%=(currentTransport).getName()%></b> 
transport is <span class="transport-enabled">enabled</span> for this service. 
[<a href="#" onclick="disableTransport('<%=mashupServiceName%>', 
'<%=(currentTransport).getName()%>', 
'transport_<%=transportCount%>');">Disable</a>]
-                           </div>
-                         </li>
-                      <%
-                    }else{
-                        %>
-                         <li>
-                           <div  id="transport_<%=transportCount%>">
-                               <b><%=(currentTransport).getName()%></b> 
transport is <span class="transport-disabled">disabled</span> for this service. 
[<a href="#" onclick="enableTransport('<%=mashupServiceName%>', 
'<%=(currentTransport).getName()%>', 
'transport_<%=transportCount%>');">Enable</a>]
-                           </div>
-                         </li>
-                      <%
+                    String transportName = currentTransport.getName();
+                    if (!(allowHttp && "http".equals(transportName))) {
+                        if(MashupUtils.isTransportExposed(mashupServiceName, 
transportName)){
+                           %>
+                             <li>
+                               <div id="transport_<%=transportCount%>">
+                                   <b><%=transportName%></b> transport is 
<span class="transport-enabled">enabled</span> for this service. [<a href="#" 
onclick="disableTransport('<%=mashupServiceName%>', 
'<%=(currentTransport).getName()%>', 
'transport_<%=transportCount%>');">Disable</a>]
+                               </div>
+                             </li>
+                          <%
+                        }else{
+                            %>
+                             <li>
+                               <div  id="transport_<%=transportCount%>">
+                                   <b><%=transportName%></b> transport is 
<span class="transport-disabled">disabled</span> for this service. [<a href="#" 
onclick="enableTransport('<%=mashupServiceName%>', 
'<%=(currentTransport).getName()%>', 
'transport_<%=transportCount%>');">Enable</a>]
+                               </div>
+                             </li>
+                          <%
+                        }
                     }
                     transportCount++;
                 }

_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to