Index: ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorServicesXml.java
diff -u ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorServicesXml.java:1.4 ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorServicesXml.java:1.5
--- ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorServicesXml.java:1.4 Fri Jun 25 19:55:10 2004
+++ ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorServicesXml.java Sat Jun 26 17:18:33 2004
@@ -49,7 +49,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*@author Olivier.Heintz@nereide.biz
- *@version $Revision: 1.4 $
+ *@version $Revision: 1.5 $
*@since 3.1
*
* This file has been generated, and will be re-generated,
@@ -75,13 +75,13 @@
if (Util.hasGuiEdit(clazz) || Util.isEditViaAssoc(model, clazz) ){
/*{
+ location="org.ofbiz.<%=packageName%>.<%=subpackageName%>.generated.<%=entityName%>Services" invoke="edit<%=entityName%>" auth="true">
Create or Update a <%=entityName%>
+ location="org.ofbiz.<%=packageName%>.<%=subpackageName%>.generated.<%=entityName%>Services" invoke="remove<%=entityName%>" auth="true">
Remove a <%=entityName%>
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.21 ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/Util.java:1.22
--- ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/Util.java:1.21 Wed Jun 23 12:31:02 2004
+++ ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/Util.java Sat Jun 26 17:18:33 2004
@@ -28,9 +28,9 @@
* Copyright Code Lutin
* Copyright Nereide
* Copyright Neogia
-* @version $Revision: 1.21 $
+* @version $Revision: 1.22 $
*
-* Last update : $Date: 2004/06/23 12:31:02 $
+* Last update : $Date: 2004/06/26 17:18:33 $
* by : $Author: holivier $
*/
package org.nereide.ofbiz.neogia.generators;
@@ -55,7 +55,7 @@
/**
*
*/
-public class Util extends org.codelutin.topia.Util {
+public class Util extends org.codelutin.topia.generators.Util {
static private final String tagSeparator = ", ";
@@ -217,7 +217,7 @@
primaryKeys.addAll(Util.getPrimaryKeyAttributes(superClass));
}
}
- primaryKeys.addAll(org.codelutin.topia.Util.getPrimaryKeyAttributes(clazz));
+ primaryKeys.addAll(org.codelutin.topia.generators.Util.getPrimaryKeyAttributes(clazz));
return primaryKeys;
}
@@ -302,7 +302,7 @@
}
//System.out.println("XXXXXXX-getMapPrimaryKeyAttr3-Debug associationClass class="+clazz.getName()+" listPrimaryKeys="+listPrimaryKeyName);
}
- for (Iterator iter=org.codelutin.topia.Util.getPrimaryKeyAttributes(clazz).iterator(); iter.hasNext(); ){
+ for (Iterator iter=org.codelutin.topia.generators.Util.getPrimaryKeyAttributes(clazz).iterator(); iter.hasNext(); ){
ObjectModelAttribute attribute = (ObjectModelAttribute) iter.next();
listPrimaryKeyName.add(attribute.getName());
if (entity) listPrimaryKeyType.add(Util.getOfbizType(attribute) );
Index: ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorLookupJava.java
diff -u ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorLookupJava.java:1.7 ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorLookupJava.java:1.8
--- ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorLookupJava.java:1.7 Fri Jun 25 19:55:10 2004
+++ ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorLookupJava.java Sat Jun 26 17:18:33 2004
@@ -11,12 +11,20 @@
public class GeneratorLookupJava extends ObjectModelGenerator {
- final private String packageParam = "org.neogia.manufacturing";
- final private String packageName = "manufacturing";
- // il faudrait le lancer par subpackage, et alors changer la methode getFilenameForxxxx
+ private String packageParam = null;
+ private String packageName = null;
public String getFilenameForModel(ObjectModel model){
- return "src/org/ofbiz/"+packageName+"/generated/lookupParams.java";
+ // il faudrait le lancer par subpackage, et alors changer la methode getFilenameForxxxx
+ if (packageName == null) {
+ String[] packageParams = new String[2];
+ if (! Util.initPackageParam(packageParams)) packageName="error";
+ else{
+ packageParam = packageParams[0];
+ packageName = packageParams[1];
+ }
+ }
+ return packageName + "/src/org/ofbiz/"+packageName+"/generated/lookupParams.java";
}
public void generateFromModel(Writer output, ObjectModel model) throws IOException {
@@ -42,7 +50,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// @author malin.nicolas@nereide.biz
-// @version $Revision: 1.7 $
+// @version $Revision: 1.8 $
// @since 3.1
//
// This file has been generated, and will be re-generated,
@@ -54,6 +62,14 @@
public static final String module = lookupParams.class.getName();
}*/
+ if (packageParam == null){
+ String[] packageParams = new String[2];
+ if (! Util.initPackageParam(packageParams)) return;
+ else{
+ packageParam = packageParams[0];
+ packageName = packageParams[1];
+ }
+ }
ObjectModelClass clazz;
String entityName, packageName, subpackageName;
for( Iterator iterClazz = model.getClasses().iterator(); iterClazz.hasNext(); ){
@@ -84,7 +100,7 @@
} else paramLookup.clear();
paramLookup.put("lookupName","Lookup<%=entityName%>");
paramLookup.put("titleProperty","PageTitleLookup<%=entityName%>");
- paramLookup.put("formDefFile","/<%=packageName%>/<%=subpackageName%>/<%=entityName%>Forms.xml");
+ paramLookup.put("formDefFile","/<%=packageName%>/<%=subpackageName%>/generated/<%=entityName%>Forms.xml");
paramLookup.put("singleFormName","lookup<%=entityName%>");
paramLookup.put("listFormName","listLookup<%=entityName%>");
paramLookup.put("entityName","<%=entityName%>");
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.3 ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/ListPkAttribute.java:1.4
--- ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/ListPkAttribute.java:1.3 Wed Jun 23 12:31:02 2004
+++ ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/ListPkAttribute.java Sat Jun 26 17:18:33 2004
@@ -39,9 +39,9 @@
* @param clazz
* @param boolean to say if the ofbizType is an entity OfbizType (true) or java OfbizType (false)
* @param _classAssoc to be able to test for not retreiving primaryKey when they coming from _classAssoc.
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*
- * Last update : $Date: 2004/06/23 12:31:02 $
+ * Last update : $Date: 2004/06/26 17:18:33 $
* by : $Author: holivier $
*/
public class ListPkAttribute {
@@ -122,7 +122,7 @@
}
//System.out.println("XXXXXXX-getMapPrimaryKeyAttr3-Debug associationClass class="+clazz.getName()+" listPrimaryKeys="+this.name);
}
- for (Iterator iter=org.codelutin.topia.Util.getPrimaryKeyAttributes(clazz).iterator(); iter.hasNext(); ){
+ for (Iterator iter=org.codelutin.topia.generators.Util.getPrimaryKeyAttributes(clazz).iterator(); iter.hasNext(); ){
ObjectModelAttribute attribute = (ObjectModelAttribute) iter.next();
this.name.add(attribute.getName());
if (entity) this.type.add(Util.getOfbizType(attribute) );
Index: ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEntitygroupXml.java
diff -u ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEntitygroupXml.java:1.4 ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEntitygroupXml.java:1.5
--- ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEntitygroupXml.java:1.4 Thu Jun 10 08:47:55 2004
+++ ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEntitygroupXml.java Sat Jun 26 17:18:33 2004
@@ -29,8 +29,7 @@
public void generateFromModel(Writer output, ObjectModel model) throws IOException {
- /*{
-
+/*{
@@ -476,7 +448,6 @@
=================================
*/
/*{
-
+/*{
}*/
}
@@ -505,7 +474,6 @@
if( Util.hasGuiShowList( clazz ) ){
/*{
-
+/*{
}*/
}
@@ -541,7 +506,6 @@
if (Util.hasGuiList( clazz ) || Util.hasGuiListAll( clazz ) ){
//System.out.println( "Beginning ListEdit " );
/*{
-
+/*{
}*/
}
Index: ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEditAssocBsh.java
diff -u ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEditAssocBsh.java:1.3 ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEditAssocBsh.java:1.4
--- ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEditAssocBsh.java:1.3 Fri Jun 25 19:55:10 2004
+++ ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEditAssocBsh.java Sat Jun 26 17:18:33 2004
@@ -62,7 +62,7 @@
/*{
-// $Id: GeneratorEditAssocBsh.java,v 1.3 2004/06/25 19:55:10 holivier Exp $
+// $Id: GeneratorEditAssocBsh.java,v 1.4 2004/06/26 17:18:33 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
@@ -82,7 +82,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
//
// Calls Find on a dynamiqueView to return an EntityListIterator of the
@@ -121,15 +121,13 @@
if (associationList.size() > 1){
for (Iterator iter=associationList.iterator(); iter.hasNext(); ){
ObjectModelAttribute association = (ObjectModelAttribute) iter.next();
-/*{
-if (association.equals("<%=association.getName()%>") ) {
+/*{if (association.equals("<%=association.getName()%>") ) {
page.setProperty("tabButtonItem", page.getProperty("tabButtonItem<%=Util.toUpperCaseFirstLetter(association.getName())%>") );
}
}*/
}
}
-/*{
-context.put("association",association);
+/*{context.put("association",association);
}*/
ListPkAttribute listPrimaryKey = new ListPkAttribute(model, clazz, false);
@@ -143,34 +141,28 @@
primaryKeysEmpty += ") || UtilValidate.isEmpty(";
primaryKeysMap += ",\"";
}
-/*{
-String <%=attributeKeyName%> = request.getParameter("<%=attributeKeyName%>");
+/*{String <%=attributeKeyName%> = request.getParameter("<%=attributeKeyName%>");
}*/
}
primaryKeysEmpty += ")";
-/*{
-if (<%=primaryKeysEmpty%>) {
+/*{if (<%=primaryKeysEmpty%>) {
}*/
for (Iterator iter=associationList.iterator(); iter.hasNext(); ){
ObjectModelAttribute association = (ObjectModelAttribute) iter.next();
-/*{
- if (association.equals("<%=association.getName()%>") ){
+/*{ if (association.equals("<%=association.getName()%>") ){
}*/
String reverseAttributeName = ( association.getReverseAttribute() != null ) ?
Util.getAttributeShortName(association.getReverseAttribute()) :
Util.getClassShortName(clazz);
for(int i=0; i = request.getParameter("<%=reverseAttributeName%><%=Util.toUpperCaseFirstLetter(attributeKeyName)%>");
+/*{ <%=attributeKeyName%> = request.getParameter("<%=reverseAttributeName%><%=Util.toUpperCaseFirstLetter(attributeKeyName)%>");
}*/
}
-/*{
- }
+/*{ }
}*/
}
-/*{
-}
+/*{}
}*/
for (Iterator iter=associationList.iterator(); iter.hasNext(); ){
ObjectModelAttribute association = (ObjectModelAttribute) iter.next();
@@ -185,12 +177,10 @@
assocPkParameters += "&";
}
}
-/*{
-context.put("<%=association.getName()%>PkParameters",<%=assocPkParameters%>);
+/*{context.put("<%=association.getName()%>PkParameters",<%=assocPkParameters%>);
}*/
}
/*{
-
if ( ! ( <%=primaryKeysEmpty%> ) ) {
// TODO : use the <%=entityName%> object and its methods to access the attributes
GenericValue <%=Util.toLowerCaseFirstLetter(entityName)%> = delegator.findByPrimaryKey("<%=entityName%>", UtilMisc.toMap(<%=primaryKeysMap%>));
@@ -205,40 +195,34 @@
}*/
for (int i=0; i = request.getParameter("<%=attributeName%>");
+/*{ <%=attributeName%> = request.getParameter("<%=attributeName%>");
}*/
}
/*{
-
if (<%=Util.toLowerCaseFirstLetter(entityName)%> != null){
}*/
for(int j=0; j", <%=attributeKeyName%>);
+/*{ context.put("<%=attributeKeyName%>", <%=attributeKeyName%>);
formsData.put("<%=attributeKeyName%>",<%=attributeKeyName%>);
}*/
}
-/*{
- // FOR attribue with calculated
+/*{ // FOR attribue with calculated
// formsData.put("%attribue%",<%=Util.toLowerCaseFirstLetter(entityName)%>.get("%attribue%"));
//
}*/
for (int i=0; i != null) formsData.put("<%=attributeName%>",<%=attributeName%>);
+/*{ if (<%=attributeName%> != null) formsData.put("<%=attributeName%>",<%=attributeName%>);
else formsData.put("<%=attributeName%>",<%=Util.toLowerCaseFirstLetter(entityName)%>.get("<%=attributeName%>" ));
}*/
}
for (int i=0; i",<%=Util.toLowerCaseFirstLetter(entityName)%>.get("<%=attributeName%>" ));
+/*{ formsData.put("<%=attributeName%>",<%=Util.toLowerCaseFirstLetter(entityName)%>.get("<%=attributeName%>" ));
}*/
}
for (int i=0; i = <%=Util.toLowerCaseFirstLetter(entityName)%>.getRelatedOne("<%=relationName%>");
+/*{ GenericValue <%=Util.toLowerCaseFirstLetter(relationName )%> = <%=Util.toLowerCaseFirstLetter(entityName)%>.getRelatedOne("<%=relationName%>");
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%>") );
@@ -255,10 +238,8 @@
}*/
}
-/*{
- HtmlFormWrapper singleWrapper = new NsingleHtmlFormWrapper("/<%=subPackageName%>/Forms<%=entityName%>.xml", "show<%=entityName%>", request, response, formsData);
+/*{ HtmlFormWrapper singleWrapper = new NsingleHtmlFormWrapper("/<%=subPackageName%>/generated/Forms<%=entityName%>.xml", "show<%=entityName%>", request, response, formsData);
context.put("singleWrapper", singleWrapper);
-
}*/
for (Iterator iterAssoc=associationList.iterator(); iterAssoc.hasNext(); ){
ObjectModelAttribute association = (ObjectModelAttribute) iterAssoc.next();
@@ -278,7 +259,7 @@
// ==============
// List Preparation
// ==============
- page.setProperty("formDefFile","/<%=subPackageAssoc%>/Forms<%=classAssociated.getName()%>.xml");
+ page.setProperty("formDefFile","/<%=subPackageAssoc%>/generated/Forms<%=classAssociated.getName()%>.xml");
page.setProperty("listFormName","subList<%=classAssociated.getName()%><%=fromEntityName%>");
page.setProperty("entityName","<%=classAssociated.getName()%>");
request.setAttribute("association",association);
@@ -288,12 +269,10 @@
}*/
for(int j=0; j<%=Util.toUpperCaseFirstLetter(attributeKeyName)%>", <%=attributeKeyName%>);
+/*{ inputFields.put("<%=reverseAttributeName%><%=Util.toUpperCaseFirstLetter(attributeKeyName)%>", <%=attributeKeyName%>);
}*/
}
/*{
-
// create the dynamic view entity
DynamicViewEntity dynamicView = new DynamicViewEntity();
@@ -303,8 +282,7 @@
}*/
for(int j=0; j<%=Util.toUpperCaseFirstLetter(attributeKeyName)%>");
+/*{ dynamicView.addAlias("EE", "<%=reverseAttributeName%><%=Util.toUpperCaseFirstLetter(attributeKeyName)%>");
}*/
}
List listAssoc = new ArrayList();
@@ -325,8 +303,7 @@
if ( attribute.getMaxMultiplicity() == 1 ) listAssoc.add(attribute);
} else{
listAttNameAssoc.add(attribute.getName());
-/*{
- dynamicView.addAlias("EE", "<%=attribute.getName()%>");
+/*{ dynamicView.addAlias("EE", "<%=attribute.getName()%>");
}*/
}
}
@@ -339,7 +316,6 @@
ObjectModelClass clazzAssoc = (ObjectModelClass) relationKeyName.get("clazzAssociated");
String relationName = clazzAssoc.getName();
/*{
-
// Associated entities
dynamicView.addMemberEntity("E<%=String.valueOf(nbAssoc)%>", "<%=relationName%>");
dynamicView.addAlias("E<%=String.valueOf(nbAssoc)%>", "<%=Util.toLowerCaseFirstLetter(relationName)%>Name","<%=Util.getAttributeName(clazzAssoc)%>",null,null,null,null);
@@ -358,8 +334,7 @@
String fieldName = (String) relationItem.get("fieldName");
if (listAttributeName.indexOf(fieldName) == -1){ // adding the field in the dynamicView
listAttributeName.add(fieldName);
-/*{
- dynamicView.addAlias("EE", "<%=fieldName%>");
+/*{ dynamicView.addAlias("EE", "<%=fieldName%>");
}*/
}
}
@@ -367,13 +342,11 @@
for (Iterator iterAssocB=clazzAssoc.getAttributes().iterator(); iterAssocB.hasNext(); ){
ObjectModelAttribute attributeAssoc = (ObjectModelAttribute) iterAssocB.next();
if ( Util.hasGuiListInAssoc(attributeAssoc) ){
-/*{
- dynamicView.addAlias("E<%=String.valueOf(nbAssoc)%>", "<%=Util.toLowerCaseFirstLetter(relationName)%><%=Util.toUpperCaseFirstLetter(attributeAssoc.getName())%>","<%=attributeAssoc.getName()%>",null,null,null,null);
+/*{ dynamicView.addAlias("E<%=String.valueOf(nbAssoc)%>", "<%=Util.toLowerCaseFirstLetter(relationName)%><%=Util.toUpperCaseFirstLetter(attributeAssoc.getName())%>","<%=attributeAssoc.getName()%>",null,null,null,null);
}*/
}
}
-/*{
- dynamicView.addViewLink("EE", "E<%=String.valueOf(nbAssoc)%>", Boolean.TRUE, ModelKeyMap.makeKeyMapList( }*/
+/*{ dynamicView.addViewLink("EE", "E<%=String.valueOf(nbAssoc)%>", Boolean.TRUE, ModelKeyMap.makeKeyMapList( }*/
boolean first = true;
for(Iterator iterList=listName.iterator(); iterList.hasNext(); ){
Map relationItem = (Map) iterList.next();
@@ -388,7 +361,6 @@
nbAssoc += 1;
}
/*{
-
// read and analyse the inputFields
Map queryStringMap = new HashMap();
Map origValueMap = new HashMap();
@@ -399,19 +371,16 @@
}*/
for (Iterator iter=attributesIndexed.iterator(); iter.hasNext(); ){
String attributeName = (String) iter.next();
-/*{
- keys.add("<%=attributeName%>");
+/*{ keys.add("<%=attributeName%>");
}*/
}
for(int j=0; j<%=Util.toUpperCaseFirstLetter(attributeKeyName)%>");
+/*{ keys.add("<%=reverseAttributeName%><%=Util.toUpperCaseFirstLetter(attributeKeyName)%>");
}*/
}
//
-/*{
- ArrayList tmpList = FindServices.createCondition(keys, normalizedFields, queryStringMap, origValueMap);
+/*{ ArrayList tmpList = FindServices.createCondition(keys, normalizedFields, queryStringMap, origValueMap);
//create the entity condition
EntityOperator entOp = EntityOperator.AND;
@@ -473,8 +442,7 @@
String primaryKeysMapB = "\"";
for(int j=0; j = request.getParameter("<%=attributeKeyName%>");
+/*{ String <%=attributeKeyName%> = request.getParameter("<%=attributeKeyName%>");
context.put("<%=attributeKeyName%>", <%=attributeKeyName%>);
<%=association.getName()%>FD.put("<%=attributeKeyName%>",<%=attributeKeyName%>);
@@ -487,8 +455,7 @@
}
}
primaryKeysEmptyB += ")";
-/*{
- if (<%=primaryKeysEmptyB%>) {
+/*{ if (<%=primaryKeysEmptyB%>) {
GenericValue <%=Util.toLowerCaseFirstLetter(classAssociated.getName())%> = delegator.findByPrimaryKey("<%=classAssociated.getName()%>", UtilMisc.toMap(<%=primaryKeysMapB%>));
String }*/
@@ -501,12 +468,10 @@
}*/
for (int i=0; i = request.getParameter("<%=attributeName%>");
+/*{ <%=attributeName%> = request.getParameter("<%=attributeName%>");
}*/
}
/*{
-
if (<%=Util.toLowerCaseFirstLetter(classAssociated.getName())%> != null){
if (actionForm.equals("add") ) actionForm = "edit";
// FOR attribue with calculated
@@ -516,16 +481,14 @@
}*/
for (int i=0; i != null) <%=association.getName()%>FD.put("<%=attributeName%>",<%=attributeName%>);
+/*{ if (<%=attributeName%> != null) <%=association.getName()%>FD.put("<%=attributeName%>",<%=attributeName%>);
else <%=association.getName()%>FD.put("<%=attributeName%>",<%=Util.toLowerCaseFirstLetter(classAssociated.getName())%>.get("<%=attributeName%>" ));
}*/
}
for (int i=0; iFD.put("<%=attributeName%>",<%=Util.toLowerCaseFirstLetter(classAssociated.getName())%>.get("<%=attributeName%>" ));
+/*{ <%=association.getName()%>FD.put("<%=attributeName%>",<%=Util.toLowerCaseFirstLetter(classAssociated.getName())%>.get("<%=attributeName%>" ));
}*/
}
for (int i=0; i = <%=Util.toLowerCaseFirstLetter(classAssociated.getName())%>.getRelatedOne("<%=relationName%>");
+/*{ GenericValue <%=Util.toLowerCaseFirstLetter(relationName )%> = <%=Util.toLowerCaseFirstLetter(classAssociated.getName())%>.getRelatedOne("<%=relationName%>");
if (<%=Util.toLowerCaseFirstLetter(relationName )%> != null){
<%=association.getName()%>FD.put("<%=Util.toLowerCaseFirstLetter(relationName )%>Description", <%=Util.toLowerCaseFirstLetter(relationName )%>.get("<%=descriptionFieldName%>") );
<%=association.getName()%>FD.put("<%=Util.toLowerCaseFirstLetter(relationName )%>Name", <%=Util.toLowerCaseFirstLetter(relationName )%>.get("<%=idNameFieldName%>") );
@@ -542,11 +504,10 @@
}*/
}
-/*{
- }
+/*{ }
}
request.setAttribute("actionForm",actionForm);
- HtmlFormWrapper <%=association.getName()%>Wrapper = new NsingleHtmlFormWrapper("/<%=subPackageAssoc%>/Forms<%=classAssociated.getName()%>.xml", "subEdit<%=classAssociated.getName()%><%=fromEntityName%>", request, response, <%=association.getName()%>FD);
+ HtmlFormWrapper <%=association.getName()%>Wrapper = new NsingleHtmlFormWrapper("/<%=subPackageAssoc%>/generated/Forms<%=classAssociated.getName()%>.xml", "subEdit<%=classAssociated.getName()%><%=fromEntityName%>", request, response, <%=association.getName()%>FD);
<%=association.getName()%>Wrapper.putInContext("association",association);
context.put("<%=association.getName()%>Wrapper", <%=association.getName()%>Wrapper);
}
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.12 ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorControlerXml.java:1.13
--- ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorControlerXml.java:1.12 Fri Jun 25 19:55:10 2004
+++ ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorControlerXml.java Sat Jun 26 17:18:33 2004
@@ -51,7 +51,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*@author Olivier.Heintz@nereide.biz
- *@version $Revision: 1.12 $
+ *@version $Revision: 1.13 $
*@since 3.1
*
* This file has been generated, and will be re-generated,
@@ -165,28 +165,24 @@
}*/
for( Iterator iterClazz = model.getClasses().iterator(); iterClazz.hasNext(); ){
clazz = (ObjectModelClass) iterClazz.next();
- if(Util.isEntity(clazz)){
+ if(Util.isEntity(clazz) && clazz.getPackageName().startsWith(packageParam) ){
entityName = clazz.getName();
subpackageName = Util.getLastWord(Util.getParentPackageName(clazz.getPackageName()));
if (Util.hasGuiList(clazz) || Util.hasGuiListAll(clazz)){
-/*{
-
+/*{
}*/
}
if (Util.hasGuiEdit(clazz)){
-/*{
-
+/*{
}*/
}
if (Util.hasGuiEditAssoc(clazz)){
-/*{
-
+/*{
}*/
}
if (Util.hasGuiShow(clazz)){
-/*{
-
+/*{
}*/
}
}
Index: ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEntitymodelXml.java
diff -u ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEntitymodelXml.java:1.8 ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEntitymodelXml.java:1.9
--- ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEntitymodelXml.java:1.8 Thu Jun 10 08:47:55 2004
+++ ofbiz-neogia-generators/src/java/org/nereide/ofbiz/neogia/generators/GeneratorEntitymodelXml.java Sat Jun 26 17:18:33 2004
@@ -32,8 +32,7 @@
public void generateFromModel(Writer output, ObjectModel model) throws IOException {
ObjectModelClass clazz;
- /*{
-
+/*{
+
+}*/
+ if (packageParam == null){
+ String[] packageParams = new String[2];
+ if (! Util.initPackageParam(packageParams)) return;
+ else{
+ packageParam = packageParams[0];
+ packageName = packageParams[1];
+ }
+ }
+ System.out.println("Package Name Param is =" + packageName);
+ ObjectModelClass clazz;
+ String entityName, subpackageName;
+ for( Iterator iterClazz = model.getClasses().iterator(); iterClazz.hasNext(); ){
+ clazz = (ObjectModelClass) iterClazz.next();
+ System.out.println("Class Name is =" + clazz.getName() );
+ if(Util.isEntity(clazz) ){
+ entityName = clazz.getName();
+ subpackageName = Util.getLastWord(Util.getParentPackageName(clazz.getPackageName()));
+ if (clazz.getPackageName().startsWith(packageParam) )
+ System.out.println(" Class is in the package subpackageName =" + subpackageName );
+ else
+ System.out.println(" subpackageName =" + subpackageName );
+ for (Iterator iterAtt=clazz.getAttributes().iterator(); iterAtt.hasNext(); ) {
+ ObjectModelAttribute attribute = (ObjectModelAttribute) iterAtt.next();
+ System.out.println(" Attribute Name =" + attribute.getName() );
+ if (attribute.referenceClassifier() ){
+ if (attribute.hasAssociationClass() ){
+ System.out.println(" Attribute.getClassifier =" + attribute.getClassifier().getName() + " and an association Class =" + attribute.getAssociationClass().getName() );
+ } else
+ System.out.println(" Attribute.getClassifier =" + attribute.getClassifier().getName() );
+ } else {
+ String testSt = Util.getOfbizType(attribute);
+ }
+ }
+ }
+ }
+ }
+}
+
+