svn commit: r667448 - /ofbiz/trunk/framework/example/webapp/example/WEB-INF/actions/includes/findExampleFeatures.groovy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r667448 - /ofbiz/trunk/framework/example/webapp/example/WEB-INF/actions/includes/findExampleFeatures.groovy

jleroux@apache.org
Author: jleroux
Date: Fri Jun 13 02:55:27 2008
New Revision: 667448

URL: http://svn.apache.org/viewvc?rev=667448&view=rev
Log:
My 1st bsh->groovy migration, please check. I will change the file name (uppercase className) remotely as I'm working on Windows currently (files names case insensitive)

Modified:
    ofbiz/trunk/framework/example/webapp/example/WEB-INF/actions/includes/findExampleFeatures.groovy

Modified: ofbiz/trunk/framework/example/webapp/example/WEB-INF/actions/includes/findExampleFeatures.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/webapp/example/WEB-INF/actions/includes/findExampleFeatures.groovy?rev=667448&r1=667447&r2=667448&view=diff
==============================================================================
--- ofbiz/trunk/framework/example/webapp/example/WEB-INF/actions/includes/findExampleFeatures.groovy (original)
+++ ofbiz/trunk/framework/example/webapp/example/WEB-INF/actions/includes/findExampleFeatures.groovy Fri Jun 13 02:55:27 2008
@@ -18,30 +18,27 @@
  */
 
 import java.util.TreeSet;
-import javolution.util.FastList;
 import org.ofbiz.entity.condition.EntityCondition;
 import org.ofbiz.entity.condition.EntityConditionList;
 import org.ofbiz.entity.condition.EntityExpr;
 import org.ofbiz.entity.condition.EntityFieldValue;
 import org.ofbiz.entity.condition.EntityFunction;
 import org.ofbiz.entity.condition.EntityOperator;
-import org.ofbiz.base.util.UtilMisc;
-import org.ofbiz.base.util.UtilValidate;
 
-delegator = request.getAttribute("delegator");
 
-andExprs = FastList.newInstance();
-fieldValue = request.getParameter("exampleFeatureId");
-if (UtilValidate.isNotEmpty(fieldValue)) {
+andExprs = [];
+fieldValue = parameters.exampleFeatureId;
+if (fieldValue) {
     andExprs.add(EntityCondition.makeCondition(EntityFunction.UPPER(EntityFieldValue.makeFieldValue("exampleFeatureId")),
             EntityOperator.LIKE, "%" + fieldValue.toUpperCase() + "%"));
 }
 
-List autocompleteOptions = null;
-if (andExprs.size() > 0) {
+autocompleteOptions = [];
+if (andExprs) {
     entityConditionList = EntityCondition.makeCondition(andExprs, EntityOperator.AND);
-    autocompleteOptions = delegator.findList("ExampleFeature", entityConditionList, new TreeSet(UtilMisc.toList("exampleFeatureId", "description")), UtilMisc.toList("-exampleFeatureId"), null, false);
-    //context.put("autocompleteOptions", autocompleteOptions);
+    autocompleteOptions = delegator.findList("ExampleFeature", entityConditionList,
+            new TreeSet(['exampleFeatureId', 'description'], ['-exampleFeatureId'], null, false);
+    //context.autocompleteOptions = autocompleteOptions;
  request.setAttribute("autocompleteOptions", autocompleteOptions);
 }
 return "success";
\ No newline at end of file