svn commit: r818335 - /ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContentContent.groovy

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

svn commit: r818335 - /ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContentContent.groovy

lektran
Author: lektran
Date: Thu Sep 24 00:56:30 2009
New Revision: 818335

URL: http://svn.apache.org/viewvc?rev=818335&view=rev
Log:
Misc. cleanups

Modified:
    ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContentContent.groovy

Modified: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContentContent.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContentContent.groovy?rev=818335&r1=818334&r2=818335&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContentContent.groovy (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductContentContent.groovy Thu Sep 24 00:56:30 2009
@@ -17,30 +17,29 @@
  * under the License.
  */
 
-
 import org.ofbiz.entity.*;
 import org.ofbiz.entity.util.*;
 import org.ofbiz.base.util.*;
 import java.sql.Timestamp;
 import org.ofbiz.base.util.ObjectType
 
-contentId = request.getParameter("contentId");
-if ("".equals(contentId)) {
+contentId = parameters.contentId;
+if (!contentId) {
     contentId = null;
 }
 
-productContentTypeId = request.getParameter("productContentTypeId");
+productContentTypeId = parameters.productContentTypeId;
 
-fromDate = request.getParameter("fromDate");
-if ("".equals(fromDate)) {
+fromDate = parameters.fromDate;
+if (!fromDate) {
     fromDate = null;
 } else {
     fromDate = ObjectType.simpleTypeConvert(fromDate, "Timestamp", null, null, false)
 }
 
 
-description = request.getParameter("description");
-if ("".equals(description)) {
+description = parameters.description;
+if (!description) {
     description = null;
 }
 
@@ -51,13 +50,13 @@
     productContent.contentId = contentId;
     productContent.productContentTypeId = productContentTypeId;
     productContent.fromDate = fromDate;
-    productContent.thruDate = request.getParameter("thruDate");
-    productContent.purchaseFromDate = request.getParameter("purchaseFromDate");
-    productContent.purchaseThruDate = request.getParameter("purchaseThruDate");
-    productContent.useCountLimit = request.getParameter("useCountLimit");
-    productContent.useTime = request.getParameter("useTime");
-    productContent.useTimeUomId = request.getParameter("useTimeUomId");
-    productContent.useRoleTypeId = request.getParameter("useRoleTypeId");
+    productContent.thruDate = parameters.thruDate;
+    productContent.purchaseFromDate = parameters.purchaseFromDate;
+    productContent.purchaseThruDate = parameters.purchaseThruDate;
+    productContent.useCountLimit = request.parameters.useCountLimit;
+    productContent.useTime = parameters.useTime;
+    productContent.useTimeUomId = parameters.useTimeUomId;
+    productContent.useRoleTypeId = parameters.useRoleTypeId;
 }
 context.productContent = productContent;
 
@@ -70,7 +69,6 @@
     content = delegator.findOne("Content", [contentId : contentId], false);
     context.content = content;
 } else {
-    content = [:];
     if (description) {
         content.description = description;
     }
@@ -90,8 +88,7 @@
         result = dispatcher.runSync("findAssocContent", serviceCtx);
         contentAssocs = result.get("contentAssocs");
         if (contentAssocs) {
-            for (contentAssocIter = contentAssocs.iterator(); contentAssocIter;) {
-                contentAssoc  = contentAssocIter.next();
+            contentAssocs.each { contentAssoc ->
                 bodyContent = contentAssoc.getRelatedOne("ToContent");
                 bodyDr = bodyContent.getRelatedOne("DataResource");
                 body = bodyDr.getRelatedOne("ElectronicText");