[jboss-svn-commits] JBL Code SVN: r6321 - in labs/jbossesb/workspace/rearchitecture/product/etc: schemas/xml schemas/xml/common validation validation/resources validation/src/org/jboss/soa/esb/services/xml

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Sep 20 11:41:22 EDT 2006


Author: arvinder
Date: 2006-09-20 11:40:56 -0400 (Wed, 20 Sep 2006)
New Revision: 6321

Removed:
   labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/contract.xsd
   labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/dispatcher.xsd
   labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/plugin.xsd
   labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/routing.xsd
Modified:
   labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/email.xsd
   labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/ftp.xsd
   labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/jdbc.xsd
   labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/jms.xsd
   labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/email-epr.xsd
   labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/ftp-epr.xsd
   labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/jdbc-epr.xsd
   labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/jms-epr.xsd
   labs/jbossesb/workspace/rearchitecture/product/etc/validation/build.xml
   labs/jbossesb/workspace/rearchitecture/product/etc/validation/resources/basic-email-epr-example.xml
   labs/jbossesb/workspace/rearchitecture/product/etc/validation/resources/basic-ftp-epr-example.xml
   labs/jbossesb/workspace/rearchitecture/product/etc/validation/resources/basic-jdbc-epr.example.xml
   labs/jbossesb/workspace/rearchitecture/product/etc/validation/resources/basic-jms-epr-example.xml
   labs/jbossesb/workspace/rearchitecture/product/etc/validation/src/org/jboss/soa/esb/services/xml/XmlValidation.java
   labs/jbossesb/workspace/rearchitecture/product/etc/validation/src/org/jboss/soa/esb/services/xml/XmlValidationTest.java
Log:
Initial cut

Deleted: labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/contract.xsd
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/contract.xsd	2006-09-20 15:40:57 UTC (rev 6320)
+++ labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/contract.xsd	2006-09-20 15:40:56 UTC (rev 6321)
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/esb/contract" xmlns:tns="http://www.example.org/esb/contract" xmlns:wsa="http://www.w3.org/2005/08/addressing">
-	<xs:import namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"/>
-	<xs:complexType name="ContractDefinition">
-        <xs:sequence>
-            <xs:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="lax"/>
-            <xs:element name="serviceType" type="xs:anyURI"/>
-            <xs:element minOccurs="0" name="serviceSubType" type="xs:anyURI"/>
-            <xs:element minOccurs="0" name="version" type="xs:anyURI"/>
-		   <xs:element minOccurs="0" name="protocols" type="ProtocolData"/>
-		   <!--
-		   <xs:element minOccurs="0" name="policies" type="wsp:Policy"/>
-		   -->
-        </xs:sequence>
-        <xs:attribute ref="wsu:Id" use="optional"/>
-    </xs:complexType>
-    
-    <xs:complexType name="ProtocolData">
-    		<xs:sequence>
-    			<xs:element name="epr" type="wsa:EndpointReferenceType"/>
-    			<xs:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="lax"/>
-    		</xs:sequence>
-    	</xs:complexType>
-</schema>
\ No newline at end of file

Deleted: labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/dispatcher.xsd
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/dispatcher.xsd	2006-09-20 15:40:57 UTC (rev 6320)
+++ labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/dispatcher.xsd	2006-09-20 15:40:56 UTC (rev 6321)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-<dispatchers>
-   <dispatcher-set>
-      <dispatcher></dispatcher>
-      <dispatcher></dispatcher>
-   </dispatcher-set>
-   
-
-   <dispatcher>
-      <name></name>
-      <apply-rule-set></apply-rule-set>
-   </dispatcher>
-</dispatchers>
--->
\ No newline at end of file

Modified: labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/email.xsd
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/email.xsd	2006-09-20 15:40:57 UTC (rev 6320)
+++ labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/email.xsd	2006-09-20 15:40:56 UTC (rev 6321)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <schema xmlns="http://www.w3.org/2001/XMLSchema"
         xmlns:common="http://www.jboss.org/soa/endpoint/common"
-        xmlns:jms="http://www.jboss.org/soa/endpoint/protocol/email"
+        xmlns:email="http://www.jboss.org/soa/endpoint/protocol/email"
         targetNamespace="http://www.jboss.org/soa/endpoint/protocol/email" elementFormDefault="unqualified"
         attributeFormDefault="unqualified">
     <annotation>
@@ -12,70 +12,62 @@
 
     <!-- import common -->
     <import namespace="http://www.jboss.org/soa/endpoint/common" schemaLocation="common.xsd"/>
+    <element name="email">
+        <complexType>
+            <sequence>
+                <!-- Core -->
+                <element name="service-name" type="common:service-name"/>
+                <element name="service-type" type="common:service-type"/>
+                <element name="gateway-type" type="common:gateway-type"/>
+                <!-- email related -->
+                <element name="protocol" type="email:protocol"/>
+                <element name="host" type="email:host"/>
+                <element name="port" type="email:port"/>
+                <element name="username" type="email:username"/>
+                <element name="password" type="email:password"/>
+            </sequence>
+        </complexType>
+    </element>
 
-    <complexType name="email">
-        <sequence>
-            <element name="service-name" type="common:service-name"/>
-            <element name="service-type" type="common:service-type"/>
-            <element name="gateway-type" type="common:gateway-type"/>
-            <element name="connection-factory" type="string"/>
-            <element name="destination-name" type="string"/>
-        </sequence>
-    </complexType>
-
-    <simpleType name="destination-type">
+    <!-- Email Specific Definitions -->
+    <simpleType name="protocol">
         <restriction base="string">
             <enumeration value="smtp"/>
             <enumeration value="pop"/>
         </restriction>
     </simpleType>
 
-    <element name="host" nillable="false">
-        <xs:annotation>
-            <xs:documentation>This host name</xs:documentation>
-        </xs:annotation>
-        <xs:simpleType>
-            <xs:restriction base="xs:string">
-                <xs:minLength value="1"/>
-                <xs:maxLength value="20"/>
-            </xs:restriction>
-        </xs:simpleType>
-    </element>
 
-    <element name="port" nillable="false">
-        <xs:annotation>
-            <xs:documentation>The port</xs:documentation>
-        </xs:annotation>
-        <xs:simpleType>
-            <xs:restriction base="xs:string">
-                <xs:minLength value="1"/>
-                <xs:maxLength value="2"/>
-            </xs:restriction>
-        </xs:simpleType>
-    </element>
+    <simpleType name="host">
+        <restriction base="string">
+            <minLength value="1"/>
+            <maxLength value="20"/>
+        </restriction>
+    </simpleType>
 
-    <element name="username" nillable="false">
-        <xs:annotation>
-            <xs:documentation>The username</xs:documentation>
-        </xs:annotation>
-        <xs:simpleType>
-            <xs:restriction base="xs:string">
-                <xs:minLength value="1"/>
-                <xs:maxLength value="20"/>
-            </xs:restriction>
-        </xs:simpleType>
-    </element>
 
-     <element name="password" nillable="false">
-        <xs:annotation>
-            <xs:documentation>The password</xs:documentation>
-        </xs:annotation>
-        <xs:simpleType>
-            <xs:restriction base="xs:string">
-                <xs:minLength value="1"/>
-                <xs:maxLength value="20"/>
-            </xs:restriction>
-        </xs:simpleType>
-    </element>
+    <simpleType name="port">
+        <restriction base="string">
+            <minLength value="1"/>
+            <maxLength value="5"/>
+        </restriction>
+    </simpleType>
 
+
+    <simpleType name="username">
+        <restriction base="string">
+            <minLength value="1"/>
+            <maxLength value="20"/>
+        </restriction>
+    </simpleType>
+
+
+    <simpleType name="password">
+        <restriction base="string">
+            <minLength value="1"/>
+            <maxLength value="20"/>
+        </restriction>
+    </simpleType>
+
+
 </schema>
\ No newline at end of file

Modified: labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/ftp.xsd
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/ftp.xsd	2006-09-20 15:40:57 UTC (rev 6320)
+++ labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/ftp.xsd	2006-09-20 15:40:56 UTC (rev 6321)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:common="http://www.jboss.org/soa/endpoint/common"
+        xmlns:ftp="http://www.jboss.org/soa/endpoint/protocol/ftp"
+        targetNamespace="http://www.jboss.org/soa/endpoint/protocol/ftp" elementFormDefault="unqualified"
+        attributeFormDefault="unqualified">
+    <annotation>
+        <documentation>
+            JBoss Inc JMS SOA Schema Definition Copyright 2006
+        </documentation>
+    </annotation>
+
+    <!-- import common -->
+    <import namespace="http://www.jboss.org/soa/endpoint/common" schemaLocation="common.xsd"/>
+    <element name="ftp">
+        <complexType>
+            <sequence>
+                <!-- Core -->
+                <element name="service-name" type="common:service-name"/>
+                <element name="service-type" type="common:service-type"/>
+                <element name="gateway-type" type="common:gateway-type"/>
+                <!-- ftp related -->
+                <element name="host" type="ftp:host"/>
+                <element name="port" type="ftp:port"/>
+                <element name="username" type="ftp:username"/>
+                <element name="password" type="ftp:password"/>
+                <element name="directory" type="ftp:directory"/>
+
+            </sequence>
+        </complexType>
+    </element>
+
+    <!-- FTP Specific Definitions -->
+    <simpleType name="host">
+        <restriction base="string">
+            <minLength value="1"/>
+            <maxLength value="20"/>
+        </restriction>
+    </simpleType>
+
+
+    <simpleType name="port">
+        <restriction base="string">
+            <minLength value="1"/>
+            <maxLength value="5"/>
+        </restriction>
+    </simpleType>
+
+
+    <simpleType name="username">
+        <restriction base="string">
+            <minLength value="1"/>
+            <maxLength value="20"/>
+        </restriction>
+    </simpleType>
+
+
+    <simpleType name="password">
+        <restriction base="string">
+            <minLength value="1"/>
+            <maxLength value="20"/>
+        </restriction>
+    </simpleType>
+
+    <simpleType name="directory">
+        <restriction base="string">
+            <minLength value="1"/>
+            <maxLength value="20"/>
+        </restriction>
+    </simpleType>
+
+
+</schema>
\ No newline at end of file

Modified: labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/jdbc.xsd
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/jdbc.xsd	2006-09-20 15:40:57 UTC (rev 6320)
+++ labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/jdbc.xsd	2006-09-20 15:40:56 UTC (rev 6321)
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:common="http://www.jboss.org/soa/endpoint/common"
+        xmlns:jdbc="http://www.jboss.org/soa/endpoint/protocol/jdbc"
+        targetNamespace="http://www.jboss.org/soa/endpoint/protocol/jdbc" elementFormDefault="unqualified"
+        attributeFormDefault="unqualified">
+    <annotation>
+        <documentation>
+            JBoss Inc JMS SOA Schema Definition Copyright 2006
+        </documentation>
+    </annotation>
+
+    <!-- import common -->
+    <import namespace="http://www.jboss.org/soa/endpoint/common" schemaLocation="common.xsd"/>
+    <element name="jdbc">
+        <complexType>
+            <sequence>
+                <!-- Core -->
+                <element name="service-name" type="common:service-name"/>
+                <element name="service-type" type="common:service-type"/>
+                <element name="gateway-type" type="common:gateway-type"/>
+                <!-- jdbc related -->
+                <element name="url" type="jdbc:url"/>
+                <element name="driver" type="jdbc:driver"/>
+                <element name="username" type="jdbc:username"/>
+                <element name="password" type="jdbc:password"/>
+                <element name="sql" type="jdbc:sql"/>
+            </sequence>
+        </complexType>
+    </element>
+
+    <!-- JDBC Specific Definitions -->
+    <simpleType name="url">
+        <restriction base="string">
+             <minLength value="1"/>
+            <maxLength value="20"/>
+        </restriction>
+    </simpleType>
+
+
+    <simpleType name="driver">
+        <restriction base="string">
+            <minLength value="1"/>
+            <maxLength value="20"/>
+        </restriction>
+    </simpleType>
+
+    <simpleType name="username">
+        <restriction base="string">
+            <minLength value="1"/>
+            <maxLength value="20"/>
+        </restriction>
+    </simpleType>
+
+
+    <simpleType name="password">
+        <restriction base="string">
+            <minLength value="1"/>
+            <maxLength value="20"/>
+        </restriction>
+    </simpleType>
+
+    <simpleType name="sql">
+        <restriction base="string">
+            <minLength value="1"/>
+            <maxLength value="100"/>
+        </restriction>
+    </simpleType>
+
+</schema>
\ No newline at end of file

Modified: labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/jms.xsd
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/jms.xsd	2006-09-20 15:40:57 UTC (rev 6320)
+++ labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/jms.xsd	2006-09-20 15:40:56 UTC (rev 6321)
@@ -11,18 +11,24 @@
 		
 	<!-- import common -->
 	<import namespace="http://www.jboss.org/soa/endpoint/common" schemaLocation="common.xsd" />
-		
-	<complexType name="jms">
+	<element name="jms">
+	<complexType>
 		<sequence>
-			<element name="service-name" type="common:service-name"/>	
+            <!-- Core -->
+            <element name="service-name" type="common:service-name"/>
 			<element name="service-type" type="common:service-type"/>
 			<element name="gateway-type" type="common:gateway-type" />
-			<element name="connection-factory" type="string"/>			
-			<element name="destination-name" type="string"/>
-		</sequence>		
-	</complexType>	    	
-		
-	<simpleType name="specification-version">
+            <!-- jms related -->
+            <element name="spec-version" type="jms:specification-version" />
+            <element name="destination-type" type="jms:destination-type" />
+            <element name="destination-name" type="string"/>
+            <element name="connection-factory" type="string"/>
+        </sequence>
+	</complexType>
+    </element>
+
+    <!-- JMS Specific Definitions -->
+    <simpleType name="specification-version">
 		<restriction base="string">
 			<enumeration value="1.1"/>
 			<enumeration value="1.0.2b"/>					
@@ -35,5 +41,7 @@
 			<enumeration value="topic"/>					
 		</restriction>
 	</simpleType>	
-	
+
+
+
 </schema>
\ No newline at end of file

Deleted: labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/plugin.xsd
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/plugin.xsd	2006-09-20 15:40:57 UTC (rev 6320)
+++ labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/plugin.xsd	2006-09-20 15:40:56 UTC (rev 6321)
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-<plugins>
-   <plugin-set>
-      <set-name></set-name>
-      <plugin-name></plugin-name>
-   </plugin-set>
-
-   <plugin>
-      <name></name>
-      <class></class>
-      <parameters>
-         <name></name>
-         <value></value>
-         ...
-         ...
-      </parameters>
-   </plugin>
-</plugins>
--->
\ No newline at end of file

Deleted: labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/routing.xsd
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/routing.xsd	2006-09-20 15:40:57 UTC (rev 6320)
+++ labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/common/routing.xsd	2006-09-20 15:40:56 UTC (rev 6321)
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-<routing>
-        <route>
-            <source></source>
-            <destination>
-               <type></type>
-               <name></name>
-            </destination>
-        </route>
-</routing>        
--->
\ No newline at end of file

Modified: labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/email-epr.xsd
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/email-epr.xsd	2006-09-20 15:40:57 UTC (rev 6320)
+++ labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/email-epr.xsd	2006-09-20 15:40:56 UTC (rev 6321)
@@ -1,44 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- This is the first cut at defining a standard jms-eps for jboss soa, what is happening here is
-     the assembling of xsds into our email epr destination.
--->
-<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:email-epr="http://www.jboss.org/soa/endpoint/email-epr" xmlns:wsa="http://www.w3.org/2005/08/addressing"
-xmlns:email="http://www.jboss.org/soa/endpoint/protocol/email" targetNamespace="http://www.jboss.org/soa/endpoint/email-epr" elementFormDefault="qualified">
-
-	<import namespace="http://www.w3.org/2005/08/addressing" schemaLocation="common/ws-addr.xsd"/>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:email="http://www.jboss.org/soa/endpoint/protocol/email"  targetNamespace="http://www.jboss.org/soa/endpoint/email-epr" elementFormDefault="qualified" attributeFormDefault="unqualified">
+    <import namespace="http://www.w3.org/2005/08/addressing" schemaLocation="common/ws-addr.xsd"/>
 	<import namespace="http://www.jboss.org/soa/endpoint/protocol/email" schemaLocation="common/email.xsd"/>
-  <complexType name="jms-epr">
-     <sequence>
-      <element name="epr" type="wsa:EndpointReferenceType"/>
-      <element name="email" type="email:email"/>
-     </sequence>
-	</complexType>
-
-
-	<!--
-   NOTE:
-   The next set of stuff here is purely to provoke thoughts about defining these aspects and their
-   configuration etc. But if the general feeling is this should not be here, it can be deleted.
-   -->
-	<!--
-      Plugins (aka interceptors?) Would the dispatcher send requests through the plugins? And would they
-      be configured for each endpoint instance?
-	<xs:include namespace="http://www.jboss.org/soa/endpoint/plugin" schemaLocation="common/plugin.xsd"/>
-   -->
-	<!--
-      Contract defintions? We 'may' want this here. Mark? Unless this is delegated to the dispatcher layer, but
-      what if we include the dispatching defintions here/interceptors - I'm guessing you may not like this..
-<xs:include namespace="http://www.jboss.org/soa/endpoint/contract" schemaLocation="common/contract.xsd"/>
-   -->
-	<!--
-      We can define a dispatcher(s) configuration which may also encompass routing, this is now relevant to
-      what ever task is assigned. If the dispatcher layer is forced to process the message before dumping it
-      on the bus? In this case could we say that the dispatchers.xsd contains/imports routing based information ?
-<xs:include namespace="http://www.jboss.org/soa/endpoint/dispatcher" schemaLocation="common/dispatcher.xsd"/>
-   -->
-	<!--
-      Ok I know routing was briefly discussed on the transformation thread, this can be deleted. The point
-      is to combine thoughts to a common definition.
-<xs:include namespace="http://www.jboss.org/soa/endpoint/routing" schemaLocation="common/routing.xsd"/>
-   -->
+	<element name="email-epr">
+      <complexType>
+       <sequence>
+        <element ref="wsa:EndpointReference"/>
+        <element ref="email:email"/>
+        </sequence>
+       <attribute name="version" type="string" use="required"/>
+      </complexType>
+  </element>
 </schema>
\ No newline at end of file

Modified: labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/ftp-epr.xsd
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/ftp-epr.xsd	2006-09-20 15:40:57 UTC (rev 6320)
+++ labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/ftp-epr.xsd	2006-09-20 15:40:56 UTC (rev 6321)
@@ -1,17 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
-<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:jms-epr="http://www.jboss.org/soa/endpoint/jms-epr" xmlns:wsa="http://www.w3.org/2005/08/addressing"
-xmlns:jms="http://www.jboss.org/soa/endpoint/protocol/jms" targetNamespace="http://www.jboss.org/soa/endpoint/jms-epr" elementFormDefault="qualified">
-
-	<import namespace="http://www.w3.org/2005/08/addressing" schemaLocation="common/ws-addr.xsd"/>
-	<import namespace="http://www.jboss.org/soa/endpoint/protocol/jms" schemaLocation="common/jms.xsd"/>
-  <complexType name="jms-epr">
-     <sequence>
-      <element name="epr" type="wsa:EndpointReferenceType"/>
-      <element name="jms" type="jms:jms"/>
-     </sequence>
-	</complexType>
-
-
-
-</schema>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:ftp="http://www.jboss.org/soa/endpoint/protocol/ftp"  targetNamespace="http://www.jboss.org/soa/endpoint/ftp-epr" elementFormDefault="qualified" attributeFormDefault="unqualified">
+    <import namespace="http://www.w3.org/2005/08/addressing" schemaLocation="common/ws-addr.xsd"/>
+	<import namespace="http://www.jboss.org/soa/endpoint/protocol/ftp" schemaLocation="common/ftp.xsd"/>
+	<element name="ftp-epr">
+      <complexType>
+       <sequence>
+        <element ref="wsa:EndpointReference"/>
+        <element ref="ftp:ftp"/>
+        </sequence>
+       <attribute name="version" type="string" use="required"/>
+      </complexType>
+  </element>
+</schema>
\ No newline at end of file

Modified: labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/jdbc-epr.xsd
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/jdbc-epr.xsd	2006-09-20 15:40:57 UTC (rev 6320)
+++ labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/jdbc-epr.xsd	2006-09-20 15:40:56 UTC (rev 6321)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:jdbc="http://www.jboss.org/soa/endpoint/protocol/jdbc"  targetNamespace="http://www.jboss.org/soa/endpoint/jdbc-epr" elementFormDefault="qualified" attributeFormDefault="unqualified">
+    <import namespace="http://www.w3.org/2005/08/addressing" schemaLocation="common/ws-addr.xsd"/>
+	<import namespace="http://www.jboss.org/soa/endpoint/protocol/jdbc" schemaLocation="common/jdbc.xsd"/>
+	<element name="jdbc-epr">
+      <complexType>
+       <sequence>
+        <element ref="wsa:EndpointReference"/>
+        <element ref="jdbc:jdbc"/>
+        </sequence>
+       <attribute name="version" type="string" use="required"/>
+      </complexType>
+  </element>
+</schema>
\ No newline at end of file

Modified: labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/jms-epr.xsd
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/jms-epr.xsd	2006-09-20 15:40:57 UTC (rev 6320)
+++ labs/jbossesb/workspace/rearchitecture/product/etc/schemas/xml/jms-epr.xsd	2006-09-20 15:40:56 UTC (rev 6321)
@@ -1,44 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- This is the first cut at defining a standard jms-eps for jboss soa, what is happening here is
-     the assembling of xsds into our jms epr destination. 
--->
-<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:jms-epr="http://www.jboss.org/soa/endpoint/jms-epr" xmlns:wsa="http://www.w3.org/2005/08/addressing" 
-xmlns:jms="http://www.jboss.org/soa/endpoint/protocol/jms" targetNamespace="http://www.jboss.org/soa/endpoint/jms-epr" elementFormDefault="qualified">
-	
-	<import namespace="http://www.w3.org/2005/08/addressing" schemaLocation="common/ws-addr.xsd"/>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:jms="http://www.jboss.org/soa/endpoint/protocol/jms"  targetNamespace="http://www.jboss.org/soa/endpoint/jms-epr" elementFormDefault="qualified" attributeFormDefault="unqualified">
+    <import namespace="http://www.w3.org/2005/08/addressing" schemaLocation="common/ws-addr.xsd"/>
 	<import namespace="http://www.jboss.org/soa/endpoint/protocol/jms" schemaLocation="common/jms.xsd"/>
-  <complexType name="jms-epr">
-     <sequence>
-      <element name="epr" type="wsa:EndpointReferenceType"/>
-      <element name="jms" type="jms:jms"/>
-     </sequence>
-	</complexType>  
- 
-
-	<!-- 
-   NOTE:
-   The next set of stuff here is purely to provoke thoughts about defining these aspects and their
-   configuration etc. But if the general feeling is this should not be here, it can be deleted.
-   -->
-	<!--
-      Plugins (aka interceptors?) Would the dispatcher send requests through the plugins? And would they
-      be configured for each endpoint instance?
-	<xs:include namespace="http://www.jboss.org/soa/endpoint/plugin" schemaLocation="common/plugin.xsd"/>
-   -->
-	<!--
-      Contract defintions? We 'may' want this here. Mark? Unless this is delegated to the dispatcher layer, but
-      what if we include the dispatching defintions here/interceptors - I'm guessing you may not like this..
-<xs:include namespace="http://www.jboss.org/soa/endpoint/contract" schemaLocation="common/contract.xsd"/>
-   -->
-	<!--
-      We can define a dispatcher(s) configuration which may also encompass routing, this is now relevant to
-      what ever task is assigned. If the dispatcher layer is forced to process the message before dumping it
-      on the bus? In this case could we say that the dispatchers.xsd contains/imports routing based information ?
-<xs:include namespace="http://www.jboss.org/soa/endpoint/dispatcher" schemaLocation="common/dispatcher.xsd"/>
-   -->
-	<!--
-      Ok I know routing was briefly discussed on the transformation thread, this can be deleted. The point
-      is to combine thoughts to a common definition.
-<xs:include namespace="http://www.jboss.org/soa/endpoint/routing" schemaLocation="common/routing.xsd"/>
-   -->
+	<element name="jms-epr">
+      <complexType>
+       <sequence>
+        <element ref="wsa:EndpointReference"/>
+        <element ref="jms:jms"/>
+        </sequence>
+       <attribute name="version" type="string" use="required"/>
+      </complexType>
+  </element>
 </schema>
+

Modified: labs/jbossesb/workspace/rearchitecture/product/etc/validation/build.xml
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/etc/validation/build.xml	2006-09-20 15:40:57 UTC (rev 6320)
+++ labs/jbossesb/workspace/rearchitecture/product/etc/validation/build.xml	2006-09-20 15:40:56 UTC (rev 6321)
@@ -110,6 +110,8 @@
                 <path refid="build.classpath"/>
             </classpath>
         	<sysproperty key="log4j.configuration" value="log4j.xml"/>
+            <sysproperty key="xml.base.dir" value="${basedir}/resources"/>
+            <sysproperty key="xsd.base.dir" value="F:/projects/jboss.svn/jbossesb/workspace/rearchitecture/product/etc/schemas/xml"/>
         </junit>
         <junitreport>
             <fileset dir="${org.jboss.esb.etc.validation.junit.dir}">

Modified: labs/jbossesb/workspace/rearchitecture/product/etc/validation/resources/basic-email-epr-example.xml
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/etc/validation/resources/basic-email-epr-example.xml	2006-09-20 15:40:57 UTC (rev 6320)
+++ labs/jbossesb/workspace/rearchitecture/product/etc/validation/resources/basic-email-epr-example.xml	2006-09-20 15:40:56 UTC (rev 6321)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<e:email-epr
+        xmlns:e="http://www.jboss.org/soa/endpoint/email-epr"
+        xmlns:email="http://www.jboss.org/soa/endpoint/protocol/email"
+        xmlns:wsa="http://www.w3.org/2005/08/addressing"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://www.jboss.org/soa/endpoint/email-epr email-epr.xsd" version="String">
+	<wsa:EndpointReference>
+		<wsa:Address>http://www.altova.com</wsa:Address>
+		<wsa:ReferenceParameters/>
+		<wsa:Metadata/>
+	</wsa:EndpointReference>
+	<email:email>
+		<service-name>basic-email-epr-example</service-name>
+		<service-type>email</service-type>
+		<gateway-type>consumer</gateway-type>
+		<protocol>smtp</protocol>
+		<host>String</host>
+		<port>25</port>
+		<username>String</username>
+		<password>String</password>
+	</email:email>
+</e:email-epr>

Modified: labs/jbossesb/workspace/rearchitecture/product/etc/validation/resources/basic-ftp-epr-example.xml
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/etc/validation/resources/basic-ftp-epr-example.xml	2006-09-20 15:40:57 UTC (rev 6320)
+++ labs/jbossesb/workspace/rearchitecture/product/etc/validation/resources/basic-ftp-epr-example.xml	2006-09-20 15:40:56 UTC (rev 6321)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<f:ftp-epr
+        xmlns:f="http://www.jboss.org/soa/endpoint/ftp-epr"
+        xmlns:ftp="http://www.jboss.org/soa/endpoint/protocol/ftp"
+        xmlns:wsa="http://www.w3.org/2005/08/addressing"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://www.jboss.org/soa/endpoint/ftp-epr ftp-epr.xsd" version="String">
+	<wsa:EndpointReference>
+		<wsa:Address>http://www.altova.com</wsa:Address>
+		<wsa:ReferenceParameters/>
+		<wsa:Metadata/>
+	</wsa:EndpointReference>
+	<ftp:ftp>
+		<service-name>String</service-name>
+		<service-type>ftp</service-type>
+		<gateway-type>consumer</gateway-type>
+		<host>String</host>
+		<port>23</port>
+		<username>String</username>
+		<password>String</password>
+		<directory>String</directory>
+	</ftp:ftp>
+</f:ftp-epr>

Modified: labs/jbossesb/workspace/rearchitecture/product/etc/validation/resources/basic-jdbc-epr.example.xml
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/etc/validation/resources/basic-jdbc-epr.example.xml	2006-09-20 15:40:57 UTC (rev 6320)
+++ labs/jbossesb/workspace/rearchitecture/product/etc/validation/resources/basic-jdbc-epr.example.xml	2006-09-20 15:40:56 UTC (rev 6321)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<j:jdbc-epr
+        xmlns:j="http://www.jboss.org/soa/endpoint/jdbc-epr"
+        xmlns:jdbc="http://www.jboss.org/soa/endpoint/protocol/jdbc"
+        xmlns:wsa="http://www.w3.org/2005/08/addressing"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://www.jboss.org/soa/endpoint/jdbc-epr jdbc-epr.xsd" version="String">
+	<wsa:EndpointReference>
+		<wsa:Address>http://www.altova.com</wsa:Address>
+		<wsa:ReferenceParameters/>
+		<wsa:Metadata/>
+	</wsa:EndpointReference>
+	<jdbc:jdbc>
+		<service-name>String</service-name>
+		<service-type>http</service-type>
+		<gateway-type>consumer</gateway-type>
+		<url>String</url>
+		<driver>String</driver>
+		<username>String</username>
+		<password>String</password>
+		<sql>String</sql>
+	</jdbc:jdbc>
+</j:jdbc-epr>
\ No newline at end of file

Modified: labs/jbossesb/workspace/rearchitecture/product/etc/validation/resources/basic-jms-epr-example.xml
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/etc/validation/resources/basic-jms-epr-example.xml	2006-09-20 15:40:57 UTC (rev 6320)
+++ labs/jbossesb/workspace/rearchitecture/product/etc/validation/resources/basic-jms-epr-example.xml	2006-09-20 15:40:56 UTC (rev 6321)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<j:jms-epr
+        xmlns:j="http://www.jboss.org/soa/endpoint/jms-epr"
+        xmlns:jms="http://www.jboss.org/soa/endpoint/protocol/jms"
+        xmlns:wsa="http://www.w3.org/2005/08/addressing"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://www.jboss.org/soa/endpoint/jms-epr jms-epr.xsd" version="String">
+	<wsa:EndpointReference>
+		<wsa:Address>http://www.altova.com</wsa:Address>
+		<wsa:ReferenceParameters/>
+		<wsa:Metadata/>
+	</wsa:EndpointReference>
+	<jms:jms>
+		<service-name>basic-jms-epr-example</service-name>
+		<service-type>jms</service-type>
+		<gateway-type>consumer</gateway-type>
+		<spec-version>1.1</spec-version>
+		<destination-type>queue</destination-type>
+		<destination-name>String</destination-name>
+		<connection-factory>String</connection-factory>
+	</jms:jms>
+</j:jms-epr>
\ No newline at end of file

Modified: labs/jbossesb/workspace/rearchitecture/product/etc/validation/src/org/jboss/soa/esb/services/xml/XmlValidation.java
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/etc/validation/src/org/jboss/soa/esb/services/xml/XmlValidation.java	2006-09-20 15:40:57 UTC (rev 6320)
+++ labs/jbossesb/workspace/rearchitecture/product/etc/validation/src/org/jboss/soa/esb/services/xml/XmlValidation.java	2006-09-20 15:40:56 UTC (rev 6321)
@@ -49,15 +49,41 @@
      */
     private Logger log = Logger.getLogger(XmlValidation.class);
     /**
-     * The xml file to validate.
+     * The xml base directory.
      */
-    private String xmlFileToValidate = null;
+    private String xmlBaseDirectory = null;
     /**
-     * The xsd to validate it against.
+     * The xml base directory key.
      */
-    private String xsdToValidateAgainst = null;
+    private String xmlBaseDirectoryKey = "xml.base.dir";
+    /**
+     * The xsd base directory.
+     */
+    private String xsdBaseDirectory = null;
+    /**
+     * The xsd base directory key.
+     */
+    private String xsdBaseDirectoryKey = "xsd.base.dir";
+    /**
+     * The path separator
+      */
+    private static String SEP = System.getProperty("file.separator");
 
     /**
+     * Default class constructor
+     */
+    public XmlValidation() {
+        if(System.getProperty(xmlBaseDirectoryKey) != null) {
+            xmlBaseDirectory = System.getProperty(xmlBaseDirectoryKey);
+            log.info("Using xml base directory " + xmlBaseDirectory);
+        }
+        if(System.getProperty(xsdBaseDirectoryKey) != null) {
+            xsdBaseDirectory = System.getProperty(xsdBaseDirectoryKey);
+            log.info("Using xsd base directory " + xsdBaseDirectory);
+        }
+    }
+
+    /**
      * Validation method used to validate an xml file against an xsd.
      * @param xml The xml file to be validated.
      * @param xsd The schema to validate against.
@@ -69,10 +95,16 @@
             log.info("Validating " + xml + " Against " + xsd);
         }
         boolean isValid = false;
+        File xmlFile = new File(xmlBaseDirectory + SEP + xml);
+        File xsdFile = new File(xsdBaseDirectory + SEP + xsd);
+        log.info("Xml File=" + xmlFile.getAbsolutePath());
+        log.info("Xsd File=" + xsdFile.getAbsolutePath());
         DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
-        Document document = parser.parse(new File(xml));
+        Document document = parser.parse(xmlFile);
+        log.info("Xml=" + document.toString());
         SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
-        Source schemaFile = new StreamSource(new File(xsd));
+        Source schemaFile = new StreamSource(xsdFile);
+        log.info("Xsd=" + schemaFile.toString());
         Schema schema = factory.newSchema(schemaFile);
         Validator validator = schema.newValidator();
         try {

Modified: labs/jbossesb/workspace/rearchitecture/product/etc/validation/src/org/jboss/soa/esb/services/xml/XmlValidationTest.java
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/etc/validation/src/org/jboss/soa/esb/services/xml/XmlValidationTest.java	2006-09-20 15:40:57 UTC (rev 6320)
+++ labs/jbossesb/workspace/rearchitecture/product/etc/validation/src/org/jboss/soa/esb/services/xml/XmlValidationTest.java	2006-09-20 15:40:56 UTC (rev 6321)
@@ -17,6 +17,9 @@
      */
     public void testBasicEmailEPR() throws Exception {
         log.info("Running Basic Email EPR Test");
+        XmlValidation xmlValidator = new XmlValidation();
+        boolean isValid = xmlValidator.validate("basic-email-epr-example.xml","email-epr.xsd");
+        assertTrue("Expecting basic-email-epr-example.xml to be valid.", isValid);
     }
 
     /**
@@ -25,6 +28,9 @@
      */
     public void testBasicJMSEPR() throws Exception {
         log.info("Running Basic JMS EPR Test");
+        XmlValidation xmlValidator = new XmlValidation();
+        boolean isValid = xmlValidator.validate("basic-jms-epr-example.xml","jms-epr.xsd");
+        assertTrue("Expecting basic-jms-epr-example.xml to be valid.", isValid);
     }
 
     /**
@@ -33,6 +39,9 @@
      */
     public void testBasicJDBCEPR() throws Exception {
         log.info("Running Basic JDBC EPR Test");
+        XmlValidation xmlValidator = new XmlValidation();
+        boolean isValid = xmlValidator.validate("basic-jdbc-epr-example.xml","jdbc-epr.xsd");
+        assertTrue("Expecting basic-jdbc-epr-example.xml to be valid.", isValid);
     }
 
     /**
@@ -41,6 +50,9 @@
      */
     public void testBasicFTPEPR() throws Exception {
         log.info("Running Basic FTP EPR Test");
+        XmlValidation xmlValidator = new XmlValidation();
+        boolean isValid = xmlValidator.validate("basic-ftp-epr-example.xml","ftp-epr.xsd");
+        assertTrue("Expecting basic-ftp-epr-example.xml to be valid.", isValid);
     }
 
 




More information about the jboss-svn-commits mailing list