geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r292333 [3/4] - in /geronimo/trunk: applications/console-ear/src/plan/ applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/ applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/activem...
Date Wed, 28 Sep 2005 22:10:54 GMT
Modified: geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java (original)
+++ geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java Wed Sep 28 15:09:15 2005
@@ -36,13 +36,14 @@
     public ClassLoader cl;
     public String contextRoot;
     private Map portMap = null;
+    private String namespace = "foo";
 
     public Module createModule(File plan, JarFile moduleFile) throws DeploymentException {
-        return new WebModule(true, null, null, moduleFile, "war", null, null, null, contextRoot, portMap);
+        return new WebModule(true, null, null, moduleFile, "war", null, null, null, contextRoot, portMap, namespace);
     }
 
     public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, URI earConfigId, Object moduleContextInfo) throws DeploymentException {
-        return new WebModule(false, null, null, moduleFile, targetPath, null, null, null, contextRoot, portMap);
+        return new WebModule(false, null, null, moduleFile, targetPath, null, null, null, contextRoot, portMap, namespace);
     }
 
     public void installModule(JarFile earFile, EARContext earContext, Module webModule) throws DeploymentException {

Modified: geronimo/trunk/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java (original)
+++ geronimo/trunk/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java Wed Sep 28 15:09:15 2005
@@ -19,8 +19,11 @@
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.File;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Map;
+import java.util.HashMap;
 import java.net.URL;
 import javax.xml.namespace.QName;
 
@@ -43,58 +46,41 @@
 public class SchemaConversionUtils {
     static final String J2EE_NAMESPACE = "http://java.sun.com/xml/ns/j2ee";
 
-    static final String GERONIMO_NAMING_NAMESPACE = "http://geronimo.apache.org/xml/ns/naming";
-    private static final String GERONIMO_SECURITY_NAMESPACE = "http://geronimo.apache.org/xml/ns/security";
-    private static final String GERONIMO_SERVICE_NAMESPACE = "http://geronimo.apache.org/xml/ns/deployment";
+    static final String GERONIMO_NAMING_NAMESPACE = "http://geronimo.apache.org/xml/ns/naming-1.0";
+    private static final String GERONIMO_SECURITY_NAMESPACE = "http://geronimo.apache.org/xml/ns/security-1.0";
+    private static final String GERONIMO_SERVICE_NAMESPACE = "http://geronimo.apache.org/xml/ns/deployment-1.0";
 
     private static final QName RESOURCE_ADAPTER_VERSION = new QName(J2EE_NAMESPACE, "resourceadapter-version");
     private static final QName TAGLIB = new QName(J2EE_NAMESPACE, "taglib");
     private static final QName CMP_VERSION = new QName(J2EE_NAMESPACE, "cmp-version");
 
-    private SchemaConversionUtils() {
-    }
-
-    public static XmlObject parse(URL url) throws IOException, XmlException {
-        ArrayList errors = new ArrayList();
-        XmlObject parsed = XmlObject.Factory.parse(url, createXmlOptions(errors));
-        if (errors.size() != 0) {
-            throw new XmlException(errors.toArray().toString());
-        }
-        return parsed;
-    }
+    private static final Map GERONIMO_SCHEMA_CONVERSIONS = new HashMap();
 
-    public static XmlObject parse(InputStream is) throws IOException, XmlException {
-        ArrayList errors = new ArrayList();
-        XmlObject parsed = XmlObject.Factory.parse(is, createXmlOptions(errors));
-        if (errors.size() != 0) {
-            throw new XmlException(errors.toArray().toString());
-        }
-        return parsed;
-    }
+    static {
 
-    public static XmlObject parse(String xml) throws XmlException {
-        ArrayList errors = new ArrayList();
-        XmlObject parsed = XmlObject.Factory.parse(xml, createXmlOptions(errors));
-        if (errors.size() != 0) {
-            throw new XmlException(errors.toArray().toString());
-        }
-        return parsed;
+        GERONIMO_SCHEMA_CONVERSIONS.put("ejb-ref", GERONIMO_NAMING_NAMESPACE);
+        GERONIMO_SCHEMA_CONVERSIONS.put("ejb-local-ref", GERONIMO_NAMING_NAMESPACE);
+        GERONIMO_SCHEMA_CONVERSIONS.put("service-ref", GERONIMO_NAMING_NAMESPACE);
+        GERONIMO_SCHEMA_CONVERSIONS.put("resource-ref", GERONIMO_NAMING_NAMESPACE);
+        GERONIMO_SCHEMA_CONVERSIONS.put("resource-env-ref", GERONIMO_NAMING_NAMESPACE);
+        GERONIMO_SCHEMA_CONVERSIONS.put("cmp-connection-factory", GERONIMO_NAMING_NAMESPACE);
+        GERONIMO_SCHEMA_CONVERSIONS.put("workmanager", GERONIMO_NAMING_NAMESPACE);
+        GERONIMO_SCHEMA_CONVERSIONS.put("resource-adapter", GERONIMO_NAMING_NAMESPACE);
+
+        GERONIMO_SCHEMA_CONVERSIONS.put("security", GERONIMO_SECURITY_NAMESPACE);
+        GERONIMO_SCHEMA_CONVERSIONS.put("default-principal", GERONIMO_SECURITY_NAMESPACE);
+
+        GERONIMO_SCHEMA_CONVERSIONS.put("gbean", GERONIMO_SERVICE_NAMESPACE);
+        GERONIMO_SCHEMA_CONVERSIONS.put("import", GERONIMO_SERVICE_NAMESPACE);
+        GERONIMO_SCHEMA_CONVERSIONS.put("dependency", GERONIMO_SERVICE_NAMESPACE);
+        GERONIMO_SCHEMA_CONVERSIONS.put("include", GERONIMO_SERVICE_NAMESPACE);
     }
 
-    public static XmlObject parse(Element element) throws XmlException {
-        ArrayList errors = new ArrayList();
-        XmlObject parsed = XmlObject.Factory.parse(element, createXmlOptions(errors));
-        if (errors.size() != 0) {
-            throw new XmlException(errors.toArray().toString());
-        }
-        return parsed;
+    private SchemaConversionUtils() {
     }
 
-    public static XmlOptions createXmlOptions(ArrayList errors) {
-        XmlOptions options = new XmlOptions();
-        options.setLoadLineNumbers();
-        options.setErrorListener(errors);
-        return options;
+    public static void registerNamespaceConversions(Map conversions) {
+        GERONIMO_SCHEMA_CONVERSIONS.putAll(conversions);
     }
 
     public static ApplicationDocument convertToApplicationSchema(XmlObject xmlObject) throws XmlException {
@@ -339,111 +325,84 @@
         return (WebAppDocument) xmlObject;
     }
 
-    public static XmlObject convertToGeronimoNamingSchema(XmlObject xmlObject) {
-        XmlCursor cursor = xmlObject.newCursor();
-        XmlCursor end = xmlObject.newCursor();
+    public static void convertToGeronimoSubSchemas(XmlCursor cursor) {
+        cursor.toStartDoc();
+        XmlCursor end = cursor.newCursor();
         try {
             while (cursor.hasNextToken()) {
                 if (cursor.isStart()) {
                     String localName = cursor.getName().getLocalPart();
-                    if (localName.equals("ejb-ref")
-                            || localName.equals("ejb-local-ref")
-                            || localName.equals("service-ref")
-                            || localName.equals("resource-ref")
-                            || localName.equals("resource-env-ref")
-                            || localName.equals("cmp-connection-factory")
-                            || localName.equals("workmanager")
-                            || localName.equals("resource-adapter")) {
-                        convertElementToSchema(cursor, end, GERONIMO_NAMING_NAMESPACE);
+                    String namespace = (String) GERONIMO_SCHEMA_CONVERSIONS.get(localName);
+                    if (namespace != null) {
+                        convertElementToSchema(cursor, end, namespace);
                     }
                 }
                 cursor.toNextToken();
             }
         } finally {
-            cursor.dispose();
             end.dispose();
         }
-        return xmlObject;
     }
 
-    public static XmlObject convertToGeronimoSecuritySchema(XmlObject xmlObject) {
-        XmlCursor cursor = xmlObject.newCursor();
-        XmlCursor end = xmlObject.newCursor();
+    public static XmlObject fixGeronimoSchema(XmlObject rawPlan, String desiredElement, SchemaType desiredType) throws XmlException {
+        XmlCursor cursor = rawPlan.newCursor();
         try {
-            while (cursor.hasNextToken()) {
-                if (cursor.isStart()) {
-                    String localName = cursor.getName().getLocalPart();
-                    if (localName.equals("security") || localName.equals("default-principal")) {
-                        convertElementToSchema(cursor, end, GERONIMO_SECURITY_NAMESPACE);
-                    }
+            if (findNestedElement(cursor, desiredElement)) {
+                cursor.push();
+                convertToGeronimoSubSchemas(cursor);
+                cursor.pop();
+                XmlObject temp = cursor.getObject();
+
+                XmlObject result = temp.changeType(desiredType);
+                if (result == null || result.schemaType() != desiredType) {
+                    result = temp.copy().changeType(desiredType);
                 }
-                cursor.toNextToken();
+                validateDD(result);
+                return result;
+            } else {
+                return null;
             }
         } finally {
             cursor.dispose();
-            end.dispose();
         }
-        return xmlObject;
     }
 
-    public static XmlObject convertToGeronimoServiceSchema(XmlObject xmlObject) {
+    public static XmlObject getNestedObject(XmlObject xmlObject, String desiredElement) {
         XmlCursor cursor = xmlObject.newCursor();
-        XmlCursor end = xmlObject.newCursor();
         try {
-            while (cursor.hasNextToken()) {
-                if (cursor.isStart()) {
-                    String localName = cursor.getName().getLocalPart();
-                    if (localName.equals("gbean")
-                            || localName.equals("import")
-                            || localName.equals("dependency")
-                            || localName.equals("include")) {
-                        convertElementToSchema(cursor, end, GERONIMO_SERVICE_NAMESPACE);
-                    }
-                }
-                cursor.toNextToken();
+            if (findNestedElement(cursor, desiredElement)) {
+                XmlObject child = cursor.getObject();
+                //The copy seems to be needed to make the type change work for some documents!
+                return child.copy();
             }
         } finally {
             cursor.dispose();
-            end.dispose();
         }
-        return xmlObject;
+        throw new IllegalArgumentException("xmlobject did not have desired element: " + desiredElement + "/n" + xmlObject);
     }
 
-    public static XmlObject getNestedObject(XmlObject xmlObject, String desiredElement) {
-        XmlCursor cursor = xmlObject.newCursor();
-        try {
-            while (cursor.hasNextToken()) {
-                if (cursor.isStart()) {
-                    String localName = cursor.getName().getLocalPart();
-                    if (localName.equals(desiredElement)) {
-                        XmlObject child = cursor.getObject();
-                        //The copy seems to be needed to make the type change work for some documents!
-                        return child.copy();
-                    }
+    public static boolean findNestedElement(XmlCursor cursor, String desiredElement) {
+        while (cursor.hasNextToken()) {
+            if (cursor.isStart()) {
+                String localName = cursor.getName().getLocalPart();
+                if (localName.equals(desiredElement)) {
+                    return true;
                 }
-                cursor.toNextToken();
             }
-        } finally {
-            cursor.dispose();
+            cursor.toNextToken();
         }
-        throw new IllegalArgumentException("xmlobject did not have desired element: " + desiredElement + "/n" + xmlObject);
+        return false;
     }
 
     public static XmlObject getNestedObjectAsType(XmlObject xmlObject, String desiredElement, SchemaType type) {
         XmlCursor cursor = xmlObject.newCursor();
         try {
-            while (cursor.hasNextToken()) {
-                if (cursor.isStart()) {
-                    String localName = cursor.getName().getLocalPart();
-                    if (localName.equals(desiredElement)) {
-                        XmlObject child = cursor.getObject();
-                        //The copy seems to be needed to make the type change work for some documents!
-                        XmlObject result = child.copy().changeType(type);
-                        assert result.schemaType() == type;
-                        return result;
-                    }
-                }
-                cursor.toNextToken();
+            if (findNestedElement(cursor, desiredElement)) {
+                XmlObject child = cursor.getObject();
+                //The copy seems to be needed to make the type change work for some documents!
+                XmlObject result = child.copy().changeType(type);
+                assert result.schemaType() == type;
+                return result;
             }
         } finally {
             cursor.dispose();

Modified: geronimo/trunk/modules/j2ee-schema/src/test-data/geronimo/ejb-naming-post.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-schema/src/test-data/geronimo/ejb-naming-post.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-schema/src/test-data/geronimo/ejb-naming-post.xml (original)
+++ geronimo/trunk/modules/j2ee-schema/src/test-data/geronimo/ejb-naming-post.xml Wed Sep 28 15:09:15 2005
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 
-<openejb-jar configId="org/openejb/Itests" parentId="org/apache/geronimo/DefaultDatabase" xmlns="http://www.openejb.org/xml/ns/openejb-jar" xmlns:nam="http://geronimo.apache.org/xml/ns/naming">
+<openejb-jar configId="org/openejb/Itests" parentId="org/apache/geronimo/DefaultDatabase" xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.0" xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.0">
   <dependency>
     <uri>junit/jars/junit-3.8.jar</uri>
   </dependency>

Modified: geronimo/trunk/modules/j2ee-schema/src/test-data/geronimo/ejb-naming-pre.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-schema/src/test-data/geronimo/ejb-naming-pre.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-schema/src/test-data/geronimo/ejb-naming-pre.xml (original)
+++ geronimo/trunk/modules/j2ee-schema/src/test-data/geronimo/ejb-naming-pre.xml Wed Sep 28 15:09:15 2005
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 
 <openejb-jar
-    xmlns="http://www.openejb.org/xml/ns/openejb-jar"
+    xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.0"
     configId="org/openejb/Itests"
     parentId="org/apache/geronimo/DefaultDatabase">
 

Modified: geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java (original)
+++ geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java Wed Sep 28 15:09:15 2005
@@ -365,15 +365,20 @@
         File srcXml = new File(basedir, "src/test-data/geronimo/ejb-naming-pre.xml");
         File expectedOutputXml = new File(basedir, "src/test-data/geronimo/ejb-naming-post.xml");
         XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
-        xmlObject = SchemaConversionUtils.convertToGeronimoNamingSchema(xmlObject);
-        //        System.out.println(xmlObject.toString());
-        XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
-        List problems = new ArrayList();
-        boolean ok = compareXmlObjects(xmlObject, expected, problems);
-        assertTrue("Differences: " + problems, ok);
-        xmlObject = SchemaConversionUtils.convertToGeronimoNamingSchema(xmlObject);
-        boolean ok2 = compareXmlObjects(xmlObject, expected, problems);
-        assertTrue("Differences: " + problems, ok2);
+        XmlCursor cursor = xmlObject.newCursor();
+        try {
+            SchemaConversionUtils.convertToGeronimoSubSchemas(cursor);
+            //        System.out.println(xmlObject.toString());
+            XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
+            List problems = new ArrayList();
+            boolean ok = compareXmlObjects(xmlObject, expected, problems);
+            assertTrue("Differences: " + problems, ok);
+            SchemaConversionUtils.convertToGeronimoSubSchemas(cursor);
+            boolean ok2 = compareXmlObjects(xmlObject, expected, problems);
+            assertTrue("Differences: " + problems, ok2);
+        } finally {
+            cursor.dispose();
+        }
     }
 //
     public void testGetNestedObjectAsType() throws Exception {

Modified: geronimo/trunk/modules/jetty-builder/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/maven.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty-builder/maven.xml (original)
+++ geronimo/trunk/modules/jetty-builder/maven.xml Wed Sep 28 15:09:15 2005
@@ -25,7 +25,7 @@
 
     <preGoal name="java:compile">
         <xmlbeans:schema2java
-            maven.xmlbeans2.sourceschema="schema/geronimo-jetty.xsd"/>
+            maven.xmlbeans2.sourceschema="schema/geronimo-jetty-1.0.xsd,schema/geronimo-jetty-config-1.0.xsd"/>
         <mkdir dir="${basedir}/target/xmlbeans-classes"/>
         <mkdir dir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans"/>
         <copy todir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans">

Modified: geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java (original)
+++ geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java Wed Sep 28 15:09:15 2005
@@ -29,6 +29,7 @@
 import java.security.PermissionCollection;
 import java.security.Permissions;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
@@ -40,10 +41,8 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
-import java.util.Arrays;
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
-
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 import javax.security.jacc.WebResourcePermission;
@@ -51,16 +50,16 @@
 import javax.security.jacc.WebUserDataPermission;
 import javax.servlet.Servlet;
 import javax.transaction.UserTransaction;
-import javax.xml.namespace.QName;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.service.ServiceConfigBuilder;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.deployment.xbeans.DependencyType;
 import org.apache.geronimo.deployment.xbeans.GbeanType;
-import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
@@ -89,11 +88,11 @@
 import org.apache.geronimo.security.jacc.ComponentPermissions;
 import org.apache.geronimo.security.util.URLPattern;
 import org.apache.geronimo.transaction.context.OnlineUserTransaction;
-import org.apache.geronimo.xbeans.geronimo.web.GerWebAppDocument;
-import org.apache.geronimo.xbeans.geronimo.web.GerWebAppType;
-import org.apache.geronimo.xbeans.geronimo.web.GerContainerConfigType;
-import org.apache.geronimo.xbeans.geronimo.web.jetty.GerJettyConfigType;
+import org.apache.geronimo.web.deployment.GenericToSpecificPlanConverter;
 import org.apache.geronimo.xbeans.geronimo.naming.GerMessageDestinationType;
+import org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppDocument;
+import org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppType;
+import org.apache.geronimo.xbeans.geronimo.web.jetty.config.GerJettyDocument;
 import org.apache.geronimo.xbeans.j2ee.DispatcherType;
 import org.apache.geronimo.xbeans.j2ee.ErrorPageType;
 import org.apache.geronimo.xbeans.j2ee.FilterMappingType;
@@ -105,6 +104,7 @@
 import org.apache.geronimo.xbeans.j2ee.LocaleEncodingMappingListType;
 import org.apache.geronimo.xbeans.j2ee.LocaleEncodingMappingType;
 import org.apache.geronimo.xbeans.j2ee.LoginConfigType;
+import org.apache.geronimo.xbeans.j2ee.MessageDestinationType;
 import org.apache.geronimo.xbeans.j2ee.MimeMappingType;
 import org.apache.geronimo.xbeans.j2ee.ParamValueType;
 import org.apache.geronimo.xbeans.j2ee.RoleNameType;
@@ -119,7 +119,7 @@
 import org.apache.geronimo.xbeans.j2ee.WebAppType;
 import org.apache.geronimo.xbeans.j2ee.WebResourceCollectionType;
 import org.apache.geronimo.xbeans.j2ee.WelcomeFileListType;
-import org.apache.geronimo.xbeans.j2ee.MessageDestinationType;
+import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 import org.mortbay.http.BasicAuthenticator;
@@ -148,9 +148,7 @@
 
     private final Repository repository;
     private final Kernel kernel;
-    private static final String JETTY_CONFIG_NAMESPACE = "http://geronimo.apache.org/xml/ns/web/jetty";
-    private static final QName JETTY_CONFIG_QNAME = new QName(JETTY_CONFIG_NAMESPACE, "jetty");
-    private static final String JETTY_NAMESPACE = JETTY_CONFIG_NAMESPACE;//GerConnectorDocument.type.getDocumentElementName().getNamespaceURI();
+    private static final String JETTY_NAMESPACE = JettyWebAppDocument.type.getDocumentElementName().getNamespaceURI();//GerConnectorDocument.type.getDocumentElementName().getNamespaceURI();
 
     public JettyModuleBuilder(URI[] defaultParentId,
                               Integer defaultSessionTimeoutSeconds,
@@ -164,7 +162,7 @@
                               WebServiceBuilder webServiceBuilder,
                               Repository repository,
                               Kernel kernel) throws GBeanNotFoundException {
-        this.defaultParentId = defaultParentId == null? Collections.EMPTY_LIST: Arrays.asList(defaultParentId);
+        this.defaultParentId = defaultParentId == null ? Collections.EMPTY_LIST : Arrays.asList(defaultParentId);
 
         this.defaultSessionTimeoutSeconds = (defaultSessionTimeoutSeconds == null) ? new Integer(30 * 60) : defaultSessionTimeoutSeconds;
         this.defaultContextPriorityClassloader = defaultContextPriorityClassloader;
@@ -222,7 +220,7 @@
         //we found web.xml, if it won't parse that's an error.
         try {
             // parse it
-            XmlObject parsed = SchemaConversionUtils.parse(specDD);
+            XmlObject parsed = XmlBeansUtil.parse(specDD);
             WebAppDocument webAppDoc = SchemaConversionUtils.convertToServletSchema(parsed);
             webApp = webAppDoc.getWebApp();
         } catch (XmlException xmle) {
@@ -231,7 +229,7 @@
         check(webApp);
 
         // parse vendor dd
-        GerWebAppType jettyWebApp = getJettyWebApp(plan, moduleFile, standAlone, targetPath, webApp);
+        JettyWebAppType jettyWebApp = getJettyWebApp(plan, moduleFile, standAlone, targetPath, webApp);
         if (contextRoot == null) {
             if (jettyWebApp.isSetContextRoot()) {
                 contextRoot = jettyWebApp.getContextRoot();
@@ -263,7 +261,7 @@
         if (parentId.isEmpty()) {
             parentId = new ArrayList(defaultParentId);
         }
-        WebModule module = new WebModule(standAlone, configId, parentId, moduleFile, targetPath, webApp, jettyWebApp, specDD, contextRoot, portMap);
+        WebModule module = new WebModule(standAlone, configId, parentId, moduleFile, targetPath, webApp, jettyWebApp, specDD, contextRoot, portMap, JETTY_NAMESPACE);
         return module;
     }
 
@@ -287,58 +285,54 @@
         return map;
     }
 
-    GerWebAppType getJettyWebApp(Object plan, JarFile moduleFile, boolean standAlone, String targetPath, WebAppType webApp) throws DeploymentException {
-        GerWebAppType jettyWebApp = null;
+    JettyWebAppType getJettyWebApp(Object plan, JarFile moduleFile, boolean standAlone, String targetPath, WebAppType webApp) throws DeploymentException {
+        XmlObject rawPlan = null;
         try {
             // load the geronimo-web.xml from either the supplied plan or from the earFile
             try {
                 if (plan instanceof XmlObject) {
-                    XmlObject object = SchemaConversionUtils.getNestedObject((XmlObject) plan, "web-app");
-                    jettyWebApp = TemporaryPlanAdapter.convertJettyElementToWeb(object);
+                    rawPlan = (XmlObject) plan;//SchemaConversionUtils.getNestedObject((XmlObject) plan, "web-app");
                 } else {
-                    GerWebAppDocument jettyWebAppdoc = null;
                     if (plan != null) {
-                        XmlObject object = SchemaConversionUtils.parse(((File) plan).toURL());
-                        jettyWebAppdoc = TemporaryPlanAdapter.convertJettyDocumentToWeb(object);
+                        rawPlan = XmlBeansUtil.parse(((File) plan).toURL());
                     } else {
                         URL path = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/geronimo-web.xml");
                         try {
-                            jettyWebAppdoc = GerWebAppDocument.Factory.parse(path);
+                            rawPlan = XmlBeansUtil.parse(path);
                         } catch (FileNotFoundException e) {
                             path = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/geronimo-jetty.xml");
                             try {
-                                XmlObject object = SchemaConversionUtils.parse(path);
-                                if (object != null) {
-                                    log.error("Incorrect deployment plan naming: found geronimo-jetty.xml, should be geronimo-web.xml");
-                                    jettyWebAppdoc = TemporaryPlanAdapter.convertJettyDocumentToWeb(object);
-                                }
+                                rawPlan = XmlBeansUtil.parse(path);
                             } catch (FileNotFoundException e1) {
                                 log.warn("Web application does not contain a WEB-INF/geronimo-web.xml deployment plan.  This may or may not be a problem, depending on whether you have things like resource references that need to be resolved.  You can also give the deployer a separate deployment plan file on the command line.");
                             }
                         }
                     }
-                    if (jettyWebAppdoc != null) {
-                        jettyWebApp = jettyWebAppdoc.getWebApp();
-                    }
                 }
             } catch (IOException e) {
                 log.warn(e);
             }
 
-            // if we got one extract and validate it otherwise create a default one
-            if (jettyWebApp != null) {
-                jettyWebApp = (GerWebAppType) SchemaConversionUtils.convertToGeronimoNamingSchema(jettyWebApp);
-                jettyWebApp = (GerWebAppType) SchemaConversionUtils.convertToGeronimoSecuritySchema(jettyWebApp);
-                jettyWebApp = (GerWebAppType) SchemaConversionUtils.convertToGeronimoServiceSchema(jettyWebApp);
-                SchemaConversionUtils.validateDD(jettyWebApp);
+            JettyWebAppType jettyWebApp = null;
+            if (rawPlan != null) {
+                XmlCursor cursor = rawPlan.newCursor();
+                try {
+                    new GenericToSpecificPlanConverter(GerJettyDocument.type.getDocumentElementName().getNamespaceURI(),
+                            JettyWebAppDocument.type.getDocumentElementName().getNamespaceURI()).convertToSpecificPlan(cursor);
+                    SchemaConversionUtils.findNestedElement(cursor, "web-app");
+                    jettyWebApp = (JettyWebAppType) cursor.getObject().copy().changeType(JettyWebAppType.type);
+                    SchemaConversionUtils.validateDD(jettyWebApp);
+                } finally {
+                    cursor.dispose();
+                }
             } else {
                 String defaultContextRoot = determineDefaultContextRoot(webApp, standAlone, moduleFile, targetPath);
                 jettyWebApp = createDefaultPlan(defaultContextRoot);
             }
+            return jettyWebApp;
         } catch (XmlException e) {
             throw new DeploymentException("xml problem", e);
         }
-        return jettyWebApp;
     }
 
     private String determineDefaultContextRoot(WebAppType webApp, boolean isStandAlone, JarFile moduleFile, String targetPath) {
@@ -372,8 +366,8 @@
         return path;
     }
 
-    private GerWebAppType createDefaultPlan(String contextRoot) {
-        GerWebAppType jettyWebApp = GerWebAppType.Factory.newInstance();
+    private JettyWebAppType createDefaultPlan(String contextRoot) {
+        JettyWebAppType jettyWebApp = JettyWebAppType.Factory.newInstance();
 
         // set the parentId, configId and context root
         jettyWebApp.setConfigId(contextRoot);
@@ -406,7 +400,7 @@
             earContext.addManifestClassPath(warFile, URI.create(module.getTargetPath()));
 
             // add the dependencies declared in the geronimo-web.xml file
-            GerWebAppType jettyWebApp = (GerWebAppType) module.getVendorDD();
+            JettyWebAppType jettyWebApp = (JettyWebAppType) module.getVendorDD();
             DependencyType[] dependencies = jettyWebApp.getDependencyArray();
             ServiceConfigBuilder.addDependencies(earContext, dependencies, repository);
         } catch (IOException e) {
@@ -419,7 +413,7 @@
     public void initContext(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {
         WebAppType webApp = (WebAppType) module.getSpecDD();
         MessageDestinationType[] messageDestinations = webApp.getMessageDestinationArray();
-        GerWebAppType gerWebApp = (GerWebAppType) module.getVendorDD();
+        JettyWebAppType gerWebApp = (JettyWebAppType) module.getVendorDD();
         GerMessageDestinationType[] gerMessageDestinations = gerWebApp.getMessageDestinationArray();
 
         ENCConfigBuilder.registerMessageDestinations(earContext.getRefContext(), module.getName(), messageDestinations, gerMessageDestinations);
@@ -431,7 +425,7 @@
         WebModule webModule = (WebModule) module;
 
         WebAppType webApp = (WebAppType) webModule.getSpecDD();
-        GerWebAppType jettyWebApp = (GerWebAppType) webModule.getVendorDD();
+        JettyWebAppType jettyWebApp = (JettyWebAppType) webModule.getVendorDD();
 
         boolean contextPriorityClassLoader = defaultContextPriorityClassloader;
         if (jettyWebApp.isSetContextPriorityClassloader()) {
@@ -467,21 +461,11 @@
 
             webModuleData.setAttribute("uri", URI.create(module.getTargetPath() + "/"));
 
-            if (jettyWebApp.isSetContainerConfig()) {
-                GerContainerConfigType containerConfig = jettyWebApp.getContainerConfig();
-                XmlObject[] anys = containerConfig.selectChildren(JETTY_CONFIG_QNAME);
-                if (anys.length > 1) {
-                    throw new DeploymentException("More than one jetty configuration element: " + anys);
-                }
-                if (anys.length == 1) {
-                    GerJettyConfigType jettyConfigType = (GerJettyConfigType) anys[0].copy().changeType(GerJettyConfigType.type);
-                    String[] hosts = jettyConfigType.getVirtualHostArray();
-                    for (int i = 0; i < hosts.length; i++) {
-                        hosts[i] = hosts[i].trim();
-                    }
-                    webModuleData.setAttribute("virtualHosts", hosts);
-                }
+            String[] hosts = jettyWebApp.getVirtualHostArray();
+            for (int i = 0; i < hosts.length; i++) {
+                hosts[i] = hosts[i].trim();
             }
+            webModuleData.setAttribute("virtualHosts", hosts);
 
             webModuleData.setAttribute("componentContext", compContext);
             webModuleData.setAttribute("userTransaction", userTransaction);
@@ -1274,7 +1258,7 @@
         }
     }
 
-    private Map buildComponentContext(EARContext earContext, Module webModule, WebAppType webApp, GerWebAppType jettyWebApp, UserTransaction userTransaction, ClassLoader cl) throws DeploymentException {
+    private Map buildComponentContext(EARContext earContext, Module webModule, WebAppType webApp, JettyWebAppType jettyWebApp, UserTransaction userTransaction, ClassLoader cl) throws DeploymentException {
         return ENCConfigBuilder.buildComponentContext(earContext,
                 earContext,
                 webModule,

Added: geronimo/trunk/modules/jetty-builder/src/schema/geronimo-jetty-1.0.xsd
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/schema/geronimo-jetty-1.0.xsd?rev=292333&view=auto
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/schema/geronimo-jetty-1.0.xsd (added)
+++ geronimo/trunk/modules/jetty-builder/src/schema/geronimo-jetty-1.0.xsd Wed Sep 28 15:09:15 2005
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2004-2005 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.
+-->
+
+<xs:schema
+    xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0"
+    targetNamespace="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0"
+    xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.0"
+    xmlns:security="http://geronimo.apache.org/xml/ns/security-1.0"
+    xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.0"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    elementFormDefault="qualified"
+    attributeFormDefault="unqualified"
+    version="1.0">
+
+    <xs:import namespace="http://geronimo.apache.org/xml/ns/naming-1.0" schemaLocation="schema/geronimo-naming-1.0.xsd"/>
+    <xs:import namespace="http://geronimo.apache.org/xml/ns/security-1.0" schemaLocation="schema/geronimo-security-1.0.xsd"/>
+    <xs:import namespace="http://geronimo.apache.org/xml/ns/deployment-1.0" schemaLocation="schema/geronimo-config-1.0.xsd"/>
+
+    <xs:element name="web-app" type="web:web-appType"/>
+
+
+    <xs:complexType name="web-appType">
+        <xs:sequence>
+            <xs:element ref="sys:import" minOccurs="0" maxOccurs="unbounded"/>
+            <xs:element ref="sys:dependency" minOccurs="0" maxOccurs="unbounded"/>
+
+            <xs:element name="context-root" type="xs:string" minOccurs="0"/>
+            <xs:element name="context-priority-classloader" type="xs:boolean" minOccurs="0"/>
+            <xs:element name="virtual-host" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+
+            <xs:group ref="naming:jndiEnvironmentRefsGroup"/>
+            <xs:element ref="naming:message-destination" minOccurs="0" maxOccurs="unbounded"/>
+
+            <xs:sequence minOccurs="0">
+                <xs:element name="security-realm-name" type="xs:string"/>
+                <xs:element ref="security:security" minOccurs="0"/>
+            </xs:sequence>
+
+            <xs:element ref="sys:gbean" minOccurs="0" maxOccurs="unbounded"/>
+
+        </xs:sequence>
+        <xs:attribute name="configId" type="xs:string" use="required"/>
+        <xs:attribute name="parentId" type="xs:string" use="optional"/>
+    </xs:complexType>
+
+    <xs:complexType name="container-configType">
+        <xs:sequence>
+            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+</xs:schema>

Added: geronimo/trunk/modules/jetty-builder/src/schema/geronimo-jetty-config-1.0.xsd
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/schema/geronimo-jetty-config-1.0.xsd?rev=292333&view=auto
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/schema/geronimo-jetty-config-1.0.xsd (added)
+++ geronimo/trunk/modules/jetty-builder/src/schema/geronimo-jetty-config-1.0.xsd Wed Sep 28 15:09:15 2005
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2005 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.
+-->
+
+<xs:schema
+    xmlns:jetty="http://geronimo.apache.org/xml/ns/web/jetty/config-1.0"
+    targetNamespace="http://geronimo.apache.org/xml/ns/web/jetty/config-1.0"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    elementFormDefault="qualified"
+    attributeFormDefault="unqualified"
+    version="1.0">
+
+    <xs:element name="jetty" type="jetty:jetty-configType"/>
+
+    <xs:complexType name="jetty-configType">
+        <xs:sequence>
+            <xs:element name="virtual-host" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+</xs:schema>

Modified: geronimo/trunk/modules/jetty-builder/src/schema/xmlconfig.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/schema/xmlconfig.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/schema/xmlconfig.xml (original)
+++ geronimo/trunk/modules/jetty-builder/src/schema/xmlconfig.xml Wed Sep 28 15:09:15 2005
@@ -17,8 +17,12 @@
 -->
 <!-- @version $Rev: 57116 $ $Date: 2004-11-09 18:34:38 -0700 (Tue, 09 Nov 2004) $ -->
 <xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config">
-    <xb:namespace uri="http://geronimo.apache.org/xml/ns/web/jetty">
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0">
         <xb:package>org.apache.geronimo.xbeans.geronimo.web.jetty</xb:package>
+        <xb:prefix>Jetty</xb:prefix>
+    </xb:namespace>
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/web/jetty/config-1.0">
+        <xb:package>org.apache.geronimo.xbeans.geronimo.web.jetty.config</xb:package>
         <xb:prefix>Ger</xb:prefix>
     </xb:namespace>
 </xb:config>

Modified: geronimo/trunk/modules/jetty-builder/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml (original)
+++ geronimo/trunk/modules/jetty-builder/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml Wed Sep 28 15:09:15 2005
@@ -6,9 +6,9 @@
     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.
@@ -17,7 +17,7 @@
 -->
 
 <jetty:web-app
-    xmlns:jetty="http://geronimo.apache.org/xml/ns/web"
+    xmlns:jetty="http://geronimo.apache.org/xml/ns/j2ee/web-1.0"
     configId="org/apache/geronimo/jetty/Test"
     >
     <jetty:context-root>/test</jetty:context-root>

Modified: geronimo/trunk/modules/jetty-builder/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml (original)
+++ geronimo/trunk/modules/jetty-builder/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml Wed Sep 28 15:09:15 2005
@@ -6,9 +6,9 @@
     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.
@@ -17,8 +17,8 @@
 -->
 
 <web-app
-    xmlns="http://geronimo.apache.org/xml/ns/web"
-    xmlns:sec="http://geronimo.apache.org/xml/ns/security"
+    xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0"
+    xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.0"
     configId="org/apache/geronimo/test">
 
     <context-root>/test</context-root>

Modified: geronimo/trunk/modules/jetty-builder/src/test-resources/deployables/war5/WEB-INF/geronimo-jetty.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test-resources/deployables/war5/WEB-INF/geronimo-jetty.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test-resources/deployables/war5/WEB-INF/geronimo-jetty.xml (original)
+++ geronimo/trunk/modules/jetty-builder/src/test-resources/deployables/war5/WEB-INF/geronimo-jetty.xml Wed Sep 28 15:09:15 2005
@@ -6,9 +6,9 @@
     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.
@@ -17,20 +17,20 @@
 -->
 
 <web-app
-    xmlns="http://geronimo.apache.org/xml/ns/web/jetty"
-    xmlns:sec="http://geronimo.apache.org/xml/ns/security"
+    xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0"
+    xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.0"
     configId="org/apache/geronimo/test">
 
     <context-root>/test</context-root>
     <context-priority-classloader>false</context-priority-classloader>
+    <resource-ref>
+        <ref-name>jdbc/DB1</ref-name>
+        <target-name>DefaultDatabase</target-name>
+    </resource-ref>
     <security-realm-name>demo-properties-realm</security-realm-name>
     <sec:security>
         <sec:default-principal realm-name="demo-properties-realm">
             <sec:principal class="org.apache.geronimo.security.realm.providers.PropertiesFileUserPrincipal" name="izumi"/>
         </sec:default-principal>
     </sec:security>
-    <resource-ref>
-        <ref-name>jdbc/DB1</ref-name>
-        <target-name>DefaultDatabase</target-name>
-    </resource-ref>
 </web-app>

Modified: geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan1.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan1.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan1.xml (original)
+++ geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan1.xml Wed Sep 28 15:09:15 2005
@@ -1,8 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns="http://geronimo.apache.org/xml/ns/web"
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0"
     configId="goodservlet"
     parentId="org/apache/geronimo/DefaultDatabase">
     <context-priority-classloader>false</context-priority-classloader>
+    <resource-ref>
+        <ref-name>jdbc/DB1</ref-name>
+        <target-name>DefaultDatabase</target-name>
+    </resource-ref>
     <security-realm-name>public-properties-realm</security-realm-name>
     <security default-role="UNASSIGNED" doas-current-caller="true">
         <default-principal realm-name="public-properties-realm">
@@ -41,8 +45,4 @@
             </role>
         </role-mappings>
     </security>
-    <resource-ref>
-        <ref-name>jdbc/DB1</ref-name>
-        <target-name>DefaultDatabase</target-name>
-    </resource-ref>
 </web-app>

Added: geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan1A.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan1A.xml?rev=292333&view=auto
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan1A.xml (added)
+++ geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan1A.xml Wed Sep 28 15:09:15 2005
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0"
+    configId="goodservlet"
+    parentId="org/apache/geronimo/DefaultDatabase">
+    <context-priority-classloader>false</context-priority-classloader>
+    <security-realm-name>public-properties-realm</security-realm-name>
+    <security default-role="UNASSIGNED" doas-current-caller="true">
+        <default-principal realm-name="public-properties-realm">
+            <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="guest"/>
+        </default-principal>
+
+        <role-mappings>
+            <role role-name="UNASSIGNED">
+                <realm realm-name="public-properties-realm">
+                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="guest" designated-run-as="true"/>
+                </realm>
+            </role>
+
+            <role role-name="LOW">
+                <realm realm-name="public-properties-realm">
+                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="acct" designated-run-as="true"/>
+                </realm>
+                <distinguished-name name="CN=Duke, OU=Java Software, O=Sun Microsystems\, Inc., L=Palo Alto, ST=CA, C=US"/>
+            </role>
+
+            <role role-name="MEDIUM">
+                <realm realm-name="public-properties-realm">
+                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="it"/>
+                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="george" designated-run-as="true"/>
+                </realm>
+            </role>
+
+            <role role-name="HIGH">
+                <realm realm-name="public-properties-realm">
+                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="mgmt" designated-run-as="true"/>
+                </realm>
+                <realm realm-name="black-properties-realm">
+                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="dain"/>
+                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="david"/>
+                </realm>
+            </role>
+        </role-mappings>
+    </security>
+    <resource-ref>
+        <ref-name>jdbc/DB1</ref-name>
+        <target-name>DefaultDatabase</target-name>
+    </resource-ref>
+</web-app>

Added: geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan1B.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan1B.xml?rev=292333&view=auto
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan1B.xml (added)
+++ geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan1B.xml Wed Sep 28 15:09:15 2005
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0"
+    configId="goodservlet"
+    parentId="org/apache/geronimo/DefaultDatabase">
+    <context-priority-classloader>false</context-priority-classloader>
+    <security-realm-name>public-properties-realm</security-realm-name>
+    <security default-role="UNASSIGNED" doas-current-caller="true">
+        <default-principal realm-name="public-properties-realm">
+            <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="guest"/>
+        </default-principal>
+
+        <role-mappings>
+            <role role-name="UNASSIGNED">
+                <realm realm-name="public-properties-realm">
+                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="guest" designated-run-as="true"/>
+                </realm>
+            </role>
+
+            <role role-name="LOW">
+                <realm realm-name="public-properties-realm">
+                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="acct" designated-run-as="true"/>
+                </realm>
+                <distinguished-name name="CN=Duke, OU=Java Software, O=Sun Microsystems\, Inc., L=Palo Alto, ST=CA, C=US"/>
+            </role>
+
+            <role role-name="MEDIUM">
+                <realm realm-name="public-properties-realm">
+                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="it"/>
+                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="george" designated-run-as="true"/>
+                </realm>
+            </role>
+
+            <role role-name="HIGH">
+                <realm realm-name="public-properties-realm">
+                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="mgmt" designated-run-as="true"/>
+                </realm>
+                <realm realm-name="black-properties-realm">
+                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="dain"/>
+                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="david"/>
+                </realm>
+            </role>
+        </role-mappings>
+    </security>
+    <resource-ref>
+        <ref-name>jdbc/DB1</ref-name>
+        <target-name>DefaultDatabase</target-name>
+    </resource-ref>
+    <gbean name="foo" class="org.apache.geronimo.Foo"/>
+</web-app>

Added: geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan1C.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan1C.xml?rev=292333&view=auto
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan1C.xml (added)
+++ geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan1C.xml Wed Sep 28 15:09:15 2005
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0"
+    configId="goodservlet"
+    parentId="org/apache/geronimo/DefaultDatabase">
+    <context-priority-classloader>false</context-priority-classloader>
+    <security-realm-name>public-properties-realm</security-realm-name>
+    <security default-role="UNASSIGNED" doas-current-caller="true">
+        <default-principal realm-name="public-properties-realm">
+            <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="guest"/>
+        </default-principal>
+
+        <role-mappings>
+            <role role-name="UNASSIGNED">
+                <realm realm-name="public-properties-realm">
+                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="guest" designated-run-as="true"/>
+                </realm>
+            </role>
+
+            <role role-name="LOW">
+                <realm realm-name="public-properties-realm">
+                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="acct" designated-run-as="true"/>
+                </realm>
+                <distinguished-name name="CN=Duke, OU=Java Software, O=Sun Microsystems\, Inc., L=Palo Alto, ST=CA, C=US"/>
+            </role>
+
+            <role role-name="MEDIUM">
+                <realm realm-name="public-properties-realm">
+                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="it"/>
+                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="george" designated-run-as="true"/>
+                </realm>
+            </role>
+
+            <role role-name="HIGH">
+                <realm realm-name="public-properties-realm">
+                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="mgmt" designated-run-as="true"/>
+                </realm>
+                <realm realm-name="black-properties-realm">
+                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="dain"/>
+                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="david"/>
+                </realm>
+            </role>
+        </role-mappings>
+    </security>
+</web-app>

Modified: geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan2.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan2.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan2.xml (original)
+++ geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan2.xml Wed Sep 28 15:09:15 2005
@@ -1,8 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns="http://geronimo.apache.org/xml/ns/web/jetty"
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0"
     configId="goodservlet"
     parentId="org/apache/geronimo/DefaultDatabase">
     <context-priority-classloader>false</context-priority-classloader>
+    <resource-ref>
+        <ref-name>jdbc/DB1</ref-name>
+        <target-name>DefaultDatabase</target-name>
+    </resource-ref>
     <security-realm-name>public-properties-realm</security-realm-name>
     <security default-role="UNASSIGNED" doas-current-caller="true">
         <default-principal realm-name="public-properties-realm">
@@ -41,8 +45,4 @@
             </role>
         </role-mappings>
     </security>
-    <resource-ref>
-        <ref-name>jdbc/DB1</ref-name>
-        <target-name>DefaultDatabase</target-name>
-    </resource-ref>
 </web-app>

Modified: geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan3.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan3.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan3.xml (original)
+++ geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan3.xml Wed Sep 28 15:09:15 2005
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns="http://geronimo.apache.org/xml/ns/web/jetty"
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0"
     configId="goodservlet"
     parentId="org/apache/geronimo/DefaultDatabase">
 

Added: geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan4-converted.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan4-converted.xml?rev=292333&view=auto
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan4-converted.xml (added)
+++ geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan4-converted.xml Wed Sep 28 15:09:15 2005
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0"
+    configId="goodservlet"
+    parentId="org/apache/geronimo/DefaultDatabase">
+
+    <context-priority-classloader>true</context-priority-classloader>
+
+            <virtual-host>foo</virtual-host>
+            <virtual-host>bar</virtual-host>
+
+</web-app>

Modified: geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan4.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan4.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan4.xml (original)
+++ geronimo/trunk/modules/jetty-builder/src/test-resources/plans/plan4.xml Wed Sep 28 15:09:15 2005
@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns="http://geronimo.apache.org/xml/ns/web"
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0"
     configId="goodservlet"
     parentId="org/apache/geronimo/DefaultDatabase">
 
     <context-priority-classloader>true</context-priority-classloader>
 
     <container-config>
-        <jetty xmlns="http://geronimo.apache.org/xml/ns/web/jetty">
+        <jetty xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0/config">
             <virtual-host>foo</virtual-host>
             <virtual-host>bar</virtual-host>
         </jetty>

Modified: geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java (original)
+++ geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java Wed Sep 28 15:09:15 2005
@@ -3,19 +3,28 @@
 import java.io.File;
 import java.net.URI;
 import java.util.HashSet;
+import java.util.List;
+import java.util.ArrayList;
 import java.util.jar.JarFile;
 import javax.management.ObjectName;
 
 import junit.framework.TestCase;
 import org.apache.geronimo.deployment.util.UnpackedJarFile;
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefType;
 import org.apache.geronimo.xbeans.geronimo.web.GerWebAppDocument;
 import org.apache.geronimo.xbeans.geronimo.web.GerWebAppType;
+import org.apache.geronimo.xbeans.geronimo.web.jetty.config.GerJettyDocument;
+import org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppDocument;
+import org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppType;
 import org.apache.geronimo.xbeans.j2ee.WebAppDocument;
 import org.apache.geronimo.xbeans.j2ee.WebAppType;
+import org.apache.geronimo.web.deployment.GenericToSpecificPlanConverter;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.XmlCursor;
 
 /**
  */
@@ -27,21 +36,45 @@
     private File basedir = new File(System.getProperty("basedir", "."));
 
     public PlanParsingTest() throws Exception {
-        builder = new JettyModuleBuilder(new URI[] {URI.create("defaultParent")}, new Integer(1800), false, null, jettyContainerObjectName, new HashSet(), new HashSet(), new HashSet(), pojoWebServiceTemplate, webServiceBuilder, null, null);
+        builder = new JettyModuleBuilder(new URI[]{URI.create("defaultParent")}, new Integer(1800), false, null, jettyContainerObjectName, new HashSet(), new HashSet(), new HashSet(), pojoWebServiceTemplate, webServiceBuilder, null, null);
     }
 
     public void testContents() throws Exception {
         File resourcePlan = new File(basedir, "src/test-resources/plans/plan1.xml");
         assertTrue(resourcePlan.exists());
-        GerWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, true, null, null);
+        JettyWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, true, null, null);
         assertEquals(1, jettyWebApp.getResourceRefArray().length);
         assertEquals(4, jettyWebApp.getSecurity().getRoleMappings().getRoleArray().length);
     }
 
+    public void testMoveSecurity1() throws Exception {
+        File resourcePlan = new File(basedir, "src/test-resources/plans/plan1A.xml");
+        assertTrue(resourcePlan.exists());
+        JettyWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, true, null, null);
+        assertEquals(1, jettyWebApp.getResourceRefArray().length);
+        assertEquals(4, jettyWebApp.getSecurity().getRoleMappings().getRoleArray().length);
+    }
+
+    public void testMoveSecurity2() throws Exception {
+        File resourcePlan = new File(basedir, "src/test-resources/plans/plan1B.xml");
+        assertTrue(resourcePlan.exists());
+        JettyWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, true, null, null);
+        assertEquals(1, jettyWebApp.getResourceRefArray().length);
+        assertEquals(4, jettyWebApp.getSecurity().getRoleMappings().getRoleArray().length);
+    }
+
+    public void testMoveSecurity3() throws Exception {
+        File resourcePlan = new File(basedir, "src/test-resources/plans/plan1C.xml");
+        assertTrue(resourcePlan.exists());
+        JettyWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, true, null, null);
+        assertEquals(4, jettyWebApp.getSecurity().getRoleMappings().getRoleArray().length);
+//        System.out.println(jettyWebApp.xmlText());
+    }
+
     public void testOldFormat() throws Exception {
         File resourcePlan = new File(basedir, "src/test-resources/plans/plan2.xml");
         assertTrue(resourcePlan.exists());
-        GerWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, true, null, null);
+        JettyWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, true, null, null);
         assertEquals(1, jettyWebApp.getResourceRefArray().length);
         assertEquals(4, jettyWebApp.getSecurity().getRoleMappings().getRoleArray().length);
     }
@@ -50,39 +83,39 @@
         File war = new File(basedir, "src/test-resources/deployables/war5");
         assertTrue(war.exists());
         UnpackedJarFile moduleFile = new UnpackedJarFile(war);
-        GerWebAppType jettyWebApp = builder.getJettyWebApp(null, moduleFile, true, null, null);
+        JettyWebAppType jettyWebApp = builder.getJettyWebApp(null, moduleFile, true, null, null);
         moduleFile.close();
         assertEquals(1, jettyWebApp.getResourceRefArray().length);
     }
 
-    public void testOldFormatPackaged() throws Exception {
+    public void XtestOldFormatPackaged() throws Exception {
         File war = new File(basedir, "src/test-resources/deployables/war6.war");
         assertTrue(war.exists());
         JarFile moduleFile = new JarFile(war);
-        GerWebAppType jettyWebApp = builder.getJettyWebApp(null, moduleFile, true, null, null);
+        JettyWebAppType jettyWebApp = builder.getJettyWebApp(null, moduleFile, true, null, null);
         moduleFile.close();
         assertEquals(1, jettyWebApp.getResourceRefArray().length);
     }
 
     public void testConstructPlan() throws Exception {
-        GerWebAppDocument jettyWebAppDoc = GerWebAppDocument.Factory.newInstance();
-        GerWebAppType GerWebAppType = jettyWebAppDoc.addNewWebApp();
-        GerWebAppType.setConfigId("configId");
-        GerWebAppType.setParentId("parentId");
-        GerWebAppType.setContextPriorityClassloader(false);
-        GerResourceRefType ref = GerWebAppType.addNewResourceRef();
+        JettyWebAppDocument jettyWebAppDoc = JettyWebAppDocument.Factory.newInstance();
+        JettyWebAppType webApp = jettyWebAppDoc.addNewWebApp();
+        webApp.setConfigId("configId");
+        webApp.setParentId("parentId");
+        webApp.setContextPriorityClassloader(false);
+        GerResourceRefType ref = webApp.addNewResourceRef();
         ref.setRefName("ref");
         ref.setTargetName("target");
 
-        SchemaConversionUtils.validateDD(GerWebAppType);
-        System.out.println(GerWebAppType.toString());
+        SchemaConversionUtils.validateDD(webApp);
+        System.out.println(webApp.toString());
     }
 
     public void testContextPriorityClassloader() throws Exception {
         File resourcePlan = new File(basedir, "src/test-resources/plans/plan3.xml");
         assertTrue(resourcePlan.exists());
 
-        GerWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, false, null, null);
+        JettyWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, false, null, null);
         assertFalse(jettyWebApp.getContextPriorityClassloader());
     }
 
@@ -90,31 +123,31 @@
         File resourcePlan = new File(basedir, "src/test-resources/plans/plan4.xml");
         assertTrue(resourcePlan.exists());
 
-        GerWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, false, null, null);
+        JettyWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, false, null, null);
         assertTrue(jettyWebApp.getContextPriorityClassloader());
 
     }
 
     public void testContextRootWithPlanAndContextSet() throws Exception {
 
-        GerWebAppDocument jettyWebAppDoc = GerWebAppDocument.Factory.newInstance();
-        GerWebAppType GerWebAppType = jettyWebAppDoc.addNewWebApp();
-        GerWebAppType.setConfigId("myId");
-        GerWebAppType.setContextRoot("myContextRoot");
-        GerWebAppType.setContextPriorityClassloader(false);
+        JettyWebAppDocument jettyWebAppDoc = JettyWebAppDocument.Factory.newInstance();
+        JettyWebAppType webApp = jettyWebAppDoc.addNewWebApp();
+        webApp.setConfigId("myId");
+        webApp.setContextRoot("myContextRoot");
+        webApp.setContextPriorityClassloader(false);
 
         JarFile dummyFile = new JarFile(new File(basedir, "src/test-resources/deployables/war2.war"));
 
-        GerWebAppType = builder.getJettyWebApp(GerWebAppType, dummyFile, true, null, null);
+        webApp = builder.getJettyWebApp(webApp, dummyFile, true, null, null);
 
-        assertEquals("myContextRoot", GerWebAppType.getContextRoot());
+        assertEquals("myContextRoot", webApp.getContextRoot());
 
     }
 
     public void testContextRootWithoutPlanStandAlone() throws Exception {
 
         JarFile dummyFile = new JarFile(new File(basedir, "src/test-resources/deployables/war2.war"));
-        GerWebAppType GerWebAppType = builder.getJettyWebApp(null, dummyFile, true, null, null);
+        JettyWebAppType GerWebAppType = builder.getJettyWebApp(null, dummyFile, true, null, null);
 
         assertEquals("war2", GerWebAppType.getContextRoot());
 
@@ -123,7 +156,7 @@
     public void testContextRootWithoutPlanAndTargetPath() throws Exception {
 
         JarFile dummyFile = new JarFile(new File(basedir, "src/test-resources/deployables/war2.war"));
-        GerWebAppType GerWebAppType = builder.getJettyWebApp(null, dummyFile, false, "myTargetPath", null);
+        JettyWebAppType GerWebAppType = builder.getJettyWebApp(null, dummyFile, false, "myTargetPath", null);
 
         assertEquals("myTargetPath", GerWebAppType.getContextRoot());
 
@@ -136,13 +169,68 @@
         webAppType.setId("myId");
 
         JarFile dummyFile = new JarFile(new File(basedir, "src/test-resources/deployables/war2.war"));
-        GerWebAppType GerWebAppType = builder.getJettyWebApp(null, dummyFile, false, "myTargetPath", webAppType);
+        JettyWebAppType GerWebAppType = builder.getJettyWebApp(null, dummyFile, false, "myTargetPath", webAppType);
 
         assertEquals("myId", GerWebAppType.getContextRoot());
 
     }
 
-     public void testParseSpecDD() {
+    public void testParseSpecDD() {
+
+    }
 
+    public void testConvertToJettySchema() throws Exception {
+        File resourcePlan = new File(basedir, "src/test-resources/plans/plan4.xml");
+        assertTrue(resourcePlan.exists());
+        XmlObject plan = XmlBeansUtil.parse(resourcePlan.toURL());
+        XmlCursor cursor = plan.newCursor();
+        try {
+        new GenericToSpecificPlanConverter(GerJettyDocument.type.getDocumentElementName().getNamespaceURI(),
+                JettyWebAppDocument.type.getDocumentElementName().getNamespaceURI()).convertToSpecificPlan(cursor);
+        } finally {
+            cursor.dispose();
+        }
+        File ConvertedPlan = new File(basedir, "src/test-resources/plans/plan4-converted.xml");
+        assertTrue(ConvertedPlan.exists());
+        XmlObject converted = XmlBeansUtil.parse(ConvertedPlan.toURL());
+        XmlCursor c = converted.newCursor();
+        SchemaConversionUtils.findNestedElement(c, "web-app");
+        ArrayList problems = new ArrayList();
+        compareXmlObjects(plan, c, problems);
+        assertEquals("problems: " + problems, 0, problems.size());
+    }
+
+    private boolean compareXmlObjects(XmlObject xmlObject, XmlCursor expected, List problems) {
+        XmlCursor test = xmlObject.newCursor();
+        boolean similar = true;
+        int elementCount = 0;
+        while (toNextStartToken(test)) {
+            elementCount++;
+            if (!toNextStartToken(expected)) {
+                problems.add("test longer than expected at element: " + elementCount);
+                return false;
+            }
+            String actualChars = test.getName().getLocalPart();
+            String expectedChars = expected.getName().getLocalPart();
+            if (!actualChars.equals(expectedChars)) {
+                problems.add("Different elements at elementCount: " + elementCount + ", test: " + actualChars + ", expected: " + expectedChars);
+                similar = false;
+            }
+            test.toNextToken();
+            expected.toNextToken();
+        }
+        return similar;
+    }
+
+    private boolean toNextStartToken(XmlCursor cursor) {
+        while (!cursor.isStart()) {
+            if (!cursor.hasNextToken()) {
+                return false;
+            }
+            cursor.toNextToken();
+        }
+        return true;
     }
+
+
 }

Modified: geronimo/trunk/modules/jetty/src/etc/META-INF/geronimo-service.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/etc/META-INF/geronimo-service.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty/src/etc/META-INF/geronimo-service.xml (original)
+++ geronimo/trunk/modules/jetty/src/etc/META-INF/geronimo-service.xml Wed Sep 28 15:09:15 2005
@@ -18,7 +18,7 @@
 
 
 <!--dependencies for jetty-->
-<service xmlns="http://geronimo.apache.org/xml/ns/deployment">
+<service xmlns="http://geronimo.apache.org/xml/ns/deployment-1.0">
 
     <dependency>
         <uri>jetty/jars/org.mortbay.jetty-${jetty_version}.jar</uri>

Modified: geronimo/trunk/modules/jetty/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml (original)
+++ geronimo/trunk/modules/jetty/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml Wed Sep 28 15:09:15 2005
@@ -6,9 +6,9 @@
     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.
@@ -17,7 +17,7 @@
 -->
 
 <jetty:web-app
-    xmlns:jetty="http://geronimo.apache.org/xml/ns/web/jetty"
+    xmlns:jetty="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0"
     configId="org/apache/geronimo/jetty/Test"
     >
     <jetty:context-root>/test</jetty:context-root>

Modified: geronimo/trunk/modules/jetty/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml (original)
+++ geronimo/trunk/modules/jetty/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml Wed Sep 28 15:09:15 2005
@@ -6,9 +6,9 @@
     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.
@@ -17,8 +17,8 @@
 -->
 
 <web-app
-    xmlns="http://geronimo.apache.org/xml/ns/web/jetty"
-    xmlns:sec="http://geronimo.apache.org/xml/ns/security"
+    xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0"
+    xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.0"
     configId="org/apache/geronimo/test">
 
     <context-root>/test</context-root>

Modified: geronimo/trunk/modules/naming-builder/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/naming-builder/maven.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/naming-builder/maven.xml (original)
+++ geronimo/trunk/modules/naming-builder/maven.xml Wed Sep 28 15:09:15 2005
@@ -24,7 +24,7 @@
 
     <preGoal name="java:compile">
         <xmlbeans:schema2java
-            maven.xmlbeans2.sourceschema="schema/geronimo-naming.xsd"/>
+            maven.xmlbeans2.sourceschema="schema/geronimo-naming-1.0.xsd"/>
         <mkdir dir="${basedir}/target/xmlbeans-classes"/>
         <mkdir dir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans"/>
         <copy todir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans">

Copied: geronimo/trunk/modules/naming-builder/src/schema/geronimo-naming-1.0.xsd (from r292006, geronimo/trunk/modules/naming-builder/src/schema/geronimo-naming.xsd)
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/naming-builder/src/schema/geronimo-naming-1.0.xsd?p2=geronimo/trunk/modules/naming-builder/src/schema/geronimo-naming-1.0.xsd&p1=geronimo/trunk/modules/naming-builder/src/schema/geronimo-naming.xsd&r1=292006&r2=292333&rev=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/naming-builder/src/schema/geronimo-naming.xsd (original)
+++ geronimo/trunk/modules/naming-builder/src/schema/geronimo-naming-1.0.xsd Wed Sep 28 15:09:15 2005
@@ -17,8 +17,8 @@
 -->
 
 <xsd:schema
-    targetNamespace="http://geronimo.apache.org/xml/ns/naming"
-    xmlns:gernaming="http://geronimo.apache.org/xml/ns/naming"
+    targetNamespace="http://geronimo.apache.org/xml/ns/naming-1.0"
+    xmlns:gernaming="http://geronimo.apache.org/xml/ns/naming-1.0"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     elementFormDefault="qualified"
     attributeFormDefault="unqualified"

Modified: geronimo/trunk/modules/naming-builder/src/schema/xmlconfig.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/naming-builder/src/schema/xmlconfig.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/naming-builder/src/schema/xmlconfig.xml (original)
+++ geronimo/trunk/modules/naming-builder/src/schema/xmlconfig.xml Wed Sep 28 15:09:15 2005
@@ -1,7 +1,7 @@
 <xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config"
     >
 
-    <xb:namespace uri="http://geronimo.apache.org/xml/ns/naming">
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/naming-1.0">
         <xb:package>org.apache.geronimo.xbeans.geronimo.naming</xb:package>
         <xb:prefix>Ger</xb:prefix>
     </xb:namespace>

Modified: geronimo/trunk/modules/security-builder/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security-builder/maven.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/security-builder/maven.xml (original)
+++ geronimo/trunk/modules/security-builder/maven.xml Wed Sep 28 15:09:15 2005
@@ -31,7 +31,7 @@
 
     <preGoal name="java:compile">
         <xmlbeans:schema2java
-            maven.xmlbeans2.sourceschema="schema/geronimo-security.xsd,schema/geronimo-login-config.xsd"/>
+            maven.xmlbeans2.sourceschema="schema/geronimo-security-1.0.xsd,schema/geronimo-login-config-1.0.xsd"/>
         <mkdir dir="${basedir}/target/xmlbeans-classes"/>
         <mkdir dir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans"/>
         <copy todir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans">

Modified: geronimo/trunk/modules/security-builder/src/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security-builder/src/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/security-builder/src/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java (original)
+++ geronimo/trunk/modules/security-builder/src/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java Wed Sep 28 15:09:15 2005
@@ -47,7 +47,7 @@
  * @version $Rev:  $ $Date:  $
  */
 public class LoginConfigBuilder implements XmlReferenceBuilder {
-    public static final String LOGIN_CONFIG_NAMESPACE = "http://geronimo.apache.org/xml/ns/loginconfig";
+    public static final String LOGIN_CONFIG_NAMESPACE = "http://geronimo.apache.org/xml/ns/loginconfig-1.0";
 
     public String getNamespace() {
         return LOGIN_CONFIG_NAMESPACE;

Copied: geronimo/trunk/modules/security-builder/src/schema/geronimo-login-config-1.0.xsd (from r292006, geronimo/trunk/modules/security-builder/src/schema/geronimo-login-config.xsd)
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security-builder/src/schema/geronimo-login-config-1.0.xsd?p2=geronimo/trunk/modules/security-builder/src/schema/geronimo-login-config-1.0.xsd&p1=geronimo/trunk/modules/security-builder/src/schema/geronimo-login-config.xsd&r1=292006&r2=292333&rev=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/security-builder/src/schema/geronimo-login-config.xsd (original)
+++ geronimo/trunk/modules/security-builder/src/schema/geronimo-login-config-1.0.xsd Wed Sep 28 15:09:15 2005
@@ -19,8 +19,8 @@
 <xsd:schema
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
-    xmlns:geronimo="http://geronimo.apache.org/xml/ns/loginconfig"
-    targetNamespace="http://geronimo.apache.org/xml/ns/loginconfig"
+    xmlns:geronimo="http://geronimo.apache.org/xml/ns/loginconfig-1.0"
+    targetNamespace="http://geronimo.apache.org/xml/ns/loginconfig-1.0"
     elementFormDefault="qualified"
     attributeFormDefault="unqualified"
     version="1.0">

Copied: geronimo/trunk/modules/security-builder/src/schema/geronimo-security-1.0.xsd (from r292006, geronimo/trunk/modules/security-builder/src/schema/geronimo-security.xsd)
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security-builder/src/schema/geronimo-security-1.0.xsd?p2=geronimo/trunk/modules/security-builder/src/schema/geronimo-security-1.0.xsd&p1=geronimo/trunk/modules/security-builder/src/schema/geronimo-security.xsd&r1=292006&r2=292333&rev=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/security-builder/src/schema/geronimo-security.xsd (original)
+++ geronimo/trunk/modules/security-builder/src/schema/geronimo-security-1.0.xsd Wed Sep 28 15:09:15 2005
@@ -19,8 +19,8 @@
 <xsd:schema
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
-    xmlns:geronimo="http://geronimo.apache.org/xml/ns/security"
-    targetNamespace="http://geronimo.apache.org/xml/ns/security"
+    xmlns:geronimo="http://geronimo.apache.org/xml/ns/security-1.0"
+    targetNamespace="http://geronimo.apache.org/xml/ns/security-1.0"
     elementFormDefault="qualified"
     attributeFormDefault="unqualified"
     version="1.0">

Modified: geronimo/trunk/modules/security-builder/src/schema/xmlconfig.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security-builder/src/schema/xmlconfig.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/security-builder/src/schema/xmlconfig.xml (original)
+++ geronimo/trunk/modules/security-builder/src/schema/xmlconfig.xml Wed Sep 28 15:09:15 2005
@@ -1,11 +1,11 @@
 <xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config">
 
-    <xb:namespace uri="http://geronimo.apache.org/xml/ns/security">
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/security-1.0">
         <xb:package>org.apache.geronimo.xbeans.geronimo.security</xb:package>
         <xb:prefix>Ger</xb:prefix>
     </xb:namespace>
 
-    <xb:namespace uri="http://geronimo.apache.org/xml/ns/loginconfig">
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/loginconfig-1.0">
         <xb:package>org.apache.geronimo.xbeans.geronimo.loginconfig</xb:package>
         <xb:prefix>Ger</xb:prefix>
     </xb:namespace>

Modified: geronimo/trunk/modules/security/src/test-data/xml/deployment/geronimo-security.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/test-data/xml/deployment/geronimo-security.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/security/src/test-data/xml/deployment/geronimo-security.xml (original)
+++ geronimo/trunk/modules/security/src/test-data/xml/deployment/geronimo-security.xml Wed Sep 28 15:09:15 2005
@@ -6,19 +6,19 @@
     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.
 -->
-  
+
 <security xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xmlns="http://geronimo.apache.org/xml/ns/security"
+         xmlns="http://geronimo.apache.org/xml/ns/security-1.0"
          version="1.0">
     <default-principal>
         <principal>

Modified: geronimo/trunk/modules/service-builder/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/service-builder/maven.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/service-builder/maven.xml (original)
+++ geronimo/trunk/modules/service-builder/maven.xml Wed Sep 28 15:09:15 2005
@@ -24,7 +24,7 @@
 
     <preGoal name="java:compile">
         <xmlbeans:schema2java
-            maven.xmlbeans2.sourceschema="schema/geronimo-config.xsd,schema/geronimo-service.xsd,schema/geronimo-javabean-xmlattribute.xsd"/>
+            maven.xmlbeans2.sourceschema="schema/geronimo-config-1.0.xsd,schema/geronimo-service-1.0.xsd,schema/geronimo-javabean-xmlattribute-1.0.xsd"/>
         <mkdir dir="${basedir}/target/xmlbeans-classes"/>
         <mkdir dir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans"/>
         <copy todir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans">

Modified: geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeBuilder.java?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeBuilder.java (original)
+++ geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeBuilder.java Wed Sep 28 15:09:15 2005
@@ -37,7 +37,7 @@
  */
 public class JavaBeanXmlAttributeBuilder implements XmlAttributeBuilder {
 
-    private static final String NAMESPACE = "http://geronimo.apache.org/xml/ns/deployment/javabean";
+    private static final String NAMESPACE = "http://geronimo.apache.org/xml/ns/deployment/javabean-1.0";
 
     public String getNamespace() {
         return NAMESPACE;



Mime
View raw message