Author: doogie
Date: Sun Jun 26 18:10:40 2011 New Revision: 1139880 URL: http://svn.apache.org/viewvc?rev=1139880&view=rev Log: FIX: Fix NPE when converting a view to xml that was originally created as a dynamic-view. Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/FindInventoryItemsByLabels.groovy ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/DynamicViewEntity.java ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/EntityPlanner.java ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/expression/BaseEntityCondExprBldr.java Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java?rev=1139880&r1=1139879&r2=1139880&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java Sun Jun 26 18:10:40 2011 @@ -101,7 +101,7 @@ public class OrderLookupServices { // dynamic view entity DynamicViewEntity dve = new DynamicViewEntity(); dve.addMemberEntity("OH", "OrderHeader"); - dve.addAliasAll("OH", ""); // no prefix + dve.addAliasAll("OH", "", null); // no prefix dve.addRelation("one-nofk", "", "OrderType", UtilMisc.toList(new ModelKeyMap("orderTypeId", "orderTypeId"))); dve.addRelation("one-nofk", "", "StatusItem", UtilMisc.toList(new ModelKeyMap("statusId", "statusId"))); Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/FindInventoryItemsByLabels.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/FindInventoryItemsByLabels.groovy?rev=1139880&r1=1139879&r2=1139880&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/FindInventoryItemsByLabels.groovy (original) +++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/FindInventoryItemsByLabels.groovy Sun Jun 26 18:10:40 2011 @@ -37,7 +37,7 @@ try { inventoryItemAndLabelsView = new DynamicViewEntity(); inventoryItemAndLabelsView.addMemberEntity("II", "InventoryItem"); -inventoryItemAndLabelsView.addAliasAll("II", null); +inventoryItemAndLabelsView.addAliasAll("II", null, null); for (int i = 1; i <= numberOfFields; i++) { inventoryItemLabelId = parameters.get("inventoryItemLabelId_" + i); if (inventoryItemLabelId) { Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy?rev=1139880&r1=1139879&r2=1139880&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy (original) +++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy Sun Jun 26 18:10:40 2011 @@ -63,7 +63,7 @@ if (action) { } prodView.addMemberEntity("PRFA", "ProductFacility"); - prodView.addAliasAll("PRFA", null); + prodView.addAliasAll("PRFA", null, null); prodView.addMemberEntity("PROD", "Product"); prodView.addViewLink("PROD", "PRFA", Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId")); Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/DynamicViewEntity.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/DynamicViewEntity.java?rev=1139880&r1=1139879&r2=1139880&view=diff ============================================================================== --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/DynamicViewEntity.java (original) +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/DynamicViewEntity.java Sun Jun 26 18:10:40 2011 @@ -20,6 +20,7 @@ package org.ofbiz.entity.model; import java.io.IOException; import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -228,8 +229,16 @@ public class DynamicViewEntity { return this.memberModelMemberEntities.entrySet().iterator(); } + /** + * @deprecated use {@link #addAliasAll(String, String, Collection<String>)} + */ + @Deprecated public void addAliasAll(String entityAlias, String prefix) { - ModelAliasAll aliasAll = new ModelAliasAll(entityAlias, prefix, false, null, null); + addAliasAll(entityAlias, prefix, null); + } + + public void addAliasAll(String entityAlias, String prefix, Collection<String> excludes) { + ModelAliasAll aliasAll = new ModelAliasAll(entityAlias, prefix, false, null, excludes); this.aliasAlls.add(aliasAll); } Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/EntityPlanner.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/EntityPlanner.java?rev=1139880&r1=1139879&r2=1139880&view=diff ============================================================================== --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/EntityPlanner.java (original) +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/EntityPlanner.java Sun Jun 26 18:10:40 2011 @@ -82,7 +82,8 @@ public class EntityPlanner extends Plann addMember(dve, table.getTableName()); addJoined(dve, table.getTableName().getAlias(), table.getJoined()); for (FieldAll fieldAll: selectGroup.getFieldAlls()) { - dve.addAliasAll(fieldAll.getAlias(), null); + // FIXME: handle excludes + dve.addAliasAll(fieldAll.getAlias(), null, null); } for (Relation relation: selectStatement.getRelations().values()) { dve.addRelation(relation.getType(), relation.getTitle(), relation.getEntityName(), buildKeyMaps(relation)); Modified: ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/expression/BaseEntityCondExprBldr.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/expression/BaseEntityCondExprBldr.java?rev=1139880&r1=1139879&r2=1139880&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/expression/BaseEntityCondExprBldr.java (original) +++ ofbiz/trunk/specialpurpose/shark/src/org/ofbiz/shark/expression/BaseEntityCondExprBldr.java Sun Jun 26 18:10:40 2011 @@ -164,7 +164,7 @@ public abstract class BaseEntityCondExpr Iterator aai = autoFields.iterator(); while (aai.hasNext()) { String alias = (String) aai.next(); - view.addAliasAll(alias, ""); + view.addAliasAll(alias, "", null); } // create the other field aliases |
Free forum by Nabble | Edit this page |