geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmcma...@apache.org
Subject svn commit: r520023 [9/10] - in /geronimo/sandbox/j2g: ./ bin/ doc/ src/ src/common/ src/common/META-INF/ src/common/src/ src/common/src/org/ src/common/src/org/apache/ src/common/src/org/apache/apps/ src/common/src/org/apache/apps/j2gmigrator/ src/con...
Date Mon, 19 Mar 2007 17:43:49 GMT
Added: geronimo/sandbox/j2g/src2/web-migration-plugin/build.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/web-migration-plugin/build.properties?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/web-migration-plugin/build.properties (added)
+++ geronimo/sandbox/j2g/src2/web-migration-plugin/build.properties Mon Mar 19 10:43:27 2007
@@ -0,0 +1,21 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.
+ */
+ source.. = src/
+output.. = classes/
+bin.includes = plugin.xml,\
+               META-INF/,\
+               .,\

Propchange: geronimo/sandbox/j2g/src2/web-migration-plugin/build.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/web-migration-plugin/build.properties
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/web-migration-plugin/build.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/web-migration-plugin/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/web-migration-plugin/plugin.xml?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/web-migration-plugin/plugin.xml (added)
+++ geronimo/sandbox/j2g/src2/web-migration-plugin/plugin.xml Mon Mar 19 10:43:27 2007
@@ -0,0 +1,23 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.
+ */
+ <?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ 	<extension point="com.ibm.j2g.descriptors.migrations">
+      	<migration class="com.ibm.j2g.descriptors.web.WebDescriptorTool"/>
+   	</extension>
+</plugin>

Propchange: geronimo/sandbox/j2g/src2/web-migration-plugin/plugin.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/web-migration-plugin/plugin.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/web-migration-plugin/plugin.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/j2g/src2/web-migration-plugin/src/commons-logging.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/web-migration-plugin/src/commons-logging.properties?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/web-migration-plugin/src/commons-logging.properties (added)
+++ geronimo/sandbox/j2g/src2/web-migration-plugin/src/commons-logging.properties Mon Mar 19 10:43:27 2007
@@ -0,0 +1,30 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.
+ */
+ # Set root logger level to DEBUG and its only appender to console.
+log4j.rootLogger=INFO
+
+#define loggers
+#pluging logger
+log4j.logger.com.ibm.j2g= DEBUG,console
+
+# console is set to be a ConsoleAppender.
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+
+# console uses PatternLayout.
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+#log4j.appender.console.layout.ConversionPattern=[%t] %-5p %l - %m%n
+log4j.appender.console.layout.ConversionPattern=[%t] %-5p - %m%n
\ No newline at end of file

Propchange: geronimo/sandbox/j2g/src2/web-migration-plugin/src/commons-logging.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/web-migration-plugin/src/commons-logging.properties
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/web-migration-plugin/src/commons-logging.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/web-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/web/WebDescriptorTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/web-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/web/WebDescriptorTool.java?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/web-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/web/WebDescriptorTool.java (added)
+++ geronimo/sandbox/j2g/src2/web-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/web/WebDescriptorTool.java Mon Mar 19 10:43:27 2007
@@ -0,0 +1,141 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.apps.j2gmigrator.descriptors.web;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Iterator;
+
+import org.dom4j.*;
+import org.apache.apps.j2gmigrator.*;
+import org.apache.apps.j2gmigrator.descriptors.env.EnvirionmentElementProcessor;
+import org.apache.apps.j2gmigrator.descriptors.naming.NamingElementProcessor;
+import org.apache.apps.j2gmigrator.descriptors.security.SecurityElementProcessor;
+import org.apache.apps.j2gmigrator.descriptors.util.Constants;
+import org.apache.apps.j2gmigrator.descriptors.xmlutil.XMLConversionHelper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class WebDescriptorTool implements IFileMigration {
+
+    private IOutput out = Tool.getCurrent().getOutput();
+
+    private static Log logger = LogFactory.getLog(WebDescriptorTool.class);
+
+    private EnvirionmentElementProcessor envirionmentElementProcessor;
+
+    private SecurityElementProcessor securityElementProcessor;
+
+    private NamingElementProcessor namingElementProcessor;
+
+    public WebDescriptorTool() {
+        envirionmentElementProcessor = new EnvirionmentElementProcessor();
+        securityElementProcessor = new SecurityElementProcessor();
+        namingElementProcessor = new NamingElementProcessor(envirionmentElementProcessor);
+    }
+
+    public boolean migrate(File file) {
+
+        boolean migrated = false;
+            String directoryName = file.getParent();
+            String jbossFileName = file.getName();
+            logger.debug("Directory Name ==> " + directoryName + " jboss file Name ==> "
+                    + jbossFileName);
+            if (jbossFileName.equals(Constants.JBOSS_WEB_XML_FILE)) {
+                out.info("Converting Jboss-web.xml file in " + directoryName);
+                try {
+                    Document jbossDocument = XMLConversionHelper.getDocument(file);
+                    Document geronimoDocument = XMLConversionHelper.createNewGeronimoDocument(
+                            Constants.WEB_NAME_SPACE, Constants.GERONIMO_WEB_XML_ROOT_NODE);
+                    migrate(jbossDocument.getRootElement(), geronimoDocument.getRootElement());
+                    String geronimoWebFileName = directoryName + File.separator
+                            + Constants.GERONIMO_WEB_XML_FILE;
+                    XMLConversionHelper.saveGeronimoDocument(geronimoWebFileName, geronimoDocument);
+                    migrated = true;
+                    out.info("Successfully migrated the jboss-web.xml file in "
+                            + directoryName + ", with the error and warning messages as shown");
+                } catch (DocumentException e) {
+                	out.error("Errors occurs while reading xml descriptor "
+    						+ file.getAbsolutePath()
+    						+ ". It is possible that the migrator cannot download an xml schema or xml file has a wrong syntax. Nested exception:"
+    						+ e.getMessage());
+                } catch (IOException e) {
+                    out.error("IO exception " + e.getMessage());
+                }
+            } else if (jbossFileName.equals(Constants.WEB_XML_FILE)){
+                out.info("Converting web.xml file in " + directoryName);
+                out.info("Nothing to convert. Keep the file as it is");
+            }
+        return migrated;
+    }
+
+    private void migrate(Element jbossRootElement, Element geronimoRootElement) {
+
+        // migrate the web descriptor componets here
+        Element jbossRootChildElement;
+        for (Iterator iter = jbossRootElement.elements().iterator(); iter.hasNext();) {
+            jbossRootChildElement = (Element) iter.next();
+            if (jbossRootChildElement.getName().equals("context-root")) {
+                QName qname = new QName("context-root", geronimoRootElement.getNamespace());
+                Element contextRootElement = geronimoRootElement.addElement(qname);
+                contextRootElement.setText(jbossRootChildElement.getText());
+            } else if (jbossRootChildElement.getName().equals("security-domain")) {
+                QName qname = new QName("security-realm-name", geronimoRootElement.getNamespace());
+                Element realmNameElement = geronimoRootElement.addElement(qname);
+                realmNameElement.setText(jbossRootChildElement.getText());
+                securityElementProcessor.setSecurityDomain(jbossRootChildElement.getText());
+            } else if (jbossRootChildElement.getName().equals("security-role")) {
+                Element geronimoRoleMapping = securityElementProcessor
+                        .getGeronimoSecurityRoleElement(geronimoRootElement);
+                securityElementProcessor.migrateSecurityRole(jbossRootChildElement,
+                        geronimoRoleMapping);
+            } else if (jbossRootChildElement.getName().equals("resource-ref")) {
+                QName qname = new QName("resource-ref", geronimoRootElement
+                        .getNamespaceForPrefix(Constants.NAMING_NAME_SPACE_PREFIX));
+                Element geronimoResourceRef = geronimoRootElement.addElement(qname);
+                namingElementProcessor.migrateResourceRef(jbossRootChildElement,
+                        geronimoResourceRef);
+            } else if (jbossRootChildElement.getName().equals("ejb-ref")) {
+                out.error(
+                        "The Element 'ejb-ref' is not supported. It is not possible to determine the EJB name "
+                                + "from the jndi name. Please migrate this element manually",
+                        XMLConversionHelper.getLineNumber(jbossRootChildElement),
+                        XMLConversionHelper.getColumnNumber(jbossRootChildElement));
+                logger
+                        .debug("The Element 'ejb-ref' is not supported. It is not possible to determine the EJB name "
+                                + "from the jndi name. Please migrate this element manually");
+            } else if (jbossRootChildElement.getName().equals("ejb-local-ref")) {
+                out.error(
+                        "The Element 'ejb-local-ref' is not supported. It is not possible to determine the EJB name "
+                                + "from the jndi name. Please migrate this element manually",
+                        XMLConversionHelper.getLineNumber(jbossRootChildElement),
+                        XMLConversionHelper.getColumnNumber(jbossRootChildElement));
+                logger
+                        .debug("The Element 'ejb-local-ref' is not supported. It is not possible to determine the EJB name "
+                                + "from the jndi name. Please migrate this element manually");
+            } else {
+                out.warn(
+                        "The Element '" + jbossRootChildElement.getName() + "' is not supported. ",
+                        XMLConversionHelper.getLineNumber(jbossRootChildElement),
+                        XMLConversionHelper.getColumnNumber(jbossRootChildElement));
+                logger.debug("The Element '" + jbossRootChildElement.getName()
+                        + "' is not supported. ");
+            }
+        }
+    }
+
+}

Propchange: geronimo/sandbox/j2g/src2/web-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/web/WebDescriptorTool.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/web-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/web/WebDescriptorTool.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/web-migration-plugin/src/org/apache/apps/j2gmigrator/descriptors/web/WebDescriptorTool.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/web-migration-plugin/test-resources/jboss-web.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/web-migration-plugin/test-resources/jboss-web.xml?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/web-migration-plugin/test-resources/jboss-web.xml (added)
+++ geronimo/sandbox/j2g/src2/web-migration-plugin/test-resources/jboss-web.xml Mon Mar 19 10:43:27 2007
@@ -0,0 +1,48 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.
+ */
+ <?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN"
+        "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
+
+<jboss-web>
+    <security-domain>securityDomation</security-domain>
+    <context-root>/myApp</context-root>
+    <resource-env-ref>
+        <resource-env-ref-name>envResource1</resource-env-ref-name>
+        <jndi-name>jdbc/TestDB</jndi-name>
+    </resource-env-ref>
+     <resource-ref>
+        <res-ref-name>resource1</res-ref-name>
+        <jndi-name>jdbc/TestDB</jndi-name>
+    </resource-ref>
+    <security-role>
+        <role-name>amila1</role-name>
+        <principal-name>amila1</principal-name>
+    </security-role>
+     <security-role>
+        <role-name>amila2</role-name>
+        <principal-name>amila2</principal-name>
+    </security-role>
+    <ejb-ref>
+        <ejb-ref-name>ejb/TestEJB</ejb-ref-name>
+        <jndi-name>ejb/TestEJB</jndi-name>
+    </ejb-ref>
+    <ejb-local-ref>
+        <ejb-ref-name>ejb/LocalTestEJB</ejb-ref-name>
+        <local-jndi-name>ejb/LocalEJB</local-jndi-name>
+    </ejb-local-ref>
+</jboss-web>
\ No newline at end of file

Propchange: geronimo/sandbox/j2g/src2/web-migration-plugin/test-resources/jboss-web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/web-migration-plugin/test-resources/jboss-web.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/web-migration-plugin/test-resources/jboss-web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/j2g/src2/web-migration-plugin/test/org/apache/apps/j2gmigrator/descriptors/web/TestWebDescriptorTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/web-migration-plugin/test/org/apache/apps/j2gmigrator/descriptors/web/TestWebDescriptorTool.java?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/web-migration-plugin/test/org/apache/apps/j2gmigrator/descriptors/web/TestWebDescriptorTool.java (added)
+++ geronimo/sandbox/j2g/src2/web-migration-plugin/test/org/apache/apps/j2gmigrator/descriptors/web/TestWebDescriptorTool.java Mon Mar 19 10:43:27 2007
@@ -0,0 +1,43 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.apps.j2gmigrator.descriptors.web;
+
+import junit.framework.TestCase;
+
+import java.io.File;
+
+import org.apache.apps.j2gmigrator.descriptors.DescriptorsTool;
+import org.apache.apps.j2gmigrator.descriptors.web.WebDescriptorTool;
+
+
+
+/**
+ * Author: amila
+ * Date: Aug 10, 2006
+ */
+public class TestWebDescriptorTool extends TestCase {
+
+    public void testMigration() {
+
+        DescriptorsTool descriptorsTool = new DescriptorsTool();
+        File file = new File("test-resources/jboss-web.xml");
+        WebDescriptorTool webMigrationTool = new WebDescriptorTool();
+        webMigrationTool.migrate(file);
+
+    }
+
+}

Propchange: geronimo/sandbox/j2g/src2/web-migration-plugin/test/org/apache/apps/j2gmigrator/descriptors/web/TestWebDescriptorTool.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/web-migration-plugin/test/org/apache/apps/j2gmigrator/descriptors/web/TestWebDescriptorTool.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/web-migration-plugin/test/org/apache/apps/j2gmigrator/descriptors/web/TestWebDescriptorTool.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/xml-conversion-helper/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/xml-conversion-helper/META-INF/MANIFEST.MF?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/xml-conversion-helper/META-INF/MANIFEST.MF (added)
+++ geronimo/sandbox/j2g/src2/xml-conversion-helper/META-INF/MANIFEST.MF Mon Mar 19 10:43:27 2007
@@ -0,0 +1,57 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Xml_conversion_helper Plug-in
+Bundle-SymbolicName: com.ibm.j2g.util;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Vendor: ibm
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime
+Eclipse-LazyStart: true
+Bundle-ClassPath: lib/dom4j-1.6.1.jar,
+ lib/jaxen-1.1-beta-6.jar,
+ lib/junit-3.8.1.jar,
+ lib/pull-parser-2.1.10.jar,
+ .,
+ lib/commons-logging-api-1.1.jar
+Export-Package: com.ibm.j2g.descriptors.env,
+ com.ibm.j2g.descriptors.naming,
+ com.ibm.j2g.descriptors.security,
+ com.ibm.j2g.descriptors.util,
+ com.ibm.j2g.descriptors.xmlutil,
+ com.ibm.j2g.resources.utils,
+ com.ibm.j2g.resources.xmlutil,
+ junit.awtui,
+ org.apache.commons.logging,
+ org.apache.commons.logging.impl,
+ org.dom4j,
+ org.gjt.xpp,
+ org.dom4j.bean,
+ org.dom4j.datatype,
+ org.dom4j.dom,
+ org.dom4j.dtd,
+ org.dom4j.io,
+ org.dom4j.jaxb,
+ org.dom4j.rule,
+ org.dom4j.rule.pattern,
+ org.dom4j.swing,
+ org.dom4j.tree,
+ org.dom4j.util,
+ org.dom4j.xpath,
+ org.dom4j.xpp,
+ org.jaxen,
+ org.jaxen.dom,
+ org.jaxen.dom.html,
+ org.jaxen.dom4j,
+ org.jaxen.expr,
+ org.jaxen.expr.iter,
+ org.jaxen.function,
+ org.jaxen.function.ext,
+ org.jaxen.function.xslt,
+ org.jaxen.javabean,
+ org.jaxen.jdom,
+ org.jaxen.pattern,
+ org.jaxen.saxpath,
+ org.jaxen.saxpath.base,
+ org.jaxen.saxpath.helpers,
+ org.jaxen.util,
+ org.jaxen.xom

Added: geronimo/sandbox/j2g/src2/xml-conversion-helper/build.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/xml-conversion-helper/build.properties?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/xml-conversion-helper/build.properties (added)
+++ geronimo/sandbox/j2g/src2/xml-conversion-helper/build.properties Mon Mar 19 10:43:27 2007
@@ -0,0 +1,26 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.
+ */
+ source.. = src/
+output.. = classes/
+bin.includes = plugin.xml,\
+               META-INF/,\
+               .,\
+               lib/dom4j-1.6.1.jar,\
+               lib/jaxen-1.1-beta-6.jar,\
+               lib/junit-3.8.1.jar,\
+               lib/pull-parser-2.1.10.jar,\
+               lib/commons-logging-api-1.1.jar

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/build.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/build.properties
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/build.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/xml-conversion-helper/lib/commons-logging-api-1.1.jar
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/xml-conversion-helper/lib/commons-logging-api-1.1.jar?view=auto&rev=520023
==============================================================================
Binary file - no diff available.

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/lib/commons-logging-api-1.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/java-archive

Added: geronimo/sandbox/j2g/src2/xml-conversion-helper/lib/dom4j-1.6.1.jar
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/xml-conversion-helper/lib/dom4j-1.6.1.jar?view=auto&rev=520023
==============================================================================
Binary file - no diff available.

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/lib/dom4j-1.6.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/java-archive

Added: geronimo/sandbox/j2g/src2/xml-conversion-helper/lib/jaxen-1.1-beta-6.jar
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/xml-conversion-helper/lib/jaxen-1.1-beta-6.jar?view=auto&rev=520023
==============================================================================
Binary file - no diff available.

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/lib/jaxen-1.1-beta-6.jar
------------------------------------------------------------------------------
    svn:mime-type = application/java-archive

Added: geronimo/sandbox/j2g/src2/xml-conversion-helper/lib/junit-3.8.1.jar
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/xml-conversion-helper/lib/junit-3.8.1.jar?view=auto&rev=520023
==============================================================================
Binary file - no diff available.

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/lib/junit-3.8.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/java-archive

Added: geronimo/sandbox/j2g/src2/xml-conversion-helper/lib/pull-parser-2.1.10.jar
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/xml-conversion-helper/lib/pull-parser-2.1.10.jar?view=auto&rev=520023
==============================================================================
Binary file - no diff available.

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/lib/pull-parser-2.1.10.jar
------------------------------------------------------------------------------
    svn:mime-type = application/java-archive

Added: geronimo/sandbox/j2g/src2/xml-conversion-helper/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/xml-conversion-helper/plugin.xml?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/xml-conversion-helper/plugin.xml (added)
+++ geronimo/sandbox/j2g/src2/xml-conversion-helper/plugin.xml Mon Mar 19 10:43:27 2007
@@ -0,0 +1,20 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.
+ */
+ <?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+</plugin>

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/plugin.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/plugin.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/plugin.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/commons-logging.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/xml-conversion-helper/src/commons-logging.properties?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/xml-conversion-helper/src/commons-logging.properties (added)
+++ geronimo/sandbox/j2g/src2/xml-conversion-helper/src/commons-logging.properties Mon Mar 19 10:43:27 2007
@@ -0,0 +1,30 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.
+ */
+ # Set root logger level to DEBUG and its only appender to console.
+commons-logging.rootLogger=INFO
+
+#define loggers
+#pluging logger
+lcommons-logging.logger.com.ibm.j2g= DEBUG,console
+
+# console is set to be a ConsoleAppender.
+commons-logging.appender.console=org.apache.log4j.ConsoleAppender
+
+# console uses PatternLayout.
+commons-logging.appender.console.layout=org.apache.log4j.PatternLayout
+#commons-logging.appender.console.layout.ConversionPattern=[%t] %-5p %l - %m%n
+commons-logging.appender.console.layout.ConversionPattern=[%t] %-5p - %m%n
\ No newline at end of file

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/commons-logging.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/commons-logging.properties
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/commons-logging.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/env/EnvirionmentElementProcessor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/env/EnvirionmentElementProcessor.java?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/env/EnvirionmentElementProcessor.java (added)
+++ geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/env/EnvirionmentElementProcessor.java Mon Mar 19 10:43:27 2007
@@ -0,0 +1,107 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.apps.j2gmigrator.descriptors.env;
+
+import org.dom4j.Element;
+import org.dom4j.Namespace;
+import org.dom4j.QName;
+import org.apache.apps.j2gmigrator.descriptors.util.Constants;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.util.Map;
+import java.util.HashMap;
+
+
+public class EnvirionmentElementProcessor {
+
+    private Map processedJndiNames;
+
+    private Log logger = LogFactory.getLog(EnvirionmentElementProcessor.class);
+
+    public EnvirionmentElementProcessor() {
+        this.processedJndiNames = new HashMap();
+    }
+
+    public String addDependencyModule(String jndiName, Element geronimoRootElement) {
+
+        String orginalJndiName = jndiName;
+        // process the invalid chars
+        jndiName = jndiName.replaceAll("%", "%25");
+        jndiName = jndiName.replaceAll("\\\\/", "%2F");
+        jndiName = jndiName.replaceAll("\\\\\\\\", "%5F");
+
+        // add prefix
+        jndiName = "j2g/" + jndiName;
+
+        String firstPart = jndiName.substring(0, jndiName.lastIndexOf("/"));
+        String lastPart = jndiName.substring(jndiName.lastIndexOf("/") + 1);
+
+        firstPart = firstPart.replaceAll("/", ".");
+        logger.debug("Creating a new dependency with groupID ==> " + firstPart + " artifactID ==> "
+                + lastPart + " version ==> 1.0 type ==> rar");
+
+        Namespace sysNS = geronimoRootElement
+                .getNamespaceForPrefix(Constants.SYS_NAME_SPACE_PREFIX);
+
+        // get Dependencies Element
+        QName envirionmentQName = new QName("environment", sysNS);
+        Element envirionmentElement = geronimoRootElement.element(envirionmentQName);
+        QName dependenciesQName = new QName("dependencies", sysNS);
+        Element geronimoDependenciesElement = envirionmentElement.element(dependenciesQName);
+
+        // adding the dependency
+        QName depencencyQName = new QName("dependency", sysNS);
+        Element geronimoDepencyElement = geronimoDependenciesElement.addElement(depencencyQName);
+
+        QName groupIdQName = new QName("groupId", sysNS);
+        Element geronimoGroupIdElement = geronimoDepencyElement.addElement(groupIdQName);
+        geronimoGroupIdElement.setText(firstPart);
+
+        QName artifactIdQName = new QName("artifactId", sysNS);
+        Element geronimoArtifactIdElement = geronimoDepencyElement.addElement(artifactIdQName);
+        geronimoArtifactIdElement.setText(lastPart);
+
+        QName versionQName = new QName("version", sysNS);
+        Element geronimoVersionElement = geronimoDepencyElement.addElement(versionQName);
+        geronimoVersionElement.setText("1.0");
+
+        QName typeQName = new QName("type", sysNS);
+        Element geronimoTypeElement = geronimoDepencyElement.addElement(typeQName);
+        geronimoTypeElement.setText("rar");
+
+        processedJndiNames.put(orginalJndiName, lastPart);
+
+        return lastPart;
+
+    }
+
+    public boolean isJndiNameProcessed(String jndiName) {
+        return processedJndiNames.containsKey(jndiName);
+    }
+
+    /**
+     * assume jndiName already exists
+     * 
+     * @param jndiName
+     * @return artifact ID
+     */
+
+    public String getArtifactID(String jndiName) {
+        return (String) processedJndiNames.get(jndiName);
+    }
+}

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/env/EnvirionmentElementProcessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/env/EnvirionmentElementProcessor.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/env/EnvirionmentElementProcessor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/naming/NamingElementProcessor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/naming/NamingElementProcessor.java?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/naming/NamingElementProcessor.java (added)
+++ geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/naming/NamingElementProcessor.java Mon Mar 19 10:43:27 2007
@@ -0,0 +1,63 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.apps.j2gmigrator.descriptors.naming;
+
+import org.apache.apps.j2gmigrator.descriptors.env.EnvirionmentElementProcessor;
+import org.apache.apps.j2gmigrator.descriptors.util.Constants;
+import org.dom4j.Element;
+import org.dom4j.QName;
+
+import java.util.Iterator;
+
+
+public class NamingElementProcessor {
+
+    private EnvirionmentElementProcessor envirionmentElementProcessor;
+
+    public NamingElementProcessor(EnvirionmentElementProcessor envirionmentElementProcessor) {
+        this.envirionmentElementProcessor = envirionmentElementProcessor;
+    }
+
+    public void migrateResourceRef(Element jbossResourceRef, Element geronimoResourceRef) {
+
+        Element jbossResourceRefChildElement;
+        for (Iterator iter = jbossResourceRef.elements().iterator(); iter.hasNext();) {
+            jbossResourceRefChildElement = (Element) iter.next();
+            if (jbossResourceRefChildElement.getName().equals("res-ref-name")) {
+                QName qname = new QName("ref-name", geronimoResourceRef
+                        .getNamespaceForPrefix(Constants.NAMING_NAME_SPACE_PREFIX));
+                Element geronimoRefName = geronimoResourceRef.addElement(qname);
+                geronimoRefName.setText(jbossResourceRefChildElement.getText());
+            } else if (jbossResourceRefChildElement.getName().equals("jndi-name")) {
+                // create a dependency element at the envirionment
+                String jndiName = jbossResourceRefChildElement.getText();
+                String artifactID;
+                if (envirionmentElementProcessor.isJndiNameProcessed(jndiName)) {
+                    artifactID = envirionmentElementProcessor.getArtifactID(jndiName);
+                } else {
+                    artifactID = envirionmentElementProcessor.addDependencyModule(jndiName,
+                            geronimoResourceRef.getDocument().getRootElement());
+                }
+                // create the resource link
+                QName qname = new QName("resource-link", geronimoResourceRef
+                        .getNamespaceForPrefix(Constants.NAMING_NAME_SPACE_PREFIX));
+                Element geronimoResourceLink = geronimoResourceRef.addElement(qname);
+                geronimoResourceLink.setText(artifactID);
+            }
+        }
+    }
+}

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/naming/NamingElementProcessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/naming/NamingElementProcessor.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/naming/NamingElementProcessor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/security/SecurityElementProcessor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/security/SecurityElementProcessor.java?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/security/SecurityElementProcessor.java (added)
+++ geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/security/SecurityElementProcessor.java Mon Mar 19 10:43:27 2007
@@ -0,0 +1,120 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.apps.j2gmigrator.descriptors.security;
+
+
+import org.apache.apps.j2gmigrator.descriptors.util.Constants;
+import org.dom4j.*;
+
+import java.util.Iterator;
+
+
+public class SecurityElementProcessor {
+
+    private boolean isSecurityAdded;
+
+    private String defaultPrincipal = "anonymous";
+
+    private String securityDomain;
+
+    /**
+     * converts the security role element in jobss to role mapping
+     * 
+     * @param jbossSecurityRoleElement
+     * @param geronimoRoleMapping
+     */
+    public void migrateSecurityRole(Element jbossSecurityRoleElement, Element geronimoRoleMapping) {
+
+        QName roleQname = new QName("role", geronimoRoleMapping.getNamespace());
+        Element geronimoRoleElement = geronimoRoleMapping.addElement(roleQname);
+
+        Element jbossSecurityRoleElementChild;
+        for (Iterator iter = jbossSecurityRoleElement.elements().iterator(); iter.hasNext();) {
+            jbossSecurityRoleElementChild = (Element) iter.next();
+            if (jbossSecurityRoleElementChild.getName().equals("role-name")) {
+                geronimoRoleElement.addAttribute("role-name", jbossSecurityRoleElementChild
+                        .getText());
+            } else if (jbossSecurityRoleElementChild.getName().equals("principal-name")) {
+                addPrinciple(geronimoRoleElement, jbossSecurityRoleElementChild.getText());
+            }
+        }
+    }
+
+    /**
+     * if there is no element created then create new one otherwise return the
+     * existing one
+     * 
+     * @param geronimoRootElement
+     * @return security Rolemapping Element
+     */
+    public Element getGeronimoSecurityRoleElement(Element geronimoRootElement) {
+
+        Element geronimoRoleMappingsElement = null;
+        if (isSecurityAdded) {
+            // security element is already there we have to return it
+            Element geronimoSecurity = geronimoRootElement.element("security");
+            geronimoRoleMappingsElement = geronimoSecurity.element("role-mappings");
+        } else {
+            // we have to create a security element
+            Namespace securityNS = geronimoRootElement
+                    .getNamespaceForPrefix(Constants.SECURITY_NAME_SPACE_PREFIX);
+            QName securityQname = new QName("security", securityNS);
+            Element geronimoSecurityElement = geronimoRootElement.addElement(securityQname);
+
+            // add default principle
+            QName defaultPrincipleQname = new QName("default-principal", securityNS);
+            Element defaultPrincipleElement = geronimoSecurityElement
+                    .addElement(defaultPrincipleQname);
+            addPrinciple(defaultPrincipleElement, defaultPrincipal);
+
+            // add security role mappings element
+            QName roleMappingsQname = new QName("role-mappings", securityNS);
+            geronimoRoleMappingsElement = geronimoSecurityElement.addElement(roleMappingsQname);
+            isSecurityAdded = true;
+        }
+
+        return geronimoRoleMappingsElement;
+    }
+
+    private void addPrinciple(Element geronimoElement, String name) {
+        QName principleQname = new QName("realm-principal", geronimoElement.getNamespace());
+        Element geronimoPrincipleElement = geronimoElement.addElement(principleQname);
+        geronimoPrincipleElement.addAttribute("class",
+                "org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal");
+        geronimoPrincipleElement.addAttribute("name", name);
+        if (securityDomain != null) {
+            geronimoPrincipleElement.addAttribute("domain-name", securityDomain);
+            geronimoPrincipleElement.addAttribute("realm-name", securityDomain);
+        }
+    }
+
+    public String getDefaultPrincipal() {
+        return defaultPrincipal;
+    }
+
+    public void setDefaultPrincipal(String defaultPrincipal) {
+        this.defaultPrincipal = defaultPrincipal;
+    }
+
+    public String getSecurityDomain() {
+        return securityDomain;
+    }
+
+    public void setSecurityDomain(String securityDomain) {
+        this.securityDomain = securityDomain;
+    }
+}

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/security/SecurityElementProcessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/security/SecurityElementProcessor.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/security/SecurityElementProcessor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/util/Constants.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/util/Constants.java?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/util/Constants.java (added)
+++ geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/util/Constants.java Mon Mar 19 10:43:27 2007
@@ -0,0 +1,68 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.apps.j2gmigrator.descriptors.util;
+
+public interface Constants {
+
+    public static final String JBOSS_WEB_XML_FILE = "jboss-web.xml";
+
+    public static final String GERONIMO_WEB_XML_FILE = "geronimo-web.xml";
+
+    public static final String JBOSS_JBOSS_XML_FILE = "jboss.xml";
+
+    public static final String JBOSS_JBOSS_CMP_JDBC_XML_FILE = "jbosscmp-jdbc.xml";
+
+    public static final String GERONIMO_OPEN_EJB_XML_FILE = "openejb-jar.xml";
+
+    public static final String EJB_JAR_XML_FILE = "ejb-jar.xml";
+
+    public static final String JBOSS_JBOSS_APPLICATION_XML_FILE = "jboss-app.xml";
+
+    public static final String GERONIMO_APPLICATION_XML_FILE = "geronimo-application.xml";
+
+    //standard j2ee files
+    public static final String WEB_XML_FILE = "web.xml";
+
+    public static final String APPLICATION_XML_FILE = "application.xml";
+
+    // name spaces
+    public static final String WEB_NAME_SPACE = "http://geronimo.apache.org/xml/ns/j2ee/web-1.1";
+
+    public static final String NAMING_NAME_SPACE = "http://geronimo.apache.org/xml/ns/naming-1.1";
+
+    public static final String SECURITY_NAME_SPACE = "http://geronimo.apache.org/xml/ns/security-1.1";
+
+    public static final String SYS_NAME_SPACE = "http://geronimo.apache.org/xml/ns/deployment-1.1";
+
+    public static final String EJB_NAME_SPACE = "http://www.openejb.org/xml/ns/openejb-jar-2.1";
+
+    public static final String APPLICATION_NAME_SPACE = "http://geronimo.apache.org/xml/ns/j2ee/application-1.1";
+
+    // prefixes
+    public static final String NAMING_NAME_SPACE_PREFIX = "naming";
+
+    public static final String SECURITY_NAME_SPACE_PREFIX = "security";
+
+    public static final String SYS_NAME_SPACE_PREFIX = "sys";
+
+    public static final String GERONIMO_WEB_XML_ROOT_NODE = "web-app";
+
+    public static final String GERONIMO_OPEN_EJB_XML_ROOT_NODE = "openejb-jar";
+
+    public static final String GERONIMO_APPLICATION_XML_ROOT_NODE = "application";
+
+}

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/util/Constants.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/util/Constants.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/util/Constants.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/xmlutil/XMLConversionHelper.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/xmlutil/XMLConversionHelper.java?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/xmlutil/XMLConversionHelper.java (added)
+++ geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/xmlutil/XMLConversionHelper.java Mon Mar 19 10:43:27 2007
@@ -0,0 +1,400 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.apps.j2gmigrator.descriptors.xmlutil;
+
+import org.dom4j.Attribute;
+import org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+import org.dom4j.Namespace;
+import org.dom4j.Node;
+import org.dom4j.QName;
+import org.dom4j.XPath;
+import org.dom4j.io.OutputFormat;
+import org.dom4j.io.SAXReader;
+import org.dom4j.io.XMLWriter;
+import org.apache.apps.j2gmigrator.descriptors.util.Constants;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLFilter;
+import org.xml.sax.helpers.AttributesImpl;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+import java.io.*;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+
+public class XMLConversionHelper {
+
+    private static Log logger = LogFactory.getLog(XMLConversionHelper.class);
+
+    private static final String NAMESPACE_URI = "http://www.ibm.com/j2g";
+
+    private static final String PREFIX = "j2g";
+
+    private static final QName LINE_NUMBER_ATTR = QName.get("lineNumber", PREFIX, NAMESPACE_URI);
+
+    private static final QName COLUMN_NUMBER_ATTR = QName
+            .get("columnNumber", PREFIX, NAMESPACE_URI);
+
+    public static int getLineNumber(Element element) {
+        return getIntAttribute(element, LINE_NUMBER_ATTR);
+    }
+
+    public static int getColumnNumber(Element element) {
+        return getIntAttribute(element, COLUMN_NUMBER_ATTR);
+    }
+
+    private static int getIntAttribute(Element element, QName name) {
+        Attribute attr = element.attribute(name);
+        return attr == null ? 0 : Integer.parseInt(attr.getValue());
+    }
+
+    public static Document getDocument(File file) throws DocumentException {
+        XMLFilter xmlFilter = new XMLFilterImpl() {
+            private Locator locator;
+
+            public void setDocumentLocator(Locator locator) {
+                this.locator = locator;
+                super.setDocumentLocator(locator);
+            }
+
+            public void startElement(String uri, String localName, String qName, Attributes atts)
+                    throws SAXException {
+                Attributes extAtts;
+                if (locator != null) {
+                    AttributesImpl locationAtts = new AttributesImpl(atts);
+                    addIntAttribute(locationAtts, LINE_NUMBER_ATTR, locator.getLineNumber());
+                    addIntAttribute(locationAtts, COLUMN_NUMBER_ATTR, locator.getColumnNumber());
+                    extAtts = locationAtts;
+                } else {
+                    extAtts = atts;
+                }
+                super.startElement(uri, localName, qName, extAtts);
+            }
+
+            private void addIntAttribute(AttributesImpl locAtts, QName name, int value) {
+                locAtts.addAttribute(name.getNamespaceURI(), name.getName(), name
+                        .getQualifiedName(), "CDATA", String.valueOf(value));
+            }
+
+        };
+
+        SAXReader saxReader = new SAXReader();
+        saxReader.setXMLFilter(xmlFilter);
+        return saxReader.read(file);
+    }
+
+    /**
+     * @return a new dom4j document for geronimo-web.xml
+     */
+
+    public static Document createNewGeronimoDocument(String namespaceName, String rootName) {
+
+        Document document = getEmptyGeronimoDocument(namespaceName, rootName);
+        Element rootElement = document.getRootElement();
+        Namespace deploymentNS = rootElement.getNamespaceForPrefix(Constants.SYS_NAME_SPACE_PREFIX);
+
+        // add system environment and dependencies element
+        QName envirionmentQName = new QName("environment", deploymentNS);
+        Element envirionmentElement = rootElement.addElement(envirionmentQName);
+        addModuleDetails(envirionmentElement, rootName);
+        QName dependenciesQName = new QName("dependencies", deploymentNS);
+        envirionmentElement.addElement(dependenciesQName);
+        return document;
+    }
+
+    private static Document getEmptyGeronimoDocument(String namespaceName, String rootName) {
+
+        Namespace namespace = new Namespace("", namespaceName);
+        QName qname = new QName(rootName, namespace);
+        Document document = DocumentHelper.createDocument();
+        document.addElement(qname);
+        // adding the other required name spaces
+        Namespace namingNS = new Namespace(Constants.NAMING_NAME_SPACE_PREFIX,
+                Constants.NAMING_NAME_SPACE);
+        Namespace securityNS = new Namespace(Constants.SECURITY_NAME_SPACE_PREFIX,
+                Constants.SECURITY_NAME_SPACE);
+        Namespace deploymentNS = new Namespace(Constants.SYS_NAME_SPACE_PREFIX,
+                Constants.SYS_NAME_SPACE);
+
+        Element rootElement = document.getRootElement();
+        rootElement.add(namingNS);
+        rootElement.add(securityNS);
+        rootElement.add(deploymentNS);
+
+        return document;
+    }
+
+    private static void addModuleDetails(Element geronimoEnvirionment, String rooName) {
+
+        QName qname = new QName("moduleId", geronimoEnvirionment.getNamespace());
+        Element geronimoModuleID = geronimoEnvirionment.addElement(qname);
+
+        // add groupID
+        qname = new QName("groupId", geronimoModuleID.getNamespace());
+        geronimoModuleID.addElement(qname).setText("j2g");
+
+        if (rooName.equals(Constants.GERONIMO_WEB_XML_ROOT_NODE)) {
+            qname = new QName("artifactId", geronimoModuleID.getNamespace());
+            geronimoModuleID.addElement(qname).setText("web-module");
+            qname = new QName("version", geronimoModuleID.getNamespace());
+            geronimoModuleID.addElement(qname).setText("1.0");
+            qname = new QName("type", geronimoModuleID.getNamespace());
+            geronimoModuleID.addElement(qname).setText("war");
+
+        } else if (rooName.equals(Constants.GERONIMO_OPEN_EJB_XML_ROOT_NODE)) {
+            qname = new QName("artifactId", geronimoModuleID.getNamespace());
+            geronimoModuleID.addElement(qname).setText("ejb-module");
+            qname = new QName("version", geronimoModuleID.getNamespace());
+            geronimoModuleID.addElement(qname).setText("1.0");
+            qname = new QName("type", geronimoModuleID.getNamespace());
+            geronimoModuleID.addElement(qname).setText("jar");
+
+        } else if (rooName.equals(Constants.GERONIMO_APPLICATION_XML_ROOT_NODE)) {
+            qname = new QName("artifactId", geronimoModuleID.getNamespace());
+            geronimoModuleID.addElement(qname).setText("application");
+            qname = new QName("version", geronimoModuleID.getNamespace());
+            geronimoModuleID.addElement(qname).setText("1.0");
+            qname = new QName("type", geronimoModuleID.getNamespace());
+            geronimoModuleID.addElement(qname).setText("ear");
+
+        }
+    }
+
+    public static Document getOpenEJBJarDocument(String directoryName) throws DocumentException {
+        File openEJBJarFile = new File(directoryName + File.separator
+                + Constants.GERONIMO_OPEN_EJB_XML_FILE);
+        Document geronimoOpenEjbDocument = null;
+        if (openEJBJarFile.exists()) {
+            // get the dom from this file
+            SAXReader saxReader = new SAXReader();
+            geronimoOpenEjbDocument = saxReader.read(openEJBJarFile);
+        } else {
+            geronimoOpenEjbDocument = createNewGeronimoDocument(Constants.EJB_NAME_SPACE,
+                    Constants.GERONIMO_OPEN_EJB_XML_ROOT_NODE);
+        }
+        return geronimoOpenEjbDocument;
+
+    }
+
+    /**
+     * writes the dom4j document object to the file given in fileNmae
+     * 
+     * @param fileName
+     * @param document
+     * @throws IOException
+     */
+
+    public static void saveGeronimoDocument(String fileName, Document document) throws IOException {
+        // delete the file if already exists
+        File file = new File(fileName);
+        if (file.exists()) {
+            logger.debug("Deleting existig open ejb jar file");
+            file.delete();
+        }
+
+        OutputFormat format = OutputFormat.createPrettyPrint();
+        XMLWriter writer = new XMLWriter(new FileWriter(fileName), format);
+        writer.write(document);
+        writer.close();
+
+    }
+
+    /**
+     * since openejb-jar.xml contains both jboss.xml and jbosscmp-jdbc.xml file
+     * entries the order, in which elements in the dom tree may not be according
+     * to the schema. So we have to fix this error by re arranging the elements
+     * of the document. This method rearrange the elements in the root element
+     * and the entity element. entity bean element is the only element that both
+     * jboss.xml and the jbosscmp-jdbc.xml files add entries.
+     * 
+     * @param fileName
+     * @param openEJBDocument
+     * @throws IOException
+     */
+
+    public static void saveOpenEJBDocument(String fileName, Document openEJBDocument)
+            throws IOException {
+
+        // create a new geronimo document
+        Document emptyOpenEJBDocuemnt = getEmptyGeronimoDocument(Constants.EJB_NAME_SPACE,
+                Constants.GERONIMO_OPEN_EJB_XML_ROOT_NODE);
+
+        Element openEJBRootElement = openEJBDocument.getRootElement();
+        // put existing elements to hashmap
+        Map elementsMap = getChildrenHashMap(openEJBRootElement);
+        // add existing elements in order
+        addElementToEmptyDocument(elementsMap, emptyOpenEJBDocuemnt.getRootElement(), "environment");
+        addElementToEmptyDocument(elementsMap, emptyOpenEJBDocuemnt.getRootElement(),
+                "cmp-connection-factory");
+        addEnterpriseBeanToEmptyDocument(elementsMap, emptyOpenEJBDocuemnt.getRootElement());
+        addElementToEmptyDocument(elementsMap, emptyOpenEJBDocuemnt.getRootElement(),
+                "relationships");
+        addElementToEmptyDocument(elementsMap, emptyOpenEJBDocuemnt.getRootElement(), "security");
+
+        saveGeronimoDocument(fileName, emptyOpenEJBDocuemnt);
+    }
+
+    /**
+     * this map contains the element name as the key and the elements list as
+     * the value
+     * 
+     * @param element
+     * @return children has map
+     */
+
+    private static Map getChildrenHashMap(Element element) {
+        Map elementsMap = new HashMap();
+        Element elementChild;
+        for (Iterator iter = element.elementIterator(); iter.hasNext();) {
+            elementChild = (Element) iter.next();
+            if (!elementsMap.containsKey(elementChild.getName())) {
+                // add the element list to map only if key does not exits
+                elementsMap.put(elementChild.getName(), element.elements(elementChild.getName()));
+            }
+        }
+        return elementsMap;
+    }
+
+    private static void addElementToEmptyDocument(Map elementsMap, Element element,
+            String elementName) {
+        List elementsList;
+        if (elementsMap.containsKey(elementName)) {
+            elementsList = (List) elementsMap.get(elementName);
+            Element elementChild;
+            for (Iterator iter = elementsList.iterator(); iter.hasNext();) {
+                elementChild = (Element) iter.next();
+                element.add(elementChild.createCopy());
+            }
+        }
+    }
+
+    /**
+     * rearrange the enterprise beans element
+     * 
+     * @param elementsMap
+     * @param element
+     */
+
+    public static void addEnterpriseBeanToEmptyDocument(Map elementsMap, Element element) {
+
+        List enterpriseBeans;
+        if (elementsMap.containsKey("enterprise-beans")) {
+            enterpriseBeans = (List) elementsMap.get("enterprise-beans");
+
+            Element enterpriseBean;
+            for (Iterator iter = enterpriseBeans.iterator(); iter.hasNext();) {
+                enterpriseBean = (Element) iter.next();
+
+                QName qname = new QName("enterprise-beans", element.getNamespace());
+                Element geronimoEnterpriseBeans = element.addElement(qname);
+
+                Map childrenMap = getChildrenHashMap(enterpriseBean);
+                addElementToEmptyDocument(childrenMap, geronimoEnterpriseBeans, "session");
+                addEntityBeanToEmptyDocument(childrenMap, geronimoEnterpriseBeans);
+            }
+        }
+    }
+
+    /**
+     * rearranges the entity bean in correct order
+     * 
+     * @param elementsMap
+     * @param element
+     */
+
+    public static void addEntityBeanToEmptyDocument(Map elementsMap, Element element) {
+
+        List entityBeans;
+        if (elementsMap.containsKey("entity")) {
+            entityBeans = (List) elementsMap.get("entity");
+
+            Element entityBean;
+            for (Iterator iter = entityBeans.iterator(); iter.hasNext();) {
+                entityBean = (Element) iter.next();
+
+                QName qname = new QName("entity", element.getNamespace());
+                Element geronimoEntityBean = element.addElement(qname);
+
+                Map childrenMap = getChildrenHashMap(entityBean);
+                addElementToEmptyDocument(childrenMap, geronimoEntityBean, "ejb-name");
+                addElementToEmptyDocument(childrenMap, geronimoEntityBean, "jndi-name");
+                addElementToEmptyDocument(childrenMap, geronimoEntityBean, "local-jndi-name");
+                addElementToEmptyDocument(childrenMap, geronimoEntityBean, "table-name");
+                addElementToEmptyDocument(childrenMap, geronimoEntityBean, "cmp-field-mapping");
+            }
+        }
+    }
+
+    /**
+     * if the element already exists then use it otherwise return a new element
+     * 
+     * @param parentElement
+     * @param xpathToNewElemnt
+     * @param newElementName
+     * @param newElementNamespace
+     * @return new element
+     */
+
+    public static Element getGeronimoElement(Element parentElement, String xpathToNewElemnt,
+            String newElementName, Namespace newElementNamespace) {
+        Document document = parentElement.getDocument();
+        XPath xpath = document.createXPath(xpathToNewElemnt);
+        xpath.setNamespaceURIs(getNamespacesHashMap());
+        Node node = xpath.selectSingleNode(document);
+        Element newElement = null;
+        if (node == null) {
+            QName qname = new QName(newElementName, newElementNamespace);
+            newElement = parentElement.addElement(qname);
+        } else {
+            newElement = (Element) node;
+        }
+        return newElement;
+    }
+
+    public static Element getJbossElement(Document jbossDocument, String xpathToElement) {
+        XPath xpath = jbossDocument.createXPath(xpathToElement);
+        Node node = xpath.selectSingleNode(jbossDocument);
+        return (Element) node;
+    }
+
+    public static boolean isNodeAvailable(Element parentElement, String xpathValue) {
+        Document document = parentElement.getDocument();
+        XPath xpath = document.createXPath(xpathValue);
+        xpath.setNamespaceURIs(getNamespacesHashMap());
+        Node node = xpath.selectSingleNode(parentElement);
+        return (node != null);
+    }
+
+    public static Map getNamespacesHashMap() {
+        Map hashMap = new HashMap();
+        hashMap.put("ejb", Constants.EJB_NAME_SPACE);
+        hashMap.put(Constants.NAMING_NAME_SPACE_PREFIX, Constants.NAMING_NAME_SPACE);
+        hashMap.put(Constants.SECURITY_NAME_SPACE_PREFIX, Constants.SECURITY_NAME_SPACE);
+        hashMap.put(Constants.SYS_NAME_SPACE_PREFIX, Constants.SYS_NAME_SPACE);
+        return hashMap;
+    }
+}

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/xmlutil/XMLConversionHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/xmlutil/XMLConversionHelper.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/descriptors/xmlutil/XMLConversionHelper.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/resources/utils/Constants.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/resources/utils/Constants.java?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/resources/utils/Constants.java (added)
+++ geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/resources/utils/Constants.java Mon Mar 19 10:43:27 2007
@@ -0,0 +1,106 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.apps.j2gmigrator.resources.utils;
+
+/**
+ * Constants use by the Resources Tool
+ */
+public interface Constants {
+
+    // JBoss resources files
+    public static final String JBOSS_VALID_DS_XML_FILE = "ds.xml";
+
+    public static final String JBOSS_VALID_SECURITY_XML_FILE = "login-config.xml";
+
+    public static final String JBOSS_VALID_MAIL_XML_FILE = "mail-service.xml";
+
+    public static final String JBOSS_VALID_JMS_DESTINATIONS_SERVICES_XML_FILE = "jbossmq-destinations-service.xml";
+
+    public static final String JBOSS_VALID_JMS_CONNECTION_FACTORY_XML_FILE = "jms-ds.xml";
+
+
+    // Geronimo Resources files
+    public static final String GERONIMO_PLAN_FILE = "-geronimo-plan.xml";
+
+    public static final String GERONIMO_SECURITY_PLAN_FILE = "security-geronimo-plan.xml";
+
+    public static final String GERONIMO_JMS_PLAN_FILE = "jms-geronimo-plan.xml";
+
+    public static final String GERONIMO_MAIL_PLAN_FILE = "mail-geronimo-plan.xml";
+
+    // namespaces
+    public static final String NAMESPACE_CONNECTOR = "http://geronimo.apache.org/xml/ns/j2ee/connector-1.1";
+
+    public static final String NAMESPACE_ENV = "http://geronimo.apache.org/xml/ns/deployment-1.1";
+
+    public static final String NAMESPACE_SYS = "http://geronimo.apache.org/xml/ns/deployment-1.1";
+
+    public static final String NAMESPACE_GERONIMO_LOGGIN = "http://geronimo.apache.org/xml/ns/loginconfig-1.1";
+
+    public static final String NAMESPACE_GERONIMO_NAMING = "http://geronimo.apache.org/xml/ns/naming-1.1";
+
+    // prefexes
+    public static final String ENV_NAMESPACE_PREFIX = "dep";
+
+    public static final String NAMING_NAME_SPACE_PREFIX = "naming";
+
+    public static final String SECURITY_NAME_SPACE_PREFIX = "security";
+
+    public static final String SYS_NAME_SPACE_PREFIX = "sys";
+
+    // other
+    public static final String CONNECTION_FACTORY_INTERFACE = "javax.sql.DataSource";
+
+    public static final String TEST_RESOURCES_DIRECTORY = "test-apps/";
+
+    public static final String USER_PROPERTIES_FILE_PATH = "var/security/user.properties";
+
+    public static final String GROUP_PROPERTIES_FILE_PATH = "var/security/user.properties";
+
+    // section of the Resource Tool
+    public static final String MAIL_RESOURCE_TOOL = "mail";
+
+    public static final String JMS_RESOURCE_TOOL = "jms";
+
+    public static final String SECURITY_RESOURCE_TOOL = "security";
+
+    public static final String DS_RESOURCE_TOOL = "ds";
+
+    // Jboss login modules
+    public static final String JBOSS_LOGIN_MODULE_IDELTITY = "org.jboss.security.auth.spi.IdentityLoginModule";
+
+    public static final String JBOSS_LOGIN_MODULE_USERS_ROLES = "org.jboss.security.auth.spi.UsersRolesLoginModule";
+
+    public static final String JBOSS_LOGIN_MODULE_LDAP = "org.jboss.security.auth.spi.LdapLoginModule";
+
+    public static final String JBOSS_LOGIN_MODULE_DATABASE_SERVER = "org.jboss.security.auth.spi.DatabaseServerLoginModule";
+
+    // Geronimo login modules
+    public static final String GERONIMO_LOGIN_MODULE_IDELTITY = "org.jboss.security.auth.spi.IdentityLoginModule";
+
+    public static final String GERONIMO_LOGIN_MODULE_USERS_ROLES = "org.apche.geronimo.security.realm.providers.PropertiesFileLoginModule";
+
+    public static final String GERONIMO_LOGIN_MODULE_LDAP = "org.apche.geronimo.security.realm.providers.LDAPLoginModule";
+
+    public static final String GERONIMO_LOGIN_MODULE_DATABASE_SERVER = "org.apache.geronimo.security.realm.providers.SQLLoginModule";
+
+    // Jboss jms classes
+    public static final String TOPIC_CLASS_JBOSS = "org.jboss.mq.server.jmx.Topic";
+
+    public static final String QUEUE_CLASS_JBOSS = "org.jboss.mq.server.jmx.Queue";
+
+}
\ No newline at end of file

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/resources/utils/Constants.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/resources/utils/Constants.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/xml-conversion-helper/src/org/apache/apps/j2gmigrator/resources/utils/Constants.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message