juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexo...@apache.org
Subject svn commit: r1481327 - in /juddi/trunk/juddiv3-war/src/main/webapp: happy.jsp index.jsp
Date Sat, 11 May 2013 13:46:12 GMT
Author: alexoree
Date: Sat May 11 13:46:12 2013
New Revision: 1481327

URL: http://svn.apache.org/r1481327
Log:
Updating WAR index page to fix a number of broken links, add some new ones and to bring back
the happy juddi page

Added:
    juddi/trunk/juddiv3-war/src/main/webapp/happy.jsp
Modified:
    juddi/trunk/juddiv3-war/src/main/webapp/index.jsp

Added: juddi/trunk/juddiv3-war/src/main/webapp/happy.jsp
URL: http://svn.apache.org/viewvc/juddi/trunk/juddiv3-war/src/main/webapp/happy.jsp?rev=1481327&view=auto
==============================================================================
--- juddi/trunk/juddiv3-war/src/main/webapp/happy.jsp (added)
+++ juddi/trunk/juddiv3-war/src/main/webapp/happy.jsp Sat May 11 13:46:12 2013
@@ -0,0 +1,379 @@
+<%-- 
+    Document   : happy
+    Created on : May 4, 2013, 9:05:05 AM
+    Author     : Alex O'Ree
+--%>
+
+<%@page import="org.apache.commons.lang.StringEscapeUtils"%>
+<%@page import="org.apache.juddi.servlets.RegistryServlet"%>
+<%@page import="java.util.SortedSet"%>
+<%@page import="java.util.Properties"%>
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<!DOCTYPE html>
+<%@ page session="false"
+         import="java.io.File,
+                 java.io.IOException,
+                 java.net.URL,
+                 java.net.JarURLConnection,
+                 java.sql.Connection,
+                 java.sql.ResultSet,
+                 java.sql.Statement,
+                 java.util.Properties,
+                 java.util.Iterator,
+                 java.util.SortedSet,
+                 java.util.TreeSet,
+                 javax.naming.Context,
+                 javax.naming.InitialContext,
+                 javax.sql.DataSource"
+		 
+                 
+%>
+<%
+/*
+ * Copyright 2002,2004 The Apache Software Foundation.
+ * 
+ * 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.
+ */
+%>
+<%!
+
+    /**
+     * Look for the named class in the classpath
+     *
+     * @param name of the class to lookup
+     * @return the location of the named class
+     * @throws IOException
+     */
+    String lookupClass(String className) 
+      throws IOException 
+    {
+      // load the class (if it exists)
+      Class clazz = null;      
+      try {
+        clazz = Class.forName(className);
+        if (clazz == null)
+          return null;
+      }
+      catch (ClassNotFoundException e) {
+        return null;
+      }
+
+      // class was found, now get it's URL
+      URL url = null;
+      try {
+        url = clazz.getProtectionDomain().getCodeSource().getLocation();
+        if (url == null)
+          return "";
+      }
+      catch(Throwable t) {
+        return "";
+      }
+      
+      // got the classes URL, now determine it's location
+      String location = getLocation(url);
+      if (location == null) 
+        return "";
+      else
+        return location;   
+    }
+
+    /**
+     * Look for the named resource or properties file.
+     *
+     * @param resourceName
+     * @return true if the file was found
+     */
+    String lookupResource(String resourceName) 
+    {
+      URL url = null;
+      ClassLoader classLoader = null;
+
+      classLoader = this.getClass().getClassLoader();
+      if (classLoader != null) 
+      {
+        url = classLoader.getResource(resourceName);
+        if (url != null) {
+          return getLocation(url);
+        }
+      }
+      else      
+      {
+        classLoader = System.class.getClassLoader(); 
+        if (classLoader != null) 
+        {
+          url = classLoader.getResource(resourceName);
+          if (url != null) {
+            return getLocation(url);
+          }
+        }
+        else
+                       {
+            //try to the thread context loader
+        }
+      }
+
+      return null;
+    }
+
+    /**
+     * Determine the location of the Java class.
+     *
+     * @param clazz
+     * @return the file path to the jar file or class 
+     *  file where the class was located.
+     */
+    String getLocation(URL url)
+    {
+      try
+      {
+        String location = url.toString();
+        if (location.startsWith("jar:file:/"))
+        {
+          File file = new File(url.getFile());
+          return file.getPath().substring(6);
+        }
+        else if (location.startsWith("jar")) 
+        {
+          url = ((JarURLConnection)url.openConnection()).getJarFileURL();
+          return url.toString();
+        }
+        else if (location.startsWith("file")) 
+        {
+          File file = new File(url.getFile());
+          return file.getAbsolutePath();
+        }
+        else
+        {
+          return url.toString();
+        }
+      } 
+      catch (Throwable t) { 
+        return null;
+      }
+    }
+%>
+<html>
+<head>
+<title>jUDDI Happiness Page</title>
+<link rel="stylesheet" href="juddi.css">
+</head>
+<body>
+
+<div class="nav" align="right"><font size="-2"><a href="http://juddi.apache.org/">jUDDI@Apache</a></font></div>
+<h1>jUDDI</h1>
+
+<div class="announcement">
+<p>
+<h3>Happy jUDDI!</h3>
+
+<h4>jUDDI Version Information</h4>
+<pre>
+<b>jUDDI Version:</b> <%= org.apache.juddi.config.Release.getRegistryVersion()
%>
+<b>UDDI Version:</b>  <%= org.apache.juddi.config.Release.getUDDIVersion()
%>
+</pre>
+        
+<h4>jUDDI Dependencies: Class Files &amp; Libraries</h4>
+<pre>
+<%
+    //creates the schema if not there
+ //  RegistryEngine registry = RegistryServlet.getRegistry();
+  //  registry.init();
+    
+    String[] classArray = {
+      "org.apache.juddi.servlets.RegistryServlet",
+      "org.apache.juddi.servlets.NotifyServlet",
+      "org.apache.axis.transport.http.AxisServlet",
+      "org.springframework.web.context.ContextLoaderListener",
+      "org.apache.cxf.transport.servlet.CXFServlet",
+      "org.apache.commons.discovery.Resource",
+      "org.apache.commons.logging.Log",
+      "org.apache.log4j.Layout",
+      "javax.xml.soap.SOAPMessage",
+    //not used anymore  "javax.xml.rpc.Service",
+      "com.ibm.wsdl.factory.WSDLFactoryImpl",
+      "javax.xml.parsers.SAXParserFactory"
+    };
+    
+    for (int i=0; i<classArray.length; i++)
+    {
+      out.write("<b>Looking for</b>: "+classArray[i]+"<br>");
+      
+      String result = lookupClass(classArray[i]);
+      if (result == null)
+      {
+        out.write("<font color=\"red\">-Not Found</font><br>");
+      }
+      else if (result.length() == 0)
+      {        
+        out.write("<font color=\"blue\">+Found in an unknown location</font><br>");
+      }
+      else
+      {        
+        out.write("<font color=\"green\">+Found in: "+ result +"</font><br>");
+      }
+    }   
+%>
+</pre>
+        
+<h4>jUDDI Dependencies: Resource &amp; Properties Files</h4>
+<pre>
+<%
+    String[] resourceArray = {
+      "log4j.xml",
+      "juddiv3.properties",
+      "context.xml",
+      "beans.xml",
+      "persistence.xml"
+    };
+    
+    for (int i=0; i<resourceArray.length; i++)
+    {
+      out.write("<b>Looking for</b>: "+resourceArray[i]+"<br>");
+      
+      String result = lookupResource(resourceArray[i]);
+      if (result == null)
+      {
+        out.write("<font color=\"red\">-Not Found</font><br>");
+      }
+      else if (result.length() == 0)
+      {        
+        out.write("<font color=\"blue\">+Found in an unknown location</font><br>");
+      }
+      else
+      {        
+        out.write("<font color=\"green\">+Found in: "+ result +"</font><br>");
+      }
+    }   
+%>
+</pre>
+
+<h4>jUDDI DataSource Validation</h4>
+<pre>
+<%
+  String dsname = null;
+  Context ctx = null;
+  DataSource ds = null;
+  Connection conn = null;
+  String sql = "SELECT COUNT(*) FROM PUBLISHER";
+  
+  try
+  {
+    dsname = request.getParameter("dsname");
+    if ((dsname == null) || (dsname.trim().length() == 0)) {
+      dsname = "java:comp/env/jdbc/juddiDB";
+    } else {
+      dsname = StringEscapeUtils.escapeXml(dsname); 
+    }
+    
+    ctx = new InitialContext();
+    if (ctx == null )
+      throw new Exception("No Context");
+  
+    out.print("<font color=\"green\">");
+    out.print("+ Got a JNDI Context!");
+    out.println("</font>");
+  }
+  catch(Exception ex)
+  {
+    out.print("<font color=\"red\">");
+    out.print("- No JNDI Context ("+ex.getMessage()+")");
+    out.println("</font>");
+  }
+
+  try
+  {
+    ds = (DataSource)ctx.lookup(dsname);
+    if (ds == null)
+      throw new Exception("No Context");
+
+    out.print("<font color=\"green\">");
+    out.print("+ Got a JDBC DataSource (dsname="+dsname+")");
+    out.println("</font>");
+  }
+  catch(Exception ex)
+  {
+    out.print("<font color=\"red\">");
+    out.print("- No '"+dsname+"' DataSource Located("+ex.getMessage()+")");
+    out.println("</font>");
+  }
+  
+  try
+  {
+    conn = ds.getConnection();
+    if (conn == null)
+    throw new Exception("No Connection (conn=null)");  
+
+    out.print("<font color=\"green\">");
+    out.print("+ Got a JDBC Connection!");
+    out.println("</font>");
+  }
+  catch(Exception ex)
+  {
+    out.print("<font color=\"red\">");
+    out.print("- DB connection was not acquired. ("+ex.getMessage()+")");
+    out.println("</font>");
+  }
+  
+  try
+  {
+    Statement stmt = conn.createStatement();
+    ResultSet rs = stmt.executeQuery(sql);
+
+    out.print("<font color=\"green\">");
+    out.print("+ "+sql+" = ");
+    if (rs.next())
+      out.print(rs.getString(1));
+    out.println("</font>");
+
+    conn.close();
+  }
+  catch (Exception ex)
+  {
+    out.print("<font color=\"red\">");
+    out.print("- "+sql+" failed ("+ex.getMessage()+")");
+    out.println("</font>");
+  }
+%>
+</pre>
+
+
+<h4>System Properties</h4>
+<pre>
+<%
+  try
+  {
+    Properties sysProps = System.getProperties();
+    SortedSet sortedProperties = new TreeSet(sysProps.keySet()); 
+    for (Iterator keys = sortedProperties.iterator(); keys.hasNext();)
+    {
+      String key = (String)keys.next();
+      out.println("<b>"+key + "</b>: " + sysProps.getProperty(key));
+    }
+  }
+  catch(Exception e)
+  {
+    e.printStackTrace();
+  }
+%>
+</pre>
+
+<hr>
+Platform: <%= getServletConfig().getServletContext().getServerInfo() %>
+
+<table width="100%" border="0">
+<tr><td height="50" align="center" valign="bottom" nowrap><div class="footer">&nbsp;</div></td></tr>
+</table>
+
+</div>
+</body>
+</html>
\ No newline at end of file

Modified: juddi/trunk/juddiv3-war/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/juddi/trunk/juddiv3-war/src/main/webapp/index.jsp?rev=1481327&r1=1481326&r2=1481327&view=diff
==============================================================================
--- juddi/trunk/juddiv3-war/src/main/webapp/index.jsp (original)
+++ juddi/trunk/juddiv3-war/src/main/webapp/index.jsp Sat May 11 13:46:12 2013
@@ -1,92 +1,103 @@
 <%@ page session="false" %>
 <%@ page import="java.util.List,
-                 org.apache.juddi.config.Install,
-                 javax.xml.bind.JAXBException,
-                 org.uddi.v3_service.DispositionReportFaultMessage,
-                 org.apache.juddi.config.AppConfig,
-                 org.apache.juddi.config.Property,
-                 org.uddi.api_v3.BusinessEntity,
-                 org.uddi.api_v3.Name,
-                 org.uddi.api_v3.Description,
-                 java.io.IOException,
-                 org.apache.juddi.config.Release"
-%>
+         org.apache.juddi.config.Install,
+         javax.xml.bind.JAXBException,
+         org.uddi.v3_service.DispositionReportFaultMessage,
+         org.apache.juddi.config.AppConfig,
+         org.apache.juddi.config.Property,
+         org.uddi.api_v3.BusinessEntity,
+         org.uddi.api_v3.Name,
+         org.uddi.api_v3.Description,
+         java.io.IOException,
+         org.apache.juddi.config.Release"
+         %>
 
 <!-- index.jsp -->
 <html>
-<head>
-<title>Apache jUDDI Registry</title>
-<link rel="stylesheet" href="juddi.css" />
-</head>
-<body>
-<div class="header" align="right"><a href="http://ws.apache.org/juddi/" target="_top">jUDDI@Apache</a></div>
-<h1>Apache jUDDI version <%= Release.getRegistryVersion() %></h1>
-
-
-<h3><em>Welcome</em> to Apache jUDDI!</h3>
-<ul>
-    <li><a href="/pluto/portal/jUDDI">jUDDI Portal</a></li>
-    <li><a href="services">View</a> service listing</li>
-    <li><a href="http://ws.apache.org/juddi/">Visit</a> the Apache-jUDDI
Home Page</li>
-</ul>
-
-<div class="install">
-  <h4>jUDDI Installation</h4>
-    <div class="content">
-<%
-    // This will tirgger the install process...
-    String rootPartition = AppConfig.getConfiguration().getString(Property.JUDDI_ROOT_PARTITION);
-	String nodeId = AppConfig.getConfiguration().getString(Property.JUDDI_NODE_ID);
-    String nodeName = "";
-    String nodeDescription = "";
-    
-    BusinessEntity be = Install.getNodeBusinessEntity(nodeId);
-    
-    if (be != null) {
-        Name n = (Name) be.getName().get(0);
-        if (n != null)
-            nodeName = n.getValue();
-
-        List descList = be.getDescription();
-        if (descList != null && descList.size() > 0) {
-            Description d = (Description) descList.get(0);
-            if (d != null)
-                nodeDescription = d.getValue();
-        }
-    }
-%>
-    <div>jUDDI has been successfully installed!</div>
-    <p />
-    <h3>Node Information</h3>
-    <table>
-        <tr>
-            <td><b>Root Partition:</b></td>
-            <td><%= rootPartition %></td>
-        </tr>
-        <tr>
-            <td><b>Node Id:</b></td>
-            <td><%= nodeId %></td>
-        </tr>
-        <tr>
-            <td><b>Name:</b></td>
-            <td><%= nodeName %></td>
-        </tr>
-        <tr>
-            <td><b>Description:</b></td>
-            <td><%= nodeDescription %></td>
-        </tr>
-    </table>
-  </div>
-</div>
-
-<hr />
-<table width="100%" border="0">
-    <tr>
-        <td height="50" align="center" valign="bottom" nowrap>
-        <div class="footer">&nbsp;</div>
-        </td>
-    </tr>
-</table>
+    <head>
+        <title>Apache jUDDI Registry</title>
+        <link rel="stylesheet" href="juddi.css" />
+    </head>
+    <body>
+        <div class="header" align="right"><a href="http://juddi.apache.org/" target="_top">jUDDI@Apache</a></div>
+        <h1>Apache jUDDI version <%= Release.getRegistryVersion()%></h1>
+
+
+        <h3><em>Welcome</em> to Apache jUDDI!</h3>
+        <ul>
+            <li><a href="/pluto/portal/jUDDI">jUDDI Portal</a></li>
+			<li><a href="happy.jsp">jUDDI Status</a></li>
+            <li><a href="services">View</a> service listing</li>
+            <li><a href="http://juddi.apache.org/">Visit</a> the Apache-jUDDI
Home Page</li>
+            <li><a href="http://juddi.apache.org/docs/3.x/userguide/html/index.html">Users
Guide</a></li>
+            <li><a href="http://juddi.apache.org/docs/3.x/devguide/html/index.html"
>Developers Guide</a></li>
+            <li><a href="http://juddi.apache.org/docs.html" >API Documentation</a></li>
+            <li><a href="http://wiki.apache.org/juddi" >jUDDI Wiki</a></li>
+            <li><a href="http://juddi.apache.org/issue-tracking.html" >Report
a bug</a></li>
+            <li><a href="http://svn.apache.org/viewvc/juddi/" >jUDDI Source Code</a></li>
+            <li><a href="http://www.nabble.com/jUDDI-f218.html">Mailing list</a></li>
+			
+        </ul>
+
+        <div class="install">
+            <h4>jUDDI Installation</h4>
+            <div class="content">
+                <%
+                    // This will tirgger the install process...
+                    String rootPartition = AppConfig.getConfiguration().getString(Property.JUDDI_ROOT_PARTITION);
+                    String nodeId = AppConfig.getConfiguration().getString(Property.JUDDI_NODE_ID);
+                    String nodeName = "";
+                    String nodeDescription = "";
+
+                    BusinessEntity be = Install.getNodeBusinessEntity(nodeId);
+
+                    if (be != null) {
+                        Name n = (Name) be.getName().get(0);
+                        if (n != null) {
+                            nodeName = n.getValue();
+                        }
+
+                        List descList = be.getDescription();
+                        if (descList != null && descList.size() > 0) {
+                            Description d = (Description) descList.get(0);
+                            if (d != null) {
+                                nodeDescription = d.getValue();
+                            }
+                        }
+                    }
+                %>
+                <div>jUDDI has been successfully installed!</div>
+                <p />
+                <h3>Node Information</h3>
+                <table>
+                    <tr>
+                        <td><b>Root Partition:</b></td>
+                        <td><%= rootPartition%></td>
+                    </tr>
+                    <tr>
+                        <td><b>Node Id:</b></td>
+                        <td><%= nodeId%></td>
+                    </tr>
+                    <tr>
+                        <td><b>Name:</b></td>
+                        <td><%= nodeName%></td>
+                    </tr>
+                    <tr>
+                        <td><b>Description:</b></td>
+                        <td><%= nodeDescription%></td>
+                    </tr>
+                </table>
+            </div>
+        </div>
+
+        <hr />
+        <table width="100%" border="0">
+            <tr>
+                <td height="50" align="center" valign="bottom" nowrap>
+                    <div class="footer">&nbsp;</div>
+                </td>
+            </tr>
+        </table>
 
-</body>
+    </body>
 </html>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org


Mime
View raw message