svn commit: r676255 - in /ofbiz/trunk/applications: ecommerce/widget/ order/webapp/ordermgr/WEB-INF/actions/entry/ order/widget/ordermgr/

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

svn commit: r676255 - in /ofbiz/trunk/applications: ecommerce/widget/ order/webapp/ordermgr/WEB-INF/actions/entry/ order/widget/ordermgr/

lektran
Author: lektran
Date: Sat Jul 12 18:00:11 2008
New Revision: 676255

URL: http://svn.apache.org/viewvc?rev=676255&view=rev
Log:
A few more bsh -> groovy conversions

Added:
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.groovy
      - copied, changed from r676141, ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.bsh
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShipSettings.groovy
      - copied, changed from r676141, ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/shipsettings.bsh
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShoppingList.groovy
      - copied, changed from r676141, ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/shoppinglist.bsh
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy
      - copied, changed from r676141, ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/showcart.bsh
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowPromoText.groovy
      - copied, changed from r676141, ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/showpromotext.bsh
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/StorePaymentOptions.groovy
      - copied unchanged from r676141, ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/storepaymentoptions.bsh
Removed:
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.bsh
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/shipsettings.bsh
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/shoppinglist.bsh
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/showcart.bsh
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/showpromotext.bsh
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/storepaymentoptions.bsh
Modified:
    ofbiz/trunk/applications/ecommerce/widget/OrderScreens.xml
    ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryCartScreens.xml
    ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryCommonScreens.xml
    ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryOrderScreens.xml
    ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryScreens.xml

Modified: ofbiz/trunk/applications/ecommerce/widget/OrderScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/widget/OrderScreens.xml?rev=676255&r1=676254&r2=676255&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/widget/OrderScreens.xml (original)
+++ ofbiz/trunk/applications/ecommerce/widget/OrderScreens.xml Sat Jul 12 18:00:11 2008
@@ -117,7 +117,7 @@
                 <set field="parameters.formNameValue" value="shipsetupform" global="true"/>
 
                 <set field="titleProperty" value="PageTitleShippingInformation"/>
-                <script location="component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/shipsettings.bsh"/>
+                <script location="component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/ShipSettings.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="anonymousCheckoutDecorator">
@@ -158,7 +158,7 @@
 
                 <set field="titleProperty" value="PageTitleBillingInformation"/>
                 <script location="component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/paymentoptions.bsh"/>
-                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/storepaymentoptions.bsh"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/StorePaymentOptions.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="anonymousCheckoutDecorator">
@@ -179,7 +179,7 @@
 
                 <set field="titleProperty" value="PageTitleBillingInformation"/>
                 <script location="component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/paymentinformation.bsh"/>
-                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/storepaymentoptions.bsh"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/StorePaymentOptions.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="anonymousCheckoutDecorator">
@@ -217,7 +217,7 @@
                 <set field="titleProperty" value="PageTitleBillingInformation"/>
                 <set field="anonymoustrailScreen" value="component://ecommerce/widget/OrderScreens.xml#anonymoustrail"/>
                 <script location="component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/billsettings.bsh"/>
-                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/storepaymentoptions.bsh"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/StorePaymentOptions.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
@@ -236,7 +236,7 @@
 
                 <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/checkoutpayment.bsh"/>
                 <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutOptions.groovy"/>
-                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/storepaymentoptions.bsh"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/StorePaymentOptions.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
@@ -294,7 +294,7 @@
 
                 <set field="titleProperty" value="PageTitleCheckoutOptions"/>
                 <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/checkoutpayment.bsh"/>
-                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/storepaymentoptions.bsh"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/StorePaymentOptions.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
@@ -504,7 +504,7 @@
             <actions>
                 <set field="titleProperty" value="PageTitleBillingInformation"/>
                 <script location="component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/quickAnonPaymentInformation.bsh"/>
-                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/storepaymentoptions.bsh"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/StorePaymentOptions.groovy"/>
             </actions>
             <widgets>
                <platform-specific><html><html-template location="component://ecommerce/webapp/ecommerce/order/quickAnonPaymentInformation.ftl"/></html></platform-specific>

Copied: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.groovy (from r676141, ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.bsh)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.groovy?p2=ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.groovy&p1=ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.bsh&r1=676141&r2=676255&rev=676255&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.bsh (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.groovy Sat Jul 12 18:00:11 2008
@@ -22,7 +22,6 @@
 // Get the Cart and put it in the context.
 
 shoppingCart = ShoppingCartEvents.getCartObject(request);
-context.put("shoppingCart", shoppingCart);
-context.put("currencyUomId", shoppingCart.getCurrency());
-context.put("partyId", shoppingCart.getPartyId());
-
+context.shoppingCart = shoppingCart;
+context.currencyUomId = shoppingCart.getCurrency();
+context.partyId = shoppingCart.getPartyId();

Copied: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShipSettings.groovy (from r676141, ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/shipsettings.bsh)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShipSettings.groovy?p2=ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShipSettings.groovy&p1=ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/shipsettings.bsh&r1=676141&r2=676255&rev=676255&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/shipsettings.bsh (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShipSettings.groovy Sat Jul 12 18:00:11 2008
@@ -26,68 +26,65 @@
 import javolution.util.FastMap;
 import javolution.util.FastList;
 
-delegator = request.getAttribute("delegator");
 cart = session.getAttribute("shoppingCart");
 
-String createNewShipGroup = request.getParameter("createNewShipGroup");
-if (createNewShipGroup != null && createNewShipGroup.equals("Y")) {
+createNewShipGroup = request.getParameter("createNewShipGroup");
+if ("Y".equals(createNewShipGroup)) {
     cart.addShipInfo();
 }
 
 orderPartyId = cart.getPartyId();
-shipToPartyId = parameters.get("shipToPartyId");
-context.put("cart", cart);
+shipToPartyId = parameters.shipToPartyId;
+context.cart = cart;
 
 // nuke the event messages
 request.removeAttribute("_EVENT_MESSAGE_");
 
 if ("SALES_ORDER".equals(cart.getOrderType())) {
-    if (orderPartyId != null && !orderPartyId.equals("_NA_")) {
-        orderParty = delegator.findByPrimaryKey("Party", UtilMisc.toMap("partyId", orderPartyId));
-        if (orderParty != null) {                
+    if (!"_NA_".equals(orderPartyId)) {
+        orderParty = delegator.findByPrimaryKey("Party", [partyId : orderPartyId]);
+        if (orderParty) {                
             shippingContactMechList = ContactHelper.getContactMech(orderParty, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false);
             orderPerson = orderParty.getRelatedOne("Person");
-            context.put("orderParty", orderParty);
-            context.put("orderPerson", orderPerson);
-            context.put("shippingContactMechList", shippingContactMechList);
+            context.orderParty = orderParty;
+            context.orderPerson = orderPerson;
+            context.shippingContactMechList = shippingContactMechList;
         }
     }
     // Ship to another party
-    if (shipToPartyId != null) {
-        shipToParty = delegator.findByPrimaryKey("Party", UtilMisc.toMap("partyId", shipToPartyId));
-        if (shipToParty != null) {    
-            context.put("shipToParty", shipToParty);            
+    if (shipToPartyId) {
+        shipToParty = delegator.findByPrimaryKey("Party", [partyId : shipToPartyId]);
+        if (shipToParty) {
+            context.shipToParty = shipToParty;
             shipToPartyShippingContactMechList = ContactHelper.getContactMech(shipToParty, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false);
-            context.put("shipToPartyShippingContactMechList", shipToPartyShippingContactMechList);
+            context.shipToPartyShippingContactMechList = shipToPartyShippingContactMechList;
         }
     }
     // suppliers for the drop-ship select box
-    suppliers = delegator.findByAnd("PartyRole", UtilMisc.toMap("roleTypeId", "SUPPLIER"));
-    context.put("suppliers", suppliers);
+    suppliers = delegator.findByAnd("PartyRole", [roleTypeId : "SUPPLIER"]);
+    context.suppliers = suppliers;
 } else {
     // Purchase order
-    if (orderPartyId != null && !orderPartyId.equals("_NA_")) {
-        orderParty = delegator.findByPrimaryKey("Party", UtilMisc.toMap("partyId", orderPartyId));
-        if (orderParty != null) {
+    if (!"_NA_".equals(orderPartyId)) {
+        orderParty = delegator.findByPrimaryKey("Party", [partyId : orderPartyId]);
+        if (orderParty) {
            orderPerson = orderParty.getRelatedOne("Person");
-           context.put("orderParty", orderParty);
-           context.put("orderPerson", orderPerson);
+           context.orderParty = orderParty;
+           context.orderPerson = orderPerson;
          }
     }
 
-    String companyId = cart.getBillToCustomerPartyId();
-    if (companyId != null) {
-        List facilityMaps = FastList.newInstance();
-        List facilities = delegator.findByAndCache("Facility", UtilMisc.toMap("ownerPartyId", companyId));
-        Iterator facilitiesIt = facilities.iterator();
-        while (facilitiesIt.hasNext()) {
-            Map facilityMap = FastMap.newInstance();
-            GenericValue facility = (GenericValue)facilitiesIt.next();
-            List facilityContactMechValueMaps = ContactMechWorker.getFacilityContactMechValueMaps(delegator, facility.getString("facilityId"), false, null);
-            facilityMap.put("facilityContactMechList", facilityContactMechValueMaps);
-            facilityMap.put("facility", facility);
+    companyId = cart.getBillToCustomerPartyId();
+    if (companyId) {
+        facilityMaps = FastList.newInstance();
+        facilities = delegator.findByAndCache("Facility", [ownerPartyId : companyId]);
+        facilities.each { facility ->
+            facilityMap = FastMap.newInstance();
+            facilityContactMechValueMaps = ContactMechWorker.getFacilityContactMechValueMaps(delegator, facility.facilityId, false, null);
+            facilityMap.facilityContactMechList = facilityContactMechValueMaps;
+            facilityMap.facility = facility;
             facilityMaps.add(facilityMap);
         }
-        context.put("facilityMaps", facilityMaps);
+        context.facilityMaps = facilityMaps;
     }
 }

Copied: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShoppingList.groovy (from r676141, ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/shoppinglist.bsh)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShoppingList.groovy?p2=ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShoppingList.groovy&p1=ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/shoppinglist.bsh&r1=676141&r2=676255&rev=676255&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/shoppinglist.bsh (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShoppingList.groovy Sat Jul 12 18:00:11 2008
@@ -24,13 +24,11 @@
 import org.ofbiz.base.util.*;
 import org.ofbiz.order.shoppingcart.*;
 
-delegator = request.getAttribute("delegator");
-
 shoppingCart = session.getAttribute("shoppingCart");
 partyId = shoppingCart.getPartyId();
 
 // Get the party's collection of Shopping Lists
-shoppingLists = delegator.findByAndCache("ShoppingList", UtilMisc.toMap("partyId", partyId));
-if ((shoppingLists != null) && (shoppingLists.size() > 0)) {
-    context.put("shoppingLists", shoppingLists);
+shoppingLists = delegator.findByAndCache("ShoppingList", [partyId : partyId]);
+if (shoppingLists) {
+    context.shoppingLists = shoppingLists;
 }

Copied: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy (from r676141, ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/showcart.bsh)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy?p2=ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy&p1=ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/showcart.bsh&r1=676141&r2=676255&rev=676255&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/showcart.bsh (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy Sat Jul 12 18:00:11 2008
@@ -17,8 +17,6 @@
  * under the License.
  */
 
-import java.util.HashMap;
-
 import org.ofbiz.service.*;
 import org.ofbiz.entity.*;
 import org.ofbiz.base.util.*;
@@ -26,72 +24,64 @@
 import org.ofbiz.party.party.PartyWorker;
 import org.ofbiz.product.catalog.CatalogWorker;
 
-delegator = request.getAttribute("delegator");
-security = request.getAttribute("security");
-dispatcher= (LocalDispatcher)request.getAttribute("dispatcher");
-userLogin = session.getAttribute("userLogin");
-
-context.put("dispatcher",dispatcher);
-
 // Just in case we are here from the choosecatalog form, the
 // following call will save in the session the new catalogId
 CatalogWorker.getCurrentCatalogId(request);
 
 // Get the Cart and Prepare Size
 shoppingCart = ShoppingCartEvents.getCartObject(request);
-context.put("shoppingCartSize", shoppingCart.size());
-context.put("shoppingCart", shoppingCart);
-context.put("currencyUomId", shoppingCart.getCurrency());
+context.shoppingCartSize = shoppingCart.size();
+context.shoppingCart = shoppingCart;
+context.currencyUomId = shoppingCart.getCurrency();
 
 mode = shoppingCart.getOrderType();
 
 // get all the possible gift wrap options
-allgiftWraps = delegator.findByAnd("ProductFeature", UtilMisc.toMap("productFeatureTypeId", "GIFT_WRAP"), UtilMisc.toList("defaultSequenceNum"));
-context.put("allgiftWraps", allgiftWraps);
+allgiftWraps = delegator.findByAnd("ProductFeature", [productFeatureTypeId : "GIFT_WRAP"], ["defaultSequenceNum"]);
+context.allgiftWraps = allgiftWraps;
 
-context.put("contentPathPrefix", CatalogWorker.getContentPathPrefix(request));
+context.contentPathPrefix = CatalogWorker.getContentPathPrefix(request);
 
 // retrieve the product store id from the cart
 productStoreId = shoppingCart.getProductStoreId();
-context.put("productStoreId", productStoreId);
+context.productStoreId = productStoreId;
 
 partyId = shoppingCart.getPartyId();
-if (partyId != null && partyId.equals("_NA_")) partyId = null;
-context.put("partyId", partyId);
+if ("_NA_".equals(partyId)) partyId = null;
+context.partyId = partyId;
 
 defaultDesiredDeliveryDate = shoppingCart.getDefaultItemDeliveryDate();
-if (UtilValidate.isEmpty(defaultDesiredDeliveryDate)) {
+if (!defaultDesiredDeliveryDate) {
     defaultDesiredDeliveryDate = (new java.sql.Date(System.currentTimeMillis())).toString();
 } else {
-    context.put("useAsDefaultDesiredDeliveryDate", "true");
+    context.useAsDefaultDesiredDeliveryDate =  "true";
 }
-context.put("defaultDesiredDeliveryDate", defaultDesiredDeliveryDate);
+context.defaultDesiredDeliveryDate = defaultDesiredDeliveryDate;
 
 defaultComment = shoppingCart.getDefaultItemComment();
-if (!UtilValidate.isEmpty(defaultComment)) {
-    context.put("useAsDefaultComment", "true");
+if (defaultComment) {
+    context.useAsDefaultComment = "true";
 }
-context.put("defaultComment", defaultComment);
+context.defaultComment = defaultComment;
 
 // get all party shopping lists
-if (partyId != null) {
-  shoppingLists = delegator.findByAnd("ShoppingList", UtilMisc.toMap("partyId", partyId));
-  context.put("shoppingLists", shoppingLists);
+if (partyId) {
+  shoppingLists = delegator.findByAnd("ShoppingList", [partyId : partyId]);
+  context.shoppingLists = shoppingLists;
 }
 
 // get product inventory summary for each shopping cart item
-productStore = delegator.findByPrimaryKeyCache("ProductStore", UtilMisc.toMap("productStoreId", productStoreId));
+productStore = delegator.findByPrimaryKeyCache("ProductStore", [productStoreId : productStoreId]);
 productStoreFacilityId = null;
-if (productStore != null) {
-    productStoreFacilityId = productStore.getString("inventoryFacilityId");
+if (productStore) {
+    productStoreFacilityId = productStore.inventoryFacilityId;
 }
-inventorySummary = dispatcher.runSync("getProductInventorySummaryForItems", UtilMisc.toMap("orderItems", shoppingCart.makeOrderItems(), "facilityId", productStoreFacilityId));
-context.put("availableToPromiseMap", inventorySummary.get("availableToPromiseMap"));
-context.put("quantityOnHandMap", inventorySummary.get("quantityOnHandMap"));
-context.put("mktgPkgATPMap", inventorySummary.get("mktgPkgATPMap"));
-context.put("mktgPkgQOHMap", inventorySummary.get("mktgPkgQOHMap"));
-
+inventorySummary = dispatcher.runSync("getProductInventorySummaryForItems", [orderItems : shoppingCart.makeOrderItems(), facilityId : productStoreFacilityId]);
+context.availableToPromiseMap = inventorySummary.availableToPromiseMap;
+context.quantityOnHandMap = inventorySummary.quantityOnHandMap;
+context.mktgPkgATPMap = inventorySummary.mktgPkgATPMap;
+context.mktgPkgQOHMap = inventorySummary.mktgPkgQOHMap;
 
 // get purchase order item types
-purchaseOrderItemTypeList = delegator.findByAndCache("OrderItemType", UtilMisc.toMap("parentTypeId", "PURCHASE_SPECIFIC"));
-context.put("purchaseOrderItemTypeList", purchaseOrderItemTypeList);
+purchaseOrderItemTypeList = delegator.findByAndCache("OrderItemType", [parentTypeId : "PURCHASE_SPECIFIC"]);
+context.purchaseOrderItemTypeList = purchaseOrderItemTypeList;

Copied: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowPromoText.groovy (from r676141, ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/showpromotext.bsh)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowPromoText.groovy?p2=ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowPromoText.groovy&p1=ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/showpromotext.bsh&r1=676141&r2=676255&rev=676255&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/showpromotext.bsh (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowPromoText.groovy Sat Jul 12 18:00:11 2008
@@ -21,28 +21,21 @@
 import org.ofbiz.order.shoppingcart.product.ProductPromoWorker;
 import org.ofbiz.order.shoppingcart.*;
 
-dispatcher = request.getAttribute("dispatcher");
-delegator = request.getAttribute("delegator");
-userLogin = session.getAttribute("userLogin");
-
 shoppingCart = ShoppingCartEvents.getCartObject(request);
 mode = shoppingCart.getOrderType();
 
 promoShowLimit = 3;
 
-if (mode != null && mode.equals("SALES_ORDER")) {
+if ("SALES_ORDER".equals(mode)) {
     //Get Promo Text Data
     productPromosAll = ProductPromoWorker.getStoreProductPromos(delegator, dispatcher, request);
     //Make sure that at least one promo has non-empty promoText
     showPromoText = false;
     promoToShow = 0;
     productPromosAllShowable = new ArrayList(productPromosAll.size());
-    productPromoIterator = productPromosAll.iterator();
-    while (productPromoIterator.hasNext()) {
-        productPromo = productPromoIterator.next();
-        promoText = productPromo.get("promoText");
-    
-        if (promoText != null && promoText.length() > 0 && !"N".equals(productPromo.getString("showToCustomer"))) {
+    productPromosAll.each { productPromo ->
+        promoText = productPromo.promoText;
+        if (promoText  && !"N".equals(productPromo.showToCustomer)) {
             showPromoText = true;
             promoToShow++;
             productPromosAllShowable.add(productPromo);
@@ -54,19 +47,19 @@
     productPromos = null;
     if (productPromosRandomTemp.size() > promoShowLimit) {
         productPromos = new ArrayList(promoShowLimit);
-        for (int i=0; i<promoShowLimit; i++) {
-            randomIndex = (int) Math.round(java.lang.Math.random() * (productPromosRandomTemp.size() - 1));
+        for (i = 0; i < promoShowLimit; i++) {
+            randomIndex = Math.round(java.lang.Math.random() * (productPromosRandomTemp.size() - 1)) as int;
             productPromos.add(productPromosRandomTemp.remove(randomIndex));
         }
     } else {
         productPromos = productPromosRandomTemp;
     }
     
-    context.put("promoShowLimit", promoShowLimit);
-    context.put("productPromosAllShowable", productPromosAllShowable);
-    context.put("productPromos", productPromos);
-    context.put("showPromoText", showPromoText);
-    context.put("promoToShow", promoToShow);
+    context.promoShowLimit = promoShowLimit;
+    context.productPromosAllShowable = productPromosAllShowable;
+    context.productPromos = productPromos;
+    context.showPromoText = showPromoText;
+    context.promoToShow = promoToShow;
 } else {
-    context.put("showPromoText", false);
+    context.showPromoText = false;
 }

Modified: ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryCartScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryCartScreens.xml?rev=676255&r1=676254&r2=676255&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryCartScreens.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryCartScreens.xml Sat Jul 12 18:00:11 2008
@@ -51,7 +51,7 @@
     <screen name="orderShortcuts">
         <section>
             <actions>
-                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/shoppinglist.bsh"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/ShoppingList.groovy"/>
             </actions>
             <widgets>
                 <platform-specific><html><html-template location="component://order/webapp/ordermgr/entry/orderShortcuts.ftl"/></html></platform-specific>
@@ -66,8 +66,8 @@
                 <set field="titleProperty" value="PageTitleOrderShowCart"/>
                 <set field="productsummaryScreen" value="component://order/widget/ordermgr/OrderEntryCatalogScreens.xml#productsummary"/>
                 <set field="promoUseDetailsInlineScreen" value="component://order/widget/ordermgr/OrderEntryCartScreens.xml#promoUseDetailsInline"/>
-                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/showcart.bsh"/>
-                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/showpromotext.bsh"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/ShowPromoText.groovy"/>
                 <entity-condition entity-name="ProductStorePromoAndAppl" list-name="allProductPromos" filter-by-date="true">
                     <condition-list combine="and">
                         <condition-expr field-name="manualOnly" value="Y"/>
@@ -99,8 +99,8 @@
                 <set field="title" value="Show Cart"/>
                 <set field="productsummaryScreen" value="component://order/widget/ordermgr/OrderEntryCatalogScreens.xml#productsummary"/>
                 <set field="promoUseDetailsInlineScreen" value="component://order/widget/ordermgr/OrderEntryCartScreens.xml#promoUseDetailsInline"/>
-                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/showcart.bsh"/>
-                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/showpromotext.bsh"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/ShowPromoText.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="CommonOrderEntryDecorator" location="component://order/widget/ordermgr/OrderEntryCommonScreens.xml">
@@ -118,8 +118,8 @@
                 <set field="leftbarScreenLocation" value="component://order/widget/ordermgr/OrderEntryCommonScreens.xml"/>
                 <set field="title" value="Show All Promotions"/>
                 <set field="promoUseDetailsInlineScreen" value="component://order/widget/ordermgr/OrderEntryCartScreens.xml#promoUseDetailsInline"/>
-                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/showcart.bsh"/>
-                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/showpromotext.bsh"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/ShowPromoText.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="CommonOrderEntryDecorator" location="component://order/widget/ordermgr/OrderEntryCommonScreens.xml">

Modified: ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryCommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryCommonScreens.xml?rev=676255&r1=676254&r2=676255&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryCommonScreens.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryCommonScreens.xml Sat Jul 12 18:00:11 2008
@@ -25,7 +25,7 @@
                 <set field="leftbarScreenLocation" value="component://order/widget/ordermgr/OrderEntryCommonScreens.xml"/>
                 <set field="MainColumnStyle" value="leftonly"/>
                 <set field="headerItem" value="orderentry"/>
-                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.bsh"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
@@ -50,7 +50,7 @@
                 <set field="leftbarScreenLocation" value="component://order/widget/ordermgr/OrderEntryCommonScreens.xml"/>
                 <set field="MainColumnStyle" value="leftonly"/>
                 <set field="headerItem" value="orderentry"/>
-                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.bsh"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">

Modified: ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryOrderScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryOrderScreens.xml?rev=676255&r1=676254&r2=676255&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryOrderScreens.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryOrderScreens.xml Sat Jul 12 18:00:11 2008
@@ -25,7 +25,7 @@
         <section>
             <actions>
                 <set field="headerItem" value="orderentry"/>
-                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.bsh"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.groovy"/>
                 <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/SetCheckOutTabBar.groovy"/>
             </actions>
             <widgets>
@@ -52,7 +52,7 @@
                 <set field="title-property" value="PageTitleCheckoutOptions"/>
                 <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/checkoutpayment.bsh"/>
                 <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutOptions.groovy"/>
-                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/storepaymentoptions.bsh"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/StorePaymentOptions.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
@@ -70,7 +70,7 @@
     <screen name="CustSettings">
         <section>
             <actions>
-                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/shipsettings.bsh"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/ShipSettings.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="CommonOrderCheckoutDecorator">
@@ -88,7 +88,7 @@
             <actions>
                 <set field="stepTitleId" value="OrderOrderEntryShipToSettings"/>
                 <set field="stepLabelId" value="FacilityShipping"/>
-                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/shipsettings.bsh"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/ShipSettings.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="CommonOrderCheckoutDecorator">
@@ -124,7 +124,7 @@
             <actions>
                 <set field="stepTitleId" value="SetItemShipGroups"/>
                 <set field="stepLabelId" value="OrderShipGroups"/>
-                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.bsh"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="CommonOrderCheckoutDecorator">

Modified: ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryScreens.xml?rev=676255&r1=676254&r2=676255&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryScreens.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/OrderEntryScreens.xml Sat Jul 12 18:00:11 2008
@@ -58,7 +58,7 @@
                 <set field="entityName" value="Requirement"/>
                 <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="50"/>
-                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.bsh"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="CommonOrderCatalogDecorator" location="component://order/widget/ordermgr/OrderEntryCommonScreens.xml">
@@ -96,7 +96,7 @@
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="50"/>
 
                 <set field="requestParameters.statusId" to-scope="screen" default-value="QUO_APPROVED"/>
-                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.bsh"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.groovy"/>
                 <set field="requestParameters.currencyUomId" to-scope="screen" from-field="currencyUomId"/>
             </actions>
             <widgets>