[jboss-svn-commits] JBL Code SVN: r13758 - in labs/jbossesb/trunk/product/tools: console and 9 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Jul 24 09:26:45 EDT 2007


Author: tcunning
Date: 2007-07-24 09:26:44 -0400 (Tue, 24 Jul 2007)
New Revision: 13758

Added:
   labs/jbossesb/trunk/product/tools/console/contract-web/
   labs/jbossesb/trunk/product/tools/console/contract-web/build.xml
   labs/jbossesb/trunk/product/tools/console/contract-web/pom.xml
   labs/jbossesb/trunk/product/tools/console/contract-web/src/
   labs/jbossesb/trunk/product/tools/console/contract-web/src/main/
   labs/jbossesb/trunk/product/tools/console/contract-web/src/main/resources/
   labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/
   labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/WEB-INF/
   labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/WEB-INF/web.xml
   labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/contract.jsp
   labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/index.jsp
   labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/styles.css
Removed:
   labs/jbossesb/trunk/product/tools/jboss-esb.war/
Modified:
   labs/jbossesb/trunk/product/tools/console/build.xml
   labs/jbossesb/trunk/product/tools/console/distro/application.xml
   labs/jbossesb/trunk/product/tools/console/distro/jbossfaces-application.xml
   labs/jbossesb/trunk/product/tools/console/distro/myfaces-application.xml
   labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/index.jsp
   labs/jbossesb/trunk/product/tools/console/resources/jboss-esb-console-service.xml
   labs/jbossesb/trunk/product/tools/console/resources/jboss-esb-console.properties
   labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/UpdateNotifier.java
Log:
bug:JBESB-738
Move Tom F's contract tool into jboss-esb-console.


Modified: labs/jbossesb/trunk/product/tools/console/build.xml
===================================================================
--- labs/jbossesb/trunk/product/tools/console/build.xml	2007-07-24 13:09:16 UTC (rev 13757)
+++ labs/jbossesb/trunk/product/tools/console/build.xml	2007-07-24 13:26:44 UTC (rev 13758)
@@ -131,9 +131,14 @@
 	</target>
 
 	<target name="ear" description="Build the EAR">
+		<property name="contract.dir" value="${basedir}/contract-web"/>
 		<property name="mgmt.dir" value="${basedir}/management-web"/>
 		<ant antfile="management-web/build.xml" target="war"/>
+		<ant antfile="contract-web/build.xml" target="war"/>
 		<copy todir="${ear.dir}">
+			<fileset dir="contract-web/build">
+				<include name="*.war"/>
+			</fileset>
 			<fileset dir="management-web/build">
 				<include name="*.war"/>
 			</fileset>

Added: labs/jbossesb/trunk/product/tools/console/contract-web/build.xml
===================================================================
--- labs/jbossesb/trunk/product/tools/console/contract-web/build.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/tools/console/contract-web/build.xml	2007-07-24 13:26:44 UTC (rev 13758)
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+
+<project name="contract-web" default="war" basedir=".">
+	<property name="contract.dir" location="."/>
+	<echo>${contract.dir}</echo>
+	<target name="war"
+		description="Build the contract WAR">
+		<mkdir dir="${contract.dir}/build"/>	
+		<war destfile="${contract.dir}/build/contract.war" 
+			webxml="${contract.dir}/src/main/webapp/WEB-INF/web.xml"
+			basedir="${contract.dir}/src/main/webapp"/>
+	</target>
+</project>

Added: labs/jbossesb/trunk/product/tools/console/contract-web/pom.xml
===================================================================
--- labs/jbossesb/trunk/product/tools/console/contract-web/pom.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/tools/console/contract-web/pom.xml	2007-07-24 13:26:44 UTC (rev 13758)
@@ -0,0 +1,21 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.soa.esb</groupId>
+  <artifactId>contract-web</artifactId>
+  <packaging>war</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>contract-web Maven Webapp</name>
+  <url>http://maven.apache.org</url>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <finalName>contract-web</finalName>
+  </build>
+</project>

Added: labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/WEB-INF/web.xml
===================================================================
--- labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/WEB-INF/web.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/WEB-INF/web.xml	2007-07-24 13:26:44 UTC (rev 13758)
@@ -0,0 +1,7 @@
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd" >
+
+<web-app>
+  <display-name>Archetype Created Web Application</display-name>
+</web-app>

Added: labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/contract.jsp
===================================================================
--- labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/contract.jsp	                        (rev 0)
+++ labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/contract.jsp	2007-07-24 13:26:44 UTC (rev 13758)
@@ -0,0 +1,58 @@
+<%@ page import="java.util.List" %>
+<%@ page import="org.jboss.soa.esb.listeners.config.ServicePublisher" %>
+<%@ page import="org.jboss.soa.esb.services.registry.RegistryFactory" %>
+<%@ page import="org.jboss.soa.esb.services.registry.Registry" %>
+<%@ page import="org.jboss.soa.esb.services.registry.RegistryException" %>
+<%@ page import="java.util.ArrayList" %>
+<%@ page import="org.jboss.soa.esb.addressing.EPR" %>
+<%@ page import="java.net.URI" %>
+<%@ page import="org.jboss.internal.soa.esb.publish.ContractInfo" %>
+<%
+    List publishers = ServicePublisher.getServicePublishers();
+    Registry registry = RegistryFactory.getRegistry();
+    String targetServiceCat = request.getParameter("serviceCat");
+    String targetServiceName = request.getParameter("serviceName");
+    String targetProtocol = request.getParameter("protocol");
+    ContractInfo contractInfo = null;
+    String contractData = null;
+
+    for (int i = 0; i < publishers.size() && contractInfo == null; i++) {
+        ServicePublisher publisher = (ServicePublisher) publishers.get(i);
+        String serviceCategory = publisher.getCategory();
+        String serviceName = publisher.getServiceName();
+        List eprs;
+
+        if(publisher.getContractPublisher() == null) {
+            continue;
+        } else if (!serviceCategory.equalsIgnoreCase(targetServiceCat) ||
+                !serviceName.equalsIgnoreCase(targetServiceName)) {
+            continue;
+        }
+
+        try {
+            eprs = (List) registry.findEPRs(serviceCategory, serviceName);
+        } catch (RegistryException e) {
+            // ignore for now - just return an empty list
+            eprs = new ArrayList();
+        }
+
+        for (int ii = 0; ii < eprs.size(); ii++) {
+            EPR epr = (EPR) eprs.get(ii);
+            URI eprURI = URI.create(epr.getAddr().getAddress());
+            String protocol = eprURI.getScheme();
+
+            if (protocol.equalsIgnoreCase(targetProtocol)) {
+                contractInfo = publisher.getContractPublisher().getContractInfo(epr);
+                break;
+            }
+        }
+
+        if(contractInfo != null) {
+            contractData = contractInfo.getData();
+            response.setContentType(contractInfo.getMimeType());
+        } else {
+            contractData = "<Unavailable/>";
+            response.setContentType("text/xml");
+        }
+    }
+%><%=contractData%>
\ No newline at end of file

Added: labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/index.jsp
===================================================================
--- labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/index.jsp	                        (rev 0)
+++ labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/index.jsp	2007-07-24 13:26:44 UTC (rev 13758)
@@ -0,0 +1,77 @@
+<%@ page import="org.jboss.soa.esb.listeners.config.ServicePublisher" %>
+<%@ page import="java.util.List" %>
+<%@ page import="org.jboss.soa.esb.services.registry.Registry" %>
+<%@ page import="org.jboss.soa.esb.services.registry.RegistryFactory" %>
+<%@ page import="org.jboss.soa.esb.addressing.EPR" %>
+<%@ page import="java.net.URI" %>
+<%@ page import="org.jboss.soa.esb.services.registry.RegistryException" %>
+<%@ page import="java.util.ArrayList" %>
+<html>
+<head>
+    <title>JBoss ESB - Service List</title>
+    <link rel='stylesheet' href='./styles.css'>
+</head>
+<body>
+
+<div class="pageSection">
+<h2>JBoss ESB Service Deployments</h2>
+</div>
+
+<div class="pageSection">
+    <%
+        List publishers = ServicePublisher.getServicePublishers();
+        Registry registry = RegistryFactory.getRegistry();
+
+        for (int i = 0; i < publishers.size(); i++) {
+            ServicePublisher publisher = (ServicePublisher) publishers.get(i);
+            String serviceCategory = publisher.getCategory();
+            String serviceName = publisher.getServiceName();
+            List eprs;
+
+            try {
+                eprs = (List) registry.findEPRs(serviceCategory, serviceName);
+            } catch (RegistryException e) {
+                // ignore for now - just return an empty list
+                eprs = new ArrayList();
+            }
+    %>
+    <fieldset>
+        <legend><b><%=serviceCategory%>:<%=serviceName%></b></legend>
+        <%=publisher.getDescription()%>
+        <%
+            for (int ii = 0; ii < eprs.size(); ii++) {
+                EPR epr = (EPR) eprs.get(ii);
+                URI eprURI = URI.create(epr.getAddr().getAddress());
+                String protocol = eprURI.getScheme();
+                String relContractURI = "contract.jsp?serviceCat=" + serviceCategory + "&serviceName=" + serviceName + "&protocol=" + protocol;
+                URI thisPage = URI.create(request.getRequestURL().toString());
+                URI contractURI = thisPage.resolve(relContractURI);
+        %>
+        <fieldset>
+            <legend><b><%=protocol.toUpperCase()%></b></legend>
+
+            <ul>
+                <li><b>Endpoint</b>: <%=eprURI%></li>
+                <%
+                    if(publisher.getContractPublisher() != null) {
+                %>
+                <li><b>Contract</b>: <a href="<%=relContractURI%>"><%=contractURI%></a></li>
+                <%
+                    } else {
+                %>
+                <li><b>Contract</b>: Unavailable</li>
+                <%
+                    }
+                %>
+            </ul>
+        </fieldset>
+        <%
+            }
+        %>
+    </fieldset>
+    <%
+        }
+    %>
+</div>
+</body>
+</html>

Added: labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/styles.css
===================================================================
--- labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/styles.css	                        (rev 0)
+++ labs/jbossesb/trunk/product/tools/console/contract-web/src/main/webapp/styles.css	2007-07-24 13:26:44 UTC (rev 13758)
@@ -0,0 +1,185 @@
+
+/* table for list views */
+.table_list {
+}
+
+/* table for detail views */
+.table_form {
+}
+
+.pageHeader {
+   font-size: 14pt;
+   font-weight: BOLD;
+   color: #ffffff;
+   border-bottom-width:1px;
+   border-bottom-style:solid;
+   border-color:#000066;
+   margin-bottom:15px;
+   padding-left:15px;
+   padding-top:5px;
+   padding-bottom:5px;
+   background-color: #aaaadd;
+   max-width: 900px;
+}
+
+.pageSection {
+ padding-left:15px;
+ margin-bottom: 5px;
+}
+
+.metrics
+{	 
+   font-size: 6pt;
+   background-color: #dddddd;
+   width: 100%;
+}
+
+/* table row header */
+.list_tr_head {
+   font-family: Verdana, sans-serif;
+   font-size: 8pt;
+   font-weight: 600;
+   text-align: center;
+   background-color: #aaaadd;
+}
+
+/* table row list view */
+.list_tr {
+   font-family: Verdana, sans-serif;
+   font-size: 8pt;
+   color: #000066;
+   vertical-align: top;
+   background-color: #ffffff;
+}
+
+/* table row list view odd lines */
+.list_tr_even {
+   font-family: Verdana, sans-serif;
+   font-size: 8pt;
+   color: #000066;
+   vertical-align: top;
+   background-color: #ffffff;
+}
+
+/* table row list view even lines */
+.list_tr_odd {
+   font-family: Verdana, sans-serif;
+   font-size: 8pt;
+   color: #000066;
+   vertical-align: top;
+   background-color: #dddddd;
+}
+
+/* form label */
+.form_label {
+   font-family: Verdana, sans-serif;
+   font-weight: 500;
+   font-size: 8pt;
+   color: #000066;
+   vertical-align: top;
+   background-color: #dddddd;
+   padding-top: 2px;
+   padding-bottom: 2px;
+}
+
+/* form value */
+.form_value {
+   font-family: Verdana, sans-serif;
+   font-size: 8pt;
+   color: #000066;
+   vertical-align: baseline;
+}
+
+/* tiny writing */
+.tiny {
+   font-family: Verdana, sans-serif;
+   font-size: 8pt;
+   color: #666666;
+}
+
+/* required input fields */
+.inputmust {
+   background-color: #dddddd;
+}
+
+/* error message */
+.error {
+   font-family: Courier New;
+   color: #990000;
+}
+
+/* error message */
+.error_trace {
+   font-family: Courier New;
+}
+
+/* active tree node */
+.tree_active_label {
+   font-weight: bold;
+}
+
+body {
+   font-family: Verdana,, sans-serif;
+   font-size: 8pt;
+   color: #000066;
+   background-color: #ffffff;
+}
+
+/* title style */
+h1 {
+   font-family: Verdana, sans-serif;
+   font-size: 14pt;
+   font-weight: 600;
+   color: #000066;
+}
+
+h2 {
+   font-family: Verdana, sans-serif;
+   font-size: 12pt;
+   font-weight: 600;
+   color: #000066;
+}
+
+h3 {
+   font-family: Verdana, sans-serif;
+   font-size: 10pt;
+   font-weight: 600;
+   color: #000066;
+}
+
+h4 {
+   font-family: Verdana, sans-serif;
+   font-size: 10pt;
+   font-weight: 500;
+   color: #000066;
+}
+
+/* table desk */
+td {
+   font-family: Verdana, sans-serif;
+   font-size: 8pt;
+   padding-left: 5px;
+   padding-right: 5px;
+}
+
+input, textarea, select, option {
+   font-family: Verdana, sans-serif;
+   font-size: 8pt;
+   color: #000066;
+}
+
+a {
+   font-family: Verdana, sans-serif;
+   color: #0000dd;
+   text-decoration: none;
+}
+
+a:hover{
+   font-family: Verdana, sans-serif;
+   color: #cc0000;
+   text-decoration: none;
+}
+
+pre {
+    background:#dddddd
+}
\ No newline at end of file

Modified: labs/jbossesb/trunk/product/tools/console/distro/application.xml
===================================================================
--- labs/jbossesb/trunk/product/tools/console/distro/application.xml	2007-07-24 13:09:16 UTC (rev 13757)
+++ labs/jbossesb/trunk/product/tools/console/distro/application.xml	2007-07-24 13:26:44 UTC (rev 13758)
@@ -5,6 +5,20 @@
              version="5">
     
    <display-name>jboss-esb-console</display-name>
+
+   <module>
+      <web>
+         <web-uri>contract.war</web-uri>
+         <context-root>/contract</context-root>
+      </web>
+   </module>
+
+   <module>
+      <web>
+         <web-uri>management.war</web-uri>
+         <context-root>/management</context-root>
+      </web>
+   </module>
    
    <module>
       <web>

Modified: labs/jbossesb/trunk/product/tools/console/distro/jbossfaces-application.xml
===================================================================
--- labs/jbossesb/trunk/product/tools/console/distro/jbossfaces-application.xml	2007-07-24 13:09:16 UTC (rev 13757)
+++ labs/jbossesb/trunk/product/tools/console/distro/jbossfaces-application.xml	2007-07-24 13:26:44 UTC (rev 13758)
@@ -5,6 +5,20 @@
              version="5">
     
    <display-name>jboss-esb-console</display-name>
+
+   <module>
+      <web>
+         <web-uri>contract.war</web-uri>
+         <context-root>/contract</context-root>
+      </web>
+   </module>
+
+   <module>
+      <web>
+         <web-uri>management.war</web-uri>
+         <context-root>/management</context-root>
+      </web>
+   </module>
    
    <module>
       <web>

Modified: labs/jbossesb/trunk/product/tools/console/distro/myfaces-application.xml
===================================================================
--- labs/jbossesb/trunk/product/tools/console/distro/myfaces-application.xml	2007-07-24 13:09:16 UTC (rev 13757)
+++ labs/jbossesb/trunk/product/tools/console/distro/myfaces-application.xml	2007-07-24 13:26:44 UTC (rev 13758)
@@ -5,6 +5,20 @@
              version="5">
     
    <display-name>jboss-esb-console</display-name>
+
+   <module>
+      <web>
+    	 <web-uri>contract.war</web-uri>
+	 <context-root>/contract</context-root>
+      </web>
+   </module>
+
+   <module>
+      <web>
+	 <web-uri>management.war</web-uri>
+	 <context-root>/management</context-root>
+      </web>
+   </module>
    
    <module>
       <web>

Modified: labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/index.jsp
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/index.jsp	2007-07-24 13:09:16 UTC (rev 13757)
+++ labs/jbossesb/trunk/product/tools/console/management-web/src/main/webapp/index.jsp	2007-07-24 13:26:44 UTC (rev 13758)
@@ -1,4 +1,10 @@
-<%@ include file="include/vfaheader.jsp"%>
+<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
+<%@ page session="true" %>
+<%@ page import="
+		org.jboss.soa.esb.addressing.EPR,
+       	org.jboss.internal.soa.esb.services.registry.*,
+		java.util.* 
+"%>
 <html>
 <body>
 <h2>Hello World!</h2>
@@ -6,12 +12,28 @@
 <%
 try {
 	JAXRRegistryImpl registry = new JAXRRegistryImpl();
-	List<String> services = registry.findAllServices();
-	for (String serv : services) {
+	List services = registry.findAllServices();
+	for (Iterator it = services.iterator (); it.hasNext (); ) {
+		String serv = (String) it.next ();
+		%>
+		<%=serv%><br>
+		<%	
+
+	}
 	%>
-	<%=serv%><br>
-	<%	
+	<h2>EPR</h2><p>
+	<%
+	List eprs = registry.findAllEPRs();
+	for (Iterator it = eprs.iterator(); it.hasNext(); ) {
+		EPR epr = (EPR) it.next();
+		String eprString = epr.getAddr().toString();
+		String addr = epr.getAddr().getAddress();
+		%>
+		<%=eprString%> - <%=addr%><br>
+		<%
 	}
+} catch (Exception e) {
+	e.printStackTrace();
 }
 %>
 </html>

Modified: labs/jbossesb/trunk/product/tools/console/resources/jboss-esb-console-service.xml
===================================================================
--- labs/jbossesb/trunk/product/tools/console/resources/jboss-esb-console-service.xml	2007-07-24 13:09:16 UTC (rev 13757)
+++ labs/jbossesb/trunk/product/tools/console/resources/jboss-esb-console-service.xml	2007-07-24 13:26:44 UTC (rev 13758)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <server>
-    <mbean code="org.jboss.mq.server.jmx.Topic" name="jboss.mq.destination:service=Topic,name=org.jboss.soa.esb.transformation.Update">
+    <mbean code="org.jboss.mq.server.jmx.Topic" name="jboss.mq.destination:service=Topic,name=org.jboss.soa.esb.console.transformation.Update">
         <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
     </mbean>
-</server>
\ No newline at end of file
+</server>

Modified: labs/jbossesb/trunk/product/tools/console/resources/jboss-esb-console.properties
===================================================================
--- labs/jbossesb/trunk/product/tools/console/resources/jboss-esb-console.properties	2007-07-24 13:09:16 UTC (rev 13757)
+++ labs/jbossesb/trunk/product/tools/console/resources/jboss-esb-console.properties	2007-07-24 13:26:44 UTC (rev 13758)
@@ -17,4 +17,4 @@
 # 
 ############################################################################## 
 javax.jms.ConnectionFactory=ConnectionFactory
-update.notification.topic=topic/org.jboss.soa.esb.transformation.Update
\ No newline at end of file
+update.notification.topic=topic/org.jboss.soa.esb.console.transformation.Update

Modified: labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/UpdateNotifier.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/UpdateNotifier.java	2007-07-24 13:09:16 UTC (rev 13757)
+++ labs/jbossesb/trunk/product/tools/console/src/org/jboss/soa/esb/admin/console/UpdateNotifier.java	2007-07-24 13:26:44 UTC (rev 13758)
@@ -149,7 +149,7 @@
 		}
 		
 		// Lookup the topic...
-		String notificationTopic = properties.getProperty("update.notification.topic", "topic/org.jboss.soa.esb.transformation.Update");
+		String notificationTopic = properties.getProperty("update.notification.topic", "topic/org.jboss.soa.esb.console.transformation.Update");
 		try {
 			topic = (Topic) context.lookup(notificationTopic);
 		} catch (NamingException e) {




More information about the jboss-svn-commits mailing list