ofbiz-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hans...@apache.org
Subject svn commit: r905876 [6/7] - in /ofbiz/trunk: applications/commonext/documents/ specialpurpose/ specialpurpose/ebay/ specialpurpose/ebay/config/ specialpurpose/ebay/data/ specialpurpose/ebay/data/helpdata/ specialpurpose/ebay/entitydef/ specialpurpose/e...
Date Wed, 03 Feb 2010 03:16:40 GMT
Added: ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreInventoryServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreInventoryServices.java?rev=905876&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreInventoryServices.java (added)
+++ ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreInventoryServices.java Wed Feb  3 03:16:07 2010
@@ -0,0 +1,283 @@
+package org.ofbiz.ebaystore;
+
+import java.util.Locale;
+import java.util.Map;
+import javolution.util.FastMap;
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.entity.Delegator;
+import org.ofbiz.entity.GenericEntityException;
+import org.ofbiz.entity.GenericValue;
+import org.ofbiz.service.DispatchContext;
+import org.ofbiz.service.ServiceUtil;
+import com.ebay.sdk.ApiException;
+import com.ebay.sdk.SdkException;
+import com.ebay.sdk.SdkSoapException;
+import com.ebay.sdk.call.AddSellingManagerInventoryFolderCall;
+import com.ebay.sdk.call.AddSellingManagerProductCall;
+import com.ebay.sdk.call.GetSellingManagerInventoryCall;
+import com.ebay.sdk.call.GetSellingManagerInventoryFolderCall;
+import com.ebay.sdk.call.ReviseSellingManagerProductCall;
+import com.ebay.soap.eBLBaseComponents.AddSellingManagerInventoryFolderRequestType;
+import com.ebay.soap.eBLBaseComponents.AddSellingManagerInventoryFolderResponseType;
+import com.ebay.soap.eBLBaseComponents.AddSellingManagerProductRequestType;
+import com.ebay.soap.eBLBaseComponents.AddSellingManagerProductResponseType;
+import com.ebay.soap.eBLBaseComponents.GetSellingManagerInventoryFolderRequestType;
+import com.ebay.soap.eBLBaseComponents.GetSellingManagerInventoryFolderResponseType;
+import com.ebay.soap.eBLBaseComponents.GetSellingManagerInventoryRequestType;
+import com.ebay.soap.eBLBaseComponents.GetSellingManagerInventoryResponseType;
+import com.ebay.soap.eBLBaseComponents.ReviseSellingManagerProductRequestType;
+import com.ebay.soap.eBLBaseComponents.ReviseSellingManagerProductResponseType;
+import com.ebay.soap.eBLBaseComponents.SellingManagerFolderDetailsType;
+import com.ebay.soap.eBLBaseComponents.SellingManagerProductDetailsType;
+import com.ebay.soap.eBLBaseComponents.SellingManagerProductType;
+
+public class EbayStoreInventoryServices {
+	private static final String resource = "EbayUiLabels";
+	private static final String module = EbayStoreInventoryServices.class.getName();
+	private static final String defaultFolderName = "OFBizProducts";
+	private static String folderId = null;
+	public EbayStoreInventoryServices() {
+		// TODO Auto-generated constructor stub
+	}
+	/*update inventory on ebay site*/
+	public static Map<String,Object> updateEbayStoreInventory(DispatchContext dctx, Map<String,Object> context){
+		Map<String,Object> result = FastMap.newInstance();
+		Locale locale = (Locale) context.get("locale");
+		Delegator delegator = dctx.getDelegator();
+		GetSellingManagerInventoryRequestType invenReq = null;
+		GetSellingManagerInventoryResponseType invenResp = null;
+		boolean checkProd = false;
+		boolean status = false;
+		try {
+			if(context.get("productStoreId") == null || context.get("productId") == null || context.get("folderId") == null){
+				result  = ServiceUtil.returnError("The process was required productStoreId, productId and ebay inventory folderId.");
+				result.put("productStoreId", context.get("productStoreId"));
+				result.put("facilityId", context.get("facilityId"));
+				result.put("folderId", context.get("folderId"));
+				return result;
+			}
+
+			String productId = (String)context.get("productId");
+			String folderId = (String)context.get("folderId");
+			// start upload/update products which selected  to an ebay inventory 
+			if(folderId != null){
+				GetSellingManagerInventoryCall invenCall = new GetSellingManagerInventoryCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
+				invenReq = new GetSellingManagerInventoryRequestType();
+				invenResp = (GetSellingManagerInventoryResponseType) invenCall.execute(invenReq);
+				if(invenResp != null && "SUCCESS".equals(invenResp.getAck().toString())){
+					GenericValue ebayProductStoreInventory = delegator.findByPrimaryKey("EbayProductStoreInventory", UtilMisc.toMap("productId", productId,"facilityId",context.get("facilityId"),"productStoreId",context.get("productStoreId")));
+
+					SellingManagerProductType[]  sellingManagerProductTypeList = invenResp.getSellingManagerProduct();
+					for(SellingManagerProductType sellingManagerProductType : sellingManagerProductTypeList){
+						SellingManagerProductDetailsType sellingManagerProductDetailsType = sellingManagerProductType.getSellingManagerProductDetails();
+						if(String.valueOf(sellingManagerProductDetailsType.getFolderID()).equals(folderId) && String.valueOf(sellingManagerProductDetailsType.getProductID()).equals(String.valueOf(ebayProductStoreInventory.getLong("ebayProductId"))) && String.valueOf(sellingManagerProductDetailsType.getCustomLabel()).equals(productId)){
+							checkProd = true;
+							break;
+						}
+					}
+				}
+
+				// checkProduct is true then update detail  but is false do create new one.
+				if(checkProd == true){
+					status = updateProductInEbayInventoryFolder(dctx,context);
+				}else {
+					status = createNewProductInEbayInventoryFolder(dctx,context);
+				}
+				if(status == true){
+					Debug.logInfo("Done to updated product ".concat(context.get("productId").toString()), module);
+					result = ServiceUtil.returnSuccess("Updated ebay store inventory in folder "+context.get("folderId")+" success..");
+				}else{
+					result = ServiceUtil.returnError("Fail to update ebay store inventory.");
+				}
+			}
+		}catch (ApiException e) {
+			result = ServiceUtil.returnFailure(e.getMessage());
+		} catch (SdkSoapException e) {
+			result = ServiceUtil.returnFailure(e.getMessage());
+		} catch (SdkException e) {
+			result = ServiceUtil.returnFailure(e.getMessage());
+		} catch (GenericEntityException e) {
+			result = ServiceUtil.returnFailure(e.getMessage());
+		} 
+		result.put("productStoreId", context.get("productStoreId"));
+		result.put("facilityId", context.get("facilityId"));
+		result.put("folderId", context.get("folderId"));
+		return result;
+	}
+
+	/* add new product and quantity to ebay inventory */
+	public static boolean createNewProductInEbayInventoryFolder(DispatchContext dctx, Map<String,Object> context){
+		Locale locale = (Locale) context.get("locale");
+		Delegator delegator = dctx.getDelegator();
+		AddSellingManagerProductRequestType productReq = null;
+		AddSellingManagerProductResponseType productResp = null;
+		boolean flag = false;
+
+		try {
+			if(context.get("productStoreId") != null && context.get("productId")!=null && context.get("folderId")!=null){
+				String productId = (String)context.get("productId");
+				String folderId = (String)context.get("folderId");
+				AddSellingManagerProductCall productCall = new AddSellingManagerProductCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
+				productReq = new AddSellingManagerProductRequestType();
+				productReq.setFolderID(new Long(folderId));
+				SellingManagerProductDetailsType  sellingManagerProductDetailsType = new SellingManagerProductDetailsType();
+				GenericValue ebayProductStoreInventory = delegator.findByPrimaryKey("EbayProductStoreInventory", UtilMisc.toMap("productId", productId,"facilityId",context.get("facilityId"),"productStoreId",context.get("productStoreId")));
+
+				sellingManagerProductDetailsType.setProductName((delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId))).getString("internalName"));
+				//Must keep productId in SKU NUMBER because ebay allow productId field only long value. 
+				sellingManagerProductDetailsType.setCustomLabel(productId);
+				if(ebayProductStoreInventory!=null) sellingManagerProductDetailsType.setQuantityAvailable(ebayProductStoreInventory.getBigDecimal("availableToPromiseListing").intValue());
+				
+				productReq.setSellingManagerProductDetails(sellingManagerProductDetailsType);
+				productResp = (AddSellingManagerProductResponseType) productCall.execute(productReq);
+				if(productResp != null && "SUCCESS".equals(productResp.getAck().toString())){
+					flag = true;
+					ebayProductStoreInventory.put("ebayProductId", productResp.getSellingManagerProductDetails().getProductID());
+					ebayProductStoreInventory.put("folderId", folderId);
+					ebayProductStoreInventory.store();
+				}else{
+					Debug.logError("Fail to  create inventory product ".concat(productId).concat("in productStore ").concat(context.get("productStoreId").toString()).concat(" message from ebay : ").concat(productResp.getMessage()), module);
+				}
+			}
+		} catch (ApiException e) {
+			Debug.logError(e.getMessage(), module);
+		} catch (SdkSoapException e) {
+			Debug.logError(e.getMessage(), module);
+		} catch (SdkException e) {
+			Debug.logError(e.getMessage(), module);
+		} catch (GenericEntityException e) {
+			Debug.logError(e.getMessage(), module);
+		}
+		return flag;
+	}
+	
+	/* update product and quantity to ebay inventory */
+	public static boolean updateProductInEbayInventoryFolder(DispatchContext dctx, Map<String,Object> context){
+		Locale locale = (Locale) context.get("locale");
+		Delegator delegator = dctx.getDelegator();
+		ReviseSellingManagerProductRequestType req = null;
+		ReviseSellingManagerProductResponseType resp = null;
+		boolean flag = false;
+
+		try {
+			if(context.get("productStoreId") != null && context.get("productId")!=null && context.get("folderId")!=null){
+				String productId = (String)context.get("productId");
+				String folderId = (String)context.get("folderId");
+				ReviseSellingManagerProductCall call = new ReviseSellingManagerProductCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
+				req = new ReviseSellingManagerProductRequestType();
+				SellingManagerProductDetailsType  sellingManagerProductDetailsType = new SellingManagerProductDetailsType();
+				GenericValue ebayProductStoreInventory = delegator.findByPrimaryKey("EbayProductStoreInventory", UtilMisc.toMap("productId", productId,"facilityId",context.get("facilityId"),"productStoreId",context.get("productStoreId")));
+				Long ebayProductId = null;
+				if(ebayProductStoreInventory !=null && ebayProductStoreInventory.getLong("ebayProductId")==null){
+					Debug.logError("Can not update product "+productId+" has no ebay product Id in EbayProductStoreInventory. ", module);
+					return flag;
+				}
+				if(ebayProductStoreInventory!=null && ebayProductStoreInventory.getLong("ebayProductId")!=null){
+					ebayProductId = ebayProductStoreInventory.getLong("ebayProductId");
+				}
+				sellingManagerProductDetailsType.setProductID(ebayProductId);
+
+				sellingManagerProductDetailsType.setProductName((delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId))).getString("internalName"));
+				//Must keep productId in SKU NUMBER because ebay allow productId field only long value. 
+				sellingManagerProductDetailsType.setCustomLabel(productId);
+				if(ebayProductStoreInventory!=null) sellingManagerProductDetailsType.setQuantityAvailable(ebayProductStoreInventory.getBigDecimal("availableToPromiseListing").intValue());
+				
+				req.setSellingManagerProductDetails(sellingManagerProductDetailsType);
+				resp = (ReviseSellingManagerProductResponseType) call.execute(req);
+				if(resp != null && "SUCCESS".equals(resp.getAck().toString())){
+					flag = true;
+					ebayProductStoreInventory.put("ebayProductId", ebayProductId);
+					ebayProductStoreInventory.put("folderId", folderId);
+					ebayProductStoreInventory.store();
+				}else{
+					Debug.logError("Fail to  update inventory product ".concat(productId).concat("in productStore ").concat(context.get("productStoreId").toString()).concat(" message from ebay : ").concat(resp.getMessage()), module);
+				}
+			}
+		} catch (ApiException e) {
+			Debug.logError(e.getMessage(), module);
+		} catch (SdkSoapException e) {
+			Debug.logError(e.getMessage(), module);
+		} catch (SdkException e) {
+			Debug.logError(e.getMessage(), module);
+		} catch (GenericEntityException e) {
+			Debug.logError(e.getMessage(), module);
+		}
+		return flag;
+	}
+
+	public static Map<String,Object> getFolderInEbayStoreInventory(DispatchContext dctx, Map<String,Object> context){
+		Map<String,Object> result = FastMap.newInstance();
+		Locale locale = (Locale) context.get("locale");
+		Delegator delegator = dctx.getDelegator();
+		GetSellingManagerInventoryFolderRequestType req = null;
+		GetSellingManagerInventoryFolderResponseType resp = null;
+		boolean flag = false; 
+
+		try {
+			if(context.get("productStoreId") != null){
+				GetSellingManagerInventoryFolderCall  call = new GetSellingManagerInventoryFolderCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
+				req = new GetSellingManagerInventoryFolderRequestType();
+				resp = (GetSellingManagerInventoryFolderResponseType) call.execute(req);
+				if(resp != null && "SUCCESS".equals(resp.getAck().toString())){
+					SellingManagerFolderDetailsType sellingManagerFolderDetailsType = resp.getFolder();
+					if(sellingManagerFolderDetailsType!=null){
+						SellingManagerFolderDetailsType[] SellingManagerFolderDetailsTypeList = sellingManagerFolderDetailsType.getChildFolder();
+						for(SellingManagerFolderDetailsType sellingManagerFolderDetails : SellingManagerFolderDetailsTypeList){
+							Debug.logInfo("ebay inventory folders name ".concat(sellingManagerFolderDetails.getFolderName()), module);
+							if(sellingManagerFolderDetails.getFolderName().equals(defaultFolderName)){
+								folderId = String.valueOf(sellingManagerFolderDetails.getFolderID());
+								flag = true;
+								break;
+							}
+						}
+					}
+					if(flag == false){
+						folderId = createNewFolderInEbayStoreInventory(dctx,context);
+					}
+				}
+				result = ServiceUtil.returnSuccess("load ebay store folderId "+folderId+" success..");
+			}
+		} catch (ApiException e) {
+			result = ServiceUtil.returnFailure(e.getMessage());
+		} catch (SdkSoapException e) {
+			result = ServiceUtil.returnFailure(e.getMessage());
+		} catch (SdkException e) {
+			result = ServiceUtil.returnFailure(e.getMessage());
+		}
+		if(result.get("responseMessage")!=null && result.get("responseMessage").equals("fail")) folderId = null;
+		result.put("folderId", folderId);
+		Debug.logInfo("service return result "+ result, module);
+		return result;
+	}
+	
+	/*create new folder for export product into inventory.*/
+	public static String createNewFolderInEbayStoreInventory(DispatchContext dctx, Map<String,Object> context){
+		Locale locale = (Locale) context.get("locale");
+		Delegator delegator = dctx.getDelegator();
+		AddSellingManagerInventoryFolderRequestType req = null;
+		AddSellingManagerInventoryFolderResponseType resp = null;
+
+		try {
+			if(context.get("productStoreId") != null){
+				AddSellingManagerInventoryFolderCall call = new AddSellingManagerInventoryFolderCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
+				req = new AddSellingManagerInventoryFolderRequestType();
+				req.setFolderName(defaultFolderName);//req.setComment(value);//req.setParentFolderID(value)
+				resp = (AddSellingManagerInventoryFolderResponseType) call.execute(req);
+				if(resp != null && "SUCCESS".equals(resp.getAck().toString())) {
+					folderId = String.valueOf(resp.getFolderID());
+				}else {
+					Debug.logError("The problem with create new folder on ebay site.", module);
+					return folderId;
+				}
+			}
+		} catch (ApiException e) {
+			Debug.logError(e.getMessage(), module);
+		} catch (SdkSoapException e) {
+			Debug.logError(e.getMessage(), module);
+		} catch (SdkException e) {
+			Debug.logError(e.getMessage(), module);
+		}
+		return folderId;
+	}
+}

Added: ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOptions.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOptions.java?rev=905876&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOptions.java (added)
+++ ofbiz/trunk/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOptions.java Wed Feb  3 03:16:07 2010
@@ -0,0 +1,145 @@
+package org.ofbiz.ebaystore;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.io.Writer;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import javolution.util.FastList;
+import javolution.util.FastMap;
+
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.UtilHttp;
+import org.ofbiz.entity.Delegator;
+import org.ofbiz.service.DispatchContext;
+import org.ofbiz.service.ServiceUtil;
+import org.ofbiz.webapp.event.EventHandlerException;
+
+import com.ebay.sdk.ApiException;
+import com.ebay.sdk.SdkException;
+import com.ebay.sdk.SdkSoapException;
+import com.ebay.sdk.call.GetStoreOptionsCall;
+import com.ebay.soap.eBLBaseComponents.GetStoreOptionsRequestType;
+import com.ebay.soap.eBLBaseComponents.GetStoreOptionsResponseType;
+import com.ebay.soap.eBLBaseComponents.StoreColorSchemeType;
+import com.ebay.soap.eBLBaseComponents.StoreColorType;
+import com.ebay.soap.eBLBaseComponents.StoreFontFaceCodeType;
+import com.ebay.soap.eBLBaseComponents.StoreFontSizeCodeType;
+import com.ebay.soap.eBLBaseComponents.StoreFontType;
+import com.ebay.soap.eBLBaseComponents.StoreThemeArrayType;
+import com.ebay.soap.eBLBaseComponents.StoreThemeType;
+
+import net.sf.json.JSONObject;
+
+public class EbayStoreOptions {
+	
+	public static String  retrieveThemeColorSchemeByThemeId(HttpServletRequest request,HttpServletResponse response){
+		   
+		   Locale locale = UtilHttp.getLocale(request);
+		   Delegator delegator = (Delegator) request.getAttribute("delegator");
+	       GetStoreOptionsRequestType req = null;
+	       GetStoreOptionsResponseType resp  = null;
+	       StoreThemeArrayType returnedBasicThemeArray = null;
+	       
+	       try {
+	    	   Map paramMap = UtilHttp.getCombinedMap(request);
+	    	   if(paramMap.get("productStoreId") != null){
+	    		   String themeId = (String)paramMap.get("themeId");
+	    		   
+	    		   GetStoreOptionsCall  call = new GetStoreOptionsCall(EbayStoreHelper.getApiContext((String)paramMap.get("productStoreId"), locale, delegator));
+	    		   req = new GetStoreOptionsRequestType();
+
+	    		   resp = (GetStoreOptionsResponseType) call.execute(req);
+	    		   if(resp != null && "SUCCESS".equals(resp.getAck().toString())){
+	    			   
+	    			   returnedBasicThemeArray = resp.getBasicThemeArray();
+	    			   StoreThemeType[] storeBasicTheme = returnedBasicThemeArray.getTheme();
+	    			   
+	    			   int i=0;
+	    			   String colorSchemeId = themeId.substring(themeId.indexOf("-")+1);
+	    			   themeId = themeId.substring(0,themeId.indexOf("-"));
+	    			  
+	    			   Map<String,Object> storeColorSchemeMap = FastMap.newInstance();
+	    			   while(i<storeBasicTheme.length){
+	    				   
+	    				   StoreThemeType storeThemeType = (StoreThemeType)storeBasicTheme[i];
+	    				   if(themeId.equals(storeThemeType.getThemeID().toString())){
+	    					   StoreColorSchemeType colorSchemeType = storeThemeType.getColorScheme();
+	    					   if(colorSchemeType!=null){
+	    						   if(colorSchemeId.equals(colorSchemeType.getColorSchemeID().toString())){
+	    							   StoreColorType storeColor = colorSchemeType.getColor();
+	    							   storeColorSchemeMap.put("storeColorAccent",storeColor.getAccent());
+	    							   storeColorSchemeMap.put("storeColorPrimary",storeColor.getPrimary());
+	    							   storeColorSchemeMap.put("storeColorSecondary",storeColor.getSecondary());
+	    							   
+	    							   // get font,size and color 
+	    							   StoreFontType storeFontType = colorSchemeType.getFont();
+	    							   storeColorSchemeMap.put("storeFontTypeNameFaceColor",storeFontType.getNameColor());
+	    		    				   storeColorSchemeMap.put("storeFontTypeFontFaceValue",storeFontType.getNameFace().value());
+	    		    				   storeColorSchemeMap.put("storeFontTypeSizeFaceValue",storeFontType.getNameSize().value());
+	    		    				   
+	    		    				   storeColorSchemeMap.put("storeFontTypeTitleColor",storeFontType.getTitleColor());
+	    		    				   storeColorSchemeMap.put("storeFontTypeFontTitleValue",storeFontType.getTitleFace().value());
+	    		    				   storeColorSchemeMap.put("storeFontSizeTitleValue",storeFontType.getTitleSize().value());
+	    		    				   
+	    		    				   storeColorSchemeMap.put("storeFontTypeDescColor",storeFontType.getDescColor());
+	    		    				   storeColorSchemeMap.put("storeFontTypeFontDescValue",storeFontType.getDescFace().value());
+	    		    				   storeColorSchemeMap.put("storeDescSizeValue",storeFontType.getDescSize().value());
+	    		    				   toJsonObject(storeColorSchemeMap,response);
+	    		    				   
+	    							   break;
+	    						   }
+	    					   }
+	    				   }
+	    				   i++;
+	    			   }
+	    		   }
+	    	   }
+	       }catch (ApiException e) {
+	    	   e.printStackTrace();
+	    	   return "error";
+	       } catch (SdkSoapException e) {
+	    	   e.printStackTrace();
+	    	   return "error";
+	       } catch (SdkException e) {
+	    	   e.printStackTrace();
+	    	   return "error";
+	       } catch (EventHandlerException e) {
+	    	   e.printStackTrace();
+	    	   return "error";
+	       }
+	       
+	       return "success";
+	   }
+	
+	 public static void toJsonObject(Map<String,Object> attrMap, HttpServletResponse response) throws EventHandlerException{
+	   	 JSONObject json = JSONObject.fromObject(attrMap);
+	        String jsonStr = json.toString();
+	        if (jsonStr == null) {
+	            throw new EventHandlerException("JSON Object was empty; fatal error!");
+	        }
+	        // set the X-JSON content type
+	        response.setContentType("application/json");
+	        // jsonStr.length is not reliable for unicode characters
+	        try {
+	            response.setContentLength(jsonStr.getBytes("UTF8").length);
+	        } catch (UnsupportedEncodingException e) {
+	            throw new EventHandlerException("Problems with Json encoding", e);
+	        }
+	        // return the JSON String
+	        Writer out;
+	        try {
+	            out = response.getWriter();
+	            out.write(jsonStr);
+	            out.flush();
+	        } catch (IOException e) {
+	            throw new EventHandlerException("Unable to get response writer", e);
+	        }
+	   }
+
+}

Added: ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/automationPreferences/GetEbayJobsandbox.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/automationPreferences/GetEbayJobsandbox.groovy?rev=905876&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/automationPreferences/GetEbayJobsandbox.groovy (added)
+++ ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/automationPreferences/GetEbayJobsandbox.groovy Wed Feb  3 03:16:07 2010
@@ -0,0 +1,31 @@
+/*
+ * 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.*;
+
+jobSandboxs = delegator.findByAnd("JobSandbox", UtilMisc.toMap("authUserLoginId", userLoginId));
+job = null
+jobId = null;
+if(jobSandboxs){
+	job = jobSandboxs.get(0);
+}else{
+	jobId = delegator.getNextSeqId("JobSandbox");
+}
+context.jobId = jobId;
+context.job = job;
\ No newline at end of file

Added: ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/feedback/FeedbackList.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/feedback/FeedbackList.groovy?rev=905876&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/feedback/FeedbackList.groovy (added)
+++ ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/feedback/FeedbackList.groovy Wed Feb  3 03:16:07 2010
@@ -0,0 +1,86 @@
+/*
+ * 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 org.ofbiz.entity.condition.*;
+import java.sql.Timestamp;
+import java.util.Map;
+
+import javolution.util.FastMap;
+
+partyId = null
+inMap = FastMap.newInstance();
+inMap.put("productStoreId", parameters.productStoreId);
+inMap.put("userLogin", context.get("userLogin"));
+resultUser = dispatcher.runSync("getEbayStoreUser", inMap);
+ownerUser = resultUser.get("userLoginId");
+userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", ownerUser));
+if(userLogin){
+	partyId = userLogin.get("partyId");
+}
+expr = []
+cond = null;
+
+contentId = request.getParameter("contentId");
+fromDate = request.getParameter("fromDate");
+thruDate = request.getParameter("thruDate");
+if(contentId){
+	expr.add(EntityCondition.makeCondition("contentId",EntityOperator.EQUALS, contentId));
+}
+if(fromDate && thruDate){
+	exprSub = [];
+    condSub = null;
+    exprSub.add(EntityCondition.makeCondition("createdDate",EntityOperator.GREATER_THAN, UtilDateTime.getDayStart(Timestamp.valueOf(fromDate + " 00:00:00.000"))));
+    exprSub.add(EntityCondition.makeCondition("createdDate",EntityOperator.LESS_THAN, UtilDateTime.getDayEnd(Timestamp.valueOf(thruDate + " 23:59:59.999"))));
+    condSub = EntityCondition.makeCondition(exprSub, EntityOperator.AND);
+    expr.add(condSub);
+}else if(fromDate && !thruDate){
+    expr.add(EntityCondition.makeCondition("createdDate",EntityOperator.GREATER_THAN, UtilDateTime.getDayStart(Timestamp.valueOf(fromDate + " 00:00:00.000"))));
+}else if(!fromDate && thruDate){
+    expr.add(EntityCondition.makeCondition("createdDate",EntityOperator.LESS_THAN, UtilDateTime.getDayEnd(Timestamp.valueOf(thruDate + " 23:59:59.999"))));
+}
+contentRoles = delegator.findByAnd("ContentRole", UtilMisc.toMap("roleTypeId","OWNER", "partyId", partyId));
+contentIds = [];
+contentRoles.each{content->
+	contentIds.add(content.getString("contentId"));
+}
+expr.add(EntityCondition.makeCondition("contentId", EntityOperator.IN, contentIds));
+cond = EntityCondition.makeCondition(expr, EntityOperator.AND);
+contents = delegator.findList("Content", cond, null, null, null, false);
+
+recentFeedbackList = [];
+ownerUser = null;
+commentator = null;
+contents.each{content->
+	commentatorContents = delegator.findByAnd("ContentRole", UtilMisc.toMap("contentId",content.contentId, "roleTypeId","COMMENTATOR"));
+	if(commentatorContents){
+		commentatorPartyId = commentatorContents.get(0).get("partyId");
+		commentatorUsers = delegator.findByAnd("UserLogin", UtilMisc.toMap("partyId", commentatorPartyId));
+		if(commentatorUsers){
+			commentator = commentatorUsers.get(0).get("userLoginId");
+		}
+	}
+	entry = [contentId : content.contentId,
+	         dataResourceId : content.dataResourceId,
+	         createdDate : content.createdDate,
+	         ownerUser : ownerUser,
+	         commentator : commentator];
+	recentFeedbackList.add(entry);
+}
+context.recentFeedbackList = recentFeedbackList;
\ No newline at end of file

Added: ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/RetrieveStoreOptions.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/RetrieveStoreOptions.groovy?rev=905876&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/RetrieveStoreOptions.groovy (added)
+++ ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/RetrieveStoreOptions.groovy Wed Feb  3 03:16:07 2010
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ */
+
+productStoreId = parameters.productStoreId;
+
+storeThemeId = null;
+if(parameters.ebayStore){
+    ebayStore = parameters.get("ebayStore");
+    storeThemeId = ebayStore.get("storeThemeId");
+}
+
+if(productStoreId!=null){
+    flag = null;
+    storeBasicThemes = null;
+    resultsBasicThemes = dispatcher.runSync("retrieveBasicThemeArray",["productStoreId":productStoreId, "userLogin": userLogin]);
+    if(resultsBasicThemes){
+        storeBasicThemes = resultsBasicThemes.get("storeThemeList");
+        //check what kind of theme?
+        context.put("storeThemeOptList",storeBasicThemes);
+        if(storeThemeId!=null && storeBasicThemes!=null){
+            storeBasicThemes.each { storeTheme ->
+                if(storeThemeId == storeTheme.storeThemeId){
+                    flag = "Basic";
+                }
+            }
+        }
+    }
+    
+    storeAdvanceThemes = null;
+    storeAdvancedThemeColorOptList = null;
+    resultsAdvanceThemes = dispatcher.runSync("retrieveAdvancedThemeArray",["productStoreId":productStoreId, "userLogin": userLogin]);
+    if(resultsAdvanceThemes){
+        storeAdvanceThemes = resultsAdvanceThemes.get("storeThemeList");
+        storeAdvancedThemeColorOptList = resultsAdvanceThemes.get("storeAdvancedThemeColorOptList");
+        context.put("storeAdvanceThemeOptList",storeAdvanceThemes);
+        context.put("storeAdvancedThemeColorOptList",storeAdvancedThemeColorOptList);
+        
+        if(storeThemeId!=null && storeAdvanceThemes!=null){
+            storeAdvanceThemes.each { storeAdvanceTheme ->
+                if(storeThemeId == storeAdvanceTheme.storeThemeId){
+                    flag = "Advanced";
+                }
+            }
+        }
+    }
+    resultsFontTheme = dispatcher.runSync("retrieveStoreFontTheme",["productStoreId":productStoreId, "userLogin": userLogin]);
+    if(resultsFontTheme){
+        storeFontTheme = resultsFontTheme.get("advanceFontTheme");
+        context.put("storeFontTheme",storeFontTheme);
+    }
+    context.put("themeType",flag);
+   
+}

Added: ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/StoreAccount.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/StoreAccount.groovy?rev=905876&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/StoreAccount.groovy (added)
+++ ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/actions/store/StoreAccount.groovy Wed Feb  3 03:16:07 2010
@@ -0,0 +1,90 @@
+/*
+ * 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 javolution.util.FastList;
+import javolution.util.FastMap;
+
+
+
+results =  FastList.newInstance();
+ebayAccountList = delegator.findByAnd("PartyRoleAndPartyDetail",["roleTypeId":"EBAY_ACCOUNT"]);
+productStoreRoles = delegator.findByAnd("ProductStoreRole",["roleTypeId":"EBAY_ACCOUNT"]);
+
+if(productStoreRoles!=null && ebayAccountList != null){
+	ebayAccountList.each{ebayAccount->
+		partyId = ebayAccount.partyId;
+		productStoreRoles.each{productStoreRole ->
+			if(partyId.equals(productStoreRole.partyId)){
+				storeMap = FastMap.newInstance();
+				storeMap.partyId = ebayAccount.partyId;
+				storeMap.firstName = ebayAccount.firstName;
+				storeMap.lastName = ebayAccount.lastName;
+				storeMap.productStoreId = productStoreRole.productStoreId;
+				results.add(storeMap);
+			}
+		}
+	}
+	context.put("stores",results);
+}
+/*
+ * 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 javolution.util.FastList;
+import javolution.util.FastMap;
+
+
+
+results =  FastList.newInstance();
+ebayAccountList = delegator.findByAnd("PartyRoleAndPartyDetail",["roleTypeId":"EBAY_ACCOUNT"]);
+productStoreRoles = delegator.findByAnd("ProductStoreRole",["roleTypeId":"EBAY_ACCOUNT"]);
+
+if(productStoreRoles!=null && ebayAccountList != null){
+	ebayAccountList.each{ebayAccount->
+		partyId = ebayAccount.partyId;
+		productStoreRoles.each{productStoreRole ->
+			if(partyId.equals(productStoreRole.partyId)){
+				storeMap = FastMap.newInstance();
+				storeMap.partyId = ebayAccount.partyId;
+				storeMap.firstName = ebayAccount.firstName;
+				storeMap.lastName = ebayAccount.lastName;
+				storeMap.productStoreId = productStoreRole.productStoreId;
+				results.add(storeMap);
+			}
+		}
+	}
+	context.put("stores",results);
+}

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=905876&r1=905875&r2=905876&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/WEB-INF/controller.xml Wed Feb  3 03:16:07 2010
@@ -21,6 +21,7 @@
 <site-conf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/site-conf.xsd">
     <include location="component://product/webapp/catalog/WEB-INF/controller.xml"/>
+    <include location="component://ebay/webapp/ebay/WEB-INF/controller.xml"/>
     
     <description>eBay Component Site Configuration File</description>
     <!-- request mappings -->
@@ -28,9 +29,148 @@
         <security https="true" auth="true"/>
         <response name="success" type="view" value="main"/>
     </request-map>
+   	<!-- Export categories selected to Ebay store -->
+    <request-map uri="exportCategoryEbayStore">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="exportCategoryEbayStore"/>
+        <response name="error" type="view" value="exportCategoryEbayStore"/>
+    </request-map>
+    
+    <request-map uri="exportCategoriesSelectedToEbayStore">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="exportCategoriesSelectedToEbayStore"/>
+        <response name="success" type="view" value="exportCategoryEbayStore"/>
+        <response name="error" type="view" value="exportCategoryEbayStore"/>
+    </request-map>
+    <!-- New eBay account in OFBiz -->
+    <request-map uri="newEbayAccount">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="NewEbayAccount"/>
+    </request-map>
+    <request-map uri="createEbayAccount">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="createEbayAccount"/>
+        <response name="error" type="view" value="NewEbayAccount"/>
+        <response name="success" type="view" value="EditEbayConfiguration"/>
+    </request-map>
+    <request-map uri="ebayAccount">
+        <security https="true" auth="true"/>
+        <response name="error" type="view" value="EbayAccount"/>
+        <response name="success" type="view" value="EbayAccount"/>
+    </request-map>
+    
+    <!-- Store output -->
+    <request-map uri="ebayStores">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="ebayStores"/>
+        <response name="error" type="view" value="ebayStores"/>
+    </request-map>
+    <request-map uri="getStoreDetail">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="getEbayStoreOutput"/>
+        <response name="success" type="view" value="ebayStoreDetail"/>
+        <response name="error" type="view" value="ebayStoreDetail"/>
+    </request-map>
+    <request-map uri="editEbayStoreDetail">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="setEbayStoreInput"/>
+        <response name="success" type="view" value="ebayStoreDetail"/>
+        <response name="error" type="view" value="ebayStoreDetail"/>
+    </request-map>
+    <request-map uri="retrieveThemeColorSchemeByThemeId">
+        <security https="true" auth="true"/>
+        <event type="java" path="org.ofbiz.ebaystore.EbayStoreOptions" invoke="retrieveThemeColorSchemeByThemeId"/>
+        <response name="success" type="view" value="ebayStoreDetail"/>
+        <response name="error" type="view" value="ebayStoreDetail"/>
+    </request-map>
+    <!-- Feedback -->
+    <request-map uri="Feedback">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="Feedback"/>
+    </request-map>
+    <request-map uri="LeaveFeedback">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="LeaveFeedback"/>
+    </request-map>
+    <request-map uri="sendLeaveFeedback">
+        <security https="true" auth="true"/>
+        <event type="java" path="org.ofbiz.ebaystore.EbayEvents" invoke="sendLeaveFeedback"/>
+        <response name="success" type="view" value="LeaveFeedback"/>
+        <response name="error" type="view" value="LeaveFeedback"/>
+    </request-map>
+    
+    <!-- Automation Preferences -->
+    <request-map uri="automationPreferences">
+        <security auth="true" https="true"/>
+        <response name="success" type="view" value="AutomationPreferences"/>
+    </request-map>
+    <request-map uri="createEbayAutomaticRelistItems">
+        <security auth="true" https="true"/>
+        <event type="service" invoke="createEbayAutomaticRelistItems"/>
+        <response name="success" type="view" value="AutomationPreferences"/>
+        <response name="error" type="view" value="AutomationPreferences"/>
+    </request-map>
+    <request-map uri="updateEbayAutomaticRelistItems">
+        <security auth="true" https="true"/>
+        <event type="service" invoke="updateEbayAutomaticRelistItems"/>
+        <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"/>
+        <response name="success" type="view" value="blockItemOutOfStock"/>
+        <response name="error" type="view" value="blockItemOutOfStock"/>
+    </request-map>
+    <request-map uri="runBlockItemOutOfStock">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="getSellingInventory"/>
+        <response name="success" type="view" value="blockItemOutOfStock"/>
+        <response name="error" type="view" value="blockItemOutOfStock"/>
+    </request-map>
+    <!-- Store inventory -->
+    <request-map uri="ebayStoreInventory">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="ebayStoreInventory"/>
+    </request-map>
+    <request-map uri="reserveEbayProductInventory">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="reserveEbayProductInventory"/>
+    </request-map>
+    <request-map uri="reserveProductInventory">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="reserveEbayStoreInventory"/>
+        <response name="success" type="view" value="reserveEbayProductInventory"/>
+    </request-map>
+    <request-map uri="updateEbayStoreInventory">
+        <security https="true" auth="true"/>
+        <event type="service-multi" invoke="updateEbayStoreInventory"/>
+        <response name="success" type="view" value="ebayLoadStoreInventory"/>
+    </request-map>
 	<!-- end of request mappings -->
     
     <!-- View Mappings -->
-    <view-map name="main" type="screen" page="component://ebaystore/widget/CommonScreens.xml#main"/>
+    <view-map name="main" type="screen" page="component://ebaystore/widget/EbayStoreScreens.xml#ebayStores"/>
+    <view-map name="exportCategoryEbayStore" type="screen" page="component://ebaystore/widget/EbayStoreScreens.xml#exportCategoryEbayStore"/>
+   	<!-- store output -->
+    <view-map name="ebayStores" type="screen" page="component://ebaystore/widget/EbayStoreScreens.xml#ebayStores"/>
+    <view-map name="ebayStoreDetail" type="screen" page="component://ebaystore/widget/EbayStoreScreens.xml#ebayStoreDetail"/>
+    <!-- ebay account -->
+    <view-map name="NewEbayAccount" type="screen" page="component://ebaystore/widget/EbayStoreScreens.xml#NewEbayAccount"/>
+    <view-map name="EbayAccount" type="screen" page="component://ebaystore/widget/EbayStoreScreens.xml#EbayAccount"/>
+  
+    <!-- feedback -->
+    <view-map name="FeedbackStore" type="screen" page="component://ebaystore/widget/EbayStoreScreens.xml#FeedbackStore"/>
+    <view-map name="Feedback" type="screen" page="component://ebaystore/widget/EbayStoreScreens.xml#Feedback"/>    
+    <view-map name="LeaveFeedback" type="screen" page="component://ebaystore/widget/EbayStoreScreens.xml#LeaveFeedback"/> 
+    
+    <!-- AutomationPreferences -->
+    <view-map name="AutomationPreferences" type="screen" page="component://ebaystore/widget/EbayStoreScreens.xml#EbayAutomationPreferences"/>
+    <!-- block out of stock -->
+    <view-map name="blockItemOutOfStock" type="screen" page="component://ebaystore/widget/EbayStoreScreens.xml#blockItemOutOfStock"/>
+    <!-- store Inventory -->
+    <view-map name="ebayStoreInventory" type="screen" page="component://ebaystore/widget/EbayStoreScreens.xml#ebayStoreInventory"/>
+    <view-map name="ebayLoadStoreInventory" type="screen" page="component://ebaystore/widget/EbayStoreScreens.xml#ebayLoadStoreInventory"/>
+    <view-map name="reserveEbayProductInventory" type="screen" page="component://ebaystore/widget/EbayStoreScreens.xml#reserveEbayProductInventory"/>
     <!-- end of view mappings -->
 </site-conf>

Added: ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/feedback/LeaveFeedback.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/feedback/LeaveFeedback.ftl?rev=905876&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/feedback/LeaveFeedback.ftl (added)
+++ ofbiz/trunk/specialpurpose/ebaystore/webapp/ebaystore/feedback/LeaveFeedback.ftl Wed Feb  3 03:16:07 2010
@@ -0,0 +1,538 @@
+<#--
+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.
+-->
+<#if results.itemsAwaitingFeedback?has_content>
+<script>
+	var active = "";
+	function overStar(obj){
+		if(obj.src.match("starActive")){
+			active = obj.src;
+		}else{
+			active = "";
+		}
+		obj.src = "/images/rate/starHover.gif";
+	}
+	function outStar(obj){
+		if(active != "" || obj.src == "/images/rate/starActive.gif"){
+			obj.src = "/images/rate/starActive.gif";
+		}else{
+			obj.src = "/images/rate/starDefault.gif";
+		}
+	}
+	function setRate(name,numstar,obj,feedbackCounter){
+		for(i=1; i<=5; i++){
+			id = "star"+name+feedbackCounter+"_"+i;
+			if(numstar>=i){
+				document.getElementById(id).src = "/images/rate/starActive.gif";
+			}else{
+				document.getElementById(id).src = "/images/rate/starDefault.gif";
+			}
+		}
+		
+		active = "/images/rate/starActive.gif";
+		setTo = name+feedbackCounter;
+		document.getElementById(setTo).value = numstar;
+	}
+</script>
+<form name="leaveFeedback" action="<@ofbizUrl>sendLeaveFeedback</@ofbizUrl>" method="post">
+	<input type="hidden" value="${parameters.productStoreId}" name="productStoreId"/>
+<table cellspacing="0" class="basic-table">
+	<tbody>
+		<tr class="header-row">
+			<td>Item</td>
+			<td width="600">Rate this transaction</td>
+			<td>Role</td>
+		</tr>
+		<#assign row = "alternate-row">
+		<#assign FeedbackSize = 0>
+		<#assign feedbackCounter = 0>
+		<#assign role = "">
+		<#if parameters.role?has_content>
+			<#assign role = parameters.role>
+		</#if>
+		<#list results.itemsAwaitingFeedback as leaveFeedback>
+		<#if !leaveFeedback.commentType?has_content>
+		<#if parameters.role?has_content && parameters.transactionId?has_content && parameters.targetUser?has_content && parameters.commentingUser?has_content>
+			<#if parameters.transactionId == leaveFeedback.transactionID && parameters.itemId == leaveFeedback.itemID>
+				<#if role == "buyer">
+					<#assign feedbackCounter = feedbackCounter + 1>
+					<#if row == "">
+						<#assign row = "alternate-row">
+					<#else>
+						<#assign row = "">
+					</#if>
+					<input type="hidden" value="${leaveFeedback.itemID}" name="itemId${feedbackCounter}"/>
+					<input type="hidden" value="${leaveFeedback.transactionID}" name="transactionId${feedbackCounter}"/>
+					<input type="hidden" value="${leaveFeedback.userID}" name="targetUser${feedbackCounter}"/>
+					<input type="hidden" value="${leaveFeedback.commentingUser}" name="commentingUser${feedbackCounter}"/>
+					<input type="hidden" value="${leaveFeedback.role}" name="role${feedbackCounter}"/>
+					<tr class="${row}" style="border:#eeeeee solid thin">
+						<td valign="top">
+						${leaveFeedback.itemID} - ${leaveFeedback.title}
+						<a target="_blank" href="http://payments.sandbox.ebay.com/ws/eBayISAPI.dll?ViewPaymentStatus&transId=${leaveFeedback.transactionID}&ssPageName=STRK:MESOX:VPS&itemid=${leaveFeedback.itemID}">order details</a>
+						</td>
+						<td>
+							<input type="radio" name="commentType${feedbackCounter}" value="positive" 
+								onclick="document.getElementById('rate${feedbackCounter}').style.display='block';"/><span>Positive</span>
+							<input type="radio" name="commentType${feedbackCounter}" checked="checked" value="none" 
+								onclick="document.getElementById('rate${feedbackCounter}').style.display='none';"/><span>I'll leave Feedback later</span>
+							<div id="rate${feedbackCounter}" style="display:none">
+								<input type="text" value="" maxlength="80" size="80" name="commentText${feedbackCounter}" label="Tell us more"/>
+								<br/>80 characters left<br/><br/>
+							</div>
+						</td>
+						<td>
+							Buyer:<a target="_blank" href="http://myworld.sandbox.ebay.com/${leaveFeedback.userID}">${leaveFeedback.userID}</a>
+						</td>
+					</tr>
+				<#else>
+					<#assign feedbackCounter = feedbackCounter + 1>
+					<#if row == "">
+						<#assign row = "alternate-row">
+					<#else>
+						<#assign row = "">
+					</#if>
+					<input type="hidden" value="${leaveFeedback.itemID}" name="itemId${feedbackCounter}"/>
+					<input type="hidden" value="${leaveFeedback.transactionID}" name="transactionId${feedbackCounter}"/>
+					<input type="hidden" value="${leaveFeedback.userID}" name="targetUser${feedbackCounter}"/>
+					<input type="hidden" value="${leaveFeedback.commentingUser}" name="commentingUser${feedbackCounter}"/>
+					<input type="hidden" value="${leaveFeedback.role}" name="role${feedbackCounter}"/>
+					<tr class="${row}"  style="border:#eeeeee solid thin">
+						<td valign="top">
+						${leaveFeedback.itemID} - ${leaveFeedback.title}
+						<a target="_blank" href="http://payments.sandbox.ebay.com/ws/eBayISAPI.dll?ViewPaymentStatus&transId=${leaveFeedback.transactionID}&ssPageName=STRK:MESOX:VPS&itemid=${leaveFeedback.itemID}">order details</a>
+						</td>
+						<td>
+						<input type="radio" name="commentType${feedbackCounter}" value="positive" 
+							onclick="document.getElementById('rate${feedbackCounter}').style.display='block';"/><span>Positive</span>
+						<input type="radio" name="commentType${feedbackCounter}" value="neutral" 
+							onclick="document.getElementById('rate${feedbackCounter}').style.display='block';"/><span>Neutral</span>
+						<input type="radio" name="commentType${feedbackCounter}" value="negative" 
+							onclick="document.getElementById('rate${feedbackCounter}').style.display='block';"/><span>Negative</span>
+						<input type="radio" name="commentType${feedbackCounter}" checked="checked" value="none" 
+							onclick="document.getElementById('rate${feedbackCounter}').style.display='none';"/><span>I'll leave Feedback later</span>
+						<div id="rate${feedbackCounter}" style="display:none">
+							<input type="text" value="" maxlength="80" size="80" name="commentText${feedbackCounter}" label="Tell us more"/>
+							<br/>80 characters left<br/><br/>
+							<b>Rate details about this purchase</b>
+							<table>
+								<tr>
+									<td>
+										How accurate was the item description?
+									</td>
+									<td>
+										<input id="ItemAsDescribedId${feedbackCounter}" type="hidden" value="0" name="ratingItem${feedbackCounter}"/>
+										<img id="starItemAsDescribedId${feedbackCounter}_1" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ItemAsDescribedId',1,this,${feedbackCounter});document.getElementById('itemOption${feedbackCounter}').style.display='block'"/>
+										<img id="starItemAsDescribedId${feedbackCounter}_2" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ItemAsDescribedId',2,this,${feedbackCounter});document.getElementById('itemOption${feedbackCounter}').style.display='block'"/>
+										<img id="starItemAsDescribedId${feedbackCounter}_3" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ItemAsDescribedId',3,this,${feedbackCounter});document.getElementById('itemOption${feedbackCounter}').style.display='none'"/>
+										<img id="starItemAsDescribedId${feedbackCounter}_4" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ItemAsDescribedId',4,this,${feedbackCounter});document.getElementById('itemOption${feedbackCounter}').style.display='none'"/>
+										<img id="starItemAsDescribedId${feedbackCounter}_5" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ItemAsDescribedId',5,this,${feedbackCounter});document.getElementById('itemOption${feedbackCounter}').style.display='none'"/>
+									</td>
+								</tr>
+								<tr id="itemOption${feedbackCounter}" style="display:none;border:#eeeeee solid thin;text-indent:10px">
+									<td colspan="2">
+										Why weren't you satisfied with the item description?
+										<table class="answers" width="100%" border="0" cellpadding="0" cellspacing="0">
+											<tbody>
+												<tr>
+													<td width="25"><input name="AqItemAsDescribedId${feedbackCounter}" value="5" type="radio">
+													</td><td>Item was not received</td>
+												</tr>
+												<tr>
+													<td width="25"><input name="AqItemAsDescribedId${feedbackCounter}" value="6" type="radio"></td>
+													<td>Quality did not match item description</td>
+												</tr>
+												<tr>
+													<td width="25"><input name="AqItemAsDescribedId${feedbackCounter}" value="2" type="radio"></td>
+													<td>Item was damaged</td>
+												</tr>
+												<tr>
+													<td width="25"><input name="AqItemAsDescribedId${feedbackCounter}" value="1" type="radio"></td>
+													<td>Item was a counterfeit, replica, or an unauthorized copy</td>
+												</tr>
+												<tr>
+													<td width="25"><input name="AqItemAsDescribedId${feedbackCounter}" value="3" type="radio"></td>
+													<td>Wrong item</td>
+												</tr>
+												<tr>
+													<td width="25"><input name="AqItemAsDescribedId${feedbackCounter}" value="4" type="radio" checked="checked"></td>
+													<td>Other</td>
+												</tr>
+											</tbody>
+										</table>
+									</td>
+								</tr>
+								<tr>
+									<td>
+										How satisfied were you with the seller's communication?
+									</td>
+									<td>
+										<input id="CommResponsivenessId${feedbackCounter}" type="hidden" value="0" name="ratingComm${feedbackCounter}"/>
+										<img id="starCommResponsivenessId${feedbackCounter}_1" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('CommResponsivenessId',1,this,${feedbackCounter})"/>
+										<img id="starCommResponsivenessId${feedbackCounter}_2" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('CommResponsivenessId',2,this,${feedbackCounter})"/>
+										<img id="starCommResponsivenessId${feedbackCounter}_3" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('CommResponsivenessId',3,this,${feedbackCounter})"/>
+										<img id="starCommResponsivenessId${feedbackCounter}_4" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('CommResponsivenessId',4,this,${feedbackCounter})"/>
+										<img id="starCommResponsivenessId${feedbackCounter}_5" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('CommResponsivenessId',5,this,${feedbackCounter})"/>
+									</td>
+								</tr>
+								<tr>
+									<td>
+										How quickly did the seller ship the item?
+									</td>
+									<td>
+										<input id="ShippingTimeId${feedbackCounter}" type="hidden" value="0" name="ratingShip${feedbackCounter}"/>
+										<img id="starShippingTimeId${feedbackCounter}_1" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingTimeId',1,this,${feedbackCounter})"/>
+										<img id="starShippingTimeId${feedbackCounter}_2" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingTimeId',2,this,${feedbackCounter})"/>
+										<img id="starShippingTimeId${feedbackCounter}_3" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingTimeId',3,this,${feedbackCounter})"/>
+										<img id="starShippingTimeId${feedbackCounter}_4" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingTimeId',4,this,${feedbackCounter})"/>
+										<img id="starShippingTimeId${feedbackCounter}_5" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingTimeId',5,this,${feedbackCounter})"/>
+									</td>
+								</tr>
+								<tr>
+									<td>
+										How reasonable were the shipping and handling charges?
+									</td>
+									<td>
+										<input id="ShippingHandlingChargesId${feedbackCounter}" type="hidden" value="0" name="ratingShipHand${feedbackCounter}"/>
+										<img id="starShippingHandlingChargesId${feedbackCounter}_1" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingHandlingChargesId',1,this,${feedbackCounter})"/>
+										<img id="starShippingHandlingChargesId${feedbackCounter}_2" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingHandlingChargesId',2,this,${feedbackCounter})"/>
+										<img id="starShippingHandlingChargesId${feedbackCounter}_3" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingHandlingChargesId',3,this,${feedbackCounter})"/>
+										<img id="starShippingHandlingChargesId${feedbackCounter}_4" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingHandlingChargesId',4,this,${feedbackCounter})"/>
+										<img id="starShippingHandlingChargesId${feedbackCounter}_5" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingHandlingChargesId',5,this,${feedbackCounter})"/>
+									</td>
+								</tr>
+							</table>
+						</div>
+						</td>
+						<td>
+							Seller:<a target="_blank" href="http://myworld.sandbox.ebay.com/${leaveFeedback.userID}">${leaveFeedback.userID}</a>
+						</td>
+					</tr>
+				</#if>
+			</#if>
+		<#elseif role=="buyer">
+			<#if leaveFeedback.role == "buyer">
+				<#assign feedbackCounter = feedbackCounter + 1>
+				<#if row == "">
+					<#assign row = "alternate-row">
+				<#else>
+					<#assign row = "">
+				</#if>
+				<input type="hidden" value="${leaveFeedback.itemID}" name="itemId${feedbackCounter}"/>
+				<input type="hidden" value="${leaveFeedback.transactionID}" name="transactionId${feedbackCounter}"/>
+				<input type="hidden" value="${leaveFeedback.userID}" name="targetUser${feedbackCounter}"/>
+				<input type="hidden" value="${leaveFeedback.commentingUser}" name="commentingUser${feedbackCounter}"/>
+				<input type="hidden" value="${leaveFeedback.role}" name="role${feedbackCounter}"/>
+				<tr class="${row}" style="border:#eeeeee solid thin">
+					<td valign="top">
+					${leaveFeedback.itemID}]${leaveFeedback.title}
+					<a target="_blank" href="http://payments.sandbox.ebay.com/ws/eBayISAPI.dll?ViewPaymentStatus&transId=${leaveFeedback.transactionID}&ssPageName=STRK:MESOX:VPS&itemid=${leaveFeedback.itemID}">order details</a>
+					</td>
+					<td>
+						<input type="radio" name="commentType${feedbackCounter}" value="positive" 
+							onclick="document.getElementById('rate${feedbackCounter}').style.display='block';"/><span>Positive</span>
+						<input type="radio" name="commentType${feedbackCounter}" checked="checked" value="none" 
+							onclick="document.getElementById('rate${feedbackCounter}').style.display='none';"/><span>I'll leave Feedback later</span>
+						<div id="rate${feedbackCounter}" style="display:none">
+							<input type="text" value="" maxlength="80" size="80" name="commentText${feedbackCounter}" label="Tell us more"/>
+							<br/>80 characters left<br/><br/>
+						</div>
+					</td>
+					<td>
+						Buyer:<a target="_blank" href="http://myworld.sandbox.ebay.com/${leaveFeedback.userID}">${leaveFeedback.userID}</a>
+					</td>
+				</tr>
+			</#if>
+		<#elseif role == "seller">
+			<#if leaveFeedback.role == "seller">
+				<#assign feedbackCounter = feedbackCounter + 1>
+				<#if row == "">
+					<#assign row = "alternate-row">
+				<#else>
+					<#assign row = "">
+				</#if>
+				<input type="hidden" value="${leaveFeedback.itemID}" name="itemId${feedbackCounter}"/>
+				<input type="hidden" value="${leaveFeedback.transactionID}" name="transactionId${feedbackCounter}"/>
+				<input type="hidden" value="${leaveFeedback.userID}" name="targetUser${feedbackCounter}"/>
+				<input type="hidden" value="${leaveFeedback.commentingUser}" name="commentingUser${feedbackCounter}"/>
+				<input type="hidden" value="${leaveFeedback.role}" name="role${feedbackCounter}"/>
+				<tr class="${row}"  style="border:#eeeeee solid thin">
+					<td valign="top">
+					${leaveFeedback.itemID} - ${leaveFeedback.title}
+					<a target="_blank" href="http://payments.sandbox.ebay.com/ws/eBayISAPI.dll?ViewPaymentStatus&transId=${leaveFeedback.transactionID}&ssPageName=STRK:MESOX:VPS&itemid=${leaveFeedback.itemID}">order details</a>
+					</td>
+					<td>
+					<input type="radio" name="commentType${feedbackCounter}" value="positive" 
+						onclick="document.getElementById('rate${feedbackCounter}').style.display='block';"/><span>Positive</span>
+					<input type="radio" name="commentType${feedbackCounter}" value="neutral" 
+						onclick="document.getElementById('rate${feedbackCounter}').style.display='block';"/><span>Neutral</span>
+					<input type="radio" name="commentType${feedbackCounter}" value="negative" 
+						onclick="document.getElementById('rate${feedbackCounter}').style.display='block';"/><span>Negative</span>
+					<input type="radio" name="commentType${feedbackCounter}" checked="checked" value="none" 
+						onclick="document.getElementById('rate${feedbackCounter}').style.display='none';"/><span>I'll leave Feedback later</span>
+					<div id="rate${feedbackCounter}" style="display:none">
+						<input type="text" value="" maxlength="80" size="80" name="commentText${feedbackCounter}" label="Tell us more"/>
+						<br/>80 characters left<br/><br/>
+						<b>Rate details about this purchase</b>
+						<table>
+							<tr>
+								<td>
+									How accurate was the item description?
+								</td>
+								<td>
+									<input id="ItemAsDescribedId${feedbackCounter}" type="hidden" value="0" name="ratingItem${feedbackCounter}"/>
+									<img id="starItemAsDescribedId${feedbackCounter}_1" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ItemAsDescribedId',1,this,${feedbackCounter});document.getElementById('itemOption${feedbackCounter}').style.display='block'"/>
+									<img id="starItemAsDescribedId${feedbackCounter}_2" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ItemAsDescribedId',2,this,${feedbackCounter});document.getElementById('itemOption${feedbackCounter}').style.display='block'"/>
+									<img id="starItemAsDescribedId${feedbackCounter}_3" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ItemAsDescribedId',3,this,${feedbackCounter});document.getElementById('itemOption${feedbackCounter}').style.display='none'"/>
+									<img id="starItemAsDescribedId${feedbackCounter}_4" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ItemAsDescribedId',4,this,${feedbackCounter});document.getElementById('itemOption${feedbackCounter}').style.display='none'"/>
+									<img id="starItemAsDescribedId${feedbackCounter}_5" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ItemAsDescribedId',5,this,${feedbackCounter});document.getElementById('itemOption${feedbackCounter}').style.display='none'"/>
+								</td>
+							</tr>
+							<tr id="itemOption${feedbackCounter}" style="display:none;border:#eeeeee solid thin;text-indent:10px">
+								<td colspan="2">
+									Why weren't you satisfied with the item description?
+									<table class="answers" width="100%" border="0" cellpadding="0" cellspacing="0">
+										<tbody>
+											<tr>
+												<td width="25"><input name="AqItemAsDescribedId${feedbackCounter}" value="5" type="radio">
+												</td><td>Item was not received</td>
+											</tr>
+											<tr>
+												<td width="25"><input name="AqItemAsDescribedId${feedbackCounter}" value="6" type="radio"></td>
+												<td>Quality did not match item description</td>
+											</tr>
+											<tr>
+												<td width="25"><input name="AqItemAsDescribedId${feedbackCounter}" value="2" type="radio"></td>
+												<td>Item was damaged</td>
+											</tr>
+											<tr>
+												<td width="25"><input name="AqItemAsDescribedId${feedbackCounter}" value="1" type="radio"></td>
+												<td>Item was a counterfeit, replica, or an unauthorized copy</td>
+											</tr>
+											<tr>
+												<td width="25"><input name="AqItemAsDescribedId${feedbackCounter}" value="3" type="radio"></td>
+												<td>Wrong item</td>
+											</tr>
+											<tr>
+												<td width="25"><input name="AqItemAsDescribedId${feedbackCounter}" value="4" type="radio" checked="checked"></td>
+												<td>Other</td>
+											</tr>
+										</tbody>
+									</table>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									How satisfied were you with the seller's communication?
+								</td>
+								<td>
+									<input id="CommResponsivenessId${feedbackCounter}" type="hidden" value="0" name="ratingComm${feedbackCounter}"/>
+									<img id="starCommResponsivenessId${feedbackCounter}_1" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('CommResponsivenessId',1,this,${feedbackCounter})"/>
+									<img id="starCommResponsivenessId${feedbackCounter}_2" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('CommResponsivenessId',2,this,${feedbackCounter})"/>
+									<img id="starCommResponsivenessId${feedbackCounter}_3" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('CommResponsivenessId',3,this,${feedbackCounter})"/>
+									<img id="starCommResponsivenessId${feedbackCounter}_4" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('CommResponsivenessId',4,this,${feedbackCounter})"/>
+									<img id="starCommResponsivenessId${feedbackCounter}_5" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('CommResponsivenessId',5,this,${feedbackCounter})"/>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									How quickly did the seller ship the item?
+								</td>
+								<td>
+									<input id="ShippingTimeId${feedbackCounter}" type="hidden" value="0" name="ratingShip${feedbackCounter}"/>
+									<img id="starShippingTimeId${feedbackCounter}_1" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingTimeId',1,this,${feedbackCounter})"/>
+									<img id="starShippingTimeId${feedbackCounter}_2" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingTimeId',2,this,${feedbackCounter})"/>
+									<img id="starShippingTimeId${feedbackCounter}_3" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingTimeId',3,this,${feedbackCounter})"/>
+									<img id="starShippingTimeId${feedbackCounter}_4" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingTimeId',4,this,${feedbackCounter})"/>
+									<img id="starShippingTimeId${feedbackCounter}_5" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingTimeId',5,this,${feedbackCounter})"/>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									How reasonable were the shipping and handling charges?
+								</td>
+								<td>
+									<input id="ShippingHandlingChargesId${feedbackCounter}" type="hidden" value="0" name="ratingShipHand${feedbackCounter}"/>
+									<img id="starShippingHandlingChargesId${feedbackCounter}_1" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingHandlingChargesId',1,this,${feedbackCounter})"/>
+									<img id="starShippingHandlingChargesId${feedbackCounter}_2" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingHandlingChargesId',2,this,${feedbackCounter})"/>
+									<img id="starShippingHandlingChargesId${feedbackCounter}_3" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingHandlingChargesId',3,this,${feedbackCounter})"/>
+									<img id="starShippingHandlingChargesId${feedbackCounter}_4" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingHandlingChargesId',4,this,${feedbackCounter})"/>
+									<img id="starShippingHandlingChargesId${feedbackCounter}_5" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingHandlingChargesId',5,this,${feedbackCounter})"/>
+								</td>
+							</tr>
+						</table>
+					</div>
+					</td>
+					<td>
+						Seller:<a target="_blank" href="http://myworld.sandbox.ebay.com/${leaveFeedback.userID}">${leaveFeedback.userID}</a>
+					</td>
+				</tr>
+			</#if>
+		<#else>
+			<#assign feedbackCounter = feedbackCounter + 1>
+			<#if row == "">
+				<#assign row = "alternate-row">
+			<#else>
+				<#assign row = "">
+			</#if>
+			<input type="hidden" value="${leaveFeedback.itemID}" name="itemId${feedbackCounter}"/>
+			<input type="hidden" value="${leaveFeedback.transactionID}" name="transactionId${feedbackCounter}"/>
+			<input type="hidden" value="${leaveFeedback.userID}" name="targetUser${feedbackCounter}"/>
+			<input type="hidden" value="${leaveFeedback.commentingUser}" name="commentingUser${feedbackCounter}"/>
+			<input type="hidden" value="${leaveFeedback.role}" name="role${feedbackCounter}"/>
+			<tr class="${row}">
+				<td>
+				${leaveFeedback.itemID} - ${leaveFeedback.title}
+				<a target="_blank" href="http://payments.sandbox.ebay.com/ws/eBayISAPI.dll?ViewPaymentStatus&transId=${leaveFeedback.transactionID}&ssPageName=STRK:MESOX:VPS&itemid=${leaveFeedback.itemID}">order details</a>
+				</td>
+				<td>
+				<#if leaveFeedback.role == "seller">
+					<input type="radio" name="commentType${feedbackCounter}" value="positive" 
+						onclick="document.getElementById('rate${feedbackCounter}').style.display='block';"/><span>Positive</span>
+					<input type="radio" name="commentType${feedbackCounter}" value="neutral" 
+						onclick="document.getElementById('rate${feedbackCounter}').style.display='block';"/><span>Neutral</span>
+					<input type="radio" name="commentType${feedbackCounter}" value="negative" 
+						onclick="document.getElementById('rate${feedbackCounter}').style.display='block';"/><span>Negative</span>
+					<input type="radio" name="commentType${feedbackCounter}" checked="checked" value="none" 
+						onclick="document.getElementById('rate${feedbackCounter}').style.display='none';"/><span>I'll leave Feedback later</span>
+				<#else>
+					<input type="radio" name="commentType${feedbackCounter}" value="positive" 
+						onclick="document.getElementById('rate${feedbackCounter}').style.display='block';"/><span>Positive</span>
+					<input type="radio" name="commentType${feedbackCounter}" checked="checked" value="none" 
+						onclick="document.getElementById('rate${feedbackCounter}').style.display='none';"/><span>I'll leave Feedback later</span>
+				</#if>
+				<#if leaveFeedback.role == "seller">
+					<div id="rate${feedbackCounter}" style="display:none">
+						<input type="text" value="" maxlength="80" size="80" name="commentText${feedbackCounter}" label="Tell us more"/>
+						<br/>80 characters left<br/><br/>
+						<b>Rate details about this purchase</b>
+						<table>
+							<tr>
+								<td>
+									How accurate was the item description?
+								</td>
+								<td>
+									<input id="ItemAsDescribedId${feedbackCounter}" type="hidden" value="0" name="ratingItem${feedbackCounter}"/>
+									<img id="starItemAsDescribedId${feedbackCounter}_1" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ItemAsDescribedId',1,this,${feedbackCounter});document.getElementById('itemOption${feedbackCounter}').style.display='block'"/>
+									<img id="starItemAsDescribedId${feedbackCounter}_2" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ItemAsDescribedId',2,this,${feedbackCounter});document.getElementById('itemOption${feedbackCounter}').style.display='block'"/>
+									<img id="starItemAsDescribedId${feedbackCounter}_3" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ItemAsDescribedId',3,this,${feedbackCounter});document.getElementById('itemOption${feedbackCounter}').style.display='none'"/>
+									<img id="starItemAsDescribedId${feedbackCounter}_4" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ItemAsDescribedId',4,this,${feedbackCounter});document.getElementById('itemOption${feedbackCounter}').style.display='none'"/>
+									<img id="starItemAsDescribedId${feedbackCounter}_5" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ItemAsDescribedId',5,this,${feedbackCounter});document.getElementById('itemOption${feedbackCounter}').style.display='none'"/>
+								</td>
+							</tr>
+							<tr id="itemOption${feedbackCounter}" style="display:none;border:#eeeeee solid thin;text-indent:10px">
+								<td colspan="2">
+									Why weren't you satisfied with the item description?
+									<table class="answers" width="100%" border="0" cellpadding="0" cellspacing="0">
+										<tbody>
+											<tr>
+												<td width="25"><input name="AqItemAsDescribedId${feedbackCounter}" value="5" type="radio">
+												</td><td>Item was not received</td>
+											</tr>
+											<tr>
+												<td width="25"><input name="AqItemAsDescribedId${feedbackCounter}" value="6" type="radio"></td>
+												<td>Quality did not match item description</td>
+											</tr>
+											<tr>
+												<td width="25"><input name="AqItemAsDescribedId${feedbackCounter}" value="2" type="radio"></td>
+												<td>Item was damaged</td>
+											</tr>
+											<tr>
+												<td width="25"><input name="AqItemAsDescribedId${feedbackCounter}" value="1" type="radio"></td>
+												<td>Item was a counterfeit, replica, or an unauthorized copy</td>
+											</tr>
+											<tr>
+												<td width="25"><input name="AqItemAsDescribedId${feedbackCounter}" value="3" type="radio"/></td>
+												<td>Wrong item</td>
+											</tr>
+											<tr>
+												<td width="25"><input name="AqItemAsDescribedId${feedbackCounter}" value="4" type="radio"  checked="checked"></td>
+												<td>Other</td>
+											</tr>
+										</tbody>
+									</table>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									How satisfied were you with the seller's communication?
+								</td>
+								<td>
+									<input id="CommResponsivenessId${feedbackCounter}" type="hidden" value="0" name="ratingComm${feedbackCounter}"/>
+									<img id="starCommResponsivenessId${feedbackCounter}_1" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('CommResponsivenessId',1,this,${feedbackCounter})"/>
+									<img id="starCommResponsivenessId${feedbackCounter}_2" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('CommResponsivenessId',2,this,${feedbackCounter})"/>
+									<img id="starCommResponsivenessId${feedbackCounter}_3" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('CommResponsivenessId',3,this,${feedbackCounter})"/>
+									<img id="starCommResponsivenessId${feedbackCounter}_4" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('CommResponsivenessId',4,this,${feedbackCounter})"/>
+									<img id="starCommResponsivenessId${feedbackCounter}_5" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('CommResponsivenessId',5,this,${feedbackCounter})"/>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									How quickly did the seller ship the item?
+								</td>
+								<td>
+									<input id="ShippingTimeId${feedbackCounter}" type="hidden" value="0" name="ratingShip${feedbackCounter}"/>
+									<img id="starShippingTimeId${feedbackCounter}_1" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingTimeId',1,this,${feedbackCounter})"/>
+									<img id="starShippingTimeId${feedbackCounter}_2" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingTimeId',2,this,${feedbackCounter})"/>
+									<img id="starShippingTimeId${feedbackCounter}_3" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingTimeId',3,this,${feedbackCounter})"/>
+									<img id="starShippingTimeId${feedbackCounter}_4" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingTimeId',4,this,${feedbackCounter})"/>
+									<img id="starShippingTimeId${feedbackCounter}_5" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingTimeId',5,this,${feedbackCounter})"/>
+								</td>
+							</tr>
+							<tr>
+								<td>
+									How reasonable were the shipping and handling charges?
+								</td>
+								<td>
+									<input id="ShippingHandlingChargesId${feedbackCounter}" type="hidden" value="0" name="ratingShipHand${feedbackCounter}"/>
+									<img id="starShippingHandlingChargesId${feedbackCounter}_1" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingHandlingChargesId',1,this,${feedbackCounter})"/>
+									<img id="starShippingHandlingChargesId${feedbackCounter}_2" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingHandlingChargesId',2,this,${feedbackCounter})"/>
+									<img id="starShippingHandlingChargesId${feedbackCounter}_3" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingHandlingChargesId',3,this,${feedbackCounter})"/>
+									<img id="starShippingHandlingChargesId${feedbackCounter}_4" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingHandlingChargesId',4,this,${feedbackCounter})"/>
+									<img id="starShippingHandlingChargesId${feedbackCounter}_5" src="/images/rate/starDefault.gif" onmouseover="overStar(this)" onmouseout="outStar(this)" onclick="setRate('ShippingHandlingChargesId',5,this,${feedbackCounter})"/>
+								</td>
+							</tr>
+						</table>
+					</div>
+				<#else>
+					<div id="rate${feedbackCounter}" style="display:none">
+						<input type="text" value="" maxlength="80" size="80" name="commentText${feedbackCounter}" label="Tell us more"/>
+						<br/>80 characters left<br/><br/>
+					</div>
+				</#if>
+				</td>
+				<td>
+				<#if leaveFeedback.role == "buyer">
+					Buyer:<a target="_blank" href="http://myworld.sandbox.ebay.com/${leaveFeedback.userID}">${leaveFeedback.userID}</a>
+				<#else>
+					Seller:<a target="_blank" href="http://myworld.sandbox.ebay.com/${leaveFeedback.userID}">${leaveFeedback.userID}</a>
+				</#if>
+				</td>
+			</tr>
+		</#if>
+		</#if>	
+		</#list>
+	</tbody>
+</table>
+<br/>
+<input type="hidden" name="feedbackSize" value="${feedbackCounter}"/>
+<input type="submit" value="Leave Feedback"/>
+</form>
+<#else>
+No Leave Feedback.
+</#if>
\ No newline at end of file



Mime
View raw message