Index: ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEditBsh.java diff -u ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEditBsh.java:1.3 ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEditBsh.java:1.4 --- ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEditBsh.java:1.3 Tue Jun 8 07:01:32 2004 +++ ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEditBsh.java Wed Jun 16 11:48:40 2004 @@ -28,7 +28,7 @@ System.out.println("XXXXXXXX1Debug clazz.getName="+clazz.getName()); /*{ -// $Id: GeneratorEditBsh.java,v 1.3 2004/06/08 07:01:32 holivier Exp $ +// $Id: GeneratorEditBsh.java,v 1.4 2004/06/16 11:48:40 holivier Exp $ // Copyright (c) 2004 Olivier Heintz - olivier.heintz@nereide.biz // Copyright (c) 2004 Nereide - www.nereide.biz // Copyright (c) 2004 Neogia - www.neogia.org @@ -48,7 +48,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 // // @@ -71,6 +71,7 @@ context.put("actionForm",actionForm); }*/ + // same code are in the GeneratorEditAssocBsh List listAttributeName = new ArrayList(); // list of all attribute which must be declare or read List listAttCalculated = new ArrayList(); // list of read only attribute List listAttAssoc = new ArrayList(); // list of the association with MaxMultiplicity() == 1 @@ -97,19 +98,20 @@ } } } + // end of same code + // initialisation of the primaryList - List listPrimaryKeyName = new ArrayList(), listPrimaryKeyType = new ArrayList(); - Util.getListPrimaryKeyAttr(model, clazz, listPrimaryKeyName, listPrimaryKeyType); + ListPkAttribute listPrimaryKey = new ListPkAttribute(model, clazz, false); String primaryKeysEmpty = "! UtilValidate.isEmpty("; String primaryKeysMap = "\""; - for(int j=0; j = request.getParameter("<%=attributeKeyName%>"); }*/ primaryKeysEmpty = primaryKeysEmpty + attributeKeyName; primaryKeysMap = primaryKeysMap + attributeKeyName + "\"," + attributeKeyName; - if (j < listPrimaryKeyName.size()-1){ + if (j < listPrimaryKey.getName().size()-1){ primaryKeysEmpty = primaryKeysEmpty + ") && ! UtilValidate.isEmpty("; primaryKeysMap = primaryKeysMap + ",\""; } @@ -138,8 +140,8 @@ if (<%=Util.toLowerCaseFirstLetter(entityName)%> != null){ if (actionForm.equals("add") ) actionForm = "edit"; }*/ - for(int j=0; j", <%=attributeKeyName%>); formsData.put("<%=attributeKeyName%>",<%=attributeKeyName%>); @@ -148,7 +150,7 @@ } /*{ // FOR attribue with calculated - // formsData.put("%attribue%",<%=entityName%>.get("%attribue%")); + // formsData.put("%attribue%",<%=Util.toLowerCaseFirstLetter(entityName)%>.get("%attribue%")); // }*/ @@ -156,7 +158,7 @@ String attributeName = (String) listAttributeName.get(i); /*{ if (<%=attributeName%> != null) formsData.put("<%=attributeName%>",<%=attributeName%>); - else formsData.put("<%=attributeName%>",<%=entityName%>.get("<%=attributeName%>" )); + else formsData.put("<%=attributeName%>",<%=Util.toLowerCaseFirstLetter(entityName)%>.get("<%=attributeName%>" )); }*/ } @@ -169,10 +171,14 @@ for (int i=0; i = <%=Util.toLowerCaseFirstLetter(entityName)%>.getRelatedOne("<%=relationName%>"); - formsData.put("<%=Util.toLowerCaseFirstLetter(relationName )%><%=Util.toUpperCaseFirstLetter(descriptionFieldName )%>", <%=Util.toLowerCaseFirstLetter(relationName )%>.get("<%=descriptionFieldName%>") ); + if (<%=Util.toLowerCaseFirstLetter(relationName )%> != null){ + formsData.put("<%=Util.toLowerCaseFirstLetter(relationName )%>Description", <%=Util.toLowerCaseFirstLetter(relationName )%>.get("<%=descriptionFieldName%>") ); + formsData.put("<%=Util.toLowerCaseFirstLetter(relationName )%>Name", <%=Util.toLowerCaseFirstLetter(relationName )%>.get("<%=idNameFieldName%>") ); + } }*/ }