You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2012/05/29 06:17:18 UTC
svn commit: r1343509 - in /ofbiz/trunk/framework:
common/src/org/ofbiz/common/geo/ entity/src/org/ofbiz/entity/
entity/src/org/ofbiz/entity/util/
entityext/src/org/ofbiz/entityext/permission/
entityext/src/org/ofbiz/entityext/synchronization/ minilang/...
Author: doogie
Date: Tue May 29 04:17:17 2012
New Revision: 1343509
URL: http://svn.apache.org/viewvc?rev=1343509&view=rev
Log:
DEPRECATION: framework: GenericValue.getRelated/getRelatedCache variants replaced with a single getRelated variant that takes a boolean useCache parameter.
Modified:
ofbiz/trunk/framework/common/src/org/ofbiz/common/geo/GeoWorker.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericValue.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityTypeUtil.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java
ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java
ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java
ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/GetRelated.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/RecurrenceInfo.java
ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/ViewGeneric.groovy
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/ModelWidgetAction.java
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java
Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/geo/GeoWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/geo/GeoWorker.java?rev=1343509&r1=1343508&r2=1343509&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/org/ofbiz/common/geo/GeoWorker.java (original)
+++ ofbiz/trunk/framework/common/src/org/ofbiz/common/geo/GeoWorker.java Tue May 29 04:17:17 2012
@@ -62,7 +62,7 @@ public class GeoWorker {
List<GenericValue> geoList = FastList.newInstance();
List<GenericValue> thisGeoAssoc = null;
try {
- thisGeoAssoc = geo.getRelated("AssocGeoAssoc", UtilMisc.toMap("geoAssocTypeId", "GROUP_MEMBER"), null);
+ thisGeoAssoc = geo.getRelated("AssocGeoAssoc", UtilMisc.toMap("geoAssocTypeId", "GROUP_MEMBER"), null, false);
} catch (GenericEntityException e) {
Debug.logError(e, "Unable to get associated Geo GROUP_MEMBER relationship(s)", module);
}
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericValue.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericValue.java?rev=1343509&r1=1343508&r2=1343509&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericValue.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericValue.java Tue May 29 04:17:17 2012
@@ -274,7 +274,7 @@ public class GenericValue extends Generi
List<GenericValue> col = relatedCache.get(relationName);
if (col == null) {
- col = getRelated(relationName);
+ col = getRelated(relationName, null, null, false);
relatedCache.put(relationName, col);
}
return col;
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityTypeUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityTypeUtil.java?rev=1343509&r1=1343508&r2=1343509&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityTypeUtil.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityTypeUtil.java Tue May 29 04:17:17 2012
@@ -86,7 +86,7 @@ public class EntityTypeUtil {
// first get all childrenTypes ...
List<GenericValue> childrenTypes = null;
try {
- childrenTypes = typeValue.getRelatedCache("Child" + typeValue.getEntityName());
+ childrenTypes = typeValue.getRelated("Child" + typeValue.getEntityName(), null, null, true);
} catch (GenericEntityException e) {
Debug.logWarning(e, module);
return null;
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java?rev=1343509&r1=1343508&r2=1343509&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java Tue May 29 04:17:17 2012
@@ -344,7 +344,7 @@ public class EntityUtil {
List<GenericValue> result = FastList.newInstance();
for (GenericValue value: values) {
- result.addAll(value.getRelated(relationName));
+ result.addAll(value.getRelated(relationName, null, null, false));
}
return result;
}
@@ -354,7 +354,7 @@ public class EntityUtil {
List<GenericValue> result = FastList.newInstance();
for (GenericValue value: values) {
- result.addAll(value.getRelatedCache(relationName));
+ result.addAll(value.getRelated(relationName, null, null, true));
}
return result;
}
Modified: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java?rev=1343509&r1=1343508&r2=1343509&view=diff
==============================================================================
--- ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java (original)
+++ ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java Tue May 29 04:17:17 2012
@@ -778,7 +778,7 @@ public class EntityPermissionChecker {
List<GenericValue> purposes = null;
try {
- purposes = entity.getRelatedCache(entityName + "Purpose");
+ purposes = entity.getRelated(entityName + "Purpose", null, null, true);
} catch (GenericEntityException e) {
Debug.logError(e, "No associated purposes found. ", module);
return purposeIds;
@@ -820,7 +820,7 @@ public class EntityPermissionChecker {
String partyId = (String)userLogin.get("partyId");
List<GenericValue> relatedRoles = null;
- List<GenericValue> tmpRelatedRoles = entity.getRelatedCache(entityName + "Role");
+ List<GenericValue> tmpRelatedRoles = entity.getRelated(entityName + "Role", null, null, true);
relatedRoles = EntityUtil.filterByDate(tmpRelatedRoles);
if (relatedRoles != null) {
for (GenericValue contentRole: relatedRoles) {
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=1343509&r1=1343508&r2=1343509&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 Tue May 29 04:17:17 2012
@@ -847,9 +847,9 @@ public class EntitySyncContext {
/** 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<ModelEntity> makeEntityModelToUseList() throws GenericEntityException {
- List<GenericValue> entitySyncIncludes = entitySync.getRelated("EntitySyncInclude");
+ List<GenericValue> entitySyncIncludes = entitySync.getRelated("EntitySyncInclude", null, null, false);
// 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<GenericValue> entitySyncGroupIncludes = entitySync.getRelated("EntitySyncInclGrpDetailView");
+ List<GenericValue> entitySyncGroupIncludes = entitySync.getRelated("EntitySyncInclGrpDetailView", null, null, false);
entitySyncIncludes.addAll(entitySyncGroupIncludes);
List<ModelEntity> entityModelToUseList = EntityGroupUtil.getModelEntitiesFromRecords(entitySyncIncludes, delegator, true);
Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/GetRelated.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/GetRelated.java?rev=1343509&r1=1343508&r2=1343509&view=diff
==============================================================================
--- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/GetRelated.java (original)
+++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/GetRelated.java Tue May 29 04:17:17 2012
@@ -75,11 +75,7 @@ public class GetRelated extends MethodOp
return true;
}
try {
- if (useCache) {
- listAcsr.put(methodContext, value.getRelatedCache(relationName, constraintMap, orderByNames));
- } else {
- listAcsr.put(methodContext, value.getRelated(relationName, constraintMap, orderByNames));
- }
+ listAcsr.put(methodContext, value.getRelated(relationName, constraintMap, orderByNames, useCache));
} catch (GenericEntityException e) {
String errMsg = "ERROR: Could not complete the " + simpleMethod.getShortDescription() + " process [problem getting related from entity with name " + value.getEntityName() + " for the relation-name: " + relationName + ": " + e.getMessage() + "]";
Debug.logError(e, errMsg, module);
Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/RecurrenceInfo.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/RecurrenceInfo.java?rev=1343509&r1=1343508&r2=1343509&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/RecurrenceInfo.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/calendar/RecurrenceInfo.java Tue May 29 04:17:17 2012
@@ -76,7 +76,7 @@ public class RecurrenceInfo {
// Get the recurrence rules objects
try {
rRulesList = new ArrayList<RecurrenceRule>();
- for (GenericValue value: info.getRelated("RecurrenceRule")) {
+ for (GenericValue value: info.getRelated("RecurrenceRule", null, null, false)) {
rRulesList.add(new RecurrenceRule(value));
}
} catch (GenericEntityException gee) {
@@ -88,7 +88,7 @@ public class RecurrenceInfo {
// Get the exception rules objects
try {
eRulesList = new ArrayList<RecurrenceRule>();
- for (GenericValue value: info.getRelated("ExceptionRecurrenceRule")) {
+ for (GenericValue value: info.getRelated("ExceptionRecurrenceRule", null, null, false)) {
eRulesList.add(new RecurrenceRule(value));
}
} catch (GenericEntityException gee) {
Modified: ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/ViewGeneric.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/ViewGeneric.groovy?rev=1343509&r1=1343508&r2=1343509&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/ViewGeneric.groovy (original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/ViewGeneric.groovy Tue May 29 04:17:17 2012
@@ -325,7 +325,7 @@ for (int relIndex = 0; relIndex < entity
if ("one".equals(relation.getType()) || "one-nofk".equals(relation.getType())) {
if (value != null) {
if (hasAllView || security.hasEntityPermission(relatedEntity.getPlainTableName(), "_VIEW", session)) {
- Iterator tempIter = UtilMisc.toIterator(value.getRelated(relation.getTitle() + relatedEntity.getEntityName()));
+ Iterator tempIter = UtilMisc.toIterator(value.getRelated(relation.getTitle() + relatedEntity.getEntityName(), null, null, false));
GenericValue valueRelated = null;
if (tempIter != null && tempIter.hasNext()) {
valueRelated = (GenericValue) tempIter.next();
Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/ModelWidgetAction.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/ModelWidgetAction.java?rev=1343509&r1=1343508&r2=1343509&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/ModelWidgetAction.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/ModelWidgetAction.java Tue May 29 04:17:17 2012
@@ -658,11 +658,7 @@ public abstract class ModelWidgetAction
constraintMap = mapAcsr.get(context);
}
try {
- if (useCache) {
- listNameAcsr.put(context, value.getRelatedCache(relationName, constraintMap, orderByNames));
- } else {
- listNameAcsr.put(context, value.getRelated(relationName, constraintMap, orderByNames));
- }
+ listNameAcsr.put(context, value.getRelated(relationName, constraintMap, orderByNames, useCache));
} catch (GenericEntityException e) {
String errMsg = "Problem getting related from entity with name " + value.getEntityName() + " for the relation-name: " + relationName + ": " + e.getMessage();
Debug.logError(e, errMsg, module);
Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java?rev=1343509&r1=1343508&r2=1343509&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java Tue May 29 04:17:17 2012
@@ -657,11 +657,7 @@ public abstract class ModelScreenAction
constraintMap = mapAcsr.get(context);
}
try {
- if (useCache) {
- listNameAcsr.put(context, value.getRelatedCache(relationName, constraintMap, orderByNames));
- } else {
- listNameAcsr.put(context, value.getRelated(relationName, constraintMap, orderByNames));
- }
+ listNameAcsr.put(context, value.getRelated(relationName, constraintMap, orderByNames, useCache));
} catch (GenericEntityException e) {
String errMsg = "Problem getting related from entity with name " + value.getEntityName() + " for the relation-name: " + relationName + ": " + e.getMessage();
Debug.logError(e, errMsg, module);