geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmcma...@apache.org
Subject svn commit: r551566 [2/7] - in /geronimo/sandbox/j2g: configurator/ plugins/ plugins/org.apache.geronimo.j2g.common/ plugins/org.apache.geronimo.j2g.descriptors.app/ plugins/org.apache.geronimo.j2g.descriptors.app/META-INF/ plugins/org.apache.geronimo....
Date Thu, 28 Jun 2007 14:14:56 GMT
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/src/org/apache/geronimo/j2g/descriptors/comp/CMPEntityBeanMigrator.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/src/org/apache/geronimo/j2g/descriptors/comp/CMPEntityBeanMigrator.java?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/src/org/apache/geronimo/j2g/descriptors/comp/CMPEntityBeanMigrator.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/src/org/apache/geronimo/j2g/descriptors/comp/CMPEntityBeanMigrator.java Thu Jun 28 07:14:50 2007
@@ -1,132 +0,0 @@
-/**
- *  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.geronimo.j2g.descriptors.comp;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.geronimo.j2g.common.ConsoleOutput;
-import org.apache.geronimo.j2g.common.IOutput;
-import org.apache.geronimo.j2g.common.Tool;
-import org.apache.geronimo.j2g.util.descriptors.xml.XMLConversionHelper;
-import org.dom4j.Element;
-import org.dom4j.QName;
-
-
-public class CMPEntityBeanMigrator {
-
-    private IOutput out;
-
-    private Log logger = LogFactory.getLog(CMPEntityBeanMigrator.class);
-
-    // this is used to keep the filed name and column name
-    // key field name vaue column name
-    private Map keyColumnMap;
-    
-    public CMPEntityBeanMigrator () {
-    	Tool currentTool = Tool.getCurrent();
-    	if (currentTool != null) {
-    		out = currentTool.getOutput();
-    	} else {
-    		out = new ConsoleOutput();
-    	}
-    }
-
-    public void migrateBean(Element jbossEntity, Element geronimoEntity) {
-
-        Element jbossEntityChildElement;
-        keyColumnMap = new HashMap();
-        for (Iterator iter = jbossEntity.elements().iterator(); iter.hasNext();) {
-            jbossEntityChildElement = (Element) iter.next();
-            if (jbossEntityChildElement.getName().equals("ejb-name")) {
-                // we have to check the ejb name since ejb name can put by the
-                // jboss.xml as well.
-                String xpath = "//ejb:ejb-name[text() ='" + jbossEntityChildElement.getText()
-                        + "']";
-                logger.debug("Find existing ejb names with xpath ==> " + xpath);
-                if (!XMLConversionHelper.isNodeAvailable(geronimoEntity, xpath)) {
-                    logger.debug("migrating the ejb name");
-                    QName qname = new QName("ejb-name", geronimoEntity.getNamespace());
-                    Element geronimoEJBName = geronimoEntity.addElement(qname);
-                    geronimoEJBName.setText(jbossEntityChildElement.getText());
-                    logger.debug("added ejb-name to geromimo");
-                }
-
-            } else if (jbossEntityChildElement.getName().equals("table-name")) {
-                logger.debug("migrating the table name");
-                QName qname = new QName("table-name", geronimoEntity.getNamespace());
-                Element geronimoTableName = geronimoEntity.addElement(qname);
-                geronimoTableName.setText(jbossEntityChildElement.getText());
-                logger.debug("added table name");
-            } else if (jbossEntityChildElement.getName().equals("cmp-field")) {
-                QName qname = new QName("cmp-field-mapping", geronimoEntity.getNamespace());
-                Element geronimoCMPFieldMapping = geronimoEntity.addElement(qname);
-                migrateCMPFieldMapping(jbossEntityChildElement, geronimoCMPFieldMapping);
-            } else {
-                out.warn("The Element '" + jbossEntityChildElement.getName() + "' is not suported",
-                        XMLConversionHelper.getLineNumber(jbossEntityChildElement),
-                        XMLConversionHelper.getColumnNumber(jbossEntityChildElement));
-                logger.debug("The Element '" + jbossEntityChildElement.getName()
-                        + "' is not suported");
-            }
-
-        }
-    }
-
-    private void migrateCMPFieldMapping(Element jbossCMPField, Element geronimoCMPFieldMapping) {
-
-        Element jbossCMPFieldChild;
-        String fieldName = null;
-        String columnName = null;
-        for (Iterator iter = jbossCMPField.elements().iterator(); iter.hasNext();) {
-            jbossCMPFieldChild = (Element) iter.next();
-            if (jbossCMPFieldChild.getName().equals("field-name")) {
-                QName qname = new QName("cmp-field-name", geronimoCMPFieldMapping.getNamespace());
-                Element geronimoCMPFieldName = geronimoCMPFieldMapping.addElement(qname);
-                geronimoCMPFieldName.setText(jbossCMPFieldChild.getText());
-                fieldName = jbossCMPFieldChild.getText().trim();
-            } else if (jbossCMPFieldChild.getName().equals("column-name")) {
-                QName qname = new QName("table-column", geronimoCMPFieldMapping.getNamespace());
-                Element geronimoTableColumn = geronimoCMPFieldMapping.addElement(qname);
-                geronimoTableColumn.setText(jbossCMPFieldChild.getText());
-                columnName = jbossCMPFieldChild.getText().trim();
-            } else {
-               out.warn("The Element '" + jbossCMPFieldChild.getName() + "' is not suported",
-                        XMLConversionHelper.getLineNumber(jbossCMPFieldChild),
-                        XMLConversionHelper.getColumnNumber(jbossCMPFieldChild));
-               logger.debug("The Element '" + jbossCMPFieldChild.getName()
-                        + "' is not suported");
-            }
-        }
-
-        if ((fieldName != null) && (columnName != null)){
-            keyColumnMap.put(fieldName,columnName);
-        }
-    }
-
-    public Map getKeyColumnMap() {
-        return keyColumnMap;
-    }
-
-    public void setKeyColumnMap(Map keyColumnMap) {
-        this.keyColumnMap = keyColumnMap;
-    }
-}

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/src/org/apache/geronimo/j2g/descriptors/comp/EJBJarXmlProcessor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/src/org/apache/geronimo/j2g/descriptors/comp/EJBJarXmlProcessor.java?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/src/org/apache/geronimo/j2g/descriptors/comp/EJBJarXmlProcessor.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/src/org/apache/geronimo/j2g/descriptors/comp/EJBJarXmlProcessor.java Thu Jun 28 07:14:50 2007
@@ -1,98 +0,0 @@
-/**
- *  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.geronimo.j2g.descriptors.comp;
-
-
-import java.io.File;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.geronimo.j2g.descriptors.comp.dto.EJBRelation;
-import org.apache.geronimo.j2g.descriptors.comp.dto.EJBRelationshipRole;
-import org.apache.geronimo.j2g.descriptors.comp.dto.Relationships;
-import org.apache.geronimo.j2g.util.descriptors.xml.XMLConversionHelper;
-import org.dom4j.Document;
-import org.dom4j.DocumentException;
-import org.dom4j.Element;
-
-public class EJBJarXmlProcessor {
-
-    private String fileName;
-
-    public EJBJarXmlProcessor(String fileName) {
-        this.fileName = fileName;
-    }
-
-    /**
-     * @return relationships of the ejb jar xml file
-     */
-
-    public Relationships getRelationships() throws DocumentException {
-        Document document = XMLConversionHelper.getDocument(new File(fileName));
-        List ejbRelations = document.selectNodes("//relationships/ejb-relation");
-
-        Relationships relationships = new Relationships();
-
-        Element ejbRelationsChileElement;
-        for (Iterator iter = ejbRelations.iterator(); iter.hasNext();) {
-            ejbRelationsChileElement = (Element) iter.next();
-            if (ejbRelationsChileElement.getName().equals("ejb-relation")) {
-                relationships.addEJBRealtion(getEJBRelation(ejbRelationsChileElement));
-            }
-        }
-
-        return relationships;
-    }
-
-    private EJBRelation getEJBRelation(Element ejbRelationElement) {
-
-        EJBRelation ejbRelation = new EJBRelation();
-        Element ejbRelationChildElement;
-        for (Iterator iter = ejbRelationElement.elements().iterator(); iter.hasNext();) {
-            ejbRelationChildElement = (Element) iter.next();
-            if (ejbRelationChildElement.getName().equals("ejb-relation-name")) {
-                ejbRelation.setEjbRelationName(ejbRelationChildElement.getText().trim());
-            } else if (ejbRelationChildElement.getName().equals("ejb-relationship-role")) {
-                ejbRelation.addRelationshipRole(getEJBRelationshipRole(ejbRelationChildElement));
-            }
-        }
-        return ejbRelation;
-    }
-
-    private EJBRelationshipRole getEJBRelationshipRole(Element ejbRelationshipRoleElement) {
-
-        EJBRelationshipRole ejbRelationshipRole = new EJBRelationshipRole();
-        Element ejbRelationshipRoleChildElement;
-        for (Iterator iter = ejbRelationshipRoleElement.elements().iterator(); iter.hasNext();) {
-            ejbRelationshipRoleChildElement = (Element) iter.next();
-            if (ejbRelationshipRoleChildElement.getName().equals("ejb-relationship-role-name")) {
-                ejbRelationshipRole.setName(ejbRelationshipRoleChildElement.getText().trim());
-            } else if (ejbRelationshipRoleChildElement.getName().equals("multiplicity")) {
-                ejbRelationshipRole.setMultiplicity(ejbRelationshipRoleChildElement.getText().trim());
-            } else if (ejbRelationshipRoleChildElement.getName().equals("relationship-role-source")) {
-                Element ejbName = ejbRelationshipRoleChildElement.element("ejb-name");
-                ejbRelationshipRole.setSource(ejbName.getText().trim());
-            } else if (ejbRelationshipRoleChildElement.getName().equals("cmr-field")){
-                Element cmrFieldName = ejbRelationshipRoleChildElement.element("cmr-field-name");
-                ejbRelationshipRole.setCmrFieldName(cmrFieldName.getText().trim());
-            }
-        }
-        return ejbRelationshipRole;
-    }
-
-}

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/src/org/apache/geronimo/j2g/descriptors/comp/dto/EJBRelation.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/src/org/apache/geronimo/j2g/descriptors/comp/dto/EJBRelation.java?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/src/org/apache/geronimo/j2g/descriptors/comp/dto/EJBRelation.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/src/org/apache/geronimo/j2g/descriptors/comp/dto/EJBRelation.java Thu Jun 28 07:14:50 2007
@@ -1,56 +0,0 @@
-/**
- *  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.geronimo.j2g.descriptors.comp.dto;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * keep ejb relation details of the ejb-jar.xml file
- * 
- */
-public class EJBRelation {
-    private String ejbRelationName;
-
-    private Map ejbRelationshipRoles;
-
-    public EJBRelation(String ejbRelationName) {
-        this.ejbRelationName = ejbRelationName;
-        this.ejbRelationshipRoles = new HashMap();
-    }
-
-    public EJBRelation() {
-        this.ejbRelationshipRoles = new HashMap();
-    }
-
-    public void addRelationshipRole(EJBRelationshipRole ejbRelationshipRole) {
-        ejbRelationshipRoles.put(ejbRelationshipRole.getName(), ejbRelationshipRole);
-    }
-
-    public EJBRelationshipRole getEJBRelationshipRole(String name) {
-        return (EJBRelationshipRole) this.ejbRelationshipRoles.get(name);
-    }
-
-    public String getEjbRelationName() {
-        return ejbRelationName;
-    }
-
-    public void setEjbRelationName(String ejbRelationName) {
-        this.ejbRelationName = ejbRelationName;
-    }
-
-}

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/src/org/apache/geronimo/j2g/descriptors/comp/dto/EJBRelationshipRole.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/src/org/apache/geronimo/j2g/descriptors/comp/dto/EJBRelationshipRole.java?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/src/org/apache/geronimo/j2g/descriptors/comp/dto/EJBRelationshipRole.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/src/org/apache/geronimo/j2g/descriptors/comp/dto/EJBRelationshipRole.java Thu Jun 28 07:14:50 2007
@@ -1,61 +0,0 @@
-/**
- *  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.geronimo.j2g.descriptors.comp.dto;
-
-public class EJBRelationshipRole {
-
-    private String name;
-
-    private String multiplicity;
-
-    private String source;
-
-    private String cmrFieldName;
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getMultiplicity() {
-        return multiplicity;
-    }
-
-    public void setMultiplicity(String multiplicity) {
-        this.multiplicity = multiplicity;
-    }
-
-    public String getSource() {
-        return source;
-    }
-
-    public void setSource(String source) {
-        this.source = source;
-    }
-
-    public String getCmrFieldName() {
-        return cmrFieldName;
-    }
-
-    public void setCmrFieldName(String cmrFieldName) {
-        this.cmrFieldName = cmrFieldName;
-    }
-}

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/src/org/apache/geronimo/j2g/descriptors/comp/dto/Relationships.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/src/org/apache/geronimo/j2g/descriptors/comp/dto/Relationships.java?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/src/org/apache/geronimo/j2g/descriptors/comp/dto/Relationships.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/src/org/apache/geronimo/j2g/descriptors/comp/dto/Relationships.java Thu Jun 28 07:14:50 2007
@@ -1,39 +0,0 @@
-/**
- *  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.geronimo.j2g.descriptors.comp.dto;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class Relationships {
-
-    private Map ejbRelations;
-
-    public Relationships() {
-        this.ejbRelations = new HashMap();
-    }
-
-    public void addEJBRealtion(EJBRelation ejbRelation) {
-        this.ejbRelations.put(ejbRelation.getEjbRelationName(), ejbRelation);
-    }
-
-    public EJBRelation getEJBRelation(String name) {
-        return (EJBRelation) this.ejbRelations.get(name);
-    }
-
-}

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/test-resources/ejb-jar.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/test-resources/ejb-jar.xml?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/test-resources/ejb-jar.xml (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/test-resources/ejb-jar.xml Thu Jun 28 07:14:50 2007
@@ -1,242 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--  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. -->
-  
-<!--DOCTYPE ejb-jar PUBLIC
-      "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
-      "http://java.sun.com/dtd/ejb-jar_2_0.dtd" -->
-
-<ejb-jar>
-   <display-name>CMP 2.0 Lab Jar</display-name>
-
-   <enterprise-beans>
-      <session>
-         <description>JUnit Session Bean Test Runner</description>
-         <ejb-name>EJBTestRunnerEJB</ejb-name>
-         <home>net.sourceforge.junitejb.EJBTestRunnerHome</home>
-         <remote>net.sourceforge.junitejb.EJBTestRunner</remote>
-         <ejb-class>net.sourceforge.junitejb.EJBTestRunnerBean</ejb-class>
-         <session-type>Stateless</session-type>
-         <transaction-type>Bean</transaction-type>
-      </session>
-
-      <entity>
-         <display-name>Organization Entity Bean</display-name>
-         <ejb-name>OrganizationEJB</ejb-name>
-
-         <local-home>org.jboss.docs.cmp2.crimeportal.OrganizationHome</local-home>
-         <local>org.jboss.docs.cmp2.crimeportal.Organization</local>
-         <ejb-class>org.jboss.docs.cmp2.crimeportal.OrganizationBean</ejb-class>
-
-         <persistence-type>Container</persistence-type>
-         <prim-key-class>java.lang.String</prim-key-class>
-         <reentrant>False</reentrant> 
-         <cmp-version>2.x</cmp-version>
-         <abstract-schema-name>organization</abstract-schema-name>
-
-         <cmp-field><field-name>name</field-name></cmp-field>
-         <cmp-field><field-name>description</field-name></cmp-field>
-
-         <primkey-field>name</primkey-field>
-      </entity>
-
-      <entity>
-         <display-name>Gangster Entity Bean</display-name>
-         <ejb-name>GangsterEJB</ejb-name>
-
-         <local-home>org.jboss.docs.cmp2.crimeportal.GangsterHome</local-home>
-         <local>org.jboss.docs.cmp2.crimeportal.Gangster</local>
-         <ejb-class>org.jboss.docs.cmp2.crimeportal.GangsterBean</ejb-class>
-
-         <persistence-type>Container</persistence-type>
-         <prim-key-class>java.lang.Integer</prim-key-class>
-         <reentrant>False</reentrant> 
-         <cmp-version>2.x</cmp-version>
-         <abstract-schema-name>gangster</abstract-schema-name>
-         
-         <cmp-field><field-name>gangsterId</field-name></cmp-field>
-         <cmp-field><field-name>name</field-name></cmp-field>
-         <cmp-field><field-name>nickName</field-name></cmp-field>
-         <cmp-field><field-name>badness</field-name></cmp-field>
-         
-         <primkey-field>gangsterId</primkey-field>
-
-         <query>
-            <query-method>
-               <method-name>findBadDudes</method-name>
-               <method-params><method-param>int</method-param></method-params>
-            </query-method>
-            <ejb-ql><![CDATA[
-               SELECT OBJECT(g)
-               FROM gangster g
-               WHERE g.badness > ?1
-            ]]></ejb-ql>
-         </query>
-
-         <query>
-            <query-method>
-               <method-name>ejbSelectBoss</method-name>
-               <method-params>
-                  <method-param>java.lang.String</method-param>
-               </method-params>
-            </query-method>
-            <ejb-ql><![CDATA[
-               SELECT DISTINCT underling.organization.theBoss
-               FROM gangster underling
-               WHERE underling.name = ?1 OR underling.nickName = ?1
-            ]]></ejb-ql>
-         </query>
-      </entity>
-
-      <entity>
-         <display-name>Job Entity Bean</display-name>
-         <ejb-name>JobEJB</ejb-name>
-
-         <local-home>org.jboss.docs.cmp2.crimeportal.JobHome</local-home>
-         <local>org.jboss.docs.cmp2.crimeportal.Job</local>
-         <ejb-class>org.jboss.docs.cmp2.crimeportal.JobBean</ejb-class>
-
-         <persistence-type>Container</persistence-type>
-         <prim-key-class>java.lang.String</prim-key-class>
-         <reentrant>False</reentrant> 
-         <cmp-version>2.x</cmp-version>
-         <abstract-schema-name>job</abstract-schema-name>
-         
-         <cmp-field><field-name>name</field-name></cmp-field>
-         <cmp-field><field-name>score</field-name></cmp-field>
-         <cmp-field><field-name>setupCost</field-name></cmp-field>
-         
-         <primkey-field>name</primkey-field>
-      </entity>
-   </enterprise-beans>
-
-   <relationships>
-      <ejb-relation>
-         <ejb-relation-name>Organization-Gangster</ejb-relation-name>
-
-         <ejb-relationship-role> 
-            <ejb-relationship-role-name>org-has-gangsters</ejb-relationship-role-name>
-
-            <multiplicity>One</multiplicity> 
-
-            <relationship-role-source> 
-               <ejb-name>OrganizationEJB</ejb-name> 
-            </relationship-role-source> 
-            
-            <cmr-field>
-               <cmr-field-name>memberGangsters</cmr-field-name> 
-               <cmr-field-type>java.util.Set</cmr-field-type> 
-            </cmr-field> 
-         </ejb-relationship-role> 
-
-         <ejb-relationship-role> 
-            <ejb-relationship-role-name>gangster-belongs-to-org</ejb-relationship-role-name>
-            
-            <multiplicity>Many</multiplicity> 
-            
-            <relationship-role-source>   
-               <ejb-name>GangsterEJB</ejb-name> 
-            </relationship-role-source> 
-          
-            <cmr-field> 
-               <cmr-field-name>organization</cmr-field-name>
-            </cmr-field> 
-         </ejb-relationship-role> 
-      </ejb-relation> 
-
-      <ejb-relation>
-         <ejb-relation-name>Gangster-Jobs</ejb-relation-name>
-
-         <ejb-relationship-role> 
-            <ejb-relationship-role-name>gangster-has-jobs</ejb-relationship-role-name>
-
-            <multiplicity>Many</multiplicity> 
-
-            <relationship-role-source> 
-               <ejb-name>GangsterEJB</ejb-name> 
-            </relationship-role-source> 
-            
-            <cmr-field>
-               <cmr-field-name>jobs</cmr-field-name> 
-               <cmr-field-type>java.util.Set</cmr-field-type> 
-            </cmr-field> 
-         </ejb-relationship-role> 
-
-         <ejb-relationship-role> 
-            <ejb-relationship-role-name>job-has-gangsters</ejb-relationship-role-name>
-            
-            <multiplicity>Many</multiplicity> 
-            
-            <relationship-role-source>   
-               <ejb-name>JobEJB</ejb-name> 
-            </relationship-role-source> 
-          
-            <cmr-field> 
-               <cmr-field-name>gangsters</cmr-field-name>
-               <cmr-field-type>java.util.Set</cmr-field-type> 
-            </cmr-field> 
-         </ejb-relationship-role> 
-      </ejb-relation> 
-
-      <ejb-relation>
-         <ejb-relation-name>Organization-Boss</ejb-relation-name>
-
-         <ejb-relationship-role> 
-            <ejb-relationship-role-name>organization-has-a-boss</ejb-relationship-role-name>
-
-            <multiplicity>One</multiplicity> 
-
-            <relationship-role-source> 
-               <ejb-name>OrganizationEJB</ejb-name> 
-            </relationship-role-source> 
-            
-            <cmr-field>
-               <cmr-field-name>theBoss</cmr-field-name> 
-            </cmr-field> 
-         </ejb-relationship-role> 
-
-         <ejb-relationship-role> 
-            <ejb-relationship-role-name>boss-runs-an-organization</ejb-relationship-role-name>
-            
-            <multiplicity>One</multiplicity> 
-            
-            <relationship-role-source>   
-               <ejb-name>GangsterEJB</ejb-name> 
-            </relationship-role-source> 
-
-         </ejb-relationship-role> 
-      </ejb-relation> 
-   </relationships>
-
-   <assembly-descriptor>
-
-      <container-transaction>
-         <method>
-            <ejb-name>OrganizationEJB</ejb-name>
-            <method-name>*</method-name>
-         </method>
-         <method>
-            <ejb-name>GangsterEJB</ejb-name>
-            <method-name>*</method-name>
-         </method>
-         <method>
-            <ejb-name>JobEJB</ejb-name>
-            <method-name>*</method-name>
-         </method>
-         <trans-attribute>Required</trans-attribute>
-      </container-transaction>
-
-   </assembly-descriptor>
-</ejb-jar>

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/test-resources/jbosscmp-jdbc.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/test-resources/jbosscmp-jdbc.xml?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/test-resources/jbosscmp-jdbc.xml (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/test-resources/jbosscmp-jdbc.xml Thu Jun 28 07:14:50 2007
@@ -1,151 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--  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. -->
-  
-<!--DOCTYPE ejb-jar PUBLIC
-      "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
-      "http://java.sun.com/dtd/ejb-jar_2_0.dtd" -->
-
-
-<jbosscmp-jdbc>
-   <defaults>
-      <datasource>java:/DefaultDS</datasource>
-      <datasource-mapping>Hypersonic SQL</datasource-mapping>
-      <create-table>true</create-table>
-      <remove-table>true</remove-table>
-      <pk-constraint>true</pk-constraint>
-      <preferred-relation-mapping>foreign-key</preferred-relation-mapping>
-   </defaults>
-
-   <enterprise-beans>
-
-      <entity>
-         <ejb-name>OrganizationEJB</ejb-name>
-         <table-name>organization</table-name>
-
-         <cmp-field>
-            <field-name>name</field-name>
-            <column-name>name</column-name>
-         </cmp-field>
-         <cmp-field>
-            <field-name>description</field-name>
-            <column-name>desc</column-name>
-         </cmp-field>
-      </entity>
-
-      <entity>
-         <ejb-name>GangsterEJB</ejb-name>
-         <table-name>gangster</table-name>
-
-         <cmp-field>
-            <field-name>gangsterId</field-name>
-            <column-name>id</column-name>
-         </cmp-field>
-         <cmp-field>
-            <field-name>name</field-name>
-            <column-name>name</column-name>
-         </cmp-field>
-         <cmp-field>
-            <field-name>nickName</field-name>
-            <column-name>nick_name</column-name>
-            <jdbc-type>VARCHAR</jdbc-type>
-            <sql-type>VARCHAR(64)</sql-type>
-         </cmp-field>
-         <cmp-field>
-            <field-name>badness</field-name>
-            <column-name>badness</column-name>
-         </cmp-field>
-      </entity>
-
-      <entity>
-         <ejb-name>JobEJB</ejb-name>
-         <table-name>job</table-name>
-
-         <cmp-field>
-            <field-name>name</field-name>
-            <column-name>name</column-name>
-         </cmp-field>
-         <cmp-field>
-            <field-name>score</field-name>
-            <column-name>score</column-name>
-         </cmp-field>
-         <cmp-field>
-            <field-name>setupCost</field-name>
-            <column-name>setup_cost</column-name>
-         </cmp-field>
-      </entity>
-   </enterprise-beans>
-
-   <relationships>
-      <ejb-relation>
-         <ejb-relation-name>Organization-Gangster</ejb-relation-name>
-
-         <ejb-relationship-role> 
-            <ejb-relationship-role-name>org-has-gangsters</ejb-relationship-role-name>
-            <key-fields>
-               <key-field>
-                  <field-name>name</field-name>
-                  <column-name>organization</column-name>
-               </key-field>
-            </key-fields>
-         </ejb-relationship-role> 
-
-         <ejb-relationship-role> 
-            <ejb-relationship-role-name>gangster-belongs-to-org</ejb-relationship-role-name>
-         </ejb-relationship-role> 
-      </ejb-relation> 
-
-      <ejb-relation>
-         <ejb-relation-name>Gangster-Jobs</ejb-relation-name>
-         <relation-table-mapping>
-            <table-name>gangster_job</table-name>
-         </relation-table-mapping>
-
-         <ejb-relationship-role> 
-            <ejb-relationship-role-name>gangster-has-jobs</ejb-relationship-role-name>
-            <key-fields>
-               <key-field>
-                  <field-name>gangsterId</field-name>
-                  <column-name>gangster</column-name>
-               </key-field>
-            </key-fields>
-         </ejb-relationship-role> 
-
-         <ejb-relationship-role> 
-            <ejb-relationship-role-name>job-has-gangsters</ejb-relationship-role-name>
-            <key-fields>
-               <key-field>
-                  <field-name>name</field-name>
-                  <column-name>job</column-name>
-               </key-field>
-            </key-fields>
-         </ejb-relationship-role> 
-      </ejb-relation> 
-
-      <ejb-relation>
-         <ejb-relation-name>Organization-Boss</ejb-relation-name>
-		 
-         <ejb-relationship-role> 
-            <ejb-relationship-role-name>organization-has-a-boss</ejb-relationship-role-name>
-			<key-fields>
-			    <key-field>
-				  <field-name>name</field-name>
-				  <column-name>boss</column-name>
-				</key-field>
-			</key-fields>
-         </ejb-relationship-role>  
-      </ejb-relation> 
-   </relationships>
-</jbosscmp-jdbc>

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/test/org/apache/geronimo/j2g/descriptors/cmp/test/TestCMPDescriptorsTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/test/org/apache/geronimo/j2g/descriptors/cmp/test/TestCMPDescriptorsTool.java?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/test/org/apache/geronimo/j2g/descriptors/cmp/test/TestCMPDescriptorsTool.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/test/org/apache/geronimo/j2g/descriptors/cmp/test/TestCMPDescriptorsTool.java Thu Jun 28 07:14:50 2007
@@ -1,34 +0,0 @@
-/**
- *  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.geronimo.j2g.descriptors.cmp.test;
-
-import java.io.File;
-
-import junit.framework.TestCase;
-
-import org.apache.geronimo.j2g.descriptors.comp.CMPDescriptorTool;
-
-public class TestCMPDescriptorsTool extends TestCase {
-
-    public void testMigrate() {
-        File file = new File("test-resources/jbosscmp-jdbc.xml");
-        CMPDescriptorTool cmpDescriptorTool = new CMPDescriptorTool();
-        cmpDescriptorTool.migrate(file);
-    }
-    
-}

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/test/org/apache/geronimo/j2g/descriptors/cmp/test/TestEJBjarXmlProcessor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/test/org/apache/geronimo/j2g/descriptors/cmp/test/TestEJBjarXmlProcessor.java?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/test/org/apache/geronimo/j2g/descriptors/cmp/test/TestEJBjarXmlProcessor.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.cmp/test/org/apache/geronimo/j2g/descriptors/cmp/test/TestEJBjarXmlProcessor.java Thu Jun 28 07:14:50 2007
@@ -1,35 +0,0 @@
-/**
- *  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.geronimo.j2g.descriptors.cmp.test;
-
-import junit.framework.TestCase;
-
-import org.apache.geronimo.j2g.descriptors.comp.EJBJarXmlProcessor;
-import org.dom4j.DocumentException;
-
-public class TestEJBjarXmlProcessor extends TestCase {
-
-    public void testGetRelationships(){
-        EJBJarXmlProcessor ejbJarXmlProcessor = new EJBJarXmlProcessor("test-resources/ejb-jar.xml");
-        try {
-            ejbJarXmlProcessor.getRelationships();
-        } catch (DocumentException e) {
-            e.printStackTrace();
-        }
-    }
-}

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/.classpath
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/.classpath?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/.classpath (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/.classpath Thu Jun 28 07:14:50 2007
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="test"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="output" path="target/classes"/>
-</classpath>

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/.project
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/.project?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/.project (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/.project Thu Jun 28 07:14:50 2007
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.apache.geronimo.j2g.descriptors.ejb</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.ManifestBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.SchemaBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.PluginNature</nature>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/META-INF/MANIFEST.MF?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/META-INF/MANIFEST.MF (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/META-INF/MANIFEST.MF Thu Jun 28 07:14:50 2007
@@ -1,11 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: J2G Ejb Migration Plug-in
-Bundle-SymbolicName: org.apache.geronimo.j2g.descriptors.ejb; singleton:=true
-Bundle-Version: 1.0.0
-Bundle-Vendor: Apache.org
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.core.runtime,org.apache.geronimo.j2g.common,org.apache.geronimo.j2g.util,org.apache.geronimo.j2g.descriptors
-Bundle-ClassPath: .
-Export-Package: org.apache.geronimo.j2g.descriptors.ejb,
- org.apache.geronimo.j2g.descriptors.ejb.bean

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/build.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/build.properties?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/build.properties (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/build.properties Thu Jun 28 07:14:50 2007
@@ -1,26 +0,0 @@
-/**
- *  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/log4j-1.2.12.jar,\
-               lib/pull-parser-2.1.10.jar

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/plugin.xml?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/plugin.xml (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/plugin.xml Thu Jun 28 07:14:50 2007
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<!--
-  ~ 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.
-  -->
-<plugin>
-   <extension point="org.apache.geronimo.j2g.descriptors.migrations">
-      <migration class="org.apache.geronimo.j2g.descriptors.ejb.EJBDescriptorTool"/>
-   </extension>
-</plugin>

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/pom.xml?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/pom.xml (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/pom.xml Thu Jun 28 07:14:50 2007
@@ -60,3 +60,65 @@
         </dependency>
     </dependencies>
 </project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<!-- $Rev$ $Date$ -->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.geronimo.tools</groupId>
+    <artifactId>org.apache.geronimo.j2g.descriptors.ejb</artifactId>
+    <packaging>jar</packaging>
+    <name>${artifactId}</name>
+    <parent>
+        <groupId>org.apache.geronimo.tools</groupId>
+        <artifactId>j2g-plugins</artifactId>
+        <version>1.0.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.geronimo.devtools</groupId>
+                <artifactId>maven-eclipsepde-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <artifactId>maven-jar-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <artifactId>maven-dependency-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+    <dependencies>
+       <dependency>
+            <groupId>org.apache.geronimo.tools</groupId>
+            <artifactId>org.apache.geronimo.j2g.descriptors</artifactId>
+            <version>${version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.tools</groupId>
+            <artifactId>org.apache.geronimo.j2g.util</artifactId>
+            <version>${version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.tools</groupId>
+            <artifactId>org.apache.geronimo.j2g.common</artifactId>
+            <version>${version}</version>
+        </dependency>
+    </dependencies>
+</project>

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/common-logging.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/common-logging.properties?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/common-logging.properties (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/common-logging.properties Thu Jun 28 07:14:50 2007
@@ -1,30 +0,0 @@
-/**
- *  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

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/EJBDescriptorTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/EJBDescriptorTool.java?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/EJBDescriptorTool.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/EJBDescriptorTool.java Thu Jun 28 07:14:50 2007
@@ -1,216 +0,0 @@
-/**
- *  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.geronimo.j2g.descriptors.ejb;
-
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Iterator;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.geronimo.j2g.common.ConsoleOutput;
-import org.apache.geronimo.j2g.common.IFileMigration;
-import org.apache.geronimo.j2g.common.IOutput;
-import org.apache.geronimo.j2g.common.Tool;
-import org.apache.geronimo.j2g.descriptors.ejb.bean.EntityBeanMigrator;
-import org.apache.geronimo.j2g.descriptors.ejb.bean.SessionBeanMigrator;
-import org.apache.geronimo.j2g.util.descriptors.Constants;
-import org.apache.geronimo.j2g.util.descriptors.env.EnvirionmentElementProcessor;
-import org.apache.geronimo.j2g.util.descriptors.naming.NamingElementProcessor;
-import org.apache.geronimo.j2g.util.descriptors.security.SecurityElementProcessor;
-import org.apache.geronimo.j2g.util.descriptors.xml.XMLConversionHelper;
-import org.dom4j.Document;
-import org.dom4j.DocumentException;
-import org.dom4j.Element;
-import org.dom4j.QName;
-
-public class EJBDescriptorTool implements IFileMigration {
-
-    private IOutput out;
-
-    private Log logger = LogFactory.getLog(EJBDescriptorTool.class);
-
-    private EnvirionmentElementProcessor envirionmentElementProcessor;
-
-    private SessionBeanMigrator sessionBeanMigrator;
-
-    private EntityBeanMigrator entityBeanMigrator;
-
-    private NamingElementProcessor namingElementProcessor;
-
-    private SecurityElementProcessor securityElementProcessor;
-
-    public EJBDescriptorTool() {
-    	
-    	Tool currentTool = Tool.getCurrent();
-    	if (currentTool != null) {
-    		out = currentTool.getOutput();
-    	} else {
-    		out = new ConsoleOutput();
-    	}
-        envirionmentElementProcessor = new EnvirionmentElementProcessor();
-        namingElementProcessor = new NamingElementProcessor(envirionmentElementProcessor);
-        sessionBeanMigrator = new SessionBeanMigrator(envirionmentElementProcessor,
-                namingElementProcessor);
-        entityBeanMigrator = new EntityBeanMigrator(envirionmentElementProcessor,
-                namingElementProcessor);
-        securityElementProcessor = new SecurityElementProcessor();
-
-    }
-
-    /**
-     * migrates both the jboss.xml and jbosscmp-jdbc.xml file to openejb-jar.xml
-     * in geronimo
-     * 
-     * @param file
-     * @return migrate sucess or not
-     */
-
-    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_JBOSS_XML_FILE)) {
-                out.info("Converting Jboss.xml file in " + directoryName);
-                try {
-                    // check whether the jbosscmp-jdbc.xml file is present and
-                    // if so load it and process it.
-                    Document jbossDocument = XMLConversionHelper.getDocument(file);
-                    Document geronimoDocument = XMLConversionHelper
-                            .getOpenEJBJarDocument(directoryName);
-                    migrate(jbossDocument.getRootElement(), geronimoDocument.getRootElement());
-                    String geronimoOpenEjbJarFileName = directoryName + File.separator
-                            + Constants.GERONIMO_OPEN_EJB_XML_FILE;
-                    XMLConversionHelper.saveOpenEJBDocument(geronimoOpenEjbJarFileName,
-                            geronimoDocument);
-                    migrated = true;
-                    out.info("Successfully migrated the Jboss.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.EJB_JAR_XML_FILE)){
-                out.info("Converting ejb-jar.xml file in " + directoryName);
-                out.info("Nothing to convert. Keep the file as it is");
-            }
-        return migrated;
-    }
-
-    private void migrate(Element jbossRootElement, Element geronimoRootElement) {
-
-        // iterate through all the elements and convert them accordingly
-        Element jbossRootChildElement;
-        for (Iterator iter = jbossRootElement.elements().iterator(); iter.hasNext();) {
-            jbossRootChildElement = (Element) iter.next();
-            if (jbossRootChildElement.getName().equals("security-domain")) {
-                securityElementProcessor.setSecurityDomain(jbossRootChildElement.getText());
-            } else if (jbossRootChildElement.getName().equals("enterprise-beans")) {
-                logger.debug("migrating enterprise-beans");
-                // process the enterprise bean element
-                // add enterprise beans element to geronimo
-                // this element is in the same name space as the root element
-                Element geronimoEnterpriseBean = XMLConversionHelper.getGeronimoElement(
-                        geronimoRootElement, "//ejb:enterprise-beans", "enterprise-beans",
-                        geronimoRootElement.getNamespace());
-                migrateEnterpriseBeans(jbossRootChildElement, geronimoEnterpriseBean);
-            } else if (jbossRootChildElement.getName().equals("assembly-descriptor")) {
-                migrateAssemblyDescriptor(jbossRootChildElement, geronimoRootElement);
-            } 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");
-            }
-        }
-    }
-
-    private void migrateAssemblyDescriptor(Element jbossAssemblyDescriptor,
-            Element geronimoRootElement) {
-
-        Element jbossAssemblyDescriptorChildElement;
-        for (Iterator iter = jbossAssemblyDescriptor.elements().iterator(); iter.hasNext();) {
-            jbossAssemblyDescriptorChildElement = (Element) iter.next();
-            if (jbossAssemblyDescriptorChildElement.getName().equals("security-role")) {
-                Element geronimoRoleMapping = securityElementProcessor
-                        .getGeronimoSecurityRoleElement(geronimoRootElement);
-                securityElementProcessor.migrateSecurityRole(jbossAssemblyDescriptorChildElement,
-                        geronimoRoleMapping);
-            } else {
-                out.warn("The Element '" + jbossAssemblyDescriptorChildElement.getName()
-                        + "' is not supported", XMLConversionHelper
-                        .getLineNumber(jbossAssemblyDescriptorChildElement), XMLConversionHelper
-                        .getColumnNumber(jbossAssemblyDescriptorChildElement));
-                logger.debug("The Element '" + jbossAssemblyDescriptorChildElement.getName()
-                        + "' is not supported");
-            }
-        }
-    }
-
-    /**
-     * this migrates the enterprise-beans part
-     * 
-     * @param jbossEnterpriseBeans
-     * @param geronimoEnterpriseBeans
-     */
-    private void migrateEnterpriseBeans(Element jbossEnterpriseBeans,
-            Element geronimoEnterpriseBeans) {
-
-        Element jbossEnterpriseBeanChildElement;
-        for (Iterator iter = jbossEnterpriseBeans.elements().iterator(); iter.hasNext();) {
-            jbossEnterpriseBeanChildElement = (Element) iter.next();
-            if (jbossEnterpriseBeanChildElement.getName().equals("session")) {
-                // session beans can only come from jboss.xml file
-                logger.debug("migrating session beans");
-                QName qname = new QName("session", geronimoEnterpriseBeans.getNamespace());
-                Element geronimoSession = geronimoEnterpriseBeans.addElement(qname);
-                sessionBeanMigrator.migrateBean(jbossEnterpriseBeanChildElement, geronimoSession);
-            } else if (jbossEnterpriseBeanChildElement.getName().equals("entity")) {
-                logger.debug("migrating entity beans");
-                // get the session ejb name
-                Element ejbNameElement = jbossEnterpriseBeanChildElement.element("ejb-name");
-                String ejbName = ejbNameElement.getText();
-                logger.debug("Converting ejb session with name ==> " + ejbName);
-                // create a session bean in geronimo
-                String xpath = "//ejb:enterprise-beans/ejb:entity[ejb:ejb-name/text() = '"
-                        + ejbName + "']";
-                logger.debug("Find existing ejb using query ==>" + xpath);
-                Element geronimoEntity = XMLConversionHelper.getGeronimoElement(
-                        geronimoEnterpriseBeans, xpath, "entity", geronimoEnterpriseBeans
-                                .getNamespace());
-                entityBeanMigrator.migrateBean(jbossEnterpriseBeanChildElement, geronimoEntity);
-            } else {
-                out.warn("The Element '" + jbossEnterpriseBeanChildElement.getName()
-                        + "' is not supported", XMLConversionHelper
-                        .getLineNumber(jbossEnterpriseBeanChildElement), XMLConversionHelper
-                        .getColumnNumber(jbossEnterpriseBeanChildElement));
-                logger.debug("The Element '" + jbossEnterpriseBeanChildElement.getName()
-                        + "' is not supported");
-            }
-        }
-    }
-}

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/bean/BeanMigrator.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/bean/BeanMigrator.java?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/bean/BeanMigrator.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/bean/BeanMigrator.java Thu Jun 28 07:14:50 2007
@@ -1,196 +0,0 @@
-/**
- *  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.geronimo.j2g.descriptors.ejb.bean;
-
-import java.util.Iterator;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.geronimo.j2g.common.ConsoleOutput;
-import org.apache.geronimo.j2g.common.IOutput;
-import org.apache.geronimo.j2g.common.Tool;
-import org.apache.geronimo.j2g.util.descriptors.Constants;
-import org.apache.geronimo.j2g.util.descriptors.env.EnvirionmentElementProcessor;
-import org.apache.geronimo.j2g.util.descriptors.naming.NamingElementProcessor;
-import org.apache.geronimo.j2g.util.descriptors.xml.XMLConversionHelper;
-import org.dom4j.Element;
-import org.dom4j.QName;
-
-public class BeanMigrator {
-
-    private IOutput out;
-
-    private Log logger = LogFactory.getLog(BeanMigrator.class);
-
-    protected EnvirionmentElementProcessor envirionmentElementProcessor;
-
-    protected NamingElementProcessor namingElementProcessor;
-
-    public BeanMigrator(EnvirionmentElementProcessor envirionmentElementProcessor,
-            NamingElementProcessor namingElementProcessor) {
-    	
-    	Tool currentTool = Tool.getCurrent();
-    	if (currentTool != null) {
-    		out = currentTool.getOutput();
-    	} else {
-    		out = new ConsoleOutput();
-    	}
-        this.envirionmentElementProcessor = envirionmentElementProcessor;
-        this.namingElementProcessor = namingElementProcessor;
-    }
-
-    /**
-     * migrates the common methods for all the methods
-     * 
-     * @param jbossBeanElment
-     * @param geronimoBeanElemnt
-     * @return migrated or not
-     */
-    public boolean migrateBean(Element jbossBeanElment, Element geronimoBeanElemnt) {
-        boolean migrated = true;
-        if (jbossBeanElment.getName().equals("ejb-name")) {
-            // add ejb name to geronimo bean
-            // we have to check the ejb name since ejb name can put by the
-            // jbosscmp-jar as well.
-            String xpath = "//ejb:ejb-name[text() ='" + jbossBeanElment.getText() + "']";
-            logger.debug("Find existing ejb names with xpath ==> " + xpath);
-            if (!XMLConversionHelper.isNodeAvailable(geronimoBeanElemnt, xpath)) {
-                logger.debug("adding ejb-name to bean with name ==> " + jbossBeanElment.getText());
-                QName qname = new QName("ejb-name", geronimoBeanElemnt.getNamespace());
-                Element geronimoEJBName = geronimoBeanElemnt.addElement(qname);
-                geronimoEJBName.setText(jbossBeanElment.getText());
-            } else {
-                logger.debug("ejb-name already exists");
-            }
-
-        } else if (jbossBeanElment.getName().equals("resource-ref")) {
-            QName qname = new QName("resource-ref", geronimoBeanElemnt
-                    .getNamespaceForPrefix(Constants.NAMING_NAME_SPACE_PREFIX));
-            Element geronimoResourceRef = geronimoBeanElemnt.addElement(qname);
-            namingElementProcessor.migrateResourceRef(jbossBeanElment, geronimoResourceRef);
-        } else if (jbossBeanElment.getName().equals("ejb-ref")) {
-            // get the jndi name
-            String jndiName = jbossBeanElment.elementText("jndi-name");
-            // find bean element matching jndiname
-            String xpath = "//enterprise-beans/session[jndi-name/text() ='" + jndiName
-                    + "']/ejb-name";
-            Element element = XMLConversionHelper.getJbossElement(jbossBeanElment.getDocument(),
-                    xpath);
-
-            // check reference for a entity bean
-            if (element == null) {
-                xpath = "//enterprise-beans/entity[jndi-name/text() ='" + jndiName + "']/ejb-name";
-                element = XMLConversionHelper.getJbossElement(jbossBeanElment.getDocument(), xpath);
-            }
-
-            if (element != null) {
-
-                QName qname = new QName("ejb-ref", geronimoBeanElemnt
-                        .getNamespaceForPrefix(Constants.NAMING_NAME_SPACE_PREFIX));
-                Element geronimoEJBRef = geronimoBeanElemnt.addElement(qname);
-                migrateEJBRef(jbossBeanElment, geronimoEJBRef);
-                qname = new QName("ejb-link", geronimoEJBRef
-                        .getNamespaceForPrefix(Constants.NAMING_NAME_SPACE_PREFIX));
-                Element geronimoEJBLink = geronimoEJBRef.addElement(qname);
-                geronimoEJBLink.setText(element.getText());
-
-            } else {
-                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(jbossBeanElment), XMLConversionHelper
-                                .getColumnNumber(jbossBeanElment));
-                logger
-                        .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");
-            }
-
-        } else if (jbossBeanElment.getName().equals("ejb-local-ref")) {
-
-            // get the jndi name
-            String jndiName = jbossBeanElment.elementText("local-jndi-name");
-            // find bean element matching jndiname
-            String xpath = "//enterprise-beans/session[local-jndi-name/text() ='" + jndiName
-                    + "']/ejb-name";
-            Element element = XMLConversionHelper.getJbossElement(jbossBeanElment.getDocument(),
-                    xpath);
-
-            // check reference for a entity bean
-            if (element == null) {
-                xpath = "//enterprise-beans/entity[local-jndi-name/text() ='" + jndiName
-                        + "']/ejb-name";
-                element = XMLConversionHelper.getJbossElement(jbossBeanElment.getDocument(), xpath);
-            }
-
-            if (element != null) {
-                logger.debug("EJB reference found");
-                QName qname = new QName("ejb-local-ref", geronimoBeanElemnt
-                        .getNamespaceForPrefix(Constants.NAMING_NAME_SPACE_PREFIX));
-                Element geronimoEJBLocalRef = geronimoBeanElemnt.addElement(qname);
-                migrateEJBLocalRef(jbossBeanElment, geronimoEJBLocalRef);
-                qname = new QName("ejb-link", geronimoEJBLocalRef
-                        .getNamespaceForPrefix(Constants.NAMING_NAME_SPACE_PREFIX));
-                Element geronimoEJBLink = geronimoEJBLocalRef.addElement(qname);
-                geronimoEJBLink.setText(element.getText());
-
-            } else {
-                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(jbossBeanElment), XMLConversionHelper
-                                .getColumnNumber(jbossBeanElment));
-                logger
-                        .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");
-            }
-
-        } else {
-            migrated = false;
-        }
-
-        return migrated;
-    }
-
-    private void migrateEJBRef(Element jbossEJBRef, Element geronimoEJBRef) {
-
-        Element jbossEJBChildRef;
-        for (Iterator iter = jbossEJBRef.elementIterator(); iter.hasNext();) {
-            jbossEJBChildRef = (Element) iter.next();
-            if (jbossEJBChildRef.getName().equals("ejb-ref-name")) {
-                QName qname = new QName("ref-name", geronimoEJBRef
-                        .getNamespaceForPrefix(Constants.NAMING_NAME_SPACE_PREFIX));
-                Element geronimoRefName = geronimoEJBRef.addElement(qname);
-                geronimoRefName.setText(jbossEJBChildRef.getText());
-            }
-        }
-    }
-
-    private void migrateEJBLocalRef(Element jbossEJBRef, Element geronimoEJBRef) {
-
-        Element jbossEJBChildRef;
-        for (Iterator iter = jbossEJBRef.elementIterator(); iter.hasNext();) {
-            jbossEJBChildRef = (Element) iter.next();
-            if (jbossEJBChildRef.getName().equals("ejb-ref-name")) {
-                QName qname = new QName("ref-name", geronimoEJBRef
-                        .getNamespaceForPrefix(Constants.NAMING_NAME_SPACE_PREFIX));
-                Element geronimoRefName = geronimoEJBRef.addElement(qname);
-                geronimoRefName.setText(jbossEJBChildRef.getText());
-            }
-        }
-    }
-
-}

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/bean/EntityBeanMigrator.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/bean/EntityBeanMigrator.java?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/bean/EntityBeanMigrator.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/bean/EntityBeanMigrator.java Thu Jun 28 07:14:50 2007
@@ -1,61 +0,0 @@
-/**
- *  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.geronimo.j2g.descriptors.ejb.bean;
-
-import java.util.Iterator;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.geronimo.j2g.common.ConsoleOutput;
-import org.apache.geronimo.j2g.common.IOutput;
-import org.apache.geronimo.j2g.common.Tool;
-import org.apache.geronimo.j2g.util.descriptors.env.EnvirionmentElementProcessor;
-import org.apache.geronimo.j2g.util.descriptors.naming.NamingElementProcessor;
-import org.dom4j.Element;
-
-public class EntityBeanMigrator extends JNDIBeanMigrator {
-
-    private IOutput out;
-    private Log logger = LogFactory.getLog(EntityBeanMigrator.class);
-
-    public EntityBeanMigrator(EnvirionmentElementProcessor envirionmentElementProcessor,
-            NamingElementProcessor namingElementProcessor) {
-        super(envirionmentElementProcessor, namingElementProcessor);
-    	Tool currentTool = Tool.getCurrent();
-    	if (currentTool != null) {
-    		out = currentTool.getOutput();
-    	} else {
-    		out = new ConsoleOutput();
-    	}
-    }
-
-    public boolean migrateBean(Element jbossEntity, Element geronimoEntity) {
-        Element jbossEntityChildElement;
-        for (Iterator iter = jbossEntity.elements().iterator(); iter.hasNext();) {
-            jbossEntityChildElement = (Element) iter.next();
-
-            // do the migration only if super classes can not
-            if (!super.migrateBean(jbossEntityChildElement, geronimoEntity)) {
-                // TODO: entity bean secific migrations
-                out.warn("The Element '" + jbossEntityChildElement.getName()
-                        + "' is not supported");
-            }
-        }
-        return true;
-    }
-}

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/bean/JNDIBeanMigrator.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/bean/JNDIBeanMigrator.java?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/bean/JNDIBeanMigrator.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/bean/JNDIBeanMigrator.java Thu Jun 28 07:14:50 2007
@@ -1,53 +0,0 @@
-/**
- *  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.geronimo.j2g.descriptors.ejb.bean;
-
-
-import org.apache.geronimo.j2g.util.descriptors.env.EnvirionmentElementProcessor;
-import org.apache.geronimo.j2g.util.descriptors.naming.NamingElementProcessor;
-import org.dom4j.Element;
-import org.dom4j.QName;
-
-public class JNDIBeanMigrator extends BeanMigrator {
-
-
-    public JNDIBeanMigrator(EnvirionmentElementProcessor envirionmentElementProcessor,
-            NamingElementProcessor namingElementProcessor) {
-        super(envirionmentElementProcessor, namingElementProcessor);
-    }
-
-    public boolean migrateBean(Element jbossBeanElment, Element geronimoBeanElemnt) {
-        boolean migrated = true;
-        if (!super.migrateBean(jbossBeanElment, geronimoBeanElemnt)) {
-            if (jbossBeanElment.getName().equals("jndi-name")) {
-                // add ejb name to geronimo session
-                QName qname = new QName("jndi-name", geronimoBeanElemnt.getNamespace());
-                Element geronimoJndiName = geronimoBeanElemnt.addElement(qname);
-                geronimoJndiName.setText(jbossBeanElment.getText());
-            } else if (jbossBeanElment.getName().equals("local-jndi-name")) {
-                // add ejb name to geronimo session
-                QName qname = new QName("local-jndi-name", geronimoBeanElemnt.getNamespace());
-                Element geronimoLocalJndiName = geronimoBeanElemnt.addElement(qname);
-                geronimoLocalJndiName.setText(jbossBeanElment.getText());
-            } else {
-                migrated = false;
-            }
-        }
-        return migrated;
-    }
-}

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/bean/MessageDrivenBeanMigrator.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/bean/MessageDrivenBeanMigrator.java?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/bean/MessageDrivenBeanMigrator.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/bean/MessageDrivenBeanMigrator.java Thu Jun 28 07:14:50 2007
@@ -1,29 +0,0 @@
-/**
- *  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.geronimo.j2g.descriptors.ejb.bean;
-
-import org.apache.geronimo.j2g.util.descriptors.env.EnvirionmentElementProcessor;
-import org.apache.geronimo.j2g.util.descriptors.naming.NamingElementProcessor;
-
-
-public class MessageDrivenBeanMigrator extends BeanMigrator {
-
-    public MessageDrivenBeanMigrator(EnvirionmentElementProcessor envirionmentElementProcessor,
-            NamingElementProcessor namingElementProcessor) {
-        super(envirionmentElementProcessor, namingElementProcessor);
-    }
-}

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/bean/SessionBeanMigrator.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/bean/SessionBeanMigrator.java?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/bean/SessionBeanMigrator.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/src/org/apache/geronimo/j2g/descriptors/ejb/bean/SessionBeanMigrator.java Thu Jun 28 07:14:50 2007
@@ -1,60 +0,0 @@
-/**
- *  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.geronimo.j2g.descriptors.ejb.bean;
-
-import java.util.Iterator;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.geronimo.j2g.common.ConsoleOutput;
-import org.apache.geronimo.j2g.common.IOutput;
-import org.apache.geronimo.j2g.common.Tool;
-import org.apache.geronimo.j2g.util.descriptors.env.EnvirionmentElementProcessor;
-import org.apache.geronimo.j2g.util.descriptors.naming.NamingElementProcessor;
-import org.dom4j.Element;
-
-
-public class SessionBeanMigrator extends JNDIBeanMigrator {
-
-    private static Log logger = LogFactory.getLog(SessionBeanMigrator.class);
-    private IOutput out;
-
-    public SessionBeanMigrator(EnvirionmentElementProcessor envirionmentElementProcessor,
-            NamingElementProcessor namingElementProcessor) {
-        super(envirionmentElementProcessor, namingElementProcessor);
-    	Tool currentTool = Tool.getCurrent();
-    	if (currentTool != null) {
-    		out = currentTool.getOutput();
-    	} else {
-    		out = new ConsoleOutput();
-    	}
-    }
-
-    public boolean migrateBean(Element jbossSession, Element geronimoSession) {
-        Element jbossSessionChildElement;
-        for (Iterator iter = jbossSession.elements().iterator(); iter.hasNext();) {
-            jbossSessionChildElement = (Element) iter.next();
-            // do the migration only if super classes can not
-            if (!super.migrateBean(jbossSessionChildElement, geronimoSession)) {
-                // TODO: session bean secific migrations
-                out.warn("The Element '" + jbossSessionChildElement.getName()
-                        + "' is not supported");
-            }
-        }
-        return true;
-    }
-}

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/test-resources/jboss.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/test-resources/jboss.xml?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/test-resources/jboss.xml (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/test-resources/jboss.xml Thu Jun 28 07:14:50 2007
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--  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. -->
-  
-<!--DOCTYPE ejb-jar PUBLIC
-      "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
-      "http://java.sun.com/dtd/ejb-jar_2_0.dtd" -->
-
-<jboss>
-   <enterprise-beans>
-      <session>
-         <ejb-name>EJBTestRunnerEJB</ejb-name>
-         <jndi-name>ejb/EJBTestRunner</jndi-name>
-      </session>
-      <entity>
-         <ejb-name>OrganizationEJB</ejb-name>
-         <local-jndi-name>crimeportal/Organization</local-jndi-name>
-      </entity>
-      <entity>
-         <ejb-name>GangsterEJB</ejb-name>
-         <local-jndi-name>crimeportal/Gangster</local-jndi-name>
-      </entity>
-      <entity>
-         <ejb-name>JobEJB</ejb-name>
-         <local-jndi-name>crimeportal/Job</local-jndi-name>
-      </entity>
-   </enterprise-beans>
-</jboss>

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/test/org/apache/geronimo/j2g/descriptors/ejb/test/TestEJBDescriptorTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/test/org/apache/geronimo/j2g/descriptors/ejb/test/TestEJBDescriptorTool.java?view=diff&rev=551566&r1=551565&r2=551566
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/test/org/apache/geronimo/j2g/descriptors/ejb/test/TestEJBDescriptorTool.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors.ejb/test/org/apache/geronimo/j2g/descriptors/ejb/test/TestEJBDescriptorTool.java Thu Jun 28 07:14:50 2007
@@ -1,33 +0,0 @@
-/**
- *  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.geronimo.j2g.descriptors.ejb.test;
-
-import java.io.File;
-
-import junit.framework.TestCase;
-
-import org.apache.geronimo.j2g.descriptors.ejb.EJBDescriptorTool;
-
-public class TestEJBDescriptorTool extends TestCase {
-
-    public void testMigrate() {
-        File file = new File("test-resources/jboss.xml");
-        EJBDescriptorTool ejbDescriptorTool = new EJBDescriptorTool();
-        ejbDescriptorTool.migrate(file);
-    }
-    
-}



Mime
View raw message