geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r292333 [4/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/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java (original)
+++ geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java Wed Sep 28 15:09:15 2005
@@ -30,12 +30,8 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.jar.JarFile;
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
@@ -44,6 +40,8 @@
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.ConfigurationBuilder;
 import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.deployment.xbeans.AttributeType;
 import org.apache.geronimo.deployment.xbeans.ConfigurationDocument;
 import org.apache.geronimo.deployment.xbeans.ConfigurationType;
@@ -61,7 +59,6 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.MissingDependencyException;
@@ -69,7 +66,6 @@
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.XmlOptions;
 
 /**
  * @version $Rev$ $Date$
@@ -84,7 +80,8 @@
     private static final Map xmlReferenceBuilderMap = new HashMap();
     private Map attrRefMap;
     private Map refRefMap;
-    private static final QName SERVICE_QNAME = new QName("http://geronimo.apache.org/xml/ns/deployment", "configuration");
+    private static final QName SERVICE_QNAME = new QName("http://geronimo.apache.org/xml/ns/deployment-1.0", "configuration");
+
 
     public ServiceConfigBuilder(URI[] defaultParentId, Repository repository) {
         this(defaultParentId, repository, null, null, null);
@@ -121,8 +118,7 @@
         }
 
         try {
-            XmlObject xmlObject = XmlObject.Factory.parse(planFile);
-//            ConfigurationDocument configurationDoc = ConfigurationDocument.Factory.parse(planFile);
+            XmlObject xmlObject = XmlBeansUtil.parse(planFile);
             XmlCursor cursor = xmlObject.newCursor();
             try {
                 cursor.toFirstChild();
@@ -138,11 +134,8 @@
             } else {
                 configurationDoc = (ConfigurationDocument) xmlObject.changeType(ConfigurationDocument.type);
             }
-            XmlOptions xmlOptions = new XmlOptions();
-            xmlOptions.setLoadLineNumbers();
             Collection errors = new ArrayList();
-            xmlOptions.setErrorListener(errors);
-            if (!configurationDoc.validate(xmlOptions)) {
+            if (!configurationDoc.validate(XmlBeansUtil.createXmlOptions(errors))) {
                 throw new DeploymentException("Invalid deployment descriptor: " + errors + "\nDescriptor: " + configurationDoc.toString());
             }
             return configurationDoc.getConfiguration();
@@ -272,8 +265,12 @@
                 // it has a geronimo-service.xml file
                 ServiceDocument serviceDoc = null;
                 try {
-                    serviceDoc = ServiceDocument.Factory.parse(is);
-                } catch (org.apache.xmlbeans.XmlException e) {
+                    Collection errors = new ArrayList();
+                    serviceDoc = ServiceDocument.Factory.parse(is, XmlBeansUtil.createXmlOptions(errors));
+                    if (errors.size() > 0) {
+                        throw new DeploymentException("Invalid service doc: " + errors);
+                    }
+                } catch (XmlException e) {
                     throw new DeploymentException("Invalid geronimo-service.xml file in " + url, e);
                 } catch (IOException e) {
                     throw new DeploymentException("Unable to parse geronimo-service.xml file in " + url, e);

Added: geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/xmlbeans/XmlBeansUtil.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/xmlbeans/XmlBeansUtil.java?rev=292333&view=auto
==============================================================================
--- geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/xmlbeans/XmlBeansUtil.java (added)
+++ geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/xmlbeans/XmlBeansUtil.java Wed Sep 28 15:09:15 2005
@@ -0,0 +1,115 @@
+/**
+ *
+ * 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.
+ */
+package org.apache.geronimo.deployment.xmlbeans;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import org.w3c.dom.Element;
+import org.apache.xmlbeans.XmlOptions;
+import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlObject;
+
+/**
+ * @version $Rev:  $ $Date:  $
+ */
+public class XmlBeansUtil {
+    private static final Map NAMESPACE_UPDATES = new HashMap();
+
+    static {
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/application-client", "http://geronimo.apache.org/xml/ns/j2ee/application-client-1.0");
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/application", "http://geronimo.apache.org/xml/ns/j2ee/application-1.0");
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/deployment", "http://geronimo.apache.org/xml/ns/deployment-1.0");
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/connector", "http://geronimo.apache.org/xml/ns/j2ee/connector-1.0");
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/deployment/javabean", "http://geronimo.apache.org/xml/ns/deployment/javabean-1.0");
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/loginconfig", "http://geronimo.apache.org/xml/ns/loginconfig-1.0");
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/naming", "http://geronimo.apache.org/xml/ns/naming-1.0");
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/security", "http://geronimo.apache.org/xml/ns/security-1.0");
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/web", "http://geronimo.apache.org/xml/ns/j2ee/web-1.0");
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/web/jetty", "http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0");
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/web/jetty/config", "http://geronimo.apache.org/xml/ns/j2ee/web/jetty/config-1.0");
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/web/tomcat", "http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.0");
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/web/tomcat/config", "http://geronimo.apache.org/xml/ns/j2ee/web/tomcat/config-1.0");
+        NAMESPACE_UPDATES.put("http://www.openejb.org/xml/ns/openejb-jar", "http://www.openejb.org/xml/ns/openejb-jar-2.0");
+        NAMESPACE_UPDATES.put("http://www.openejb.org/xml/ns/pkgen", "http://www.openejb.org/xml/ns/pkgen-2.0");
+        NAMESPACE_UPDATES.put("http://www.openejb.org/xml/ns/corba-css-config_1_0", "http://www.openejb.org/xml/ns/corba-css-config-2.0");
+        NAMESPACE_UPDATES.put("http://www.openejb.org/xml/ns/corba-tss-config_1_0", "http://www.openejb.org/xml/ns/corba-tss-config-2.0");
+    }
+
+    private XmlBeansUtil() {
+    }
+
+
+    public static XmlObject parse(File file) throws IOException, XmlException {
+        ArrayList errors = new ArrayList();
+        XmlObject parsed = XmlObject.Factory.parse(file, createXmlOptions(errors));
+        if (errors.size() != 0) {
+            throw new XmlException(errors.toArray().toString());
+        }
+        return parsed;
+    }
+
+    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;
+    }
+
+    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;
+    }
+
+    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;
+    }
+
+    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;
+    }
+
+    public static XmlOptions createXmlOptions(Collection errors) {
+        XmlOptions options = new XmlOptions();
+        options.setLoadLineNumbers();
+        options.setErrorListener(errors);
+        options.setLoadSubstituteNamespaces(NAMESPACE_UPDATES);
+        return options;
+    }
+}

Copied: geronimo/trunk/modules/service-builder/src/schema/geronimo-config-1.0.xsd (from r292006, geronimo/trunk/modules/service-builder/src/schema/geronimo-config.xsd)
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/service-builder/src/schema/geronimo-config-1.0.xsd?p2=geronimo/trunk/modules/service-builder/src/schema/geronimo-config-1.0.xsd&p1=geronimo/trunk/modules/service-builder/src/schema/geronimo-config.xsd&r1=292006&r2=292333&rev=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/service-builder/src/schema/geronimo-config.xsd (original)
+++ geronimo/trunk/modules/service-builder/src/schema/geronimo-config-1.0.xsd Wed Sep 28 15:09:15 2005
@@ -17,8 +17,8 @@
 -->
 
 <xs:schema
-    targetNamespace="http://geronimo.apache.org/xml/ns/deployment"
-    xmlns:sys="http://geronimo.apache.org/xml/ns/deployment"
+    targetNamespace="http://geronimo.apache.org/xml/ns/deployment-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"
@@ -28,7 +28,7 @@
             Schema for Geronimo Services deployment plans.
             Instance documents should begin with the element:
 
-            &gt;gbeans xmlns="http://geronimo.apache.org/xml/ns/deployment"&lt;
+            &gt;gbeans xmlns="http://geronimo.apache.org/xml/ns/deployment-1.0"&lt;
         </xs:documentation>
     </xs:annotation>
 

Copied: geronimo/trunk/modules/service-builder/src/schema/geronimo-javabean-xmlattribute-1.0.xsd (from r292006, geronimo/trunk/modules/service-builder/src/schema/geronimo-javabean-xmlattribute.xsd)
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/service-builder/src/schema/geronimo-javabean-xmlattribute-1.0.xsd?p2=geronimo/trunk/modules/service-builder/src/schema/geronimo-javabean-xmlattribute-1.0.xsd&p1=geronimo/trunk/modules/service-builder/src/schema/geronimo-javabean-xmlattribute.xsd&r1=292006&r2=292333&rev=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/service-builder/src/schema/geronimo-javabean-xmlattribute.xsd (original)
+++ geronimo/trunk/modules/service-builder/src/schema/geronimo-javabean-xmlattribute-1.0.xsd 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 @@
 -->
 
 <xs:schema
-    targetNamespace="http://geronimo.apache.org/xml/ns/deployment/javabean"
-    xmlns:javabean="http://geronimo.apache.org/xml/ns/deployment/javabean"
+    targetNamespace="http://geronimo.apache.org/xml/ns/deployment/javabean-1.0"
+    xmlns:javabean="http://geronimo.apache.org/xml/ns/deployment/javabean-1.0"
     xmlns:xs="http://www.w3.org/2001/XMLSchema"
     elementFormDefault="qualified"
     attributeFormDefault="unqualified"
@@ -27,7 +27,7 @@
         <xs:documentation>
             Schema for javabean xml attributes
 
-            &gt;gbeans xmlns="http://geronimo.apache.org/xml/ns/deployment/javabean"&lt;
+            &gt;gbeans xmlns="http://geronimo.apache.org/xml/ns/deployment/javabean-1.0"&lt;
         </xs:documentation>
     </xs:annotation>
 

Copied: geronimo/trunk/modules/service-builder/src/schema/geronimo-service-1.0.xsd (from r292006, geronimo/trunk/modules/service-builder/src/schema/geronimo-service.xsd)
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/service-builder/src/schema/geronimo-service-1.0.xsd?p2=geronimo/trunk/modules/service-builder/src/schema/geronimo-service-1.0.xsd&p1=geronimo/trunk/modules/service-builder/src/schema/geronimo-service.xsd&r1=292006&r2=292333&rev=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/service-builder/src/schema/geronimo-service.xsd (original)
+++ geronimo/trunk/modules/service-builder/src/schema/geronimo-service-1.0.xsd Wed Sep 28 15:09:15 2005
@@ -6,20 +6,20 @@
     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="http://geronimo.apache.org/xml/ns/deployment"
+    xmlns="http://geronimo.apache.org/xml/ns/deployment-1.0"
     xmlns:xs="http://www.w3.org/2001/XMLSchema"
-    targetNamespace="http://geronimo.apache.org/xml/ns/deployment"
+    targetNamespace="http://geronimo.apache.org/xml/ns/deployment-1.0"
     elementFormDefault="qualified"
     attributeFormDefault="unqualified"
     >
@@ -28,11 +28,11 @@
             Schema for Geronimo Service component definition files .
             Instance documents should begin with the element:
 
-            &gt;service xmlns="http://geronimo.apache.org/xml/ns/deployment"&lt;
+            &gt;service xmlns="http://geronimo.apache.org/xml/ns/deployment-1.0"&lt;
         </xs:documentation>
     </xs:annotation>
 
-    <xs:import namespace="http://geronimo.apache.org/xml/ns/deployment" schemaLocation="geronimo-config.xsd"/>
+    <xs:import namespace="http://geronimo.apache.org/xml/ns/deployment-1.0" schemaLocation="geronimo-config-1.0.xsd"/>
 
     <xs:element name="service" type="serviceType"/>
 

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

Modified: geronimo/trunk/modules/service-builder/src/test-resources/services/plan1.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/service-builder/src/test-resources/services/plan1.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/service-builder/src/test-resources/services/plan1.xml (original)
+++ geronimo/trunk/modules/service-builder/src/test-resources/services/plan1.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.
 -->
-  
+
 
 <configuration
-    xmlns="http://geronimo.apache.org/xml/ns/deployment"
+    xmlns="http://geronimo.apache.org/xml/ns/deployment-1.0"
     configId="test/plan1"
     >
     <dependency>
@@ -26,18 +26,18 @@
         <artifactId>geronimo-kernel</artifactId>
         <version>DEV</version>
     </dependency>
-    
+
     <gbean gbeanName="geronimo.test:name=MyMockGMBean" class="org.apache.geronimo.deployment.MockGBean">
         <attribute name="value">1234</attribute>
         <attribute name="intValue">1234</attribute>
         <xml-attribute name="fooBarBean">
-            <ns:javabean xmlns:ns="http://geronimo.apache.org/xml/ns/deployment/javabean">
+            <ns:javabean xmlns:ns="http://geronimo.apache.org/xml/ns/deployment/javabean-1.0">
                 <ns:property name="Foo">foo</ns:property>
                 <ns:property name="Bar">10</ns:property>
                 <ns:bean-property name="Bean">
                     <ns:javabean>
                         <ns:property name="Foo">foo2</ns:property>
-                        <ns:property name="Bar">100</ns:property>                                          
+                        <ns:property name="Bar">100</ns:property>
                     </ns:javabean>
                 </ns:bean-property>
             </ns:javabean>

Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/SilentStartupMonitor.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/SilentStartupMonitor.java?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/SilentStartupMonitor.java (original)
+++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/SilentStartupMonitor.java Wed Sep 28 15:09:15 2005
@@ -60,7 +60,8 @@
     }
 
     public void serverStartFailed(Exception problem) {
-        System.out.println("Geronimo startup failed");
+        System.out.println("Geronimo startup failed:");
+        problem.printStackTrace(System.out);
     }
 
     public void loadFailed(String configuration, Exception problem) {

Modified: geronimo/trunk/modules/test-ddbean/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/test-ddbean/project.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/test-ddbean/project.xml (original)
+++ geronimo/trunk/modules/test-ddbean/project.xml Wed Sep 28 15:09:15 2005
@@ -66,6 +66,11 @@
                 <xmlbeans>true</xmlbeans>
             </properties>
         </dependency>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-service-builder</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
     </dependencies>
 
 

Modified: geronimo/trunk/modules/test-ddbean/src/java/org/apache/geronimo/deployment/tools/DDBeanRootImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/test-ddbean/src/java/org/apache/geronimo/deployment/tools/DDBeanRootImpl.java?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/test-ddbean/src/java/org/apache/geronimo/deployment/tools/DDBeanRootImpl.java (original)
+++ geronimo/trunk/modules/test-ddbean/src/java/org/apache/geronimo/deployment/tools/DDBeanRootImpl.java Wed Sep 28 15:09:15 2005
@@ -27,7 +27,7 @@
 import javax.enterprise.deploy.model.exceptions.DDBeanCreateException;
 import javax.enterprise.deploy.shared.ModuleType;
 
-import org.apache.geronimo.schema.SchemaConversionUtils;
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlObject;
 
@@ -46,7 +46,7 @@
         try {
             is = descriptor.openStream();
         try {
-        XmlObject xmlObject = SchemaConversionUtils.parse(is);
+        XmlObject xmlObject = XmlBeansUtil.parse(is);
             XmlCursor c = xmlObject.newCursor();
             try {
                 c.toStartDoc();

Modified: geronimo/trunk/modules/tomcat-builder/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/maven.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/maven.xml (original)
+++ geronimo/trunk/modules/tomcat-builder/maven.xml Wed Sep 28 15:09:15 2005
@@ -28,7 +28,7 @@
 
     <preGoal name="java:compile">
         <xmlbeans:schema2java
-            maven.xmlbeans2.sourceschema="schema/geronimo-tomcat.xsd"/>
+            maven.xmlbeans2.sourceschema="schema/geronimo-tomcat-1.0.xsd,schema/geronimo-tomcat-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/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java (original)
+++ geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java Wed Sep 28 15:09:15 2005
@@ -19,6 +19,7 @@
 
 import java.io.File;
 import java.io.FileFilter;
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URI;
@@ -27,19 +28,18 @@
 import java.security.Permission;
 import java.security.PermissionCollection;
 import java.security.Permissions;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.List;
-import java.util.ArrayList;
-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;
@@ -48,12 +48,15 @@
 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;
@@ -65,8 +68,8 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.kernel.StoredObject;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.StoredObject;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
 import org.apache.geronimo.naming.deployment.GBeanResourceEnvironmentBuilder;
@@ -82,13 +85,14 @@
 import org.apache.geronimo.tomcat.ValveGBean;
 import org.apache.geronimo.tomcat.util.SecurityHolder;
 import org.apache.geronimo.transaction.context.OnlineUserTransaction;
-import org.apache.geronimo.xbeans.geronimo.web.GerContainerConfigType;
-import org.apache.geronimo.xbeans.geronimo.web.GerWebAppDocument;
-import org.apache.geronimo.xbeans.geronimo.web.GerWebAppType;
-import org.apache.geronimo.xbeans.geronimo.web.tomcat.GerTomcatConfigType;
+import org.apache.geronimo.web.deployment.GenericToSpecificPlanConverter;
 import org.apache.geronimo.xbeans.geronimo.naming.GerMessageDestinationType;
+import org.apache.geronimo.xbeans.geronimo.web.tomcat.TomcatWebAppDocument;
+import org.apache.geronimo.xbeans.geronimo.web.tomcat.TomcatWebAppType;
+import org.apache.geronimo.xbeans.geronimo.web.tomcat.config.GerTomcatDocument;
 import org.apache.geronimo.xbeans.j2ee.FilterMappingType;
 import org.apache.geronimo.xbeans.j2ee.HttpMethodType;
+import org.apache.geronimo.xbeans.j2ee.MessageDestinationType;
 import org.apache.geronimo.xbeans.j2ee.RoleNameType;
 import org.apache.geronimo.xbeans.j2ee.SecurityConstraintType;
 import org.apache.geronimo.xbeans.j2ee.SecurityRoleRefType;
@@ -99,7 +103,7 @@
 import org.apache.geronimo.xbeans.j2ee.WebAppDocument;
 import org.apache.geronimo.xbeans.j2ee.WebAppType;
 import org.apache.geronimo.xbeans.j2ee.WebResourceCollectionType;
-import org.apache.geronimo.xbeans.j2ee.MessageDestinationType;
+import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 
@@ -109,8 +113,7 @@
  */
 public class TomcatModuleBuilder implements ModuleBuilder {
 
-    private static final String TOMCAT_CONFIG_NAMESPACE = "http://geronimo.apache.org/xml/ns/web/tomcat";
-    private static final QName TOMCAT_CONFIG_QNAME = new QName(TOMCAT_CONFIG_NAMESPACE, "tomcat");
+    private static final Log log = LogFactory.getLog(TomcatModuleBuilder.class);
 
     private final List defaultParentId;
     private final boolean defaultContextPriorityClassloader;
@@ -119,22 +122,19 @@
     private final WebServiceBuilder webServiceBuilder;
 
     private final Repository repository;
-    private final Kernel kernel;
-    private static final String TOMCAT_NAMESPACE = TOMCAT_CONFIG_NAMESPACE;//OpenejbOpenejbJarDocument.type.getDocumentElementName().getNamespaceURI();
+    private static final String TOMCAT_NAMESPACE = TomcatWebAppDocument.type.getDocumentElementName().getNamespaceURI();
 
     public TomcatModuleBuilder(URI[] defaultParentId,
                                boolean defaultContextPriorityClassloader,
                                ObjectName tomcatContainerObjectName,
                                WebServiceBuilder webServiceBuilder,
-                               Repository repository,
-                               Kernel kernel) {
+                               Repository repository) {
         this.defaultParentId = defaultParentId == null? Collections.EMPTY_LIST: Arrays.asList(defaultParentId);
 
         this.defaultContextPriorityClassloader = defaultContextPriorityClassloader;
         this.tomcatContainerObjectName = tomcatContainerObjectName;
         this.webServiceBuilder = webServiceBuilder;
         this.repository = repository;
-        this.kernel = kernel;
     }
 
     public Module createModule(File plan, JarFile moduleFile) throws DeploymentException {
@@ -168,7 +168,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) {
@@ -178,7 +178,7 @@
 
 
         // parse vendor dd
-        GerWebAppType tomcatWebApp = getTomcatWebApp(plan, moduleFile, standAlone, targetPath, webApp);
+        TomcatWebAppType tomcatWebApp = getTomcatWebApp(plan, moduleFile, standAlone, targetPath, webApp);
 
         // get the ids from either the application plan or for a stand alone module from the specific deployer
         URI configId = null;
@@ -209,7 +209,7 @@
             }
         }
 
-        WebModule module = new WebModule(standAlone, configId, parentId, moduleFile, targetPath, webApp, tomcatWebApp, specDD, contextRoot, portMap);
+        WebModule module = new WebModule(standAlone, configId, parentId, moduleFile, targetPath, webApp, tomcatWebApp, specDD, contextRoot, portMap, TOMCAT_NAMESPACE);
         return module;
     }
 
@@ -233,73 +233,92 @@
         return map;
     }
 
-    GerWebAppType getTomcatWebApp(Object plan, JarFile moduleFile, boolean standAlone, String targetPath, WebAppType webApp) throws DeploymentException {
-        GerWebAppType tomcatWebApp = null;
+    TomcatWebAppType getTomcatWebApp(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) {
-                    tomcatWebApp = (GerWebAppType) SchemaConversionUtils.getNestedObjectAsType((XmlObject) plan,
-                            "web-app",
-                            GerWebAppType.type);
+                    rawPlan = (XmlObject) plan;//SchemaConversionUtils.getNestedObject((XmlObject) plan, "web-app");
                 } else {
-                    GerWebAppDocument tomcatWebAppdoc = null;
                     if (plan != null) {
-                        tomcatWebAppdoc = GerWebAppDocument.Factory.parse((File) plan);
+                        rawPlan = XmlBeansUtil.parse(((File) plan).toURL());
                     } else {
                         URL path = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/geronimo-web.xml");
-                        tomcatWebAppdoc = GerWebAppDocument.Factory.parse(path);
-                    }
-                    if (tomcatWebAppdoc != null) {
-                        tomcatWebApp = tomcatWebAppdoc.getWebApp();
+                        try {
+                            rawPlan = XmlBeansUtil.parse(path);
+                        } catch (FileNotFoundException e) {
+                            path = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/geronimo-tomcat.xml");
+                            try {
+                                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.");
+                            }
+                        }
                     }
                 }
             } catch (IOException e) {
+                log.warn(e);
             }
 
-            // if we got one extract and validate it otherwise create a default one
-            if (tomcatWebApp != null) {
-                tomcatWebApp = (GerWebAppType) SchemaConversionUtils.convertToGeronimoNamingSchema(tomcatWebApp);
-                tomcatWebApp = (GerWebAppType) SchemaConversionUtils.convertToGeronimoSecuritySchema(tomcatWebApp);
-                tomcatWebApp = (GerWebAppType) SchemaConversionUtils.convertToGeronimoServiceSchema(tomcatWebApp);
-                SchemaConversionUtils.validateDD(tomcatWebApp);
-            } else {
-                String path;
-                if (standAlone) {
-                    // default configId is based on the moduleFile name
-                    path = new File(moduleFile.getName()).getName();
-                } else {
-                    // default configId is based on the module uri from the application.xml
-                    path = targetPath;
+            TomcatWebAppType tomcatWebApp = null;
+            if (rawPlan != null) {
+                XmlCursor cursor = rawPlan.newCursor();
+                try {
+                    new GenericToSpecificPlanConverter(GerTomcatDocument.type.getDocumentElementName().getNamespaceURI(),
+                            TomcatWebAppDocument.type.getDocumentElementName().getNamespaceURI()).convertToSpecificPlan(cursor);
+                    SchemaConversionUtils.findNestedElement(cursor, "web-app");
+                    tomcatWebApp = (TomcatWebAppType) cursor.getObject().copy().changeType(TomcatWebAppType.type);
+                    SchemaConversionUtils.validateDD(tomcatWebApp);
+                } finally {
+                    cursor.dispose();
                 }
-                tomcatWebApp = createDefaultPlan(path, webApp);
+            } else {
+                String defaultContextRoot = determineDefaultContextRoot(webApp, standAlone, moduleFile, targetPath);
+                tomcatWebApp = createDefaultPlan(defaultContextRoot);
             }
+            return tomcatWebApp;
         } catch (XmlException e) {
             throw new DeploymentException("xml problem", e);
         }
-        return tomcatWebApp;
     }
 
-    private GerWebAppType createDefaultPlan(String path, WebAppType webApp) {
-        String id = webApp.getId();
-        if (id == null) {
-            id = path;
-            if (id.endsWith(".war")) {
-                id = id.substring(0, id.length() - 4);
-            }
-            if (id.endsWith("/")) {
-                id = id.substring(0, id.length() - 1);
-            }
+    private String determineDefaultContextRoot(WebAppType webApp, boolean isStandAlone, JarFile moduleFile, String targetPath) {
+
+        if (webApp != null && webApp.getId() != null) {
+            return webApp.getId();
         }
 
-        GerWebAppType tomcatWebApp = GerWebAppType.Factory.newInstance();
+        if (isStandAlone) {
+            // default configId is based on the moduleFile name
+            return trimPath(new File(moduleFile.getName()).getName());
+        }
 
-        // set the configId and context root
-        if (null != webApp.getId()) {
-            id = webApp.getId();
+        // default configId is based on the module uri from the application.xml
+        return trimPath(targetPath);
+    }
+
+    private String trimPath(String path) {
+
+        if (path == null) {
+            return null;
         }
-        tomcatWebApp.setConfigId(id);
-        tomcatWebApp.setContextRoot("/" + id);
+
+        if (path.endsWith(".war")) {
+            path = path.substring(0, path.length() - 4);
+        }
+        if (path.endsWith("/")) {
+            path = path.substring(0, path.length() - 1);
+        }
+
+        return path;
+    }
+
+    private TomcatWebAppType createDefaultPlan(String path) {
+        TomcatWebAppType tomcatWebApp = TomcatWebAppType.Factory.newInstance();
+        tomcatWebApp.setConfigId(path);
+        tomcatWebApp.setContextRoot("/" + path);
+        tomcatWebApp.setContextPriorityClassloader(defaultContextPriorityClassloader);
         return tomcatWebApp;
     }
 
@@ -327,7 +346,7 @@
             earContext.addManifestClassPath(warFile, URI.create(module.getTargetPath()));
 
             // add the dependencies declared in the geronimo-web.xml file
-            GerWebAppType tomcatWebApp = (GerWebAppType) module.getVendorDD();
+            TomcatWebAppType tomcatWebApp = (TomcatWebAppType) module.getVendorDD();
             DependencyType[] dependencies = tomcatWebApp.getDependencyArray();
             ServiceConfigBuilder.addDependencies(earContext, dependencies, repository);
         } catch (IOException e) {
@@ -340,7 +359,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();
+        TomcatWebAppType gerWebApp = (TomcatWebAppType) module.getVendorDD();
         GerMessageDestinationType[] gerMessageDestinations = gerWebApp.getMessageDestinationArray();
 
         ENCConfigBuilder.registerMessageDestinations(earContext.getRefContext(), module.getName(), messageDestinations, gerMessageDestinations);
@@ -352,7 +371,7 @@
         WebModule webModule = (WebModule) module;
 
         WebAppType webApp = (WebAppType) webModule.getSpecDD();
-        GerWebAppType tomcatWebApp = (GerWebAppType) webModule.getVendorDD();
+        TomcatWebAppType tomcatWebApp = (TomcatWebAppType) webModule.getVendorDD();
 
         boolean contextPriorityClassLoader = defaultContextPriorityClassloader;
         if (tomcatWebApp != null && tomcatWebApp.isSetContextPriorityClassloader()) {
@@ -407,33 +426,23 @@
             webModuleData.setReferencePattern("Container", tomcatContainerObjectName);
 
             // Process the Tomcat container-config elements
-            if (tomcatWebApp != null && tomcatWebApp.isSetContainerConfig()) {
-                GerContainerConfigType config = tomcatWebApp.getContainerConfig();
-                XmlObject[] anys = config.selectChildren(TOMCAT_CONFIG_QNAME);
-                if (anys.length > 1) {
-                    throw new DeploymentException("More than one tomcat config: " + anys);
-                }
-                if (anys.length == 1) {
-                    GerTomcatConfigType tomcatConfig = (GerTomcatConfigType) anys[0].copy().changeType(GerTomcatConfigType.type);
-                    if (tomcatConfig.isSetHost()) {
-                        String virtualServer = tomcatConfig.getHost().trim();
+                    if (tomcatWebApp.isSetHost()) {
+                        String virtualServer = tomcatWebApp.getHost().trim();
                         webModuleData.setAttribute("virtualServer", virtualServer);
                     }
-                    if (tomcatConfig.isSetCrossContext()) {
+                    if (tomcatWebApp.isSetCrossContext()) {
                         webModuleData.setAttribute("crossContext", Boolean.TRUE);
                     }
-                    if (tomcatConfig.isSetTomcatRealm()) {
-                        String tomcatRealm = tomcatConfig.getTomcatRealm().trim();
+                    if (tomcatWebApp.isSetTomcatRealm()) {
+                        String tomcatRealm = tomcatWebApp.getTomcatRealm().trim();
                         ObjectName realmName = NameFactory.getComponentName(null, null, null, null, tomcatRealm, RealmGBean.GBEAN_INFO.getJ2eeType(), moduleJ2eeContext);
                         webModuleData.setReferencePattern("TomcatRealm", realmName);
                     }
-                    if (tomcatConfig.isSetValveChain()) {
-                        String valveChain = tomcatConfig.getValveChain().trim();
+                    if (tomcatWebApp.isSetValveChain()) {
+                        String valveChain = tomcatWebApp.getValveChain().trim();
                         ObjectName valveName = NameFactory.getComponentName(null, null, null, null, valveChain, ValveGBean.J2EE_TYPE, moduleJ2eeContext);
                         webModuleData.setReferencePattern("TomcatValveChain", valveName);
                     }
-                }
-            }
 
 
             Map portMap = webModule.getPortMap();
@@ -823,7 +832,7 @@
         }
     }
 
-    private Map buildComponentContext(EARContext earContext, Module webModule, WebAppType webApp, GerWebAppType tomcatWebApp, UserTransaction userTransaction, ClassLoader cl) throws DeploymentException {
+    private Map buildComponentContext(EARContext earContext, Module webModule, WebAppType webApp, TomcatWebAppType tomcatWebApp, UserTransaction userTransaction, ClassLoader cl) throws DeploymentException {
         return ENCConfigBuilder.buildComponentContext(earContext,
                 earContext,
                 webModule,
@@ -951,15 +960,13 @@
         infoBuilder.addReference("WebServiceBuilder", WebServiceBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("Repository", Repository.class, NameFactory.GERONIMO_SERVICE);
         infoBuilder.addInterface(ModuleBuilder.class);
-        infoBuilder.addAttribute("kernel", Kernel.class, false);
 
         infoBuilder.setConstructor(new String[]{
             "defaultParentId",
             "defaultContextPriorityClassloader",
             "tomcatContainerObjectName",
             "WebServiceBuilder",
-            "Repository",
-            "kernel"});
+            "Repository"});
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }
 

Copied: geronimo/trunk/modules/tomcat-builder/src/schema/geronimo-tomcat-1.0.xsd (from r292006, geronimo/trunk/modules/tomcat-builder/src/schema/geronimo-tomcat.xsd)
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/schema/geronimo-tomcat-1.0.xsd?p2=geronimo/trunk/modules/tomcat-builder/src/schema/geronimo-tomcat-1.0.xsd&p1=geronimo/trunk/modules/tomcat-builder/src/schema/geronimo-tomcat.xsd&r1=292006&r2=292333&rev=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/schema/geronimo-tomcat.xsd (original)
+++ geronimo/trunk/modules/tomcat-builder/src/schema/geronimo-tomcat-1.0.xsd Wed Sep 28 15:09:15 2005
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 
-    Copyright 2005 The Apache Software Foundation
+    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.
@@ -17,24 +17,51 @@
 -->
 
 <xs:schema
-    xmlns:tomcat="http://geronimo.apache.org/xml/ns/web/tomcat"
-    targetNamespace="http://geronimo.apache.org/xml/ns/web/tomcat"
+    xmlns:tomcat="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.0"
+    targetNamespace="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-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:element name="tomcat" type="tomcat:tomcat-configType"/>
+    <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:complexType name="tomcat-configType">
+    <xs:element name="web-app" type="tomcat: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="host" type="xs:string" minOccurs="0"/>
             <xs:element name="cross-context" type="tomcat:emptyType" minOccurs="0"/>
             <xs:element name="valve-chain" type="xs:string" minOccurs="0"/>
             <xs:element name="tomcat-realm" type="xs:string" minOccurs="0"/>
+
+            <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="emptyType"/>
-    
+
 </xs:schema>

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

Modified: geronimo/trunk/modules/tomcat-builder/src/schema/xmlconfig.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/schema/xmlconfig.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/schema/xmlconfig.xml (original)
+++ geronimo/trunk/modules/tomcat-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/tomcat">
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.0">
         <xb:package>org.apache.geronimo.xbeans.geronimo.web.tomcat</xb:package>
+        <xb:prefix>Tomcat</xb:prefix>
+    </xb:namespace>
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/web/tomcat/config-1.0">
+        <xb:package>org.apache.geronimo.xbeans.geronimo.web.tomcat.config</xb:package>
         <xb:prefix>Ger</xb:prefix>
     </xb:namespace>
 </xb:config>

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

Modified: geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml (original)
+++ geronimo/trunk/modules/tomcat-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/tomcat-builder/src/test-resources/deployables/war4/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war4/WEB-INF/geronimo-web.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war4/WEB-INF/geronimo-web.xml (original)
+++ geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war4/WEB-INF/geronimo-web.xml Wed Sep 28 15:09:15 2005
@@ -16,14 +16,14 @@
     limitations under the License.
 -->
 <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>
     <context-priority-classloader>false</context-priority-classloader>
     <container-config>
-        <tomcat xmlns="http://geronimo.apache.org/xml/ns/web/tomcat">
+        <tomcat xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0/tomcat">
 <!--            <host>tomcathost</host>-->
             <valve-chain>FirstValve</valve-chain>
             <tomcat-realm>TomcatRealm</tomcat-realm>

Modified: geronimo/trunk/modules/tomcat-builder/src/test-resources/plans/plan1.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/test-resources/plans/plan1.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/test-resources/plans/plan1.xml (original)
+++ geronimo/trunk/modules/tomcat-builder/src/test-resources/plans/plan1.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"
+<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>

Modified: geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java (original)
+++ geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java Wed Sep 28 15:09:15 2005
@@ -4,12 +4,13 @@
 import javax.management.ObjectName;
 
 import junit.framework.TestCase;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.kernel.Kernel;
+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.GerWebAppType;
 import org.apache.geronimo.xbeans.geronimo.web.GerWebAppDocument;
+import org.apache.geronimo.xbeans.geronimo.web.GerWebAppType;
+import org.apache.geronimo.xbeans.geronimo.web.tomcat.TomcatWebAppType;
 
 /**
  */
@@ -20,13 +21,13 @@
     private File basedir = new File(System.getProperty("basedir", "."));
 
     protected void setUp() throws Exception {
-        builder = new TomcatModuleBuilder(null, false, tomcatContainerObjectName, null, null, kernel);
+        builder = new TomcatModuleBuilder(null, false, tomcatContainerObjectName, null, null);
     }
 
     public void testResourceRef() throws Exception {
         File resourcePlan = new File(basedir, "src/test-resources/plans/plan1.xml");
         assertTrue(resourcePlan.exists());
-        GerWebAppType jettyWebApp = builder.getTomcatWebApp(resourcePlan, null, true, null, null);
+        TomcatWebAppType jettyWebApp = builder.getTomcatWebApp(resourcePlan, null, true, null, null);
         assertEquals(1, jettyWebApp.getResourceRefArray().length);
     }
 

Modified: geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java (original)
+++ geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java Wed Sep 28 15:09:15 2005
@@ -385,7 +385,7 @@
 
         WebServiceBuilder webServiceBuilder = new AxisBuilder();
 
-        builder = new TomcatModuleBuilder(new URI[] {new URI("null")}, false, containerName, webServiceBuilder, null, kernel);
+        builder = new TomcatModuleBuilder(new URI[] {new URI("null")}, false, containerName, webServiceBuilder, null);
 
         // Default Realm
         Map initParams = new HashMap();

Modified: geronimo/trunk/modules/tomcat/src/etc/META-INF/geronimo-service.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/etc/META-INF/geronimo-service.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/etc/META-INF/geronimo-service.xml (original)
+++ geronimo/trunk/modules/tomcat/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>tomcat/jars/jasper-compiler-${jasper_version}.jar</uri>

Modified: geronimo/trunk/modules/tomcat/src/plan/tomcat-plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/plan/tomcat-plan.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/plan/tomcat-plan.xml (original)
+++ geronimo/trunk/modules/tomcat/src/plan/tomcat-plan.xml Wed Sep 28 15:09:15 2005
@@ -22,7 +22,7 @@
 Configuration for the Apache Tomcat web container
 -->
 <configuration
-    xmlns="http://geronimo.apache.org/xml/ns/deployment"
+    xmlns="http://geronimo.apache.org/xml/ns/deployment-1.0"
     parentId="org/apache/geronimo/System"
     configId="org/apache/geronimo/Tomcat"
     >

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

Modified: geronimo/trunk/modules/tomcat/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml (original)
+++ geronimo/trunk/modules/tomcat/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/web-builder/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/web-builder/maven.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/web-builder/maven.xml (original)
+++ geronimo/trunk/modules/web-builder/maven.xml Wed Sep 28 15:09:15 2005
@@ -27,7 +27,7 @@
     >
     <preGoal name="java:compile">
         <xmlbeans:schema2java
-            maven.xmlbeans2.sourceschema="schema/geronimo-web.xsd"/>
+            maven.xmlbeans2.sourceschema="schema/geronimo-web-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/web-builder/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/web-builder/project.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/web-builder/project.xml (original)
+++ geronimo/trunk/modules/web-builder/project.xml Wed Sep 28 15:09:15 2005
@@ -63,6 +63,12 @@
 
         <dependency>
             <groupId>geronimo</groupId>
+            <artifactId>geronimo-common</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
             <artifactId>geronimo-deploy-config</artifactId>
             <version>${pom.currentVersion}</version>
         </dependency>
@@ -118,6 +124,12 @@
         <dependency>
             <groupId>geronimo</groupId>
             <artifactId>geronimo-test-ddbean</artifactId>
+            <version>${geronimo_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-deployment</artifactId>
             <version>${geronimo_version}</version>
         </dependency>
 

Added: geronimo/trunk/modules/web-builder/src/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverter.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/web-builder/src/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverter.java?rev=292333&view=auto
==============================================================================
--- geronimo/trunk/modules/web-builder/src/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverter.java (added)
+++ geronimo/trunk/modules/web-builder/src/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverter.java Wed Sep 28 15:09:15 2005
@@ -0,0 +1,111 @@
+/**
+ *
+ * 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.
+ */
+package org.apache.geronimo.web.deployment;
+
+import javax.xml.namespace.QName;
+
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.deployment.xbeans.ConfigurationDocument;
+import org.apache.geronimo.schema.SchemaConversionUtils;
+import org.apache.geronimo.xbeans.geronimo.security.GerSecurityDocument;
+import org.apache.geronimo.xbeans.geronimo.web.GerWebAppDocument;
+import org.apache.xmlbeans.XmlCursor;
+
+/**
+ * @version $Rev:  $ $Date:  $
+ */
+public class GenericToSpecificPlanConverter {
+
+    private static final QName GENERIC_QNAME = GerWebAppDocument.type.getDocumentElementName();
+    private static final String GENERIC_NAMESPACE = GENERIC_QNAME.getNamespaceURI();
+    private static final QName GENERIC_CONFIG_QNAME = new QName(GENERIC_NAMESPACE, "container-config");
+    private static final String SYSTEM_NAMESPACE = ConfigurationDocument.type.getDocumentElementName().getNamespaceURI();
+    private static final QName SECURITY_QNAME = GerSecurityDocument.type.getDocumentElementName();
+    private final String configNamespace;
+    private final String namespace;
+
+    public GenericToSpecificPlanConverter(String configNamespace, String namespace) {
+        this.configNamespace = configNamespace;
+        this.namespace = namespace;
+    }
+
+    public void convertToSpecificPlan(XmlCursor cursor) throws DeploymentException {
+        if (SchemaConversionUtils.findNestedElement(cursor, "web-app")) {
+            cursor.push();
+            if (cursor.getName().equals(GENERIC_QNAME)) {
+                if (cursor.toChild(GENERIC_CONFIG_QNAME)) {
+                    XmlCursor source = cursor.newCursor();
+                    cursor.push();
+                    cursor.toEndToken();
+                    cursor.toNextToken();
+                    try {
+                        if (source.toChild(configNamespace, "jetty")) {
+                            source.copyXmlContents(cursor);
+                        }
+
+                    } finally {
+                        source.dispose();
+                    }
+                    cursor.pop();
+                    cursor.removeXml();
+                }
+                cursor.toStartDoc();
+                while (cursor.hasNextToken()) {
+                    if (cursor.isStart()) {
+                        if (namespace.equals(cursor.getName().getNamespaceURI())) {
+                            //already has correct schema, exit
+                            break;
+                        }
+                        cursor.setName(new QName(namespace, cursor.getName().getLocalPart()));
+                        cursor.toNextToken();
+                    } else {
+                        cursor.toNextToken();
+                    }
+                }
+            }
+            //move security elements after refs
+            SchemaConversionUtils.convertToGeronimoSubSchemas(cursor);
+
+            cursor.pop();
+            cursor.push();
+            if (cursor.toChild(namespace, "security-realm-name")) {
+                XmlCursor other = cursor.newCursor();
+                try {
+                    other.toParent();
+                    if (other.toChild(SYSTEM_NAMESPACE, "gbean")) {
+                        other.toPrevToken();
+                    } else {
+                        other.toEndToken();
+                        other.toPrevToken();
+                    }
+                    cursor.moveXml(other);
+                    cursor.pop();
+                    cursor.push();
+                    if (cursor.toChild(SECURITY_QNAME)) {
+                        cursor.moveXml(other);
+                    }
+                } finally {
+                    other.dispose();
+                }
+            }
+            cursor.pop();
+        } else {
+            throw new DeploymentException("No web-app element");
+        }
+    }
+
+}
\ No newline at end of file

Copied: geronimo/trunk/modules/web-builder/src/schema/geronimo-web-1.0.xsd (from r292006, geronimo/trunk/modules/web-builder/src/schema/geronimo-web.xsd)
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/web-builder/src/schema/geronimo-web-1.0.xsd?p2=geronimo/trunk/modules/web-builder/src/schema/geronimo-web-1.0.xsd&p1=geronimo/trunk/modules/web-builder/src/schema/geronimo-web.xsd&r1=292006&r2=292333&rev=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/web-builder/src/schema/geronimo-web.xsd (original)
+++ geronimo/trunk/modules/web-builder/src/schema/geronimo-web-1.0.xsd Wed Sep 28 15:09:15 2005
@@ -17,19 +17,19 @@
 -->
 
 <xs:schema
-    xmlns:web="http://geronimo.apache.org/xml/ns/web"
-    targetNamespace="http://geronimo.apache.org/xml/ns/web"
-    xmlns:naming="http://geronimo.apache.org/xml/ns/naming"
-    xmlns:security="http://geronimo.apache.org/xml/ns/security"
-    xmlns:sys="http://geronimo.apache.org/xml/ns/deployment"
+    xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web-1.0"
+    targetNamespace="http://geronimo.apache.org/xml/ns/j2ee/web-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" schemaLocation="schema/geronimo-naming.xsd"/>
-    <xs:import namespace="http://geronimo.apache.org/xml/ns/security" schemaLocation="schema/geronimo-security.xsd"/>
-    <xs:import namespace="http://geronimo.apache.org/xml/ns/deployment" schemaLocation="schema/geronimo-config.xsd"/>
+    <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"/>
 
@@ -43,13 +43,13 @@
             <xs:element name="context-priority-classloader" type="xs:boolean" minOccurs="0"/>
             <xs:element name="container-config" type="web:container-configType" minOccurs="0"/>
 
+            <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:group ref="naming:jndiEnvironmentRefsGroup"/>
-            <xs:element ref="naming:message-destination" minOccurs="0" maxOccurs="unbounded"/>
 
             <xs:element ref="sys:gbean" minOccurs="0" maxOccurs="unbounded"/>
 

Modified: geronimo/trunk/modules/web-builder/src/schema/xmlconfig.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/web-builder/src/schema/xmlconfig.xml?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/modules/web-builder/src/schema/xmlconfig.xml (original)
+++ geronimo/trunk/modules/web-builder/src/schema/xmlconfig.xml Wed Sep 28 15:09:15 2005
@@ -17,7 +17,7 @@
 -->
 <!-- @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">
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/j2ee/web-1.0">
         <xb:package>org.apache.geronimo.xbeans.geronimo.web</xb:package>
         <xb:prefix>Ger</xb:prefix>
     </xb:namespace>

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

Modified: geronimo/trunk/plugins/geronimo-assembly-plugin/plugin.jelly
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-assembly-plugin/plugin.jelly?rev=292333&r1=292332&r2=292333&view=diff
==============================================================================
--- geronimo/trunk/plugins/geronimo-assembly-plugin/plugin.jelly (original)
+++ geronimo/trunk/plugins/geronimo-assembly-plugin/plugin.jelly Wed Sep 28 15:09:15 2005
@@ -23,6 +23,7 @@
     xmlns:artifact="artifact"
     xmlns:ant="jelly:ant"
     xmlns:define="jelly:define"
+    xmlns:m="jelly:maven"
     xmlns:assemble="geronimo:assembly"
     >
 
@@ -98,9 +99,81 @@
         <ant:jar jarfile="${maven.build.dir}/${maven.final.name}.jar" basedir="${geronimo.assembly.dest}"/>
     </goal>
 
-    <goal name="geronimo:install-assembly" prereqs="geronimo:jar-assembly" description="Install an assembled Geronimo installation into the local repository">
-        <artifact:install artifact="${maven.build.dir}/${maven.final.name}.jar" project="${pom}"/>
-    </goal>
+    <goal name="geronimo:package-assembly" prereqs="geronimo:assemble" description="Build the binary distribution.">
+        <!-- Create a tar.gz file -->
+        <m:makeRelativePath var="geronimo.assembly.dir.name"
+            basedir="${geronimo.assembly.dir}/.."
+            path="${geronimo.assembly.dir}"/>
+        <j:if test="${context.getVariable('geronimo.assembly.tar') == 'true'}">
+            <ant:tar longfile="gnu" compression="gzip" tarfile="${geronimo.assembly.distributions.dir}/${maven.final.name}.tar.gz">
+                <ant:tarfileset dir="${geronimo.assembly.dir}/..">
+                    <ant:include name="${geronimo.assembly.dir.name}/**"/>
+                </ant:tarfileset>
+            </ant:tar>
+            <checksum file="${geronimo.assembly.distributions.dir}/${maven.final.name}.tar.gz" algorithm="MD5" fileext=".md5"/>
+            <checksum file="${geronimo.assembly.distributions.dir}/${maven.final.name}.tar.gz" algorithm="SHA" fileext=".sha"/>
+        </j:if>
+
+        <!-- Create a zip file -->
+        <j:if test="${context.getVariable('geronimo.assembly.zip') == 'true'}">
+            <ant:zip zipfile="${geronimo.assembly.distributions.dir}/${maven.final.name}.zip">
+                <ant:zipfileset dir="${geronimo.assembly.dir}/..">
+                    <ant:include name="${geronimo.assembly.dir.name}/**"/>
+                </ant:zipfileset>
+            </ant:zip>
+            <checksum file="${geronimo.assembly.distributions.dir}/${maven.final.name}.zip" algorithm="MD5" fileext=".md5"/>
+            <checksum file="${geronimo.assembly.distributions.dir}/${maven.final.name}.zip" algorithm="SHA" fileext=".sha"/>
+        </j:if>
+    </goal>
+
+    <!-- Maven artifict tags are broken so we must copy by hand -->
+    <goal name="geronimo:install-assembly" description="Deploy a binary distribution" prereqs="geronimo:package-assembly">
+        <j:if test="${context.getVariable('geronimo.assembly.tar') == 'true'}">
+            <ant:mkdir dir="${maven.repo.local}/${pom.groupId}/distributions"/>
+            <ant:copy file="${geronimo.assembly.distributions.dir}/${maven.final.name}.tar.gz"
+                todir="${maven.repo.local}/${pom.groupId}/distributions"/>
+<!--            <artifact:install-->
+<!--                artifact="${geronimo.assembly.distributions.dir}/${maven.final.name}.tar.gz"-->
+<!--                type="distribution-targz"-->
+<!--                project="${pom}"-->
+        </j:if>
+
+        <j:if test="${context.getVariable('geronimo.assembly.zip') == 'true'}">
+            <ant:mkdir dir="${maven.repo.local}/${pom.groupId}/distributions"/>
+            <ant:copy file="${geronimo.assembly.distributions.dir}/${maven.final.name}.zip"
+                todir="${maven.repo.local}/${pom.groupId}/distributions"/>
+<!--            <artifact:install-->
+<!--                artifact="${geronimo.assembly.distributions.dir}/${maven.final.name}.zip"-->
+<!--                type="distribution-zip"-->
+<!--                project="${pom}"-->
+        </j:if>
+    </goal>
+
+    <!-- ================================================================== -->
+    <!-- D E P L O Y   D I S T R I B U T I O N                              -->
+    <!-- ================================================================== -->
+
+<!--    <goal name="geronimo:deploy-assembly" description="Deploy a binary distribution" prereqs="geronimo:package-assembly">-->
+<!--        <j:if test="${context.getVariable('geronimo.assembly.tar') == 'true'}">-->
+<!--            <artifact:deploy-->
+<!--                artifact="${geronimo.assembly.distributions.dir}/${maven.final.name}.tar.gz"-->
+<!--                type="distribution-targz"-->
+<!--                project="${pom}"-->
+<!--                typeHandler="${distTypeHandler}"/>-->
+<!--        </j:if>-->
+<!---->
+<!--        <j:if test="${context.getVariable('geronimo.assembly.zip') == 'true'}">-->
+<!--            <artifact:deploy-->
+<!--                artifact="${geronimo.assembly.distributions.dir}/${maven.final.name}.zip"-->
+<!--                type="distribution-zip"-->
+<!--                project="${pom}"-->
+<!--                typeHandler="${distTypeHandler}"/>-->
+<!--        </j:if>-->
+<!--    </goal>-->
+
+<!--    <goal name="geronimo:install-assembly" prereqs="geronimo:jar-assembly" description="Install an assembled Geronimo installation into the local repository">-->
+<!--        <artifact:install artifact="${maven.build.dir}/${maven.final.name}.jar" project="${pom}"/>-->
+<!--    </goal>-->
 
     <!--
         <goal name="geronimo:deploy-assembly" prereqs="geronimo:assemble" description="Deploy an assembled Geronimo installation into the remote repository">



Mime
View raw message