Index: ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorPagedefsEditAssocXml.java diff -u ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorPagedefsEditAssocXml.java:1.1 ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorPagedefsEditAssocXml.java:1.2 --- ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorPagedefsEditAssocXml.java:1.1 Sun Jun 13 22:56:56 2004 +++ ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorPagedefsEditAssocXml.java Mon Jun 14 22:14:09 2004 @@ -7,6 +7,7 @@ import java.util.Map; import org.codelutin.generator.ObjectModelGenerator; +import org.codelutin.generator.models.object.ObjectModelAttribute; import org.codelutin.generator.models.object.ObjectModelClass; public class GeneratorPagedefsEditAssocXml extends ObjectModelGenerator { @@ -36,15 +37,15 @@ /<%=subpackageName%>/TabBarSubMenu.ftl }*/ if (associationList.size() == 1){ - String associationName = (String) associationList.get(0); + String associationName = ((ObjectModelAttribute) associationList.get(0) ).getName(); /*{ <%=associationName%> }*/ } else { for (Iterator iter=associationList.iterator(); iter.hasNext(); ){ - String associationName = (String) iter.next(); + String associationName = ((ObjectModelAttribute) iter.next() ).getName(); /*{ - <%=associationName%> + <%=associationName%> }*/ } } Index: ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEditFtl.java diff -u ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEditFtl.java:1.3 ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEditFtl.java:1.4 --- ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEditFtl.java:1.3 Thu Jun 10 08:47:55 2004 +++ ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEditFtl.java Mon Jun 14 22:14:09 2004 @@ -19,7 +19,6 @@ public void generateFromClass(Writer output, ObjectModelClass clazz) throws IOException { if(! Util.isEntity(clazz)) return; - boolean guiListAll = Util.hasGuiListAll(clazz); if (! Util.hasGuiEdit(clazz) ) return; Map nameMap = Util.initPackageName(clazz); String packageName= Util.toUpperCaseFirstLetter((String) nameMap.get("packageName") ); @@ -52,7 +51,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * @author Olivier.Heintz@nereide.biz - *@version $Revision: 1.3 $ + *@version $Revision: 1.4 $ *@since 3.1 * * This file has been generated, and will be re-generated, Index: ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/Util.java diff -u ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/Util.java:1.18 ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/Util.java:1.19 --- ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/Util.java:1.18 Sun Jun 13 22:56:56 2004 +++ ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/Util.java Mon Jun 14 22:14:09 2004 @@ -28,9 +28,9 @@ * Copyright Code Lutin * Copyright Nereide * Copyright Neogia -* @version $Revision: 1.18 $ +* @version $Revision: 1.19 $ * -* Last update : $Date: 2004/06/13 22:56:56 $ +* Last update : $Date: 2004/06/14 22:14:09 $ * by : $Author: holivier $ */ package org.nereide.ofbiz.neogia.generators; @@ -560,15 +560,15 @@ } /** - * Give the list of all the association's Name with a tag editAsssoc + * Give the list of all the attribute-association with a tag editAsssoc * @param _clazz - * @return a List of String with the attributeName which are an association and have a tagvalue=="gui" and if its value contain the word "editAssoc". + * @return a List of attribute which are an association and have a tagvalue=="gui" and if its value contain the word "editAssoc". */ public static List getAssocList( ObjectModelClass _clazz ){ List associationList = new ArrayList(); for (Iterator iter=_clazz.getAttributes().iterator(); iter.hasNext(); ){ ObjectModelAttribute attribute = (ObjectModelAttribute) iter.next(); - if (attribute.referenceClassifier() && hasGuiEditAssoc(attribute) ) associationList.add(attribute.getName() ); + if (attribute.referenceClassifier() && hasGuiEditAssoc(attribute) ) associationList.add(attribute ); } return associationList; } Index: ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorControlerXml.java diff -u ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorControlerXml.java:1.9 ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorControlerXml.java:1.10 --- ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorControlerXml.java:1.9 Sun Jun 13 22:56:56 2004 +++ ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorControlerXml.java Mon Jun 14 22:14:09 2004 @@ -7,6 +7,7 @@ import org.codelutin.generator.ObjectModelGenerator; import org.codelutin.generator.models.object.ObjectModel; +import org.codelutin.generator.models.object.ObjectModelAttribute; import org.codelutin.generator.models.object.ObjectModelClass; public class GeneratorControlerXml extends ObjectModelGenerator { @@ -50,7 +51,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * *@author Olivier.Heintz@nereide.biz - *@version $Revision: 1.9 $ + *@version $Revision: 1.10 $ *@since 3.1 * * This file has been generated, and will be re-generated, @@ -112,7 +113,7 @@ }*/ for (Iterator iter=associationList.iterator(); iter.hasNext(); ){ - String associationName = (String) iter.next(); + String associationName = ((ObjectModelAttribute) iter.next() ).getName(); /*{ Index: ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/ListPkAttribute.java diff -u ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/ListPkAttribute.java:1.1 ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/ListPkAttribute.java:1.2 --- ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/ListPkAttribute.java:1.1 Sun Jun 6 22:25:40 2004 +++ ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/ListPkAttribute.java Mon Jun 14 22:14:09 2004 @@ -38,32 +38,42 @@ * @param model to be able to search in all class the association no navigable * @param clazz * @param boolean to say if the ofbizType is an entity OfbizType (true) or java OfbizType (false) - * @version $Revision: 1.1 $ + * @param _classAssoc to be able to test for not retreiving primaryKey when they coming from _classAssoc. + * @version $Revision: 1.2 $ * - * Last update : $Date: 2004/06/06 22:25:40 $ + * Last update : $Date: 2004/06/14 22:14:09 $ * by : $Author: holivier $ */ public class ListPkAttribute { protected List name = new ArrayList(), type = new ArrayList(); - public ListPkAttribute(ObjectModel model, ObjectModelClass clazz, boolean entity){ + public ListPkAttribute(ObjectModel model, ObjectModelClass clazz, boolean entity ){ + ObjectModelClass classAssoc = null; + listPkAttribute(model, clazz, entity, classAssoc); + } + public ListPkAttribute(ObjectModel model, ObjectModelClass clazz, boolean entity, ObjectModelClass _classAssoc ){ + listPkAttribute(model, clazz, entity, _classAssoc); + } + private void listPkAttribute(ObjectModel model, ObjectModelClass clazz, boolean entity, ObjectModelClass _classAssoc){ System.out.println("XXXXXXX-getMapPrimaryKeyAttr1-Debug clazz="+clazz.getName()); // search for non navigable association and composite List classAssocWithoutNav = Util.getClassAssocWithoutNav(model, clazz); if (classAssocWithoutNav.size() > 0 ){ for (Iterator iterClass=classAssocWithoutNav.iterator(); iterClass.hasNext(); ){ ObjectModelAttribute attrAssociated = (ObjectModelAttribute) iterClass.next(); - System.out.println("XXXXXX-DebugUtil in iterator classAssocWithoutNav attrAssociated=" + attrAssociated.getName()); + //System.out.println("XXXXXX-DebugUtil in iterator classAssocWithoutNav attrAssociated=" + attrAssociated.getName()); if (attrAssociated.isComposite()){ ObjectModelClass classAssociated = (ObjectModelClass) attrAssociated.getDeclaringElement(); - String relationName = (attrAssociated.getName().equals(Util.toLowerCaseFirstLetter(clazz.getName())) ) ? - Util.getClassShortName(classAssociated) : - Util.toUpperCaseFirstLetter(attrAssociated.getName()); - ListPkAttribute listCompositePrimaryKey = new ListPkAttribute(model, classAssociated, entity); - for(int i=0; i +<#assign uiLabelMap = requestAttributes.uiLabelMap> +${pages.get(page.getProperty("subMenu"))} + +<#if hasCreatePermission> +
[${uiLabelMap.<%=packageName%>New<%=clazz.getName()%>}]
+ <#-- TODO : Add a select field to choose the instance of the entity the user want to edit --> + + +<#if hasPermission> + <#if <%=pkHasContent%>> + + + +}*/ + for (Iterator iter=associationList.iterator(); iter.hasNext(); ){ + ObjectModelAttribute association = (ObjectModelAttribute) iter.next(); + ObjectModelClass classAssociated = (ObjectModelClass) association.getClassifier(); + nameMap = Util.initPackageName(classAssociated); + String packageNameAssoc = Util.toUpperCaseFirstLetter((String) nameMap.get("packageName") ); + + ListPkAttribute listPrimaryKeyAssoc = new ListPkAttribute(model, classAssociated, false, clazz); + String primaryKeysAssoc = ""; + for(int i=0; i"> <#-- <%=Util.toUpperCaseFirstLetter(association.getName())%> sub-screen Update or Add --> + + + +}*/ + } +/*{ + +
<#-- <%=clazz.getName()%> Show sub-screen --> + + +
+ + + + +
${uiLabelMap.<%=packageName%><%=clazz.getName()%>Id} : <%=primaryKeys%>
+ ${singleWrapper.renderFormString()} +
+
  + <#if actionForm?has_content > + + + +
+ + + <#if actionForm=="add"> + + <#elseif actionForm=="edit"> + + <#else> + + + +
${uiLabelMap.<%=packageNameAssoc%><%=Util.toUpperCaseFirstLetter(association.getName())%>Creation}
${uiLabelMap.CommonEdit} ${uiLabelMap.<%=packageNameAssoc%><%=Util.toUpperCaseFirstLetter(association.getName())%>Id} : <%=primaryKeysAssoc%>
${uiLabelMap.CommonShow} ${uiLabelMap.<%=packageNameAssoc%><%=Util.toUpperCaseFirstLetter(association.getName())%>Id} : <%=primaryKeysAssoc%>
+
+ ${<%=association.getName()%>Wrapper.renderFormString()} +
+ +
+
+ +}*/ + for (Iterator iter=associationList.iterator(); iter.hasNext(); ){ + ObjectModelAttribute association = (ObjectModelAttribute) iter.next(); + ObjectModelClass classAssociated = (ObjectModelClass) association.getClassifier(); + nameMap = Util.initPackageName(classAssociated); + String packageNameAssoc = Util.toUpperCaseFirstLetter((String) nameMap.get("packageName") ); + + ListPkAttribute listPrimaryKeyAssoc = new ListPkAttribute(model, classAssociated, false, clazz); + String primaryKeysAssoc = ""; + for(int i=0; i"> <#-- <%=Util.toUpperCaseFirstLetter(association.getName())%> subList, only for one <%=clazz.getName()%> --> + + +
+ + + + + +
${uiLabelMap.<%=packageName%>ListOf<%=clazz.getName()%><%=Util.toUpperCaseFirstLetter(association.getName())%>}
+ ${listWrapper.renderFormString()} +
+ +}*/ + } +/*{ + + <#-- idName?hasContent TODO : Add the <#else> to put a message to be able to select a <%=clazz.getName()%>--> +<#else> +

${uiLabelMap.CommonPermissionError}

+ +}*/ + } +} + +