svn commit: r630279 - in /ofbiz/trunk/framework: entity/src/org/ofbiz/entity/ entity/src/org/ofbiz/entity/model/ entityext/src/org/ofbiz/entityext/ entityext/src/org/ofbiz/entityext/synchronization/ webtools/config/ webtools/servicedef/ webtools/src/or...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r630279 - in /ofbiz/trunk/framework: entity/src/org/ofbiz/entity/ entity/src/org/ofbiz/entity/model/ entityext/src/org/ofbiz/entityext/ entityext/src/org/ofbiz/entityext/synchronization/ webtools/config/ webtools/servicedef/ webtools/src/or...

jonesde
Author: jonesde
Date: Fri Feb 22 10:17:21 2008
New Revision: 630279

URL: http://svn.apache.org/viewvc?rev=630279&view=rev
Log:
Added initial implementation of entity EOModelBundle export, including various utility methods and refactoring and such

Added:
    ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/EntityGroupUtil.java   (with props)
    ofbiz/trunk/framework/webtools/widget/EntityForms.xml   (with props)
Modified:
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelReader.java
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelRelation.java
    ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java
    ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.properties
    ofbiz/trunk/framework/webtools/servicedef/services.xml
    ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java
    ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml
    ofbiz/trunk/framework/webtools/webapp/webtools/main.ftl
    ofbiz/trunk/framework/webtools/widget/EntityScreens.xml

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java?rev=630279&r1=630278&r2=630279&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java Fri Feb 22 10:17:21 2008
@@ -991,11 +991,14 @@
      *@param prefix A prefix to put in front of the entity name in the tag name
      */
     public void writeXmlText(PrintWriter writer, String prefix) {
-        final int indent = 4;
+        int indent = 4;
+        StringBuffer indentStrBuf = new StringBuffer();
+        for (int i = 0; i < indent; i++) indentStrBuf.append(' ');
+        String indentString = indentStrBuf.toString();
 
         if (prefix == null) prefix = "";
 
-        for (int i = 0; i < indent; i++) writer.print(' ');
+        writer.print(indentString);
         writer.print('<');
         writer.print(prefix);
         writer.print(this.getEntityName());
@@ -1123,7 +1126,8 @@
             writer.println('>');
 
             for (Map.Entry<String, String> entry: cdataMap.entrySet()) {
-                for (int i = 0; i < (indent << 1); i++) writer.print(' ');
+                writer.print(indentString);
+                writer.print(indentString);
                 writer.print('<');
                 writer.print(entry.getKey());
                 writer.print("><![CDATA[");
@@ -1134,7 +1138,7 @@
             }
 
             // don't forget to close the entity.
-            for (int i = 0; i < indent; i++) writer.print(' ');
+            writer.print(indentString);
             writer.print("</");
             writer.print(this.getEntityName());
             writer.println(">");

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java?rev=630279&r1=630278&r2=630279&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java Fri Feb 22 10:17:21 2008
@@ -18,6 +18,7 @@
  *******************************************************************************/
 package org.ofbiz.entity.model;
 
+import java.io.PrintWriter;
 import java.io.Serializable;
 import java.util.Arrays;
 import java.util.Collection;
@@ -1378,6 +1379,221 @@
     public Element toXmlElement(Document document) {
         return this.toXmlElement(document, this.getPackageName());
     }
-}
+    
+    /**
+     * Writes entity model information in the Apple EOModelBundle format.
+     *
+     * For document structure and definition see: http://developer.apple.com/documentation/InternetWeb/Reference/WO_BundleReference/Articles/EOModelBundle.html
+     *
+     * For examples see the JavaRealEstate.framework and JavaBusinessLogic.framework packages which are in the /Library/Frameworks directory after installing the WebObjects Examples package (get latest version of WebObjects download for this).
+     *
+     * This is based on examples and documentation from WebObjects 5.4, downloaded 20080221.
+     *
+     * @param writer
+     * @param entityPrefix
+     * @param helperName
+     */
+    public void writeEoModelText(PrintWriter writer, String entityPrefix, String helperName) {
+        int indent = 4;
+        StringBuffer indentStrBuf = new StringBuffer();
+        for (int i = 0; i < indent; i++) indentStrBuf.append(' ');
+        String indentString = indentStrBuf.toString();
+
+        if (entityPrefix == null) entityPrefix = "";
+        if (helperName == null) helperName = "localderby";
+        ModelFieldTypeReader modelFieldTypeReader = ModelFieldTypeReader.getModelFieldTypeReader(helperName);
+
+        writer.println('{');
+        
+        writer.print(indentString);
+        writer.print("externalName = ");
+        writer.print(this.getTableName(helperName));
+        writer.println(";");
+
+        writer.print(indentString);
+        writer.print("name = ");
+        writer.print(this.getEntityName());
+        writer.println(";");
+
+        writer.print(indentString);
+        writer.println("className = EOGenericRecord;");
+
+        // for classProperties add field names AND relationship names to get a nice, complete chart
+        writer.print(indentString);
+        writer.print("classProperties = (");
+        Iterator<ModelField> cpFieldIter = this.getFieldsIterator();
+        while (cpFieldIter.hasNext()) {
+            ModelField field = cpFieldIter.next();
+            writer.print(field.getName());
+            if (cpFieldIter.hasNext()) writer.print(", ");
+        }
+        Iterator<ModelRelation> cpRelationshipIter = this.getRelationsIterator();
+        // put these on a new line if there are any
+        if (cpRelationshipIter.hasNext()) {
+            writer.println(",");
+            writer.print(indentString);
+            writer.print(indentString);
+        }
+        while (cpRelationshipIter.hasNext()) {
+            ModelRelation relationship = cpRelationshipIter.next();
+            writer.print(relationship.getCombinedName());
+            if (cpRelationshipIter.hasNext()) writer.print(", ");
+        }
+        writer.println(");");
+        
+        // attributes
+        writer.print(indentString);
+        writer.println("attributes = (");
+        Iterator<ModelField> attrFieldIter = this.getFieldsIterator();
+        while (attrFieldIter.hasNext()) {
+            ModelField field = attrFieldIter.next();
+            ModelFieldType fieldType = modelFieldTypeReader.getModelFieldType(field.getType());
+
+            writer.print(indentString);
+            writer.println("{");
+            
+            writer.print(indentString);
+            writer.print(indentString);
+            writer.print("name = ");
+            writer.print(field.getName());
+            writer.println(";");
+            
+            writer.print(indentString);
+            writer.print(indentString);
+            writer.print("columnName = ");
+            writer.print(field.getColName());
+            writer.println(";");
+            
+            writer.print(indentString);
+            writer.print(indentString);
+            writer.print("externalType = ");
+            writer.print(fieldType.getSqlType());
+            writer.println(";");
+            
+            writer.print(indentString);
+            writer.print(indentString);
+            writer.print("valueClassName = ");
+            writer.print(fieldType.getJavaType());
+            writer.println(";");
+            
+            /* maybe map this one later, probably not needed for diagramming help anyway
+            writer.print(indentString);
+            writer.print(indentString);
+            writer.print("valueType = ");
+            writer.print(??);
+            writer.println(";");
+            */
+            
+            writer.print(indentString);
+            if (attrFieldIter.hasNext()) {
+                writer.println("},");
+            } else {
+                writer.println("}");
+            }
+        }
+        writer.print(indentString);
+        writer.println(");");
 
+        // primaryKeyAttributes
+        writer.print(indentString);
+        writer.print("primaryKeyAttributes = (");
+        Iterator<ModelField> pkFieldIter = this.getPksIterator();
+        while (pkFieldIter.hasNext()) {
+            ModelField field = pkFieldIter.next();
+            writer.print(field.getName());
+            if (pkFieldIter.hasNext()) writer.print(", ");
+        }
+        writer.println(");");
+
+        // attributes
+        writer.print(indentString);
+        writer.println("relationships = (");
+        Iterator<ModelRelation> relRelationshipIter = this.getRelationsIterator();
+        while (relRelationshipIter.hasNext()) {
+            ModelRelation relationship = relRelationshipIter.next();
+
+            writer.print(indentString);
+            writer.println("{");
+            
+            writer.print(indentString);
+            writer.print(indentString);
+            writer.print("name = ");
+            writer.print(relationship.getCombinedName());
+            writer.println(";");
+            
+            writer.print(indentString);
+            writer.print(indentString);
+            writer.print("destination = ");
+            writer.print(relationship.getRelEntityName());
+            writer.println(";");
+            
+            writer.print(indentString);
+            writer.print(indentString);
+            if ("many".equals(relationship.getType())) {
+                writer.println("isToMany = Y;");
+            } else {
+                writer.println("isToMany = N;");
+            }
 
+            /* nothing in OFBiz entity models for this yet, but might be nice to add in the future
+            writer.print(indentString);
+            writer.print(indentString);
+            writer.print("isMandatory = ");
+            writer.print();
+            writer.println(";");
+            */
+            
+            writer.print(indentString);
+            writer.print(indentString);
+            writer.println("joinSemantic = EOInnerJoin;");
+            
+            writer.print(indentString);
+            writer.print(indentString);
+            writer.println("joins = (");
+            Iterator<ModelKeyMap> keyMapIter = relationship.getKeyMapsIterator();
+            while (keyMapIter.hasNext()) {
+                ModelKeyMap keyMap = keyMapIter.next();
+
+                writer.print(indentString);
+                writer.print(indentString);
+                writer.println("{");
+                
+                writer.print(indentString);
+                writer.print(indentString);
+                writer.print(indentString);
+                writer.print("sourceAttribute = ");
+                writer.print(keyMap.getFieldName());
+                writer.println(";");
+
+                writer.print(indentString);
+                writer.print(indentString);
+                writer.print(indentString);
+                writer.print("destinationAttribute = ");
+                writer.print(keyMap.getRelFieldName());
+                writer.println(";");
+
+                writer.print(indentString);
+                writer.print(indentString);
+                if (keyMapIter.hasNext()) {
+                    writer.println("},");
+                } else {
+                    writer.println("}");
+                }
+            }
+            writer.print(indentString);
+            writer.print(indentString);
+            writer.println(");");
+            
+            writer.print(indentString);
+            if (relRelationshipIter.hasNext()) {
+                writer.println("},");
+            } else {
+                writer.println("}");
+            }
+        }
+        writer.print(indentString);
+        writer.println(");");
+        
+        writer.println("}");
+    }
+}

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelReader.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelReader.java?rev=630279&r1=630278&r2=630279&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelReader.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelReader.java Fri Feb 22 10:17:21 2008
@@ -36,6 +36,7 @@
 import org.ofbiz.base.config.ResourceHandler;
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.UtilTimer;
+import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.base.util.UtilXml;
 import org.ofbiz.base.util.cache.UtilCache;
 import org.ofbiz.entity.GenericEntityConfException;
@@ -484,6 +485,48 @@
             throw new GenericEntityConfException("ERROR: Unable to load Entity Cache");
         }
         return ec.keySet();
+    }
+    
+    /** Get all entities, organized by package */
+    public Map<String, TreeSet<String>> getEntitiesByPackage(Set<String> packageFilterSet, Set<String> entityFilterSet) throws GenericEntityException {
+        Map<String, TreeSet<String>> entitiesByPackage = FastMap.newInstance();
+        
+        //put the entityNames TreeSets in a HashMap by packageName
+        Iterator<String> ecIter = this.getEntityNames().iterator();
+        while (ecIter.hasNext()) {
+            String entityName = (String) ecIter.next();
+            ModelEntity entity = this.getModelEntity(entityName);
+            String packageName = entity.getPackageName();
+            
+            if (UtilValidate.isNotEmpty(packageFilterSet)) {
+                boolean skipThis = false;
+                // does it match any of these?
+                for (String packageFilter: packageFilterSet) {
+                    boolean foundMatch = false;
+                    if (packageName.contains(packageFilter)) {
+                        foundMatch = true;
+                    }
+                    if (!foundMatch) {
+                        //Debug.logInfo("Not including entity " + entityName + " becuase it is not in the package set: " + packageFilterSet, module);
+                        skipThis = true;
+                    }
+                }
+                if (skipThis) continue;
+            }
+            if (UtilValidate.isNotEmpty(entityFilterSet) && !entityFilterSet.contains(entityName)) {
+                //Debug.logInfo("Not including entity " + entityName + " becuase it is not in the entity set: " + entityFilterSet, module);
+                continue;
+            }
+            
+            TreeSet<String> entities = entitiesByPackage.get(entity.getPackageName());
+            if (entities == null) {
+                entities = new TreeSet<String>();
+                entitiesByPackage.put(entity.getPackageName(), entities);
+            }
+            entities.add(entityName);
+        }
+        
+        return entitiesByPackage;
     }
 
     ModelEntity createModelEntity(Element entityElement, UtilTimer utilTimer, ModelInfo def) {

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelRelation.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelRelation.java?rev=630279&r1=630278&r2=630279&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelRelation.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelRelation.java Fri Feb 22 10:17:21 2008
@@ -90,6 +90,10 @@
             }
         }
     }
+    
+    public String getCombinedName() {
+        return this.title + this.relEntityName;
+    }
 
     /** the title, gives a name/description to the relation */
     public String getTitle() {

Added: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/EntityGroupUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/EntityGroupUtil.java?rev=630279&view=auto
==============================================================================
--- ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/EntityGroupUtil.java (added)
+++ ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/EntityGroupUtil.java Fri Feb 22 10:17:21 2008
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * 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.ofbiz.entityext;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javolution.util.FastList;
+import javolution.util.FastSet;
+
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.entity.GenericDelegator;
+import org.ofbiz.entity.GenericEntityException;
+import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.model.ModelEntity;
+import org.ofbiz.entity.model.ModelViewEntity;
+
+/**
+ * EntityEcaUtil
+ */
+public class EntityGroupUtil {
+
+    public static final String module = EntityGroupUtil.class.getName();
+
+    public static Set<String> getEntityNamesByGroup(String entityGroupId, GenericDelegator delegator) throws GenericEntityException {
+        Set<String> entityNames = FastSet.newInstance();
+        
+        List entitySyncGroupIncludes = delegator.findByAnd("EntitySyncInclGrpDetailView", UtilMisc.toMap("entityGroupId", entityGroupId));
+        
+        List<ModelEntity> modelEntities = getModelEntitiesFromRecords(entitySyncGroupIncludes, delegator);
+        for (ModelEntity modelEntity: modelEntities) {
+            entityNames.add(modelEntity.getEntityName());
+        }
+        
+        return entityNames;
+    }
+
+    public static List<ModelEntity> getModelEntitiesFromRecords(List<GenericValue> entityGroupEntryValues, GenericDelegator delegator) throws GenericEntityException {
+        List<ModelEntity> entityModelToUseList = FastList.newInstance();
+
+        Iterator entityNameIter = delegator.getModelReader().getEntityNamesIterator();
+        while (entityNameIter.hasNext()) {
+            String entityName = (String) entityNameIter.next();
+            ModelEntity modelEntity = delegator.getModelEntity(entityName);
+            
+            // if view-entity, throw it out
+            if (modelEntity instanceof ModelViewEntity) {
+                continue;
+            }
+            
+            // if it doesn't have either or both of the two update stamp fields, throw it out
+            if (!modelEntity.isField(ModelEntity.STAMP_FIELD) || !modelEntity.isField(ModelEntity.STAMP_TX_FIELD)) {
+                continue;
+            }
+            
+            // if there are no includes records, always include; otherwise check each one to make sure at least one matches
+            if (entityGroupEntryValues.size() == 0) {
+                entityModelToUseList.add(modelEntity);
+            } else {
+                // we have different types of include applications: ESIA_INCLUDE, ESIA_EXCLUDE, ESIA_ALWAYS
+                // if we find an always we can break right there because this will always be include regardless of excludes, etc
+                // if we find an include or exclude we have to finish going through the rest of them just in case there is something that overrides it (ie an exclude for an include or an always for an exclude)
+                boolean matchesInclude = false;
+                boolean matchesExclude = false;
+                boolean matchesAlways = false;
+                Iterator<GenericValue> entitySyncIncludeIter = entityGroupEntryValues.iterator();
+                while (entitySyncIncludeIter.hasNext()) {
+                    GenericValue entitySyncInclude = entitySyncIncludeIter.next();
+                    String entityOrPackage = entitySyncInclude.getString("entityOrPackage");
+                    boolean matches = false;
+                    if (entityName.equals(entityOrPackage)) {
+                        matches = true;
+                    } else if (modelEntity.getPackageName().startsWith(entityOrPackage)) {
+                        matches = true;
+                    }
+                    
+                    if (matches) {
+                        if ("ESIA_INCLUDE".equals(entitySyncInclude.getString("applEnumId"))) {
+                            matchesInclude = true;
+                        } else if ("ESIA_EXCLUDE".equals(entitySyncInclude.getString("applEnumId"))) {
+                            matchesExclude = true;
+                        } else if ("ESIA_ALWAYS".equals(entitySyncInclude.getString("applEnumId"))) {
+                            matchesAlways = true;
+                            break;
+                        }
+                    }
+                }
+                
+                if (matchesAlways || (matchesInclude && !matchesExclude)) {
+                    // make sure this log message is not checked in uncommented:
+                    //Debug.log("In runEntitySync adding [" + modelEntity.getEntityName() + "] to list of Entities to sync", module);
+                    entityModelToUseList.add(modelEntity);
+                }
+            }
+        }
+        
+        return entityModelToUseList;
+    }
+}

Propchange: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/EntityGroupUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/EntityGroupUtil.java
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/EntityGroupUtil.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java?rev=630279&r1=630278&r2=630279&view=diff
==============================================================================
--- ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java (original)
+++ ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java Fri Feb 22 10:17:21 2008
@@ -49,6 +49,7 @@
 import org.ofbiz.entity.transaction.GenericTransactionException;
 import org.ofbiz.entity.transaction.TransactionUtil;
 import org.ofbiz.entity.util.EntityListIterator;
+import org.ofbiz.entityext.EntityGroupUtil;
 import org.ofbiz.service.DispatchContext;
 import org.ofbiz.service.GeneralServiceException;
 import org.ofbiz.service.GenericServiceException;
@@ -843,69 +844,13 @@
     }
     
     /** prepare a list of all entities we want to synchronize: remove all view-entities and all entities that don't match the patterns attached to this EntitySync */
-    protected List makeEntityModelToUseList() throws GenericEntityException {
-        List entityModelToUseList = new LinkedList();
-        List entitySyncIncludes = entitySync.getRelated("EntitySyncInclude");
-
+    protected List<ModelEntity> makeEntityModelToUseList() throws GenericEntityException {
+        List<GenericValue> entitySyncIncludes = entitySync.getRelated("EntitySyncInclude");
         // get these ones as well, and just add them to the main list, it will have an extra field but that shouldn't hurt anything in the code below
-        List entitySyncGroupIncludes = entitySync.getRelated("EntitySyncInclGrpDetailView");
+        List<GenericValue> entitySyncGroupIncludes = entitySync.getRelated("EntitySyncInclGrpDetailView");
         entitySyncIncludes.addAll(entitySyncGroupIncludes);
 
-        Iterator entityNameIter = delegator.getModelReader().getEntityNamesIterator();
-        while (entityNameIter.hasNext()) {
-            String entityName = (String) entityNameIter.next();
-            ModelEntity modelEntity = delegator.getModelEntity(entityName);
-            
-            // if view-entity, throw it out
-            if (modelEntity instanceof ModelViewEntity) {
-                continue;
-            }
-            
-            // if it doesn't have either or both of the two update stamp fields, throw it out
-            if (!modelEntity.isField(ModelEntity.STAMP_FIELD) || !modelEntity.isField(ModelEntity.STAMP_TX_FIELD)) {
-                continue;
-            }
-            
-            // if there are no includes records, always include; otherwise check each one to make sure at least one matches
-            if (entitySyncIncludes.size() == 0) {
-                entityModelToUseList.add(modelEntity);
-            } else {
-                // we have different types of include applications: ESIA_INCLUDE, ESIA_EXCLUDE, ESIA_ALWAYS
-                // if we find an always we can break right there because this will always be include regardless of excludes, etc
-                // if we find an include or exclude we have to finish going through the rest of them just in case there is something that overrides it (ie an exclude for an include or an always for an exclude)
-                boolean matchesInclude = false;
-                boolean matchesExclude = false;
-                boolean matchesAlways = false;
-                Iterator entitySyncIncludeIter = entitySyncIncludes.iterator();
-                while (entitySyncIncludeIter.hasNext()) {
-                    GenericValue entitySyncInclude = (GenericValue) entitySyncIncludeIter.next();
-                    String entityOrPackage = entitySyncInclude.getString("entityOrPackage");
-                    boolean matches = false;
-                    if (entityName.equals(entityOrPackage)) {
-                        matches = true;
-                    } else if (modelEntity.getPackageName().startsWith(entityOrPackage)) {
-                        matches = true;
-                    }
-                    
-                    if (matches) {
-                        if ("ESIA_INCLUDE".equals(entitySyncInclude.getString("applEnumId"))) {
-                            matchesInclude = true;
-                        } else if ("ESIA_EXCLUDE".equals(entitySyncInclude.getString("applEnumId"))) {
-                            matchesExclude = true;
-                        } else if ("ESIA_ALWAYS".equals(entitySyncInclude.getString("applEnumId"))) {
-                            matchesAlways = true;
-                            break;
-                        }
-                    }
-                }
-                
-                if (matchesAlways || (matchesInclude && !matchesExclude)) {
-                    // make sure this log message is not checked in uncommented:
-                    //Debug.log("In runEntitySync adding [" + modelEntity.getEntityName() + "] to list of Entities to sync", module);
-                    entityModelToUseList.add(modelEntity);
-                }
-            }
-        }
+        List<ModelEntity> entityModelToUseList = EntityGroupUtil.getModelEntitiesFromRecords(entitySyncIncludes, delegator);
         
         if (Debug.infoOn()) Debug.logInfo("In makeEntityModelToUseList for EntitySync with ID [" + entitySync.get("entitySyncId") + "] syncing " + entityModelToUseList.size() + " entities", module);
         return entityModelToUseList;

Modified: ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.properties?rev=630279&r1=630278&r2=630279&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.properties (original)
+++ ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.properties Fri Feb 22 10:17:21 2008
@@ -143,6 +143,7 @@
 WebtoolsExport=Export
 WebtoolsExportable=Exportable
 WebtoolsExportFromDataSource=XML Export from DataSource(s)
+WebtoolsExportEntityEoModelBundle=Export Entity EOModelBundle
 WebtoolsFatalLogLevel=Fatal
 WebtoolsFatalLogLevelTooltip=The Fatal level designates very severe error events that will presumably lead the application to abort.
 WebtoolsFieldName=Field Name

Modified: ofbiz/trunk/framework/webtools/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/servicedef/services.xml?rev=630279&r1=630278&r2=630279&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/servicedef/services.xml (original)
+++ ofbiz/trunk/framework/webtools/servicedef/services.xml Fri Feb 22 10:17:21 2008
@@ -90,17 +90,33 @@
         <attribute name="txTimeout" type="Integer" mode="IN" optional="true"/>
         <attribute name="results" type="List" mode="OUT" optional="false"/>
     </service>
+    
     <service name="getEntityRefData" engine="java" location="org.ofbiz.webtools.WebToolsServices" invoke="getEntityRefData" auth="true" use-transaction="false">
         <description>Gets the entity reference data - for the entity reference screen. See org.ofbiz.webtools.WebToolsServices.getEntityRefData().</description>
         <permission-service service-name="entityMaintPermCheck" main-action="VIEW"/>
         <attribute name="numberOfEntities" type="java.lang.Integer" mode="OUT" optional="true"/>
         <attribute name="packagesList" type="java.util.List" mode="OUT" optional="true"/>
     </service>
+    <service name="exportEntityEoModelBundle" engine="java" location="org.ofbiz.webtools.WebToolsServices" invoke="exportEntityEoModelBundle" auth="true" use-transaction="false">
+        <description>Saves specified set of entities to an Apple EOModelBundle file.
+            See org.ofbiz.webtools.WebToolsServices.exportEoModelBundle().
+            Specify either entityPackageName or entityGroupId, or leave both empty for ALL entities in the data model.
+        </description>
+        <permission-service service-name="entityMaintPermCheck" main-action="VIEW"/>
+        <attribute name="eomodeldFullPath" type="java.lang.String" mode="IN" optional="false"/>
+        <attribute name="entityPackageName" type="java.lang.String" mode="IN" optional="true"/>
+        <attribute name="entityGroupId" type="java.lang.String" mode="IN" optional="true"/>
+        <attribute name="datasourceName" type="java.lang.String" mode="IN" optional="true"/>
+        <attribute name="entityNamePrefix" type="java.lang.String" mode="IN" optional="true"/>
+    </service>
+    
     <service name="entityMaintPermCheck" engine="java" location="org.ofbiz.webtools.WebToolsServices" invoke="entityMaintPermCheck">
         <description>Performs an entity maintenance security check. Returns hasPermission=true
           if the user has the ENTITY_MAINT permission.</description>
         <implements service="permissionInterface"/>
     </service>
+    
+    
     <service name="jobList" engine="java"
             location="org.ofbiz.webtools.WebToolsServices" invoke="findJobs" auth="true" use-transaction="false">
         <description>Find Jobs</description>

Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java?rev=630279&r1=630278&r2=630279&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java (original)
+++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java Fri Feb 22 10:17:21 2008
@@ -25,6 +25,7 @@
 import java.util.List;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Set;
 import java.util.TreeSet;
 import java.util.Locale;
 import java.util.Map;
@@ -40,6 +41,7 @@
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.FileNotFoundException;
+import java.io.UnsupportedEncodingException;
 import java.net.URL;
 import java.net.MalformedURLException;
 
@@ -77,6 +79,7 @@
 import org.ofbiz.entity.condition.EntityExpr;
 import org.ofbiz.entity.condition.EntityOperator;
 import org.ofbiz.entity.util.EntityFindOptions;
+import org.ofbiz.entityext.EntityGroupUtil;
 import org.ofbiz.security.Security;
 import org.ofbiz.service.DispatchContext;
 import org.ofbiz.service.LocalDispatcher;
@@ -487,7 +490,6 @@
                 outdir.mkdir();
             }
             if (outdir.isDirectory() && outdir.canWrite()) {
-                
                 Iterator passedEntityNames = null;
                 try {
                     ModelReader reader = delegator.getModelReader();
@@ -619,7 +621,7 @@
         Map<String, Object> resultMap = ServiceUtil.returnSuccess();
         
         ModelReader reader = delegator.getModelReader();
-        Map<String, Object> packages = FastMap.newInstance();
+        Map<String, TreeSet<String>> entitiesByPackage = FastMap.newInstance();
         TreeSet<String> packageNames = new TreeSet<String>();
         TreeSet<String> tableNames = new TreeSet<String>();
         
@@ -635,10 +637,10 @@
                 if (UtilValidate.isNotEmpty(ent.getPlainTableName())) {
                     tableNames.add(ent.getPlainTableName());
                 }
-                TreeSet<String> entities = (TreeSet) packages.get(ent.getPackageName());
+                TreeSet<String> entities = entitiesByPackage.get(ent.getPackageName());
                 if (entities == null) {
                     entities = new TreeSet<String>();
-                    packages.put(ent.getPackageName(), entities);
+                    entitiesByPackage.put(ent.getPackageName(), entities);
                     packageNames.add(ent.getPackageName());
                 }
                 entities.add(eName);
@@ -654,7 +656,7 @@
             while (piter.hasNext()) {
                 Map<String, Object> packageMap = FastMap.newInstance();
                 String pName = (String) piter.next();
-                TreeSet entities = (TreeSet) packages.get(pName);
+                TreeSet<String> entities = entitiesByPackage.get(pName);
                 List<Map<String, Object>> entitiesList = FastList.newInstance();
                 Iterator e = entities.iterator();
                 while (e.hasNext()) {
@@ -782,6 +784,82 @@
         
         resultMap.put("packagesList", packagesList);
         return resultMap;
+    }
+    
+    public static Map exportEntityEoModelBundle(DispatchContext dctx, Map context) {
+        String eomodeldFullPath = (String) context.get("eomodeldFullPath");
+        String entityPackageName = (String) context.get("entityPackageName");
+        String entityGroupId = (String) context.get("entityGroupId");
+        String datasourceName = (String) context.get("datasourceName");
+        String entityNamePrefix = (String) context.get("entityNamePrefix");
+
+        ModelReader reader = dctx.getDelegator().getModelReader();
+        
+        try {
+            if (!eomodeldFullPath.endsWith(".eomodeld")) {
+                eomodeldFullPath = eomodeldFullPath + ".eomodeld";
+            }
+            
+            File outdir = new File(eomodeldFullPath);
+            if (!outdir.exists()) {
+                outdir.mkdir();
+            }
+            if (!outdir.isDirectory()) {
+                return ServiceUtil.returnError("eomodel Full Path is not a directory: " + eomodeldFullPath);
+            }
+            if (!outdir.canWrite()) {
+                return ServiceUtil.returnError("eomodel Full Path is not write-able: " + eomodeldFullPath);
+            }
+            
+            Set<String> entityNames = new TreeSet();
+            if (UtilValidate.isNotEmpty(entityPackageName)) {
+                Map<String, TreeSet<String>> entitiesByPackage = reader.getEntitiesByPackage(UtilMisc.toSet(entityPackageName), null);
+                Debug.logInfo("entitiesByPackage = " + entitiesByPackage, module);
+                if (entitiesByPackage.get(entityPackageName) != null) {
+                    entityNames.addAll(entitiesByPackage.get(entityPackageName));
+                }
+            } else if (UtilValidate.isNotEmpty(entityGroupId)) {
+                entityNames.addAll(EntityGroupUtil.getEntityNamesByGroup(entityGroupId, dctx.getDelegator()));
+            } else {
+                entityNames.addAll(reader.getEntityNames());
+            }
+            
+            // write the index.eomodeld file
+            PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(eomodeldFullPath, "index.eomodeld")), "UTF-8")));
+            writer.println("{");
+            writer.println("EOModelVersion = \"2.1\";");
+            writer.println("entities = (");
+            Iterator<String> entityNameIter = entityNames.iterator();
+            while (entityNameIter.hasNext()) {
+                String entityName = entityNameIter.next();
+                writer.print("{ className = EOGenericRecord; name = ");
+                writer.print(entityName);
+                if (entityNameIter.hasNext()) {
+                    writer.println("; },");
+                } else {
+                    writer.println("; }");
+                }
+            }
+            writer.println(");");
+            writer.println("}");
+            writer.close();
+            
+            // write each <EntityName>.plist file
+            for (String curEntityName: entityNames) {
+                ModelEntity modelEntity = reader.getModelEntity(curEntityName);
+                PrintWriter entityWriter = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(eomodeldFullPath, curEntityName +".plist")), "UTF-8")));
+                modelEntity.writeEoModelText(entityWriter, entityNamePrefix, datasourceName);
+                entityWriter.close();
+            }
+        } catch (UnsupportedEncodingException e) {
+            return ServiceUtil.returnError("ERROR saving file: " + e.toString());
+        } catch (FileNotFoundException e) {
+            return ServiceUtil.returnError("ERROR: file/directory not found: " + e.toString());
+        } catch (GenericEntityException e) {
+            return ServiceUtil.returnError("ERROR: getting entity names: " + e.toString());
+        }
+        
+        return ServiceUtil.returnSuccess();
     }
 
     /** Performs an entity maintenance security check. Returns hasPermission=true

Modified: ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml?rev=630279&r1=630278&r2=630279&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml Fri Feb 22 10:17:21 2008
@@ -126,21 +126,35 @@
         <response name="success" type="view" value="sitemap"/>
     </request-map>
 
-    <request-map uri="minervainfo">
-        <security https="true" auth="true"/>
-        <response name="success" type="view" value="minervaobjects"/>        
-    </request-map>
-
+    <!-- Entity Information Requests -->
     <request-map uri="entitymaint">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="entitymaint"/>
     </request-map>
+    <request-map uri="FindGeneric">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="FindGeneric"/>
+    </request-map>
+    <request-map uri="ViewGeneric">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="ViewGeneric"/>
+    </request-map>
+    <request-map uri="UpdateGeneric">
+        <security https="true" auth="true"/>
+        <event type="java" path="org.ofbiz.webtools.GenericWebEvent" invoke="updateGeneric"/>
+        <response name="success" type="view" value="ViewGeneric"/>
+        <response name="error" type="view" value="ViewGeneric"/>
+    </request-map>
+    
+    <request-map uri="ViewRelations">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="ViewRelations"/>
+    </request-map>
 
     <request-map uri="entityref">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="entityref"/>
     </request-map>
-
     <request-map uri="entityrefReport">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="entityrefReport"/>
@@ -156,95 +170,67 @@
         <response name="success" type="view" value="ModelGroupWriter"/>
     </request-map>
 
-    <request-map uri="xmldsdump">
-        <security https="true" auth="true"/>
-        <response name="success" type="view" value="xmldsdump"/>
-    </request-map>
-    <request-map uri="xmldsrawdump">
-        <security https="true" auth="true"/>
-        <response name="success" type="view" value="xmldsrawdump"/>
-    </request-map>
-
-    <request-map uri="FindGeneric">
+    <request-map uri="EntityEoModelBundle">
         <security https="true" auth="true"/>
-        <response name="success" type="view" value="FindGeneric"/>
+        <response name="success" type="view" value="EntityEoModelBundle"/>
     </request-map>
-
-    <request-map uri="ViewGeneric">
+    <request-map uri="exportEntityEoModelBundle">
         <security https="true" auth="true"/>
-        <response name="success" type="view" value="ViewGeneric"/>
+        <event type="service" invoke="exportEntityEoModelBundle"/>
+        <response name="success" type="view" value="EntityEoModelBundle"/>
+        <response name="error" type="view" value="EntityEoModelBundle"/>
     </request-map>
     
-    <request-map uri="UpdateGeneric">
-        <security https="true" auth="true"/>
-        <event type="java" path="org.ofbiz.webtools.GenericWebEvent" invoke="updateGeneric"/>
-        <response name="success" type="view" value="ViewGeneric"/>
-        <response name="error" type="view" value="ViewGeneric"/>
-    </request-map>
-
-    <request-map uri="ViewRelations">
-        <security https="true" auth="true"/>
-        <response name="success" type="view" value="ViewRelations"/>
-    </request-map>
-
+    <!-- UtilCache Maintenance Requests -->
     <request-map uri="FindUtilCache">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="FindUtilCache"/>
     </request-map>
-
     <request-map uri="FindUtilCacheClear">
         <security https="true" auth="true"/>
         <event type="java" path="org.ofbiz.webtools.UtilCacheEvents" invoke="clearEvent"/>
         <response name="success" type="view" value="FindUtilCache"/>
         <response name="error" type="view" value="FindUtilCache"/>
     </request-map>
-
     <request-map uri="FindUtilCacheClearAll">
         <security https="true" auth="true"/>
         <event type="java" path="org.ofbiz.webtools.UtilCacheEvents" invoke="clearAllEvent"/>
         <response name="success" type="view" value="FindUtilCache"/>
         <response name="error" type="view" value="FindUtilCache"/>
     </request-map>
-
     <request-map uri="FindUtilCacheClearAllExpired">
         <security https="true" auth="true"/>
         <event type="java" path="org.ofbiz.webtools.UtilCacheEvents" invoke="clearAllExpiredEvent"/>
         <response name="success" type="view" value="FindUtilCache"/>
         <response name="error" type="view" value="FindUtilCache"/>
     </request-map>
-
     <request-map uri="ForceGarbageCollection">
         <security https="true" auth="true"/>
         <event type="service" invoke="forceGarbageCollection"/>
         <response name="success" type="view" value="FindUtilCache"/>
         <response name="error" type="view" value="FindUtilCache"/>
     </request-map>
-    
     <request-map uri="EditUtilCache">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="EditUtilCache"/>
     </request-map>
-
     <request-map uri="EditUtilCacheUpdate">
         <security https="true" auth="true"/>
         <event type="java" path="org.ofbiz.webtools.UtilCacheEvents" invoke="updateEvent"/>
         <response name="success" type="view" value="EditUtilCache"/>
         <response name="error" type="view" value="EditUtilCache"/>
     </request-map>
-
     <request-map uri="EditUtilCacheClear">
         <security https="true" auth="true"/>
         <event type="java" path="org.ofbiz.webtools.UtilCacheEvents" invoke="clearEvent"/>
         <response name="success" type="view" value="EditUtilCache"/>
         <response name="error" type="view" value="EditUtilCache"/>
     </request-map>
-
     <request-map uri="FindUtilCacheElements">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="FindUtilCacheElements"/>
         <response name="error" type="view" value="FindUtilCacheElements"/>
     </request-map>
-
     <request-map uri="FindUtilCacheElementsRemoveElement">
         <security https="true" auth="true"/>
         <event type="java" path="org.ofbiz.webtools.UtilCacheEvents" invoke="removeElementEvent"/>
@@ -252,11 +238,13 @@
         <response name="error" type="view" value="FindUtilCacheElements"/>
     </request-map>
 
+    <!-- DataFile stuff -->
     <request-map uri="viewdatafile">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="viewdatafile"/>
     </request-map>
 
+    <!-- Old Workflow Engine Requests -->
     <request-map uri="readxpdl">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="readxpdl"/>
@@ -266,6 +254,7 @@
         <response name="success" type="view" value="workflowMonitor"/>
     </request-map>    
 
+    <!-- ControlServlet and other stats requests -->
     <request-map uri="StatsSinceStart">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="StatsSinceStart"/>
@@ -275,6 +264,7 @@
         <response name="success" type="view" value="StatBinsHistory"/>
     </request-map>
 
+    <!-- Loggin Setup -->
     <request-map uri="LogConfiguration">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="LogConfiguration"/>
@@ -299,6 +289,7 @@
         <response name="success" type="view" value="LogView"/>
     </request-map>
 
+    <!-- Service Engine Info and Job Management Requests -->
     <request-map uri="serviceList">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="serviceList"/>
@@ -411,6 +402,7 @@
         <response name="error" type="view" value="EntitySQLProcessor"/>
     </request-map>
 
+    <!-- Entity Export/Import requests -->
     <request-map uri="EntityExportAll"><security https="true" auth="true"/><response name="success" type="view" value="EntityExportAll"/><response name="error" type="view" value="EntityExportAll"/></request-map>
     <request-map uri="entityExportAll">
         <security https="true" auth="true"/>
@@ -418,7 +410,6 @@
         <response name="success" type="view" value="EntityExportAll"/>
         <response name="error" type="view" value="EntityExportAll"/>
     </request-map>
-
     <request-map uri="EntityImportDir"><security https="true" auth="true"/><response name="success" type="view" value="EntityImportDir"/><response name="error" type="view" value="EntityImportDir"/></request-map>
     <request-map uri="entityImportDir">
         <security https="true" auth="true"/>
@@ -426,7 +417,6 @@
         <response name="success" type="view" value="EntityImportDir"/>
         <response name="error" type="view" value="EntityImportDir"/>
     </request-map>
-
     <request-map uri="EntityImport"><security https="true" auth="true"/><response name="success" type="view" value="EntityImport"/><response name="error" type="view" value="EntityImport"/></request-map>
     <request-map uri="entityImport">
         <security https="true" auth="true"/>
@@ -434,7 +424,6 @@
         <response name="success" type="view" value="EntityImport"/>
         <response name="error" type="view" value="EntityImport"/>
     </request-map>
-
     <request-map uri="EntityImportReaders"><security https="true" auth="true"/><response name="success" type="view" value="EntityImportReaders"/><response name="error" type="view" value="EntityImport"/></request-map>
     <request-map uri="entityImportReaders">
         <security https="true" auth="true"/>
@@ -442,7 +431,15 @@
         <response name="success" type="view" value="EntityImportReaders"/>
         <response name="error" type="view" value="EntityImportReaders"/>
     </request-map>
-    
+    <request-map uri="xmldsdump">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="xmldsdump"/>
+    </request-map>
+    <request-map uri="xmldsrawdump">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="xmldsrawdump"/>
+    </request-map>
+        
     <!-- EntitySync requests -->
     <request-map uri="EntitySyncStatus">
         <security https="true" auth="true"/>
@@ -550,7 +547,8 @@
     <view-map name="ModelWriter" page="/entity/ModelWriter.jsp"/>
     <view-map name="ModelGroupWriter" page="/entity/ModelGroupWriter.jsp"/>
     <view-map name="ModelInduceFromDb" page="/entity/ModelInduceFromDb.jsp"/>
-
+    <view-map name="EntityEoModelBundle" type="screen" page="component://webtools/widget/EntityScreens.xml#EntityEoModelBundle"/>
+    
     <view-map name="checkdb" type="screen" page="component://webtools/widget/EntityScreens.xml#CheckDb"/>  
     <view-map name="xmldsdump" type="screen" page="component://webtools/widget/EntityScreens.xml#xmldsdump"/>
     <view-map name="xmldsrawdump" page="/entity/xmldsrawdump.jsp"/>

Modified: ofbiz/trunk/framework/webtools/webapp/webtools/main.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/main.ftl?rev=630279&r1=630278&r2=630279&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/main.ftl (original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/main.ftl Fri Feb 22 10:17:21 2008
@@ -70,13 +70,15 @@
         <#if security.hasPermission("ENTITY_MAINT", session)>
           <li><h3>${uiLabelMap.WebtoolsEntityEngineTools}</h3></li>
           <li><a href="<@ofbizUrl>entitymaint</@ofbizUrl>">${uiLabelMap.WebtoolsEntityDataMaintenance}</a></li>
-          <li><a href="<@ofbizUrl>view/entityref</@ofbizUrl>" target="_blank">${uiLabelMap.WebtoolsEntityReference}</a>&nbsp;<a href="<@ofbizUrl>view/entityref?forstatic=true</@ofbizUrl>" target="_blank">- ${uiLabelMap.WebtoolsEntityReferenceStaticVersion}</a></li>
-          <li><a href="<@ofbizUrl>view/entityrefReport</@ofbizUrl>" target="_blank">${uiLabelMap.WebtoolsEntityReferencePdf}</a></li>
+          <li><a href="<@ofbizUrl>entityref</@ofbizUrl>" target="_blank">${uiLabelMap.WebtoolsEntityReference} - Interactive</a></li>
+          <li><a href="<@ofbizUrl>entityref?forstatic=true</@ofbizUrl>" target="_blank">${uiLabelMap.WebtoolsEntityReference} - ${uiLabelMap.WebtoolsEntityReferenceStaticVersion}</a></li>
+          <li><a href="<@ofbizUrl>entityrefReport</@ofbizUrl>" target="_blank">${uiLabelMap.WebtoolsEntityReferencePdf}</a></li>
           <li><a href="<@ofbizUrl>EntitySQLProcessor</@ofbizUrl>">${uiLabelMap.PageTitleEntitySQLProcessor}</a></li>
           <li><a href="<@ofbizUrl>EntitySyncStatus</@ofbizUrl>">${uiLabelMap.WebtoolsEntitySyncStatus}</a></li>
           <li><a href="<@ofbizUrl>view/ModelInduceFromDb</@ofbizUrl>" target="_blank">${uiLabelMap.WebtoolsInduceModelXMLFromDatabase}</a></li>
+          <li><a href="<@ofbizUrl>EntityEoModelBundle</@ofbizUrl>">${uiLabelMap.WebtoolsExportEntityEoModelBundle}</a></li>
           <li><a href="<@ofbizUrl>view/checkdb</@ofbizUrl>">${uiLabelMap.WebtoolsCheckUpdateDatabase}</a></li>
-          <li><a href="<@ofbizUrl>minervainfo</@ofbizUrl>">Minerva Connection Info</a></li>
+          <#-- not using Minerva by default any more <li><a href="<@ofbizUrl>minervainfo</@ofbizUrl>">Minerva Connection Info</a></li> -->
           <#-- want to leave these out because they are only working so-so, and cause people more problems that they solve, IMHO
             <li><a href="<@ofbizUrl>view/EditEntity</@ofbizUrl>"  target="_blank">Edit Entity Definitions</a></li>
             <li><a href="<@ofbizUrl>ModelWriter</@ofbizUrl>" target="_blank">Generate Entity Model XML (all in one)</a></li>

Added: ofbiz/trunk/framework/webtools/widget/EntityForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/widget/EntityForms.xml?rev=630279&view=auto
==============================================================================
--- ofbiz/trunk/framework/webtools/widget/EntityForms.xml (added)
+++ ofbiz/trunk/framework/webtools/widget/EntityForms.xml Fri Feb 22 10:17:21 2008
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+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.
+-->
+
+<forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">
+
+    <form name="EntityEoModelBundle" type="single" target="exportEntityEoModelBundle" title="">
+        <auto-fields-service service-name="exportEntityEoModelBundle"/>
+        <field name="entityGroupId">
+            <drop-down allow-empty="true">
+                <entity-options entity-name="EntityGroup" description="${entityGroupName}">
+                    <entity-order-by field-name="entityGroupName"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="submitButton" title="${uiLabelMap.CommonSubmit}"><submit button-type="button"/></field>
+    </form>
+</forms>

Propchange: ofbiz/trunk/framework/webtools/widget/EntityForms.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/webtools/widget/EntityForms.xml
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/webtools/widget/EntityForms.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: ofbiz/trunk/framework/webtools/widget/EntityScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/widget/EntityScreens.xml?rev=630279&r1=630278&r2=630279&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/widget/EntityScreens.xml (original)
+++ ofbiz/trunk/framework/webtools/widget/EntityScreens.xml Fri Feb 22 10:17:21 2008
@@ -346,6 +346,23 @@
             </widgets>
         </section>
     </screen>
+
+    <screen name="EntityEoModelBundle">
+        <section>
+            <actions>
+                <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
+                <property-map resource="WebtoolsUiLabels" map-name="uiLabelMap" global="true"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <include-form name="EntityEoModelBundle" location="component://webtools/widget/EntityForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    
     <screen name="CheckDb">
         <section>
             <condition>