Author: ashish
Date: Fri Nov 27 13:32:01 2009
New Revision: 884869

URL: http://svn.apache.org/viewvc?rev=884869&view=rev
Log:
Patch from Parimal Gain (Thanks!). Couple of enhancements are done in it.

-- Error or Success message was not displaying for buziness time theme. Fixed 
this issue.
-- In case low ATP proper error message was not coming for any product while 
importing order to the system. It was redirecting the blank page with one line 
message, that was not verbose enough. Improved error message for this.
-- The leaf category id will be provided in category data so that ebay export 
works fine.(See the numeric value provided in ProductCategory record).

OFBiz jira is not responding at my end since last 2 hours so committing this 
patch.

Added:
    ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/EbayKeywordSearch.ftl   
(with props)
Modified:
    ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java
    ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java
    ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/controller.xml
    ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/ebayExportLink.ftl
    ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/productsExportToEbay.ftl
    ofbiz/trunk/specialpurpose/ebay/widget/EbayScreens.xml
    ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml

Modified: 
ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java?rev=884869&r1=884868&r2=884869&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java 
(original)
+++ ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java 
Fri Nov 27 13:32:01 2009
@@ -1192,11 +1192,15 @@
                 Debug.logInfo("Creating order.", module);
                 Map<?, ?> orderCreate = checkout.createOrder(userLogin);
 
+                if ("error".equals(orderCreate.get("responseMessage"))) {
+                    List errorMessageList = 
(List)orderCreate.get("errorMessageList");
+                    return ServiceUtil.returnError(errorMessageList);
+                }
                 String orderId = (String) orderCreate.get("orderId");
                 Debug.logInfo("Created order with id: " + orderId, module);
                 
                 if (UtilValidate.isNotEmpty(orderId)) {
-                    String orderCreatedMsg = "Order created successfully with 
ID (" + orderId + ") & eBay Order ID associated with this order is (" + 
externalId + "). \n";
+                    String orderCreatedMsg = "Order created successfully with 
ID (" + orderId + ") & eBay Order ID associated with this order is (" + 
externalId + ").";
                     orderImportSuccessMessageList.add(orderCreatedMsg);
                 }
 

Modified: 
ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java?rev=884869&r1=884868&r2=884869&view=diff
==============================================================================
--- 
ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java 
(original)
+++ 
ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java 
Fri Nov 27 13:32:01 2009
@@ -81,7 +81,7 @@
                     GenericValue product = (GenericValue) 
productsListIter.next();
                     GenericValue startPriceValue = 
EntityUtil.getFirst(EntityUtil.filterByDate(product.getRelatedByAnd("ProductPrice",
 UtilMisc.toMap("productPricePurposeId", "EBAY", "productPriceTypeId", 
"MINIMUM_PRICE"))));
                     if (UtilValidate.isEmpty(startPriceValue)) {
-                        String startPriceMissingMsg = "Unable to find a 
starting price for auction of product with id (" + 
product.getString("productId") + "). So Ignoring the export of this product to 
eBay.  \n";
+                        String startPriceMissingMsg = "Unable to find a 
starting price for auction of product with id (" + 
product.getString("productId") + "), So Ignoring the export of this product to 
eBay.";
                         
productExportFailureMessageList.add(startPriceMissingMsg);
                         // Ignore the processing of product having no start 
price value
                         continue;
@@ -582,7 +582,7 @@
                 }
                 productExportFailureMessageList.add(errorMessage);
             } else {
-                String productSuccessfullyExportedMsg = "Product successfully 
exported with ID (" + product.getString("productId") + "). \n";
+                String productSuccessfullyExportedMsg = "Product successfully 
exported with ID (" + product.getString("productId") + ").";
                 
productExportSuccessMessageList.add(productSuccessfullyExportedMsg);
             }
         } catch (Exception e) {

Modified: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/controller.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/controller.xml?rev=884869&r1=884868&r2=884869&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/controller.xml 
(original)
+++ ofbiz/trunk/specialpurpose/ebay/webapp/ebay/WEB-INF/controller.xml Fri Nov 
27 13:32:01 2009
@@ -121,8 +121,8 @@
     <!-- New Import Order entries -->
     <request-map uri="eBayOrders">
         <security https="true" auth="true"/>
-        <response name="success" type="view" value="EbayOrders"/>
-        <response name="failure" type="view" value="EbayOrders"/>
+        <response name="success" type="view" value="FindEbayOrders"/>
+        <response name="failure" type="view" value="FindEbayOrders"/>
     </request-map>
 
     <request-map uri="GetEbayOrders">
@@ -136,14 +136,16 @@
         <security https="true" auth="true"/>
         <event type="service-multi" invoke="importEbayOrders"/>
         <response name="success" type="request" value="updatedEbayOrders"/>
-        <response name="failure" type="view" value="EbayOrders"/>
+        <response name="failure" type="view" value="FindEbayOrders"/>
+        <response name="error" type="view" value="FindEbayOrders"/>
     </request-map>
 
     <request-map uri="updatedEbayOrders">
         <security https="true" auth="true"/>
         <event type="groovy" 
path="component://ebay/webapp/ebay/WEB-INF/actions/find/" 
invoke="updatedEbayOrders.groovy"/>
-        <response name="success" type="view" value="EbayOrders"/>
-        <response name="failure" type="view" value="EbayOrders"/>
+        <response name="success" type="view" value="FindEbayOrders"/>
+        <response name="failure" type="view" value="FindEbayOrders"/>
+        <response name="error" type="view" value="FindEbayOrders"/>
     </request-map>
 
     <request-map uri="EditEbayConfiguration">
@@ -160,7 +162,7 @@
     <view-map name="ProductsExportToEbay" type="screen" 
page="component://ebay/widget/EbayScreens.xml#ProductsExportToEbay"/>
     <view-map name="ManageOrdersFromEbay" type="screen" 
page="component://ebay/widget/EbayScreens.xml#ManageOrdersFromEbay"/>
     <view-map name="EbayOrders" type="screen" 
page="component://ebay/widget/EbayScreens.xml#EbayOrders"/>
-    
+    <view-map name="FindEbayOrders" type="screen" 
page="component://ebay/widget/EbayScreens.xml#FindEbayOrders"/>
     <view-map name="FindEbayConfigurations" type="screen" 
page="component://ebay/widget/EbayScreens.xml#FindEbayConfigurations"/>
     <view-map name="EbayShippingMethods" type="screen" 
page="component://ebay/widget/EbayScreens.xml#EbayShippingMethods"/>
     <view-map name="EditEbayConfiguration" type="screen" 
page="component://ebay/widget/EbayScreens.xml#EditEbayConfiguration"/>

Added: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/EbayKeywordSearch.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/EbayKeywordSearch.ftl?rev=884869&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/EbayKeywordSearch.ftl 
(added)
+++ ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/EbayKeywordSearch.ftl Fri 
Nov 27 13:32:01 2009
@@ -0,0 +1,99 @@
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<div class="screenlet">
+  <div class="screenlet-title-bar">
+    <h3>${uiLabelMap.ProductSearchProducts}, 
${uiLabelMap.ProductSearchFor}:</h3>
+  </div>
+  <div class="screenlet-body">
+    <#list searchConstraintStrings as searchConstraintString>
+      <div><a 
href="<@ofbizUrl>keywordsearch?removeConstraint=${searchConstraintString_index}&amp;clearSearch=N</@ofbizUrl>"
 class="buttontext">X</a>${searchConstraintString}</div>
+    </#list>
+    <span 
class="label">${uiLabelMap.CommonSortedBy}:</span>${searchSortOrderString}
+    <div><a 
href="<@ofbizUrl>advancedsearch?SEARCH_CATEGORY_ID=${(requestParameters.SEARCH_CATEGORY_ID)?if_exists}</@ofbizUrl>"
 class="buttontext">${uiLabelMap.CommonRefineSearch}</a></div>
+
+    <#if !productIds?has_content>
+      <div><h2>${uiLabelMap.ProductNoResultsFound}.</h2></div>
+    </#if>
+
+    <#if productIds?has_content>
+      <script language="JavaScript" type="text/javascript">
+        //<![CDATA[
+            function toggleAll(e) {
+                var cform = document.products;
+                var len = cform.elements.length;
+                for (var i = 0; i < len; i++) {
+                    var element = cform.elements[i];
+                    if (element.name == "selectResult" && element.checked != 
e.checked) {
+                        toggle(element);
+                    }
+                }
+            }
+
+            function toggle(e) {
+                e.checked = !e.checked;
+            }
+        //]]>
+      </script>
+      <#macro paginationPanel>
+        <div class="clearfix">
+          <div class="lefthalf margin-left"><input type="checkbox" 
name="selectAll" value="0" onclick="javascript:toggleAll(this);"/> 
<strong>${uiLabelMap.ProductProduct}</strong></div>
+          <div class="right">
+            <strong>
+              <#if 0 &lt; viewIndex?int>
+                <a 
href="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${viewIndex-1}/~VIEW_SIZE=${viewSize}/~clearSearch=N/~PAGING=${paging}/~noConditionFind=${noConditionFind}</@ofbizUrl>"
 class="buttontext">${uiLabelMap.CommonPrevious}</a> |
+              </#if>
+              <#if 0 &lt; listSize?int>
+                ${lowIndex+1} - ${highIndex} ${uiLabelMap.CommonOf} ${listSize}
+              </#if>
+              <#if highIndex?int &lt; listSize?int>
+                | <a 
href="<@ofbizUrl>keywordsearch/~VIEW_INDEX=${viewIndex+1}/~VIEW_SIZE=${viewSize}/~clearSearch=N/~PAGING=${paging}/~noConditionFind=${noConditionFind}</@ofbizUrl>"
 class="buttontext">${uiLabelMap.CommonNext}</a>
+              </#if>
+              <#if paging == "Y">
+                <a 
href="<@ofbizUrl>keywordsearch/~VIEW_INDEX=0/~VIEW_SIZE=99999/~clearSearch=N/~PAGING=N/~noConditionFind=${noConditionFind}</@ofbizUrl>"
 class="buttontext">${uiLabelMap.CommonPagingOff}</a>
+              <#else>
+                <a 
href="<@ofbizUrl>keywordsearch/~VIEW_INDEX=0/~VIEW_SIZE=${previousViewSize}/~clearSearch=N/~PAGING=Y/~noConditionFind=${noConditionFind}</@ofbizUrl>"
 class="buttontext">${uiLabelMap.CommonPagingOn}</a>
+              </#if>
+            </strong>
+          </div>
+        </div>
+      </#macro>
+      <@paginationPanel />
+      <form method="post" name="products">
+        <fieldset>
+          <input type="hidden" name="productStoreId" 
value="${parameters.productStoreId?if_exists}" />
+          <table class="basic-table border-top border-bottom">
+            <#assign listIndex = lowIndex />
+            <#assign altRow = false />
+            <#list productIds as productId>
+              <#assign altRow = !altRow />
+              <#assign product = delegator.findOne("Product", {"productId" : 
productId}, true) />
+              <tr <#if altRow> class="alternate-row"</#if>>
+                <td>
+                  <input type="checkbox" name="selectResult" 
value="${productId}"/>
+                  <a 
href="<@ofbizUrl>EditProduct?productId=${productId}</@ofbizUrl>" 
class="buttontext">[${productId}] ${(product.internalName)?if_exists}</a>
+                </td>
+              </tr>
+            </#list>
+          </table>
+        </fieldset>
+      </form>
+      <@paginationPanel />
+    </#if>
+  </div>
+</div>
\ No newline at end of file

Propchange: 
ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/EbayKeywordSearch.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/EbayKeywordSearch.ftl
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: 
ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/EbayKeywordSearch.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/ebayExportLink.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/ebayExportLink.ftl?rev=884869&r1=884868&r2=884869&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/ebayExportLink.ftl 
(original)
+++ ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/ebayExportLink.ftl Fri Nov 
27 13:32:01 2009
@@ -28,7 +28,6 @@
     <table cellspacing="0" class="basic-table">
         <tr>
             <td align="center" colspan="2">
-                <hr/>
                 <a href="javascript:exportToEbay();" 
class="buttontext">${uiLabelMap.EbayExportToEbay}</a>
             </td>
         </tr>

Modified: 
ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/productsExportToEbay.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/productsExportToEbay.ftl?rev=884869&r1=884868&r2=884869&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/productsExportToEbay.ftl 
(original)
+++ ofbiz/trunk/specialpurpose/ebay/webapp/ebay/find/productsExportToEbay.ftl 
Fri Nov 27 13:32:01 2009
@@ -46,7 +46,7 @@
                 <td align="right" 
class="label">${uiLabelMap.FormFieldTitle_ebayCategory}</td>
                 <td>&nbsp;</td>
                 <td>
-                    <input type="hidden" name="selectResult" 
value="${selectResult}"/>
+                    <input type="hidden" name="selectResult" 
value="${selectResult?if_exists}"/>
                     <select name="ebayCategory" 
onchange="changeEbayCategory(this.value)">
                         <option value=""> </option>
                         <#if categories?exists>

Modified: ofbiz/trunk/specialpurpose/ebay/widget/EbayScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/widget/EbayScreens.xml?rev=884869&r1=884868&r2=884869&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/widget/EbayScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/ebay/widget/EbayScreens.xml Fri Nov 27 13:32:01 
2009
@@ -56,7 +56,7 @@
                 <decorator-screen name="permission-decorator" 
location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
                         <platform-specific>
-                            <html><html-template 
location="component://product/webapp/catalog/find/keywordsearch.ftl"/></html>
+                            <html><html-template 
location="component://ebay/webapp/ebay/find/EbayKeywordSearch.ftl"/></html>
                         </platform-specific>
                         <platform-specific>
                             <html><html-template 
location="component://ebay/webapp/ebay/find/ebayExportLink.ftl"/></html>
@@ -253,4 +253,39 @@
             </widgets>
         </section>
     </screen>
+
+    <screen name="FindEbayOrders">
+        <section>
+            <actions>
+                <set field="titleProperty" value="EbayEBayOrders"/>
+                <set field="headerItem" value="eBayOrders"/>
+                <script 
location="component://ebay/webapp/ebay/WEB-INF/actions/find/updatedEbayOrders.groovy"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="permission-decorator" 
location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <section>
+                            <condition>
+                                <if-has-permission permission="EBAY" 
action="_VIEW"/>
+                            </condition>
+                            <widgets>
+                                <decorator-screen name="FindScreenDecorator" 
location="component://common/widget/CommonScreens.xml">
+                                    <decorator-section name="search-options">
+                                        <include-form name="FindEbayOrders" 
location="component://ebay/widget/EbayForms.xml"/>
+                                    </decorator-section>
+                                    <decorator-section name="search-results">
+                                        <include-form name="ListEbayOrders" 
location="component://ebay/widget/EbayForms.xml"/>
+                                    </decorator-section>
+                                </decorator-screen>
+                            </widgets>
+                            <fail-widgets>
+                                <label 
style="h3">${uiLabelMap.EbayViewPermissionError}</label>
+                            </fail-widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+
 </screens>
\ No newline at end of file

Modified: ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml?rev=884869&r1=884868&r2=884869&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml Fri Nov 27 
13:32:01 2009
@@ -255,7 +255,7 @@
     <ProductCategory categoryName="15064" productCategoryId="eBay_Category" 
productCategoryTypeId="EBAY_CATEGORY"/>
     <ProdCatalogCategory prodCatalogId="eBayCatalog" 
productCategoryId="eBay_Category" fromDate="2009-11-05 12:00:00.0" 
sequenceNum="1" prodCatalogCategoryTypeId="PCCT_EBAY_ROOT"/>
     
-    <ProductCategory productCategoryId="eBay_ECom_Category" categoryName="Ebay 
E-Commerce Category" productCategoryTypeId="EBAY_CATEGORY"/>
+    <ProductCategory productCategoryId="eBay_ECom_Category" 
categoryName="15064" productCategoryTypeId="EBAY_CATEGORY"/>
 
     <ProdCatalogCategory prodCatalogId="GoogleCatalog" 
productCategoryId="GOOGLE_BASE" fromDate="2001-05-13 12:00:00.0"
         sequenceNum="1" prodCatalogCategoryTypeId="PCCT_BROWSE_ROOT"/>


Reply via email to