svn commit: r661946 - in /ofbiz/trunk/applications/product: webapp/catalog/WEB-INF/actions/store/ widget/catalog/

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

svn commit: r661946 - in /ofbiz/trunk/applications/product: webapp/catalog/WEB-INF/actions/store/ widget/catalog/

mrisaliti
Author: mrisaliti
Date: Fri May 30 22:31:06 2008
New Revision: 661946

URL: http://svn.apache.org/viewvc?rev=661946&view=rev
Log:
Converted EditProductStoreRoles.bsh/EditProductStoreSurveys.bsh to groovy (Part of issue OFBIZ-1801)

Added:
    ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreRoles.groovy
      - copied, changed from r661942, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreRoles.bsh
    ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreSurveys.groovy
      - copied, changed from r661942, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreSurveys.bsh
Removed:
    ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreRoles.bsh
    ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreSurveys.bsh
Modified:
    ofbiz/trunk/applications/product/widget/catalog/StoreScreens.xml

Copied: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreRoles.groovy (from r661942, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreRoles.bsh)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreRoles.groovy?p2=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreRoles.groovy&p1=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreRoles.bsh&r1=661942&r2=661946&rev=661946&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreRoles.bsh (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreRoles.groovy Fri May 30 22:31:06 2008
@@ -17,17 +17,13 @@
  * under the License.
  */
 
-import org.ofbiz.base.util.*;
-import org.ofbiz.entity.*;
-import org.ofbiz.entity.util.*;
-import org.ofbiz.widget.html.*;
+import org.ofbiz.entity.*
+import org.ofbiz.entity.util.*
 
-List productStoreRoles = delegator.findByAnd("ProductStoreRole", UtilMisc.toMap("productStoreId", productStoreId), UtilMisc.toList("sequenceNum"));
-if (request.getParameter("showAll") == null) {
+List productStoreRoles = delegator.findByAnd("ProductStoreRole", ['productStoreId' : productStoreId], ['sequenceNum']);
+if (!request.getParameter("showAll")) {
     productStoreRoles = EntityUtil.filterByDate(productStoreRoles);
 }
-context.put("productStoreRoles", productStoreRoles);
-
-roleTypes = delegator.findList("RoleType", null, null, UtilMisc.toList("description"), null, false);
-context.put("roleTypes", roleTypes);
+context.productStoreRoles = productStoreRoles;
 
+context.roleTypes = delegator.findList("RoleType", null, null, ['description'], null, false);
\ No newline at end of file

Copied: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreSurveys.groovy (from r661942, ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreSurveys.bsh)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreSurveys.groovy?p2=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreSurveys.groovy&p1=ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreSurveys.bsh&r1=661942&r2=661946&rev=661946&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreSurveys.bsh (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreSurveys.groovy Fri May 30 22:31:06 2008
@@ -25,31 +25,24 @@
 delegator = request.getAttribute("delegator");
 
 if (security.hasEntityPermission("CATALOG", "_VIEW", session)) {
-    context.put("hasPermission", Boolean.TRUE);
+    context.hasPermission = Boolean.TRUE;
 } else {
-    context.put("hasPermission", Boolean.FALSE);
+    context.hasPermission = Boolean.FALSE;
 }
 
 productStoreId = request.getParameter("productStoreId");
-if (productStoreId != null) {
-    productStore = delegator.findByPrimaryKey("ProductStore", UtilMisc.toMap("productStoreId", productStoreId));
-    context.put("productStoreId", productStoreId);
-    context.put("productStore", productStore);
+if (productStoreId) {
+    productStore = delegator.findByPrimaryKey("ProductStore", ['productStoreId' : productStoreId]);
+    context.productStoreId = productStoreId;
+    context.productStore = productStore;
 }
 
-productStoreSurveys = delegator.findByAnd("ProductStoreSurveyAppl", UtilMisc.toMap("productStoreId", productStoreId));
-productStoreSurveys = EntityUtil.filterByDate(productStoreSurveys);
-context.put("productStoreSurveys", productStoreSurveys);
+context.productStoreSurveys = EntityUtil.filterByDate(delegator.findByAnd("ProductStoreSurveyAppl", ['productStoreId' : productStoreId]));
 
-surveys = delegator.findList("Survey", null, null, UtilMisc.toList("description"), null, false);
-context.put("surveys", surveys);
+context.surveys = delegator.findList("Survey", null, null, ['description'], null, false);
 
-surveyApplTypes = delegator.findList("SurveyApplType", null, null, UtilMisc.toList("description"), null, false);
-context.put("surveyApplTypes", surveyApplTypes);
+context.surveyApplTypes = delegator.findList("SurveyApplType", null, null, ['description'], null, false);
 
-productCategories = delegator.findList("ProductCategory", null, null, UtilMisc.toList("description"), null, false);
-context.put("productCategories", productCategories);
-
-String nowTimestampString = UtilDateTime.nowTimestamp().toString();
-context.put("nowTimestampString", nowTimestampString);
+context.productCategories = delegator.findList("ProductCategory", null, null, ['description'], null, false);
 
+context.nowTimestampString = UtilDateTime.nowTimestamp().toString();
\ No newline at end of file

Modified: ofbiz/trunk/applications/product/widget/catalog/StoreScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/StoreScreens.xml?rev=661946&r1=661945&r2=661946&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/StoreScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/StoreScreens.xml Fri May 30 22:31:06 2008
@@ -101,7 +101,7 @@
                 <set field="productStoreId" from-field="parameters.productStoreId"/>
                 <entity-one entity-name="ProductStore" value-name="productStore" auto-field-map="true"/>
 
-                <script location="component://product/webapp/catalog/WEB-INF/actions/store/EditProductStoreRoles.bsh"/>
+                <script location="component://product/webapp/catalog/WEB-INF/actions/store/EditProductStoreRoles.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="CommonProductStoreDecorator" location="${parameters.mainDecoratorLocation}">
@@ -571,7 +571,7 @@
                 <set field="productStoreId" from-field="parameters.productStoreId"/>
                 <entity-one entity-name="ProductStore" value-name="productStore" auto-field-map="true"/>
 
-                <script location="component://product/webapp/catalog/WEB-INF/actions/store/EditProductStoreSurveys.bsh"/>
+                <script location="component://product/webapp/catalog/WEB-INF/actions/store/EditProductStoreSurveys.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="CommonProductStoreDecorator" location="${parameters.mainDecoratorLocation}">