svn commit: r916150 - in /ofbiz/trunk/specialpurpose/ebaystore: ./ config/ data/ entitydef/ servicedef/ src/org/ofbiz/ebaystore/ webapp/ebaystore/WEB-INF/ webapp/ebaystore/WEB-INF/actions/automationPreferences/ widget/

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

svn commit: r916150 - in /ofbiz/trunk/specialpurpose/ebaystore: ./ config/ data/ entitydef/ servicedef/ src/org/ofbiz/ebaystore/ webapp/ebaystore/WEB-INF/ webapp/ebaystore/WEB-INF/actions/automationPreferences/ widget/

hansbak-2
Author: hansbak
Date: Thu Feb 25 06:36:14 2010
New Revision: 916150

URL: http://svn.apache.org/viewvc?rev=916150&view=rev
Log:
Ebaystore update:
 - function setting for your store run auto disput and auto Relisting
        - create new entity called EbayProductStorePref used for setting automation perference data.

Added:
    ofbiz/trunk/specialpurpose/ebaystore/servicedef/secas.xml
    ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/automationPreferences/GetDisputeInfo.groovy
Removed:
    ofbiz/trunk/specialpurpose/ebaystore/data/EbayStoreScheduledJobs.xml
Modified:
    ofbiz/trunk/specialpurpose/ebaystore/config/EbayStoreUiLabels.xml
    ofbiz/trunk/specialpurpose/ebaystore/data/EbayStoreTypeData.xml
    ofbiz/trunk/specialpurpose/ebaystore/entitydef/entitymodel.xml
    ofbiz/trunk/specialpurpose/ebaystore/ofbiz-component.xml
    ofbiz/trunk/specialpurpose/ebaystore/servicedef/services.xml
    ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreHelper.java
    ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/controller.xml
    ofbiz/trunk/specialpurpose/ebaystore/widget/EbaySellingManagerForms.xml
    ofbiz/trunk/specialpurpose/ebaystore/widget/EbaySellingManagerScreens.xml

Modified: ofbiz/trunk/specialpurpose/ebaystore/config/EbayStoreUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/config/EbayStoreUiLabels.xml?rev=916150&r1=916149&r2=916150&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebaystore/config/EbayStoreUiLabels.xml (original)
+++ ofbiz/trunk/specialpurpose/ebaystore/config/EbayStoreUiLabels.xml Thu Feb 25 06:36:14 2010
@@ -205,4 +205,25 @@
     <property key="requireEbayInventory">
         <value xml:lang="en">Require eBay Inventory</value>
     </property>
+    <property key="EbayAutomationDispute">
+        <value xml:lang="en">Automation Dispute</value>
+    </property>
+    <property key="EbayDisputeCheckoutNotComplete">
+        <value xml:lang="en">Create Dispute if checkout has not been completed</value>
+    </property>
+    <property key="EbayDisputeNotPay">
+        <value xml:lang="en">Create Dispute if checkout has been completed but no payment has been received</value>
+    </property>
+    <property key="EbayAfter">
+        <value xml:lang="en">After</value>
+    </property>
+    <property key="EbayReason">
+        <value xml:lang="en">Reason</value>
+    </property>
+    <property key="EbayExplanation">
+        <value xml:lang="en">Explanation</value>
+    </property>
+    <property key="EbayAddSecondChanceOffer">
+        <value xml:lang="en">Add Second Chance Offer</value>
+    </property>
 </resource>

Modified: ofbiz/trunk/specialpurpose/ebaystore/data/EbayStoreTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/data/EbayStoreTypeData.xml?rev=916150&r1=916149&r2=916150&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebaystore/data/EbayStoreTypeData.xml (original)
+++ ofbiz/trunk/specialpurpose/ebaystore/data/EbayStoreTypeData.xml Thu Feb 25 06:36:14 2010
@@ -24,4 +24,10 @@
     
     <EnumerationType description="Inventory Reservation For Ebay Store" enumTypeId="EBAY_INV_RESERVE" hasTable="N" parentTypeId=""/>
     <Enumeration description="ebay inventory reserve" enumCode="EBAY_INV" enumId="EBAY_INV_RES" sequenceId="01" enumTypeId="EBAY_INV_RESERVE"/>
+    
+    <EnumerationType description="Ebay setting auto preferences" enumTypeId="EBAY_AUTO_PREF" hasTable="N" parentTypeId=""/>
+    
+    <Enumeration enumId="EBAY_AUTO_DISPUTE1" description="Automatic Dispute not complete" enumTypeId="EBAY_AUTO_PREF"/>
+    <Enumeration enumId="EBAY_AUTO_DISPUTE2" description="Automatic Dispute not pay" enumTypeId="EBAY_AUTO_PREF"/>
+ <Enumeration enumId="EBAY_AUTO_RELISTING" description="Automatic Relisting" enumTypeId="EBAY_AUTO_PREF"/>
 </entity-engine-xml>

Modified: ofbiz/trunk/specialpurpose/ebaystore/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/entitydef/entitymodel.xml?rev=916150&r1=916149&r2=916150&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebaystore/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/specialpurpose/ebaystore/entitydef/entitymodel.xml Thu Feb 25 06:36:14 2010
@@ -58,6 +58,26 @@
             <key-map field-name="productStoreId"/>
         </relation>
     </entity>
-    
+    <entity entity-name="EbayProductStorePref" package-name="org.ofbiz.ebay.store"
+         title="Ebay store and Preference">
+        <field name="productStoreId" type="id-ne"/>
+        <field name="autoPrefEnumId" type="id-ne"/>
+        <field name="autoPrefJobId" type="id-ne"/>
+        <field name="enabled" type="indicator"/>
+        <field name="condition1" type="value"/>
+        <field name="condition2" type="value"/>
+        <field name="condition3" type="value"/>
+        <prim-key field="productStoreId"/>
+        <prim-key field="autoPrefEnumId"/>
+        <relation type="one" fk-name="EBY_STR_PREF" rel-entity-name="ProductStore">
+            <key-map field-name="productStoreId"/>
+        </relation>
+        <relation type="one" fk-name="EBY_STR_ENUM" rel-entity-name="Enumeration">
+            <key-map field-name="autoPrefEnumId" rel-field-name="enumId"/>
+        </relation>
+        <relation type="one" fk-name="EBY_STR_JOB" rel-entity-name="JobSandbox">
+            <key-map field-name="autoPrefJobId" rel-field-name="jobId"/>
+        </relation>
+    </entity>
 </entitymodel>    
     
\ No newline at end of file

Modified: ofbiz/trunk/specialpurpose/ebaystore/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/ofbiz-component.xml?rev=916150&r1=916149&r2=916150&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebaystore/ofbiz-component.xml (original)
+++ ofbiz/trunk/specialpurpose/ebaystore/ofbiz-component.xml Thu Feb 25 06:36:14 2010
@@ -35,6 +35,7 @@
     <entity-resource type="data" reader-name="demo" loader="main" location="data/DemoEbayStoreData.xml"/>
     <entity-resource type="data" reader-name="demo" loader="main" location="data/EbayStoreScheduledJobs.xml"/>
     
+    <service-resource type="eca" loader="main" location="servicedef/secas.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services.xml"/>
     
     <webapp name="ebaystore"

Added: ofbiz/trunk/specialpurpose/ebaystore/servicedef/secas.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/servicedef/secas.xml?rev=916150&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/ebaystore/servicedef/secas.xml (added)
+++ ofbiz/trunk/specialpurpose/ebaystore/servicedef/secas.xml Thu Feb 25 06:36:14 2010
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+
+<service-eca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/service-eca.xsd">
+    <eca service="createEbayProductStorePref" event="commit">
+     <condition operator="equals" field-name="enabled" value="Y"/>
+     <condition operator="is-not-empty" field-name="serviceName"/>
+     <action mode="sync" service="startEbayAutoPreference"/>
+    </eca>
+    <eca service="updateEbayProductStorePref" event="commit">
+     <condition operator="equals" field-name="enabled" value="Y"/>
+     <condition operator="is-not-empty" field-name="serviceName"/>
+     <action mode="sync" service="startEbayAutoPreference"/>
+    </eca>
+    <eca service="createEbayProductStorePref" event="commit">
+     <condition operator="equals" field-name="enabled" value="N"/>
+     <condition operator="is-not-empty" field-name="serviceName"/>
+     <action mode="sync" service="stopEbayAutoPreference"/>
+    </eca>
+    <eca service="updateEbayProductStorePref" event="commit">
+     <condition operator="equals" field-name="enabled" value="N"/>
+     <action mode="sync" service="stopEbayAutoPreference"/>
+    </eca>
+</service-eca>
\ No newline at end of file

Modified: ofbiz/trunk/specialpurpose/ebaystore/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/servicedef/services.xml?rev=916150&r1=916149&r2=916150&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebaystore/servicedef/services.xml (original)
+++ ofbiz/trunk/specialpurpose/ebaystore/servicedef/services.xml Thu Feb 25 06:36:14 2010
@@ -326,4 +326,27 @@
         <attribute name="itemId" mode="IN" type="String" optional="false"/>
         <attribute name="checkVerify" mode="OUT" type="Boolean" optional="false"/>
     </service>
+    <service name="startEbayAutoPreference" engine="java" transaction-timeout="3600"
+        location="org.ofbiz.ebaystore.EbayStoreHelper" invoke="startEbayAutoPreference" auth="true">
+        <attribute name="productStoreId" mode="IN" type="String" optional="false"/>
+        <attribute name="autoPrefEnumId" mode="IN" type="String" optional="false"/>
+        <attribute name="serviceName" mode="IN" type="String" optional="true"/>
+    </service>
+    <service name="stopEbayAutoPreference" engine="java" transaction-timeout="3600"
+        location="org.ofbiz.ebaystore.EbayStoreHelper" invoke="stopEbayAutoPreference" auth="true">
+        <attribute name="productStoreId" mode="IN" type="String" optional="false"/>
+        <attribute name="autoPrefEnumId" mode="IN" type="String" optional="false"/>
+        <attribute name="serviceName" mode="IN" type="String" optional="true"/>
+    </service>
+    <service name="createEbayProductStorePref" engine="entity-auto" default-entity-name="EbayProductStorePref" invoke="create" auth="true">
+     <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+        <attribute name="serviceName" mode="IN" type="String" optional="false"/>
+    </service>
+    <service name="updateEbayProductStorePref" engine="entity-auto" default-entity-name="EbayProductStorePref" invoke="update" auth="true" >
+     <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true" />
+        <attribute name="enabled" mode="IN" type="String" optional="false" default-value="N"/>
+        <attribute name="serviceName" mode="IN" type="String" optional="false"/>
+    </service>
 </services>
\ No newline at end of file

Modified: ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreHelper.java?rev=916150&r1=916149&r2=916150&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreHelper.java (original)
+++ ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreHelper.java Thu Feb 25 06:36:14 2010
@@ -19,20 +19,8 @@
 
 package org.ofbiz.ebaystore;
 
-import java.io.BufferedReader;
 import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.math.BigDecimal;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.sql.Timestamp;
-import java.text.ParsePosition;
-import java.text.SimpleDateFormat;
-import java.util.Collection;
 import java.util.Date;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -42,21 +30,20 @@
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.UtilDateTime;
 import org.ofbiz.base.util.UtilMisc;
-import org.ofbiz.base.util.UtilProperties;
 import org.ofbiz.base.util.UtilValidate;
-import org.ofbiz.base.util.UtilXml;
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
-import org.ofbiz.entity.util.EntityUtil;
-import org.ofbiz.order.shoppingcart.ShoppingCart;
-import org.ofbiz.party.contact.ContactHelper;
+import org.ofbiz.entity.serialize.SerializeException;
+import org.ofbiz.entity.serialize.XmlSerializer;
+import org.ofbiz.service.DispatchContext;
 import org.ofbiz.service.GenericServiceException;
 import org.ofbiz.service.LocalDispatcher;
-import org.ofbiz.service.ModelService;
 import org.ofbiz.service.ServiceUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
+import org.ofbiz.service.calendar.RecurrenceInfo;
+import org.ofbiz.service.calendar.RecurrenceInfoException;
+import org.ofbiz.service.config.ServiceConfigUtil;
+import org.ofbiz.service.job.JobManager;
 
 import com.ebay.sdk.ApiAccount;
 import com.ebay.sdk.ApiContext;
@@ -66,6 +53,8 @@
 
 import org.ofbiz.ebay.EbayHelper;
 
+import sun.net.www.content.text.Generic;
+
 public class EbayStoreHelper {
     private static final String configFileName = "ebayStore.properties";
     private static final String module = EbayStoreHelper.class.getName();
@@ -236,4 +225,120 @@
    }
    return flag;
    }
+ public static Map<String, Object> startEbayAutoPreference(DispatchContext dctx, Map<String, ? extends Object> context) {
+ Map<String, Object>result = FastMap.newInstance();
+ LocalDispatcher dispatcher = dctx.getDispatcher();
+ GenericValue userLogin = (GenericValue) context.get("userLogin");
+ Delegator delegator = dctx.getDelegator();
+ Locale locale = (Locale) context.get("locale");
+ String productStoreId = (String) context.get("productStoreId");
+ String autoPrefEnumId = (String) context.get("autoPrefEnumId");
+ String serviceName = (String) context.get("serviceName");
+ try{
+ GenericValue ebayProductPref = delegator.findByPrimaryKey("EbayProductStorePref", UtilMisc.toMap("productStoreId", productStoreId, "autoPrefEnumId", autoPrefEnumId));
+ String jobId = ebayProductPref.getString("autoPrefJobId");
+ if (UtilValidate.isNotEmpty(jobId)) {
+ GenericValue job = delegator.findByPrimaryKey("JobSandbox", UtilMisc.toMap("jobId", jobId));
+ job = EbayStoreHelper.getCurrentJob(delegator, userLogin, job);
+ if (!job.getString("statusId").equals("SERVICE_PENDING")) {
+ Map<String, Object>inMap = FastMap.newInstance();
+ inMap.put("jobId", jobId);
+ inMap.put("userLogin", userLogin);
+ dispatcher.runSync("resetScheduledJob", inMap);
+ }
+ }
+ if (UtilValidate.isEmpty(ebayProductPref.getString("autoPrefJobId"))) {
+ if (UtilValidate.isEmpty(serviceName)) return ServiceUtil.returnError("If you add a new job, you have to add serviec name.");
+ /*** RuntimeData ***/
+        String runtimeDataId = null;
+        GenericValue runtimeData = delegator.makeValue("RuntimeData");
+        runtimeData = delegator.createSetNextSeqId(runtimeData);
+        runtimeDataId = runtimeData.getString("runtimeDataId");
+        
+ /*** JobSandbox ***/
+ // create the recurrence
+ String infoId = null;
+ String jobName = null;
+ long startTime = UtilDateTime.getNextDayStart(UtilDateTime.nowTimestamp()).getTime();
+ RecurrenceInfo info;
+ // run every day when day start
+ info = RecurrenceInfo.makeInfo(delegator, startTime, 4, 1, -1);
+        infoId = info.primaryKey();
+        // set the persisted fields
+        GenericValue enumeration = delegator.findByPrimaryKey("Enumeration", UtilMisc.toMap("enumId", autoPrefEnumId));
+        jobName = enumeration.getString("description");
+        if (jobName == null) {
+         jobName = Long.toString((new Date().getTime()));
+        }
+        Map<String, Object> jFields = UtilMisc.<String, Object>toMap("jobName", jobName, "runTime", UtilDateTime.nowTimestamp(),
+                "serviceName", serviceName, "statusId", "SERVICE_PENDING", "recurrenceInfoId", infoId, "runtimeDataId", runtimeDataId);
+
+        // set the pool ID
+        jFields.put("poolId", ServiceConfigUtil.getSendPool());
+
+        // set the loader name
+        jFields.put("loaderName", JobManager.dispatcherName);
+        // create the value and store
+        GenericValue jobV;
+        jobV = delegator.makeValue("JobSandbox", jFields);
+        GenericValue jobSandbox = delegator.createSetNextSeqId(jobV);
+        
+        ebayProductPref.set("autoPrefJobId", jobSandbox.getString("jobId"));
+        ebayProductPref.store();
+        
+        Map<String, Object>infoData = FastMap.newInstance();
+        infoData.put("jobId", jobSandbox.getString("jobId"));
+        runtimeData.set("runtimeInfo", XmlSerializer.serialize(infoData));
+        runtimeData.store();
+ }
+ } catch(GenericEntityException e){
+ return ServiceUtil.returnError(e.getMessage());
+ } catch (GenericServiceException e) {
+ return ServiceUtil.returnError(e.getMessage());
+ } catch (SerializeException e) {
+         return ServiceUtil.returnError(e.getMessage());
+        } catch (IOException e) {
+         return ServiceUtil.returnError(e.getMessage());
+        }catch (RecurrenceInfoException e) {
+         return ServiceUtil.returnError(e.getMessage());
+ }
+ return result;
+ }
+ public static Map<String, Object> stopEbayAutoPreference(DispatchContext dctx, Map<String, ? extends Object> context) {
+ Map<String, Object>result = FastMap.newInstance();
+ LocalDispatcher dispatcher = dctx.getDispatcher();
+ GenericValue userLogin = (GenericValue) context.get("userLogin");
+ Delegator delegator = dctx.getDelegator();
+ Locale locale = (Locale) context.get("locale");
+ String productStoreId = (String) context.get("productStoreId");
+ String autoPrefEnumId = (String) context.get("autoPrefEnumId");
+ try{
+ GenericValue ebayProductPref = delegator.findByPrimaryKey("EbayProductStorePref", UtilMisc.toMap("productStoreId", productStoreId, "autoPrefEnumId", autoPrefEnumId));
+ String jobId = ebayProductPref.getString("autoPrefJobId");
+ GenericValue job = delegator.findByPrimaryKey("JobSandbox", UtilMisc.toMap("jobId", jobId));
+ job = EbayStoreHelper.getCurrentJob(delegator, userLogin, job);
+ Map<String, Object>inMap = FastMap.newInstance();
+ inMap.put("userLogin", userLogin);
+ inMap.put("jobId", job.getString("jobId"));
+ dispatcher.runSync("cancelScheduledJob", inMap);
+ } catch(GenericEntityException e){
+ return ServiceUtil.returnError(e.getMessage());
+ } catch(GenericServiceException e){
+ return ServiceUtil.returnError(e.getMessage());
+ }
+ return result;
+ }
+ private static GenericValue getCurrentJob(Delegator delegator, GenericValue userLogin, GenericValue job){
+ try {
+ List<GenericValue> jobNew = delegator.findByAnd("JobSandbox", UtilMisc.toMap("previousJobId", job.getString("jobId")));
+ if (jobNew.size() != 0) {
+ job = EbayStoreHelper.getCurrentJob(delegator, userLogin, jobNew.get(0));
+ } else {
+ return job;
+ }
+ } catch (GenericEntityException e) {
+ return null;
+ }
+ return job;
+ }
 }

Added: ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/automationPreferences/GetDisputeInfo.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/automationPreferences/GetDisputeInfo.groovy?rev=916150&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/automationPreferences/GetDisputeInfo.groovy (added)
+++ ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/automationPreferences/GetDisputeInfo.groovy Thu Feb 25 06:36:14 2010
@@ -0,0 +1,100 @@
+/*
+ * 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.
+ */
+
+import org.ofbiz.base.util.*;
+
+import com.ebay.soap.eBLBaseComponents.DisputeReasonCodeType;
+import com.ebay.soap.eBLBaseComponents.DisputeExplanationCodeType;
+import javolution.util.FastList;
+import javolution.util.FastMap;
+
+public static String makeSpace(String text){
+ String result = "";
+ for (int i=0; i<text.length(); i++) {
+ if (i < text.length()-1) {
+ if (String.valueOf(text.charAt(i+1)).equals(String.valueOf(text.charAt(i+1)).toUpperCase())) {
+ result = result + String.valueOf(text.charAt(i)) + " " ;
+ } else {
+ result = result + String.valueOf(text.charAt(i));
+ }
+ }else{
+ result = result + String.valueOf(text.charAt(i));
+ }
+ }
+ return result;
+}
+reasons = FastList.newInstance();
+explanations = FastList.newInstance();
+
+entry = FastMap.newInstance();
+entry.put("reasonCode", DisputeReasonCodeType.BUYER_HAS_NOT_PAID.toString());
+entry.put("value",  makeSpace(DisputeReasonCodeType.BUYER_HAS_NOT_PAID.value()));
+reasons.add(entry);
+entry = FastMap.newInstance();
+entry.put("reasonCode", DisputeReasonCodeType.TRANSACTION_MUTUALLY_CANCELED.toString());
+entry.put("value",  makeSpace(DisputeReasonCodeType.TRANSACTION_MUTUALLY_CANCELED.value()));
+reasons.add(entry);
+
+entry = FastMap.newInstance();
+entry.put("explanationCode", DisputeExplanationCodeType.BUYER_HAS_NOT_RESPONDED.toString());
+entry.put("value", makeSpace(DisputeExplanationCodeType.BUYER_HAS_NOT_RESPONDED.value()));
+explanations.add(entry);
+entry = FastMap.newInstance();
+entry.put("explanationCode", DisputeExplanationCodeType.BUYER_REFUSED_TO_PAY.toString());
+entry.put("value", makeSpace(DisputeExplanationCodeType.BUYER_REFUSED_TO_PAY.value()));
+explanations.add(entry);
+entry = FastMap.newInstance();
+entry.put("explanationCode", DisputeExplanationCodeType.BUYER_RETURNED_ITEM_FOR_REFUND.toString());
+entry.put("value", makeSpace(DisputeExplanationCodeType.BUYER_RETURNED_ITEM_FOR_REFUND.value()));
+explanations.add(entry);
+entry = FastMap.newInstance();
+entry.put("explanationCode", DisputeExplanationCodeType.UNABLE_TO_RESOLVE_TERMS.toString());
+entry.put("value", makeSpace(DisputeExplanationCodeType.UNABLE_TO_RESOLVE_TERMS.value()));
+explanations.add(entry);
+entry = FastMap.newInstance();
+entry.put("explanationCode", DisputeExplanationCodeType.BUYER_PURCHASING_MISTAKE.toString());
+entry.put("value", makeSpace(DisputeExplanationCodeType.BUYER_PURCHASING_MISTAKE.value()));
+explanations.add(entry);
+entry = FastMap.newInstance();
+entry.put("explanationCode", DisputeExplanationCodeType.SHIP_COUNTRY_NOT_SUPPORTED.toString());
+entry.put("value",  makeSpace(DisputeExplanationCodeType.SHIP_COUNTRY_NOT_SUPPORTED.value()));
+explanations.add(entry);
+entry = FastMap.newInstance();
+entry.put("explanationCode", DisputeExplanationCodeType.SHIPPING_ADDRESS_NOT_CONFIRMED.toString());
+entry.put("value", makeSpace(DisputeExplanationCodeType.SHIPPING_ADDRESS_NOT_CONFIRMED.value()));
+explanations.add(entry);
+entry = FastMap.newInstance();
+entry.put("explanationCode", DisputeExplanationCodeType.PAYMENT_METHOD_NOT_SUPPORTED.toString());
+entry.put("value", makeSpace(DisputeExplanationCodeType.PAYMENT_METHOD_NOT_SUPPORTED.value()));
+explanations.add(entry);
+entry = FastMap.newInstance();
+entry.put("explanationCode", DisputeExplanationCodeType.BUYER_NO_LONGER_REGISTERED.toString());
+entry.put("value", makeSpace(DisputeExplanationCodeType.BUYER_NO_LONGER_REGISTERED.value()));
+explanations.add(entry);
+entry = FastMap.newInstance();
+entry.put("explanationCode", DisputeExplanationCodeType.BUYER_NO_LONGER_REGISTERED.toString());
+entry.put("value", makeSpace(DisputeExplanationCodeType.BUYER_NO_LONGER_REGISTERED.value()));
+explanations.add(entry);
+entry = FastMap.newInstance();
+entry.put("explanationCode", DisputeExplanationCodeType.OTHER_EXPLANATION.toString());
+entry.put("value", makeSpace(DisputeExplanationCodeType.OTHER_EXPLANATION.value()));
+explanations.add(entry);
+
+context.reasons = reasons;
+context.explanations = explanations;
\ No newline at end of file

Modified: ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/controller.xml?rev=916150&r1=916149&r2=916150&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/controller.xml Thu Feb 25 06:36:14 2010
@@ -125,6 +125,18 @@
         <response name="success" type="view" value="AutomationPreferences"/>
         <response name="error" type="view" value="AutomationPreferences"/>
     </request-map>
+    <request-map uri="createEbayProductStorePref">
+        <security auth="true" https="true"/>
+        <event type="service" invoke="createEbayProductStorePref"/>
+        <response name="success" type="view" value="AutomationPreferences"/>
+        <response name="error" type="view" value="AutomationPreferences"/>
+    </request-map>
+    <request-map uri="updateEbayProductStorePref">
+        <security auth="true" https="true"/>
+        <event type="service" invoke="updateEbayProductStorePref"/>
+        <response name="success" type="view" value="AutomationPreferences"/>
+        <response name="error" type="view" value="AutomationPreferences"/>
+    </request-map>
     <!-- Block item out of stock -->
     <request-map uri="blockItemOutOfStock">
         <security https="true" auth="true"/>

Modified: ofbiz/trunk/specialpurpose/ebaystore/widget/EbaySellingManagerForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/widget/EbaySellingManagerForms.xml?rev=916150&r1=916149&r2=916150&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebaystore/widget/EbaySellingManagerForms.xml (original)
+++ ofbiz/trunk/specialpurpose/ebaystore/widget/EbaySellingManagerForms.xml Thu Feb 25 06:36:14 2010
@@ -23,15 +23,54 @@
 <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">
     <!-- Automation Preference -->
-    <form name="EditAutomationRelistSoldItems" target="createEbayAutomaticRelistItems" type="single">
-        <alt-target use-when="job!=null" target="updateEbayAutomaticRelistItems"/>
-        <field name="jobId" use-when="job!=null"><hidden value="${job.jobId}"/></field>
-        <field name="jobId" use-when="job==null"><hidden value="${jobId}"/></field>
-        <field name="authUserLoginId"><hidden value="${userLoginId}"/></field>
+    <form name="EditAutomationRelistSoldItems" target="createEbayProductStorePref" type="single" default-map-name="ebayPrefRelisting" >
+     <alt-target use-when="ebayPrefRelisting!=null" target="updateEbayProductStorePref"/>
         <field name="productStoreId"><hidden value="${parameters.productStoreId}"/></field>
-        <field name="startDateTime"><date-time default-value="${job.startDateTime}"/></field>
-        <field name="finishDateTime"><date-time default-value="${job.finishDateTime}"/></field>
-        <field name="submit" title="${uiLabelMap.CommonUpdate}"><submit/></field>
+        <field name="enabled" tooltip="${uiLabelMap.EbayAutoRelisting}" tooltip-style="h3"><check/></field>
+        <field name="condition1"><hidden value="${userLoginId}"/></field>
+        <field name="condition2" title="${uiLabelMap.CommonFromDate}"><date-time/></field>
+        <field name="condition3" title="${uiLabelMap.CommonThruDate}"><date-time/></field>
+        <field name="serviceName"><hidden value="${serviceName}"/></field>
+        <field name="autoPrefEnumId"><hidden value="${autoPrefEnumId}"/></field>
+        <field name="submit" title="${uiLabelMap.CommonApply}"><submit/></field>
+    </form>
+    <form name="AutomationDisputeNotComplete" target="createEbayProductStorePref" type="single" default-map-name="ebayPrefDispute1">
+        <alt-target use-when="ebayPrefDispute1!=null" target="updateEbayProductStorePref"/>
+        <field name="productStoreId"><hidden value="${parameters.productStoreId}"/></field>
+        <field name="enabled" tooltip="${uiLabelMap.EbayDisputeCheckoutNotComplete}" tooltip-style="h3"><check/></field>
+        <field name="condition1" title="${uiLabelMap.EbayAfter}" tooltip-style="text" tooltip="${uiLabelMap.CommonDays}" ><text default-value="" size="5"/></field>
+        <field name="condition2" title="${uiLabelMap.EbayReason}">
+         <drop-down >
+         <list-options key-name="reasonCode" list-name="reasons" description="${value}"/>
+         </drop-down>
+        </field>
+        <field name="condition3" title="${uiLabelMap.EbayExplanation}">
+ <drop-down >
+         <list-options key-name="explanationCode" list-name="explanations" description="${value}"/>
+         </drop-down>        
+        </field>
+        <field name="serviceName"><hidden value="${serviceName1}"/></field>
+        <field name="autoPrefEnumId"><hidden value="${autoPrefEnumId1}"/></field>
+        <field name="submit" title="${uiLabelMap.CommonApply}"><submit/></field>
+    </form>
+    <form name="AutomationDisputeNotPay" target="createEbayProductStorePref" type="single" default-map-name="ebayPrefDispute2">
+        <alt-target use-when="ebayPrefDispute2!=null" target="updateEbayProductStorePref"/>
+        <field name="productStoreId"><hidden value="${parameters.productStoreId}"/></field>
+        <field name="enabled" tooltip="${uiLabelMap.EbayDisputeNotPay}" tooltip-style="h3"><check/></field>
+        <field name="condition1" title="${uiLabelMap.EbayAfter}" tooltip-style="text" tooltip="${uiLabelMap.CommonDays}" ><text default-value="" size="5"/></field>
+        <field name="condition2" title="${uiLabelMap.EbayReason}">
+         <drop-down >
+         <list-options key-name="reasonCode" list-name="reasons" description="${value}"/>
+         </drop-down>
+        </field>
+        <field name="condition3" title="${uiLabelMap.EbayExplanation}">
+ <drop-down >
+         <list-options key-name="explanationCode" list-name="explanations" description="${value}"/>
+         </drop-down>        
+        </field>
+        <field name="serviceName"><hidden value="${serviceName2}"/></field>
+        <field name="autoPrefEnumId"><hidden value="${autoPrefEnumId2}"/></field>
+        <field name="submit" title="${uiLabelMap.CommonApply}"><submit/></field>
     </form>
     <!-- Sold Listing -->
     <form name="SoldItemList" type="list"  target="doAction" list-name="soldItemList"

Modified: ofbiz/trunk/specialpurpose/ebaystore/widget/EbaySellingManagerScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/widget/EbaySellingManagerScreens.xml?rev=916150&r1=916149&r2=916150&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebaystore/widget/EbaySellingManagerScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/ebaystore/widget/EbaySellingManagerScreens.xml Thu Feb 25 06:36:14 2010
@@ -242,13 +242,13 @@
                     <field-map field-name="productStoreId" from-field="parameters.productStoreId"/>
                 </service>
                 <set field="userLoginId" from-field="result.userLoginId"/>
-                <script location="component://ebaystore/webapp/ebaystore/WEB-INF/actions/automationPreferences/GetEbayJobsandbox.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="SellingManagerDecorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
                         <decorator-section-include name="body"/>
                         <include-screen name="AutomationRelistSoldItems"/>
+                        <include-screen name="AutomationDispute"/>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -258,14 +258,51 @@
         <section>
             <actions>
                 <set field="headerItem" value="ebayStore"/>
+                <set field="autoPrefEnumId" value="EBAY_AUTO_RELISTING"/>
+                <set field="serviceName" value="automaticEbayRelistSoldItems"/>
+                <entity-one value-field="ebayPrefRelisting" entity-name="EbayProductStorePref">
+                 <field-map field-name="productStoreId" from-field="parameters.productStoreId"/>
+                 <field-map field-name="autoPrefEnumId" from-field="autoPrefEnumId"/>
+                </entity-one>
+                 <service service-name="getEbayStoreUser" result-map="result">
+                 <field-map field-name="productStoreId" from-field="parameters.productStoreId"/>
+                </service>
+                <set field="userLoginId" from-field="result.userLoginId"/>
             </actions>
             <widgets>
-                <screenlet title="${uiLabelMap.EbayAutomationRelistItems}">
+                <screenlet title="${uiLabelMap.EbayAutomationRelistItems}" collapsible="true" name="EbayAutomationRelistItems">
                     <include-form name="EditAutomationRelistSoldItems"  location="component://ebaystore/widget/EbaySellingManagerForms.xml"/>
                 </screenlet>
             </widgets>
         </section>
     </screen>
+    <screen name="AutomationDispute">
+        <section>
+            <actions>
+                <set field="headerItem" value="ebayStore"/>
+                <set field="tabButtonItem" value="automaticEbayDisputeItems"/>
+                <set field="autoPrefEnumId1" value="EBAY_AUTO_DISPUTE1"/>
+                <set field="autoPrefEnumId2" value="EBAY_AUTO_DISPUTE2"/>
+                <set field="serviceName1" value="eBayAutomaticDisputeNotComplete"/>
+                <set field="serviceName2" value="eBayAutomaticDisputeNotPay"/>
+                <entity-one value-field="ebayPrefDispute1" entity-name="EbayProductStorePref">
+                 <field-map field-name="productStoreId" from-field="parameters.productStoreId"/>
+                 <field-map field-name="autoPrefEnumId" from-field="autoPrefEnumId1"/>
+                </entity-one>
+                <entity-one value-field="ebayPrefDispute2" entity-name="EbayProductStorePref">
+                 <field-map field-name="productStoreId" from-field="parameters.productStoreId"/>
+                 <field-map field-name="autoPrefEnumId" from-field="autoPrefEnumId2"/>
+                </entity-one>
+                <script location="component://ebaystore/webapp/ebaystore/WEB-INF/actions/automationPreferences/GetDisputeInfo.groovy"/>
+            </actions>
+            <widgets>
+                <screenlet title="${uiLabelMap.EbayAutomaticDispute}" collapsible="true" name="AutomationDispute">
+                    <include-form name="AutomationDisputeNotComplete"  location="component://ebaystore/widget/EbaySellingManagerForms.xml"/>
+                    <include-form name="AutomationDisputeNotPay"  location="component://ebaystore/widget/EbaySellingManagerForms.xml"/>
+                </screenlet>
+            </widgets>
+        </section>
+    </screen>
     <!-- Sold -->
    <screen name="EbaySoldListing">
         <section>